Just trying to make sense of it all (95)

1 Name: Eleo 2005-07-09 17:34 ID:w9tgTU/+ [Del]

I was thinking about making my own image board script, but with PHP/MySQL since I don't know any perl (which is why I just won't modify wakaba.) There are a few features I wanted to add like being able to create/delete/manage boards from the admin panel, add bbcodes, dynamically have a list of boards created and be displayed along the top.

Anyway, I'm trying to figure out the comments database for an imageboard. Just trying to find out what is necessary and what isn't and what I want to add.

Timestamp and Lasthit were the first to get me. I have no idea what those are for. Next that confused me was the md5. I didn't have a clue what the purpose of that was. Also, the "random" numbers that are generated for an image, it looks like they have something to do with the timestamp but I'm not exactly sure what.

I'm somewhat of a newb at PHP but I don't think it would be impossible to script this if I take my time. I've done a little bit of PHP in the past and it's fairly straightforward.

There were a few other things that I was wondering about, for example why mailto: was included in the e-mail field of the database, or why the directory that an image is kept is stored in the database. I thought maybe "mailto" and "src/" could be added by the script itself.

One more thing; thumbnail height and thumbnail width. I can see what they're for but I'm not exactly sure why they're necessary.

Oh, and one more thing. Tripcodes and the secret key. How are tripcodes generated and how is it based on the secret key. I'm not looking for actual code, just concepts.

46 Post deleted by the ghost of thread 1120952093.

47 Name: Anonymous : 2005-11-16 09:48 ID:FYo4UGt8 [Del]

> "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..."

48 Name: dmpk2k!hinhT6kz2E : 2005-11-16 21:40 ID:Heaven [Del]

Sometimes I lose all hope for humanity...

49 Name: anon!21anon4H3U : 2005-11-16 21:50 ID:Heaven [Del]

>the ghost of thread 1120952093

lol wut?

50 Name: Anonymous : 2005-11-17 02:19 ID:Heaven [Del]

The ghost of past threads!

Charles Dickens co-wrote Kareha!

51 Name: ffrfr : 2005-11-17 05:18 ID:7dyot8o9 [Del]

This board stinks. And you said this is better than the "old-style" boards, geeze.

52 Name: !WAHa.06x36 : 2005-11-17 05:28 ID:Lgwl17Hy [Del]



53 Name: dmpk2k!hinhT6kz2E : 2005-11-17 05:41 ID:Heaven [Del]

Quick, look at the log files! Maybe we'll get a referring forum to trollenlighten!

54 Name: !WAHa.06x36 : 2005-11-17 06:36 ID:Lgwl17Hy [Del]

Hahah, it's some poor schmuck who stumbled in from some Mac downloads site. You can tell he knows what he's talking about because he stumbled onto the support board and posted in the first thread he could find.

55 Name: Eleo : 2005-11-17 16:04 ID:UivWox2e [Del]

What's going on here.

Yeah, I just recently continued work on this imageboard project of mine. It took a while to get my head back in the code but now it's going rather smoothly but I'm worried that the code is actually a trainwreck or is going to cause a server load that I could severely reduce if I knew what I was doing a little better.

I put in some silly things like templates for every aspect of the board (posts, replies, etc.) and made the code easier to read because my intention is to have some better-qualified people fix it up once it works.

Right now i'm wondering about the javascript involved when you click on a post number and have it appear in the comments box.

56 Name: Mr VacBob!JqK7T7zan. : 2005-11-17 16:40 ID:5MORVezp [Del]


I hope that wasn't from me linking it in http://forums.bungie.org/story/. (look, an independently invented minimalist board script!)


This is pretty simple; it's something like this:

function quote(b,a) { var v=eval("document."+a+".mesg"); 


<a href='javascript:quote(123,"post1131276165");'>123</a>

The eval() is just to get the post box you're adding text to. I believe JavaScript is capable of doing more advanced stuff than just that (for instance, creating >>a-b links if you click more than one post number), and I've been meaning to look into it, but haven't done anything about it yet.

57 Name: !WAHa.06x36 : 2005-11-17 17:39 ID:fTQ/Damf [Del]


That's one way to do it, but it's pretty primitive. You can do better, and insert the >> link at the current cursor position, at least in Firefox and IE (using different code for each, of course).

Just look at the relevant function in http://wakaba.c3.cx/sup/kareha.js.

58 Name: Eleo : 2005-11-17 20:14 ID:UivWox2e [Del]

Oh okay. Yeah, wakaba's was much more suited for an imageboard since every thread doesn't have it's own reply box. Thanks for that. You're okay with me using it, right? Not renaming it or anything.

59 Name: !WAHa.06x36 : 2005-11-18 04:45 ID:Heaven [Del]

All the Wakaba and Kareha code is public domain, you can use it for anything.

60 Name: Eleo : 2005-11-18 10:02 ID:VMwrQ8Bi [Del]


I will use Wakaba and Kareha to take over the planet.

61 Name: Eleo : 2005-11-20 16:56 ID:m1Gy/x8s [Del]

I'm stuck at the part where I have to format comments.

PHP has a function/method (whatever you call them in PHP) that formats comments called nlbr() but all that does it insert <br /> at line breaks.

Of course wakaba's comment formatting is more advanced and uses <p> tags which is more efficient partially because one has the option of using css with <p> tags unlike <br /> tags which wouldn't allow me to, say, change the background.

Considering the differences between PHP and wakaba I obviously can't ask for a code snippet, but general theory is always helpful.

62 Name: !WAHa.06x36 : 2005-11-20 17:20 ID:Heaven [Del]

Well, the WakabaMark engine I use for that does all kinds of things, including formatting nested lists, and it's not very easy to follow. The doc wiki has an implementation of it in Javascript that is probably more easily ported to PHP, but that is still a significant bit of work.

The general idea I'm using is that if I see two lines of text following each other, I put in a <br/>, and if I see a block of text followed by a number of empty lines, I surround the block with <p></p> tags. If you just want to implement that, it's pretty much up to you to figure out how to do it best, though.

63 Name: Mr VacBob!JqK7T7zan. : 2005-11-21 16:08 ID:Heaven [Del]

> PHP has a function/method (whatever you call them in PHP) that formats comments called nlbr() but all that does it insert <br /> at line breaks.

nl2br() also changes whether it inserts "<br>" or "<br />" depending on the version of PHP used (and not depending on anything else), so like many other things in PHP it's pretty much useless.

64 Post deleted by moderator.

65 Name: Anonymous : 2006-01-10 09:30 ID:njmYwDmJ [Del]

why not make a cache, almost everyone CMS have a cache, you can select the time,of course.

66 Name: Anonymous : 2006-01-10 18:09 ID:Heaven [Del]

man give this guy the Prize for seeing the Future he hit the nail ON the HEAD
and it was not yesterday that he put this post up
the seer

67 Name: Anonymous : 2006-01-10 18:13 ID:Heaven [Del]

I am >>65's fin funnel.
I am terribly sorry that my pilot has created such a thread as this one.
He really is a good person, but he's been under a lot of stress lately.
Lately, he has been screaming "THIS SENSATION, IS IT CHAR!?" every time he sees something red,
And mumbling "please lead me" every time he sees a young girl.
Just the other day, he ordered me to "shoot down the biggest dumbass in this region."
I wanted to reply, "that would be you,"
But knowing that >>65 was even more tired than I was of fighting, I couldn't say anything.
This prolonged war is to blame for everything.
It's not >>65's fault.
I posted today because I just wanted to ask for everybody's understanding in this matter.
I am terribly sorry that a mere fin funnel has made such excuses.
Please, continue to treat >>65 well.

68 Post deleted by moderator.

69 Post deleted by moderator.

70 Post deleted by moderator.

71 Post deleted by moderator.

72 Name: Irene : 2006-01-15 11:31 ID:k40RaAIe (Image: 420x184 jpg, 30 kb) [Del]

src/1137349897971.jpg: 420x184, 30 kb

I double clicked on the screen saver (LotsaWater 1.3) to install it, but I got this instead.

73 Name: !WAHa.06x36 : 2006-01-15 12:08 ID:fTQ/Damf [Del]

Wrong thread, here's the right one: http://wakaba.c3.cx/sup/kareha.pl/1118971388/

Anyway, I've gotten this once or twice myself, and I don't quite know what would cause it, but I think quitting System Preferences and doubleclicking the saver again fixed it. Try that.

74 Post deleted by moderator.

75 Name: Eleo : 2006-03-28 15:13 ID:fMJ2gsAr [Del]

I'm wondering why my thread keeps getting bumped by totally unrelated things.

Hi, you may remember me from such failed projects as PHP imageboard. The project is still running strong, but it's no longer PHP. Bet you can't guess what I'm coding it in, now. (Hint: you wish it were perl but it's not even.)

Random question: why does lasthit have to have the same value for original posts and all replies? Wouldn't just the original post cut it?

76 Name: !WAHa.06x36 : 2006-03-28 16:02 ID:fTQ/Damf [Del]


The reason is sort of hackish - it's so that I can just select all posts and sort by lasthit and thread number to get the post pre-sorted by thread and in the right order.

77 Name: Anonymous : 2006-03-28 16:28 ID:+fbewVkQ [Del]

Are you going to separate threads and posts in your program? That would be interesting.

78 Name: Eleo : 2006-03-28 17:08 ID:fMJ2gsAr [Del]

Don't know what you mean.

79 Name: Eleo : 2006-03-28 17:30 ID:fMJ2gsAr [Del]

Oh yeah, another question. Why do you choose to use the TEXT datatype over varchar, int, etc?

80 Name: Eleo : 2006-03-28 17:33 ID:fMJ2gsAr [Del]

Oh and one more, do tripcodes have a finite length?

81 Name: Eleo : 2006-03-29 04:12 ID:fMJ2gsAr [Del]

I like how my tripcodes don't make sense. I basically went off of what you said in an older thread; crypt() while using the 2nd/3rd characters as a salt.

That gets me the desired tripcode... Kind of. I actually end up with 3 extra characters at the beginning of the tripcode that shouldn't be there (ideally), I have to shave them off.

I tested my results against results generated by http://hotaru.freelinuxhost.com/trip.htm, and yeah, my results are identical.

I guess it's not a huge deal; just wondering if there's a more efficient method (despite the fact that the function is currently only 4 lines of code, anyway).

By the way, I'm working with Ruby.

82 Name: !WAHa.06x36 : 2006-03-29 06:35 ID:Lgwl17Hy [Del]


That's essentially how it's done, yes. There are details, such as how you handle short tripcodes (less than three character), empty tripcodes, and how you handle characters outside the 7-bit ASCII range, and special characters like '. 0ch and Futaba don't even agree on all of those, so it's not really possible to get it perfect, though. Try reading through some of the tripcode threads to learn more about these issues.

83 Name: Eleo : 2006-03-29 12:39 ID:fMJ2gsAr [Del]

Oh, okay. (Also, shit, I wish there was a way to get it perfect.)

You had said earlier that you realized the flaw with tripcodes is that the human brain typically cannot remember the random string of characters that is a tripcode (IMO this is true only to an extent; while I may not remember my tripcode string character-for-character, I can still easily recognize it without even reading it) and therefore tripcodes can be imitated when not brute-forced.

Did you ever come up with a solution to this?

84 Name: Anonymous : 2006-03-29 15:10 ID:Heaven [Del]

>>83 It's a non-issue right now - if you have the ability to come close enough to the correct trip, the same method will locate the correct tripcode.

85 Name: Eleo : 2006-03-29 16:08 ID:Heaven [Del]

I suppose you're right.

86 Name: EleoChan!EhVtXXdTd6 : 2006-06-16 00:01 ID:USmjutOz [Del]


What is the wizardry involved in filling an empty password field in the postarea? I think it's cool and highly effective considering 99% of us don't care to type a password in but still want to be able to delete images just in case.

ps my app is about 50% done but lately I'm making a lot of progress.

87 Name: !WAHa.06x36 : 2006-06-16 04:30 ID:Lgwl17Hy [Del]


A snippet of Javascript that does the following:

  • Check for the presence of a password cookie.
  • If not found, pick random characters from from a-z, A-Z, 0-9, and string enough of them together (I use 8).
  • Fill out the password field with this value.

The server-side script, on posting, grabs the passwords, and sends it back as a cookie.

The actual details can be found in wakaba.js.

Also, you can obviously do all of this server-side instead if you're using dynamic pages, but as usual I recommend against dynamic pages.

88 Name: EleoChan!EhVtXXdTd6 : 2006-06-26 21:06 ID:DgM0r77q [Del]

Marked for deletion (old.)

I tried to find a reference for this string's constant "S_OLD" in the Wakaba code and didn't find it. No longer in use? Or am I missing something? But most of all, how does a thread get marked for deletion? Since there are many deletion methods I imagine trying to write the logic for it will be very tedious.

Has this thread gone on for too long.

89 Name: !WAHa.06x36 : 2006-06-27 04:27 ID:Lgwl17Hy [Del]


Never implemented, for the exact reason you describe. No use wasting slow, slow SQL cycles on that.

90 Name: EleoChan!EhVtXXdTd6 : 2006-06-27 09:43 ID:Heaven [Del]

K. I figured.

91 Name: dmpk2k!hinhT6kz2E : 2006-06-27 16:50 ID:Heaven [Del]

In my opinion, TRIM_METHOD should be 1 by default.

92 Name: EleoChan!EhVtXXdTd6 : 2006-07-07 20:47 ID:Heaven [Del]

red letter day coming soon

93 Name: John : 2010-02-11 13:33 ID:YLX8nKT9 [Del]

I'm trying to customize wakaba by viewing the wakaba.html file and them making changes to the .pl file.

Why is the formatting on the html a mess - there are no line feeds?

The .pl file creates the .index file - what part of the perl script can I edit to get it to add in CrLf's

94 Name: Anonymous : 2010-02-12 00:14 ID:gkpLcLbu [Del]

Who needs line feeds? Read the HTML in a DOM viewer, not a text editor.

95 Name: !WAHa.06x36 : 2010-02-12 07:43 ID:Heaven [Del]


Why are you trying to read index.html? There should be no reason to do that.

Name: Link:
Leave these fields empty (spam trap):
More options...