And here's a new one to forever answer the question "what thread was that from?" This patch adds a nifty feature to jump to the thread an image was posted in, by adding /thread
at the end of the image's URL. For example:
http://example.com/board/src/1234567890123.jpg/thread
Put this patch in the same directory as wakaba.pl
, and apply with patch -p1 < show_thread.patch
.
Sorry for my terrible english, my native language is russian. This is Wakaba patch, added 2 radiobuttons with redirect to thread\board after posting. User choise written to cookie.
Replace in futaba_style.pl string
<if ENABLE_CAPTCHA>
with string
<tr id="trgetback"><td class="postblock">Return to</td> <td><label><input name="gb2" value="board" type="radio" /> board</label> <label><input name="gb2" value="thread" checked="checked" type="radio" /> thread</label> </td></tr>
<if ENABLE_CAPTCHA>
Replace in wakaba.pl
elsif($task eq "post")
{
my $parent=$query->param("parent");
with
elsif($task eq "post")
{
my $parent=$query->param("parent");
my $gb2=$query->param("gb2");
Replace in wakaba.pl
post_stuff($parent,$name,$email,$subject,$comment,$file,$file,$password,$nofile,$captcha,$admin,$no_captcha,$no_format,$postfix);
with
post_stuff($parent,$name,$email,$gb2,$subject,$comment,$file,$file,$password,$nofile,$captcha,$admin,$no_captcha,$no_format,$postfix);
Replace in wakaba.pl
my ($parent,$name,$email,$subject,$comment,$file,$uploadname,$password,$nofile,$captcha,$admin,$no_captcha,$no_format,$postfix)=@_;
with
my ($parent,$name,$email,$gb2,$subject,$comment,$file,$uploadname,$password,$nofile,$captcha,$admin,$no_captcha,$no_format,$postfix)=@_;
Replace in wakaba.pl
# set up cookies
my $c_name=$name;
my $c_email=$email;
my $c_password=$password;
with
# set up cookies
my $c_name=$name;
my $c_email=$email;
my $c_password=$password;
my $c_gb2=$gb2;
Replace in wakaba.pl
make_cookies(name=>$c_name,email=>$c_email,password=>$c_password,
with
make_cookies(name=>$c_name,email=>$c_email,gb2=>$c_gb2,password=>$c_password,
Replace in wakaba.pl
# forward back to the main page
make_http_forward(HTML_SELF,ALTERNATE_REDIRECT);
with
# forward back to the main page
make_http_forward(HTML_SELF,ALTERNATE_REDIRECT) if ($parent eq '0');
make_http_forward(RES_DIR.$parent.PAGE_EXT,ALTERNATE_REDIRECT) if ($c_gb2=~/thread/i);
make_http_forward(HTML_SELF,ALTERNATE_REDIRECT);
Here's a noko patch for wakaba, works like 4chan.
Note: this is pointless, but since people are always asking for it, here it is. Now you can stop asking. ;)
and another one that everyone requests for various inane reasons: stickies. Look at how easy this sort of thing is to add! Now let's never speak of stickies again, because they are dumb.
... whoops, I just realized I didn't expand_filename() for the icon, so the filename is pointing the wrong place for reply pages. oh well, easy enough to fix.
>>11
You've probably just opened the floodgates for dozens of "USER WAS BANNED FOR THIS POST" requests. You do know that, right?
>>13
Well then maybe it'd be a good idea to supply the patch for it so all these kids can STFU. For that matter any 4chan-ish patches, so then future requests for AIDS can be summarily directed at this thread, no future discussion needed.
>>14
The fact is these requests had pretty much stopped once they got the picture. Now that they have stickies and noko, they'll be drowning this place in requests for word filters, blotters, custom ban messages, and all sorts of other features that everyone here has already said they will not make. If someone wants to waste their time making such features available, then by all means, but I, and I'm sure most others, have made our stance clear for years. If people want that cancerous shit, they can get a trevorsaba clone. There are enough 4chan copies, and nobody here wants to facilitate the creation of more.
>>15
Really? Because both of those patches were in response to a recent request either here or elsewhere.
I don't agree with all those features either, but the kiddies like it. I made those two to show how ridiculously easy it is to add a feature to Wakaba -- and I don't even like Perl. In fact I haven't actually written anything in Perl that was more than a line or two long since around 2003, and I'm so rusty at it that I copied most of the syntax for those patches from nearby code (or just plain guessed at it).
The blotter is probably one of the only features of 4chan that's actually useful (and a great alternative for putting useless shit into sticky posts), and it appears to have been removed.
Now let's see some really interesting and worthwhile patches from you, if you're so adamant about your "stance". You sure talk big.
>>16
If you're referring to the "request" that's on /soc/, notice that the poster was just asking what people had come up with, and in fact explicitly states that 4chan garbage doesn't count. I agree with what you say about the blotter however, as it is indeed the only feature from 4chan that is worth using.
The entire reason nobody up until now has added those features despite how easy it would be is because everyone but you seems to understand that spoonfeeding all of the little moots what they want just encourages laziness. As you said, that crap is ridiculously easy. Hell, kirtaner managed it despite the fact he himself acknowleged he knew nothing about perl. So, why can't all the 14 year olds adamant to have it take 30 minutes to familiarise themselves with perl and get it done themselves?
You seriously think trying to call me out on my stance is going to make me share my code? It's my code that I took the time to learn and implement. I'm keeping it quiet for that very reason. Try using the same argument against, for example, Kirt. I'm sure he'll hand over all of 420's code just because you want him to.
since someone bumped this thread, i might as well post this:
http://hotaru.thinkindifferent.net/kareha.diff
<q>
and <code>
added to default list of allowed html tags>>20
I thought the SVN they were using a while back was just for 420 programmers. I've not seen their code publically anywhere.
>>21
I hear they're cool with granting read access. Drop by their irc and ask.
>Hell, kirtaner managed it despite the fact he himself acknowleged he knew nothing about perl.
Yup, and now I'm so pro I do web development professionally! Let that be a lesson kids, if you want something done, learn it yourself. Don't rely on patches from anonymous contributors. In the process I ended up learning a slew of languages (Our report system is an AJAX Java servlet hooked up to IRC, templating built around PHP, etc) and it was just a lot of fun, really.
Not only will you learn how to do this shit yourself, your users will love you just that much more because you're able to improve things yourself. For them.
Also, Taimaba (our Wakaba fork) is closed source and very little of the original code remains, but I can answer minor questions should they pop up. Major recent changes eliminated config.pl (pushed into the DB and a board manifest added, etc) and just about everything involving per-board file editing. Fun.
>Not only will you learn how to do this shit yourself, your users will love you just that much more because you're able to improve things yourself. For them.
This is pretty damn true. Hell, as I mentioned on the 420 code discussion IRC a couple of days ago, the sheer amount of work Kirt put into the place between now and when I last visited (which was quite a while back due to other things taking up all my free time) warranted a donation from me for their upkeep. Ever wonder why places like 420chan, and early days 4chan, see so much in the way of donations, while places running kusaba never see any? It's because users appreciate the work that gets put into those sorts of places. If Kirt keeps up the work he does, people like me are more than happy to help keep those places above water. It's how this works. I honestly doubt that 420 would still be alive if Kirt hadn't learned how to deal with shit himself. Sure, many people disagree with some of the features that 420chan implements, but at the end of the day they have been implemented by people who've taken their time to make them, not just sit around asking others to do it for them.
Please, Kirt, don't hand out anything too big. As much as I'd like to poke around the code myself out of sheer curiosity, I wouldn't like to see other places employing the code who haven't put the work in themselves.
Still, if it's Q&A time, how does the manager panel differ from that in wakaba? Have you got a universal panel that controls all boards, for example?
>Still, if it's Q&A time, how does the manager panel differ from that in wakaba? Have you got a universal panel that controls all boards, for example?
Yeah. The report system also doubles as a moderation interface so we basically have a "modding console" in an IRC channel, too.
That's actually pretty boss. I'm guessing you've also created an accounts system, so that mods don't know the admin pass? Always seemed like it'd be the first thing I'd do if I made a site as big as 420 using wakaba.
Also, any idea when the faq page will be back up?
>>27
FAQ pretty soon. We've almost finished integrating Taimaba with Wordpress (we have some really large content-heavy plans with 420chan, the archives, etc) and the page issues will be dealt with when the new FP launches.
Accounts system? You bet! (pic)
I was very intrigued by the whole system until I noticed your search for "purple potato". Still, pretty damn impressive, and a lesson to everyone asking for patches that doing shit yourself really will pay off eventually.
I'm sick of reports going under my nose, so I wanna ask...
Has anyone made a wakaba and kareha hack that sends you a mail of what was posted? I know I risk my mailbox being overloaded, but I'd rather have this THAN getting unwanted content slip by me again.
>>30
What's wrong with just paying attention to your board?
I have a life outside these boards too, you know. I'd like to make technology work for me, not the other way around.
http://wakaba.c3.cx/sup/kareha.pl/1190010673/11-12
-- adds link following to the spam checker, so people can't hide links to spam websites behind forwarding sites like bit.ly.
I have kaherka, how do I add noko so I can go back to the thread I replied to?
On request, I am posting a patch for Wakaba which enables the use of reCAPTCHA. It depends on the CPAN module Captcha::reCAPTCHA which means you'll probably have difficulty using this patch on shared hosting. I apologise for that, but I'm a novice programmer and don't know any other way of doing it. Debian/Ubuntu users with root access can install the module using sudo apt-get install libcaptcha-recaptcha-perl
. Dreamhost has instructions for setting up CPAN without root access on their wiki.
To apply the patch, use patch -p1 -i waka_recaptcha.patch
. To enable it, set ENABLE_CAPTCHA
in config.pl to ENABLE_CAPTCHA => 'recaptcha'
. You also need to set your private and public key from the reCAPTCHA website.
In the case that the required CPAN module is unavailable, it will bypass the CAPTCHA check altogether. I'm not sure whether this is a good decision or not. If you can, please improve this patch so it doesn't depend on the above-mentioned module.
>>36
is it really that hard to click the back button after you post?
>>40
Some browsers try to outsmart you or act stupid if you do that, so yes it sometimes is.
>>38
You could probably just grab the file from cpan manually on a shared host - make a folder called Captcha and put the file in there. It doesn't use any C extensions, and it's just one file.
http://search.cpan.org/dist/Captcha-reCAPTCHA/lib/Captcha/reCAPTCHA.pm and click on "source" at the top
>>41
name one browser that actually does that.
you can't, because there aren't any. even the browser known for having completely batshit insane bugs due to being developed by a company of lsd-using hipsters doesn't do that.
... on second thought, I'll leave hotaru alone. Otherwise, I might get called a hipster, and I wouldn't want that.
A dice roller. Type "dice (X)d(Y)[Z]" in the email field and it will prepend a little message to your post.
use List::Utils qw( sum );
#put this after "$comment=format_comment($comment,$markup,$thread);" in kareha.pl
if ($link =~ /dice \s*/( #$1
(\d+) #$2
\s* d \s* #letter d
(\d+) #$3
\s* #space
([+-]\d+)? #$4
)/xi) {
my $derp = ", "; #array element separator
my @results = map { int( rand($3) ) +1} (1 .. $2); #generate dice results
my $sum = sum(@results) + $4; #adds the results together, plus the modifier
my $roll = join($derp, @results); #adds commas to the array elements
my $modifier = ", $4" if defined $4; #http://en.wikipedia.org/wiki/Oxford_comma
my $rolled = "<strong>Rolled: $roll$modifier = $sum</strong>"; #e.g. "Rolled: 2, 3, +1 = 6", in bold
$comment = $rolled . $comment;
}
Here's some miscellaneous little stylesheet-related patches that might be worth applying to Wakaba and Kareha.
kareha/border-radius.patch
and wakaba/border-radius.patch
:
border-radius
declarations to stylesheets using -moz-border-radius
, since every common web browser (Firefox, Chrome, Safari, Opera, and even MSIE 9) now supports the standard declaration. Separate patches for Wakaba and Kareha included.kareha/javascript.patch
and wakaba/javascript.patch
:
set_cookie()
to be RFC 2109 compliant. It wasn't escaping values before, so strictly-complying cookie implementations will choke on (for example) stylesheets with spaces in the titles.set_stylesheet()
, instead of when the window is closed. This gets rid of inconsistencies when working in multiple tags; in particular, changing the style and then opening a new tab should ideally show the new tab with the newly selected style..*?
or .+?
. Not that I expect anyone to actually use IE5, but I tested the code with it and it didn't work, so there.set_stylesheet()
.kareha/pseud0ch.patch
:
.replytext em
selector to add underlining for <em>
text, since the font-style: normal
rendered it indistinguishable from normal text. (Was that intentional? Why?)I tested these changes in Firefox, Chrome, Opera, and Internet Explorer, and everything appears to work.
I am working on linking multiple boards together through a single .php file roughly like so:
index.php?board=one
get($board)
include($board/wakaba.html)
the issue I'm having is with make_http_forward, it always dumps the user into Boardname/wakaba.html rather than index.php?board=Boardname.
In every case i can find in wakaba.pl, I've changed make_http_forward(HTML_SELF,ALTERNATE_REDIRECT) to make_http_forward("http://website.com/index.php?board=$myboard",ALTERNATE_REDIRECT), and even gone so far as to go into wakabautils and alter the make_http_forward function to
if($alternate_method) { $location=mypage;
What I've found is in every call of "ALTERNATE_REDIRECT", it seems to completely ignore the location I give it. The only way I've found to get this to work is to put a $location=page in the ELSE section, but I can't actually find any calls to make_http_forward that don't use ALTERNATE_REDIRECT so i'm not sure where these calls are coming from, and doing so breaks the admin panel.
It's clear I'm not understanding this function and I've spent about 2 hours on this, so if anyone can help I'd be thrilled.
>>52
Pretty sure I have something similar working at http://www.studiocrabapple.com/index.php?id=board.php
Is this what you're trying to accomplish?
Here's a patch for Wakaba I made to deal with a raid on my board. It adds a "Ban All" link in the admin panel, which bans every poster in a thread, so you don't have to add bans for them manually. Perfect for dealing with CP floods and such. "Mass-banned: " will be prepended to the ban comment, but you can customise that in config.pl.
To apply it, run patch < wakaba_massban.patch
on a clean install of Wakaba.
While I'm at it, here's also a patch for Kareha which lets you ban IPs on non-Apache web servers, as requested in http://wakaba.c3.cx/sup/kareha.pl/1316722874/. It simply prevents the user from posting, nothing more, nothing less.
IPs are added in a file called ipbans.txt. I haven't bothered trying to encrypt it or anything, so you might want to configure your webserver to deny access to the file.
Disclaimer: I'm not really familiar with Kareha, so there might be stuff I've left out. I tested it using mode_message, and it worked fine.
Apply it using patch -p1 < kareha_bans.patch
.
>>38 The CPAN module for recaptcha is available, but it doesn't verify if it's correct or not. It just goes straight to posting.
>>56
You're probably missing one of its dependencies. The patch is designed to allow posting if the module doesn't work.
Try running perl -e 'use Captcha::reCAPTCHA'
on the command line and see if that returns any errors.
>>57 It output's:
Can't locate Captcha/reCAPTCHA.pm in @INC...
Should I reinstall? I've searched Google, no helpful information.
>>58
How did you install it? I use Debian and installing it through the package manager always worked for me. Using CPAN left out a dependency or two.
I decided to reinstall it via the package manager, and I don't receive that error anymore, but now it's saying the verification code is wrong even when it's correct. I've tried it with 10+ different codes.
>>61
I can't help you with that one. Only thing I can think of is the public/private keys being incorrect, or your server being unable to connect to Google's servers.
Adding onto my previous post;
Before:
make_error(S_BADCAPTCHA) unless $result->{is_valid};
I added:
print $result->{is_valid};
and it printed the source code of the page.
I really need help with this. I've tried everything. All the keys are correct, I've even tried it on a clean install.
Anyone at all? I've tried literally hundreds of things.
>>68
Hi,
I've taken the time to trace the problem, and I think I have a fix (but as usual, I'm too lazy to test it until anyone whines about it):
Find:
my $challenge=$query->param("challenge");
my $response=$query->param("response");
and replace it with:
my $challenge=$query->param("recaptcha_challenge_field");
my $response=$query->param("recaptcha_response_field");
That should hopefully do the trick. Obviously it was a derp on my part, I'll create an updated patch soon to rectify this.
Also, why do you even need reCAPTCHA that desperately? The default CAPTCHA is fine, easy to fill out, hard for bots to break and can easily be tweaked if you need better anti-bot measures.
If you're trying to cope with spam, I think you'll find that many of those so-called bots are actually humans.
>Ok, now I don't get "Error: Wrong verification code entered.", but it doesn't post the message. I've rebuild the caches, but no avail.
That's weird. I just tested the fix myself, and it works perfectly for me. Did you try fixing this on a clean install?
>It's definitely bots. Unless the same human is posting 20+ messages a second.
Uh, okay.
>>53
this is what i'm trying to accomplish. where do you change the redirect call? i've tried changing it in every call to make_http_forward i can find, but it doesn't work for me unless I put it in the actual function...
sub make_http_forward($;$)
{
my ($location,$alternate_method)=@_;
$location = "http://website/index.php?board=Main"; // <--- this is awful.
if($alternate_method)
{
...
I've always wondered why people thought noko was pointless. If anything it makes navigation easier. Shit, nobody even knows if you use it or not. I already wrote a noko patch for wakaba (a bit different than the one in this thread) and I'm planning on adding noko to Kareha as well. Anyone interested in a patch?
> I've always wondered why people thought noko was pointless.
it's because pretty much all browsers have a back button.
> Shit, nobody even knows if you use it or not.
yes, they do, because you usually can't use noko and sage at the same time.
>>76
Pretty sure nokosage exists, at least in Yotsuba.
When you use the back button usually you don't see the latest posts.
>>82
everyone uses the web this way aside from /b/tards. if you think noko is so useful, just write a tiny bit of javascript to implement it in your browser.
>>84
I already implemented it in Wakaba, and most message boards and forums have the feature built in and enabled by default.
Hey, you made PHPerl, which I never got around to making. GJ.
Anyone running a Wakaba board ought to read this.
There's a serious vulnerability in Wakaba 3.0.8 and below which let's anyone inject whatever HTML they want to in posts. This can be fixed by removing a couple of lines in the get_decoded_hashref()
and get_decoded_arrayref()
subroutines in wakaba.pl
, as shown in the included patch file. There should be no problem in making these changes.
Board moderators with no access to the board files may add /chr\([0-9]/
to spam.txt in order to fix the problem.
Looks like that is there to work around some absurdity in MySQL. I supposed MySQL has since changed and is now doing the wrong thing?
I'll put together a 3.0.9.
Pay no attention to the devs that tell you that you don't need something, such as noko. They seem to be into some weird sub/dom kink and want the world to bend their way. Just fork their code and make it better.
>>95
Or you know, they could just not feel obligated to bend to your every need.
> Just fork their code and make it better.
The sort of people who want things like noko aren't capable of that.
Just did these for a guy in another thread, but I might as well post them here to keep things organized
Hold back posts for moderation 1/2
Hold back posts for moderation 2/2
>>100
Just do ALTER TABLE comments ADD approved TINYINT;
in the sql interface
>>101 Not for me, for others :p
I do get this error when I click an approve link within the admin panel:
DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at wakaba.pl line 2066
Ignore the line number, my copy is modded.
sub get_decoded_arrayref($)
{
my ($sth)=@_;
my $row=$sth->fetchrow_arrayref();
That's the issue line.
>>102
No idea. Are you using SQLite or a regular mysql database? I've only tested this on SQLite. Also, did you try to run the actual patch on your modded wakaba.pl? That could very well be the issue.
The mod works, it just also throws that error into the error log. It's just MySQL.
What happended to this site? Everything I see here is so old :(
AND I have no clue about how to get kareha running.
>>105
Wakaba is mostly mature at this point. There really isn't too much to do to Wakaba to make it a futaba channel clone so therefore, there really isn't much to discuss. I suppose it would be nice to update Wakaba and Kareha to make it HTML5 semantic.