Lines 1947-2005 are particularly intriguing, and also prove that the mods hack the board to enlarge their e-penises.
Also, holy sheepshit the whole damn thing is one file, and mostly one function.
Name:
Anonymous2009-02-01 8:07
I remember when this happening way back too, some guy made a thread about which got pretty instantly removed but I had the time to go through the code. You could find this cute little sequence of preg_replaces which Snacks used to do his wordfilters with.
>>14
You'd recognize what that code does if you'd lurked /b/ back in the day IN AMERICA!
Name:
Anonymous2009-02-01 9:04
>>16
By back in the day I assume you mean after 2006.
Name:
Anonymous2009-02-01 14:50
This is pretty much all of 4chan we are looking at
Name:
Anonymous2009-02-01 15:12
oh god this is terrible!
mixing HTML, CSS, PHP, and SQL like that should be a crime.
Name:
Anonymous2009-02-01 15:23
switch ($size[2]) {
case 1 : $ext=".gif";break;
case 2 : $ext=".jpg";break;
case 3 : $ext=".png";break;
case 4 : $ext=".swf";error(S_UPFAIL,$dest);break;
case 5 : $ext=".psd";error(S_UPFAIL,$dest);break;
case 6 : $ext=".bmp";error(S_UPFAIL,$dest);break;
case 7 : $ext=".tiff";error(S_UPFAIL,$dest);break;
case 8 : $ext=".tiff";error(S_UPFAIL,$dest);break;
case 9 : $ext=".jpc";error(S_UPFAIL,$dest);break;
case 10 : $ext=".jp2";error(S_UPFAIL,$dest);break;
case 11 : $ext=".jpx";error(S_UPFAIL,$dest);break;
case 13 : $ext=".swf";error(S_UPFAIL,$dest);break;
default : $ext=".xxx";error(S_UPFAIL,$dest);break;
}
so they specifically disallow perfectly useful image types‽
Name:
Anonymous2009-02-01 15:30
Oh no. m00tles has a crush on RM Randall Munroe[1].
>>21
Well, yeah, they basically co-operated together in making /r9k/... Which you would have known if you watched the panel of internet cult icons at MIT's ROFLCON 2008[1]
ITT butthurt /b/tard doesn't realize that aging only makes his stupidity last longer.
Name:
Anonymous2009-02-01 20:03
OP here
I guess it WASNT supposed to be seen since the link here >>2
doesn't work anymore. Now some newfag on /b/ made a thread saying he hax0red 4chan to get it.
I'm not much of a web programmer, and to me the file seems HORRIBLY spaghetti-coded and hard to follow. A few things seem interesting, but figuring out what's actually going on is pretty difficult for me. If anyone finds something cool, please post an explanation.
Also if anyone has the included postfilter.php, which I assume has all the wordfilters listed, please put it up on pastebin.
The fact that the code doesn't just check for the only allowed types and reject all others with the same fucking error should be your first clue that this entire site is coded like shit.
Name:
Anonymous2009-02-01 23:20
>>49
If you want to follow the flow, scroll down all the way to the bottom where the main switch statement is. I don't think it's spaghetti-coded, there's not a single goto anywhere.
This proves that their statement about 4chan running a heavily modified version of Futaba is correct. You can see much similarity between the two, including the same variable names (lol RENZOKU) and some code which has survived from Futaba.
I'm not much of a web programmer, and to me the file seems HORRIBLY spaghetti-coded and hard to follow.
is it worse than http://waro.su/bbs.txt?
Also if anyone has the included postfilter.php, which I assume has all the wordfilters listed, please put it up on pastebin.
you should have grabbed it too while things weren't working right.
should be your first clue that this entire site is coded like shit.
my first clue was this: Shiichan was a 2ch-type board in PHP. It was written in late 2004 by a guy named Shii. Currently, it is in a buggy beta stage, and no development is planned.
Name:
Anonymous2009-02-02 1:16
This proves that their statement about 4chan running a heavily modified version of Futaba is correct. You can see much similarity between the two, including the same variable names (lol RENZOKU) and some code which has survived from Futaba.
http://1chan.net/futallaby/ FUTALLABY IS NO LONGER IN DEVELOPMENT.Wakaba can do everything Futallaby does and so much more.
lol, reminds me of: http://wakaba.c3.cx/shii/ Shiichan was a 2ch-type board in PHP. It was written in late 2004 by a guy named Shii. Currently, it is in a buggy beta stage, and no development is planned. An actually working alternative: Kareha
Why the hell do you want to look at the wordfilters? They're just a bunch of preg_replaces, and a bit of code to come up with random PENIS colors. You could probably write the file yourself in your sleep if you gave it a few seconds' thought.
Also, to the person who asked about a comparison to Trevorsaba, consider this: 4chan's code is quite compact. Yeah it's all crammed together, but really, that's much better than having everything spread out in 30 different PHP files, and requiring several different libraries for no real reason (lol, adodb and smarty) -- Kusaba is way too overengineered for the task at hand. 4chan's (and Futaba's) code might be a bit nasty looking, but dammit, it works. Once you learn what stuff does what, it's very simple to hack at the board a little bit and change something, and it's much easier to keep that code in your head all at once.
It all comes down to the YAGNI principle. Moot's not going to suddenly switch to MS SQL Server, so there's no need to abstract that sort of thing out. There's barely any HTML to output in the first place, so why bother constructing several templates and building the necessary scaffolding for them to execute? Just print the page out, and get on with it. Some of you so-called EXPERT PROGRAMMERS who praise abstractions and reusable code components and other such nonsense might scoff at this, but this is how code works in the real world. If it ain't broke, don't fix it.
Name:
Anonymous2009-02-02 7:34
>>61
If they can be accessed, that is. I'd put my includes so they can't be reached by an URL.
>>66
First of all, I'm not a 4chan staff member. I just happen to be someone with an actual programming job.
You took my statement out of context. Congratulations.
If you read the full post, I am contrasting 4chan's imgboard.php with Kusaba's gigantic and haphazardly organized collection of files. You have to agree that the former is much easier to understand.
Also, it's a couple thousand lines long. I personally would split it up into a couple different files (maybe one for the main bit, and another for the support functions) but that is not outside the limits of sanity. I have seen single functions longer than that.
I doubt you have as much "real world" experience as you claim. Any programmer worth their salt has dealt with at least one unweldy mess of barf-code in their life that far surpasses the file posted here, and many have seen horror stories that could fill entire threads. Truth is, actual code sucks. The important thing is whether or not it works, because you're not getting paid more to write beautiful works of art. As long as you're capable of continually meeting the deadlines and shipping a product that doesn't suddenly crash or make the computer burst into flames when tested, great.
>>68 I am a fucking [b][u]EXPERT PROGRAMMER[/b][/u], i wrote my first ANSI C compiler at 12 years old. The vastness of the many applications i've written is beyond the comprehensions of you feeble minded fools.
I've worked with professional programming for over 25 years and do not have to give reasons for my arguments for i have achieved satori.
Summarized you post for the other Anonymii.
Name:
Anonymous2009-02-02 10:22
>>8 Lines 1947-2005 are particularly intriguing, and also prove that the mods hack the board to enlarge their e-penises. What? Dice roll is for interactive board games on /tg/
Name:
Anonymous2009-02-02 10:34
>>68,70 I've dug through shitcode that's shittier than 4chan's shitty imageboard.php. Therefore, shitty code is the norm and is ok.
Did I sum it up correctly?
Allow me to retort.
Just because a bunch of shitty php ``programmer'' wannabes slap together shitcode and it works, doesn't mean that it's NOT SHITTY.
Yes, unfortunately, there's worse code out there. Yes, it is possible to follow the flow of imageboard.php with a little work - meaning it's somewhat usable. BUT, it's STILLSHITTY and this type of shit should NOT be expected.
As long as you're capable of continually meeting the deadlines and shipping a product that doesn't suddenly crash or make the computer burst into flames when tested, great.
-_-"
You've just named the number one problem with software development today. Bullshit from people who don't give a fuck about the quality of their work not that people like you could every produce ``quality'' work in the first place.
If you don't feel your work is important enough to perfect, then do the rest of us a favor and don't do the work.
Name:
Anonymous2009-02-02 10:40
So I just finished reading it. Pretty useless, but for some reason it was a good read.
Name:
Anonymous2009-02-02 11:04
KOREA is the best
Name:
Phrozen Voidzorz2009-02-02 11:12
>>75
is that really relevant to the conversation, or just your way of saying "i love Korea"?
Now all I need is a link to download the modified Shiichan that 4chan uses and I'm set.
Name:
Anonymous2009-02-02 13:59
>>79
Far from it. Plus, it's still incomplete. I'm missing all the little includes that are in the code. But it does give you insight into how 4chan's software has been coded.
Name:
Anonymous2009-02-02 15:40
>>78
Actually, MrVacBob posted a link with a zip somewhere.
I'd provide you with some supporting links, but my /prog/ archive seems terribly incomplete, I can only find three references to MrVacBob-sama (only 1 if case matters)... (I have only archived to May of last year though)
>>92
This is a board about programming, not about business sense, greed and the harsh realities of the real world. That means we're allowed to diss ugly and unmaintainable code that works, and praise useless code on its technical merits.
>>92 I never said it was good code. I just said that it was normal code.
I never said that you said it was good code. i actually misquoted you as saying it was the norm
of course we all know the code is shit. a fucking blind codemonkey can see that. my problem lies in your apathetic, ``well, bad code exists everywhere, deal with it'', attitude. i would continue arguing but >>94 summed it up already.
Name:
Anonymous2009-02-03 1:02
>>96
You still have 4scrape scraping the porn boards, Taro? And you're saving it all that for yourself?
>>106 I don't know a better way to get random data
Just for the reference: head -c 1024 /dev/urandom > rand
Name:
Anonymous2009-02-04 13:26
>>108
Also, if binary is not wanted for some reason use tr -dc. But you're forgetting that such characters might wanted on MICROSOFT WINDOWS SERVER 2008.
Name:
Anonymous2009-02-04 13:38
>>108
Can't reading from /dev/urandom block indefinitely, or at least for PHP's timeout!?
>>109
You have to use tr -dc '[:print:]' on BSD, apparently.
Name:
Anonymous2009-02-04 14:24
>>112
Oh, sorry, I thought you were an idiot because you didn't know that -c 1024 only takes 1024 bytes. It appears that you are an idiot because you don't know that urandom doesn't block.
>>118
considering this is the only difference between /dev/urandom and /dev/random (and urandom being less random of course), I tend to agree
Name:
Anonymous2009-02-04 16:03
>>119 (and urandom being less random of course)
This is why I wrote a kernel module to provide /dev/penguinofd00m. Not even /dev/random was random enough.
Name:
Anonymous2009-02-04 16:52
>>119
on real operating systems, urandom is just a symlink to random.
http://www.chinabulksite.com.
It is quite unique,I really can't image how that could be!Do you like sports?I suppose wearing comfortable is so important for sporting!
Name:
Anonymous2011-05-14 1:05
MORE LIKE
IN BEFORE YOTSUBA DMCA ON ITS OWN BOARD
AMIRITE LOLLLLLLLLLLLLLLLLLLLLLLLZzz!!11oNE!!1ONE1!
Obama victory T-Shirts and I do not see the Obama T-Shirt trend slowing down, i think you are going to see more and more of these around as the country http://www.bizsuper.com shows support for this amazing new leader of the free world, srsly.
<p>New listed discount price <a href="http://www.fake-raybansunglasses.org/">fake ray ban sunglasses</a> have sold on our shop online, as the style of <a href="http://www.fake-raybansunglasses.org/">fake ray bans</a> have a breakthough in optical technology, ray ban new aviator, ray ban new wayfarer are more loved by people, to our surprise, <a href="http://www.fake-raybansunglasses.org/">cheap ray bans</a> have a role in the year round. </p>
Thank you very much.Waiting for update.<a href="hhttp://www.cheapbagshopping.com/Links-n576/">wholesale cheap Links Earrings from China free shipping</a>
Name:
Anonymous2011-11-05 23:40
i lost my copy
can i have another please? i'm making a 4channel cloan that will finally get rid of /b/
What do barbers have? Hairy nuts!
When do you notice your poo poo? When relaxed!
What do my jokes taste like? Like old shoes!
How come this question has no answer? Cause it's a dry joke!
...Ladies and Gentleman, Mr Shawn T. "Acidhead" Cook!
Well, I will share with my friends about this. The former 2010 Super Bowl star with the Giants, recently released from prison after serving 20 months on a gun charge, reached an agreement in principle Sunday on a one-year deal with the Jets.
Name:
Anonymous2011-12-05 14:15
So I was browsing /b/ when it crashed, and a download popped up for imgboard.php
lolphp
>>174
LLLLLLLLLLLLLEEEEEEEEEEELLLLLLLLLLLLLL E/G/IN LE MEME ARROWS /G/RO XDDDDDDDDDDDDDDDDDDDDDDDDDDD
>LLLLLLLLLEEEEEEEEEEEEELLLLLLLLLLLL
>MFW WHEN LE 2014 DOESN'T MEME /G/ROS
SA/G/E IS LE /G/AY XDDDDDDDDDDDDDDDDDDDDDDDDDDDD
MUH MUH MUH SIDES ARE LELING INTO LE /G/ROSPHERE XDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD LE SIDES MEME LLLLLLLLLLLLEEEEEEEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
XDDDDDDDDDDDDDDDDDDDD
E/G/IN /G/ROOOOOOOOO