The Wakaba and Kareha support thread, part 3 (535)

1 Name: !WAHa.06x36 : 2011-01-07 09:57 ID:eLRTX7Vk [Del]

This thread is for all your simple questions about installing and running Wakaba or Kareha, that just require quick answers. Please don't create new threads for issues like that, post them in here instead.

Before posting, check that the question has not already been answered in this thread, or in the previous two threads:

Also check the documentation: http://wakaba.c3.cx/docs/docs.html

There is also a setup guide by Anon: http://wiki.iiichan.net/index.php?title=Wakaba_and_Kareha_Setup_Guide

Questions about "500 Internal Server Errors" go in this thread: http://wakaba.c3.cx/sup/kareha.pl/1109033191/

342 Name: hotaru!hoTarufiRE : 2013-01-02 15:10 ID:Heaven [Del]

> Also, is hotaru still around?

yes, i am still around.

343 Name: Anonymous : 2013-01-02 16:23 ID:Heaven [Del]

>>341
Perhaps use something like this instead, without the <Files> block:

Options +ExecCGI
AddHandler cgi-script .pl

344 Name: Anonymous : 2013-01-23 08:56 ID:gGuAgg98 [Del]

Anyone know how to make session cookies or non-persistent cookies in Wakaba?

345 Name: Anonymous : 2013-01-24 10:50 ID:Heaven [Del]

>>344 here,
Already figured it out on my own. I just ended up adding a few lines to the make_cookies function.

346 Name: Anonymous : 2013-02-07 12:50 ID:5YY+Crgs [Del]

Has anybody written a Futaba-style Catalog mode for Wakaba?

I'm considering writing one myself, but my Perl isn't very good...

347 Name: Mr. Manager!!wIZhSe8U : 2013-02-08 19:04 ID:OFj2WUZi [Del]

>>346
I've written something a little more similar to 4chan's, but I think its close enough. You can copy the relevant code from https://github.com/marlencrabapple/Glaukaba, but I'm not sure if you can just drop it in and have it work. Also, the entire script is pretty much a mess since I started messing with this thing a whole year before I knew what I was doing.

The guys at bunbunmaru (http://bunbunmaru.com/wakaba/general/wakaba.pl?task=cata) made one that may be a little more your speed, and if they're willing to share the code then you should be set.

If neither of those work for you, you can try bothering the guy from http://sovietrussia.org/ since I think he also had a catalog mode in his Wakaba installation.

348 Name: Anonymous : 2013-02-12 22:30 ID:Heaven [Del]

>>347
I like how you copied my broken signal handling.

You should probably use Plack/PSGI for FastCGI support. Anything else is just ridiculous, and Wakaba seems to leak memory if you run it in a persistent environment without restarting the script regularly. Plack handles that for you.

349 Name: Mr. Manager!!wIZhSe8U : 2013-03-02 13:48 ID:Heaven [Del]

>>348
I've actually had good luck with it so far. I'm pretty sure its the DB cache that takes up the memory in the first place, and apparently it'll shrink back down given enough time with no DB hits. I was actually looking into a few FastCGI frameworks right before you changed the way you did it, but I thought I might have better luck learning a little more about it before I just switched over. I was hoping that I could eventually "correct" your signal handling too, but I haven't had any issues with random crashes yet, so it hasn't been to pertinent of an issue for me.

350 Name: Anonymous : 2013-03-08 09:18 ID:7uw4gO2Z [Del]

Here this is a pretty simple question but it's been pissing me off no end, I'm trying to get a title image to display on my imageboard, the image is uploaded to the /wakaba directory and I've pointed at it in config.pl like so

use constant TITLEIMG => 'header.jpg';

The pic being named header.jpg, obviously. I've googled this many times and this thread just keeps coming up, nothing in documentation anywhere else. Is therre a pixel or size limit on the pic that's not mentioned? Cheers.

351 Name: Anonymous : 2013-03-11 13:42 ID:dH/Uh2WY [Del]

>>350

Nevermind eh got it wakaba doesn't updayte after I reupload the edited config file straight away, only after a post for some reason.

352 Name: Anonymous : 2013-03-13 20:24 ID:Heaven [Del]

>>351
It uses a static cache. You need to rebuild them manually for everything to update.

353 Name: Anonymous : 2013-03-17 14:52 ID:FVqzIfPc [Del]

Couldn't write to file "index.html" at wakautils.pl line 1013.

Help?

354 Name: Anonymous : 2013-03-17 14:58 ID:FVqzIfPc [Del]

>>353
Just needed to set perms. to 777

355 Name: Anonymous : 2013-03-19 11:28 ID:ivlqFrOT [Del]

No verification code on record - it probably timed out.

But there is no captcha image coming up.

356 Name: Anonymous : 2013-03-19 14:33 ID:ivlqFrOT [Del]

>>355
Nevermind, fixed by messing with perms.

But now thumbnails aren't showing, has anyone had any luck with ImageMagick on nearlyfreespeech?

357 Name: Anonymous : 2013-03-19 14:44 ID:Heaven (Image: 586x182 png, 6 kb) [Del]

src/1363729495799.png: 586x182, 6 kb

>>356

Picture for clarity.

358 Name: Anonymous : 2013-03-19 16:52 ID:Heaven [Del]

>>356
>>357
Doesn't look like it's a thumbnail creation issue, rather another permission issue.

359 Name: Anonymous : 2013-03-19 18:38 ID:Heaven [Del]

>>358
I've tried messing with permissions to no avail. There's no "thmubs" directory being made (hence the picture).

360 Name: Anonymous : 2013-03-19 20:12 ID:Heaven [Del]

>>359
Make the directory yourself. I think I had a similar problem.

361 Name: Anonymous : 2013-03-20 10:42 ID:ivlqFrOT [Del]

Stupid question, but where is the admin panel?

362 Name: Anonymus : 2013-03-20 12:46 ID:lDd0q0/g [Del]

How do i get it installed in my HTML document at the first place??

363 Name: Anonymous : 2013-03-20 22:12 ID:Heaven [Del]

364 Name: Anonymous : 2013-03-21 14:06 ID:Heaven [Del]

How to enable oekaki?

365 Name: Anonymous : 2013-03-23 01:52 ID:AETOpidL (Image: 1280x1024 jpg, 189 kb) [Del]

src/1364028768417.jpg: 1280x1024, 189 kb

When I access the pl file through my web browser, am I supposed to see th html code or the actual page?

366 Name: Anonymous : 2013-03-23 11:18 ID:Heaven [Del]

>>365
First, are you even running a http server? Second, you need Perl installed. Third, you need to configure your http server to pass requests for Perl files to your Perl interpreter.

367 Name: Anonymous : 2013-03-23 11:51 ID:AIXQUUGK [Del]

>>365 goldmine

368 Post deleted by moderator.

369 Post deleted by moderator.

370 Post deleted by moderator.

371 Post deleted by moderator.

372 Post deleted by moderator.

373 Post deleted by moderator.

374 Name: Anonymous : 2013-03-27 13:46 ID:Heaven [Del]

Looks like >>369 broke the board... I'm surprised that hasn't been fixed yet.

375 Post deleted by moderator.

376 Post deleted by moderator.

377 Name: Anonymous : 2013-04-09 20:27 ID:Heaven [Del]

Just wanted to thank you for keeping your software up-to-date and helping your users out, WAHA. Kareha is great. Thanks a bunch!

378 Name: Anonymous : 2013-04-10 11:17 ID:Heaven [Del]

Running Kareha in Futaba mode. When I delete a post, it still appears in the admin.pl menu as a blank post, i.e. Posted by: 46.105.XXX.XXX - Password: XXXXYYYY - delete post - delete file - ban IP with no real content beneath it (blank). Is this normal behaviour?

379 Name: Anonymous : 2013-04-10 11:47 ID:Heaven (Image: 786x685 png, 135 kb) [Del]

src/1365619637082.png: 786x685, 135 kb

>>378
Didn't think to include an image. This board looks like it's in 2ch mode but it allows image posting. It's confusing me!

380 Name: Anonymous : 2013-04-21 14:27 ID:OFj2WUZi [Del]

This is probably a stupid question, but just how much would a bunch of <if $admin> 's in the regular template slow regular posting down? Obviously, they won't work unless I'm building the pages dynamically for admin users, and of course I already have this all worked out using an almost entirely copypastad version of the normal template for this, but its become a bitch to maintain, and I'd just like to know how bad of an idea combining the two together would be.

381 Name: Anonymous : 2013-04-21 14:29 ID:Heaven [Del]

>>380
Alternatively, can anyone recommend a good way to benchmark wakaba myself?

382 Name: Anonymous : 2013-04-21 16:57 ID:Heaven [Del]

>>380
<if $admin> in the templates gets transformed to if ($admin) { ... } during compilation, so it won't run any slower than a regular if statement in Perl.

383 Name: Anonymous : 2013-04-21 22:59 ID:Heaven [Del]

>>382
I'm just wondering how much an extra 10 or so of those would effect compilation time.

384 Name: Anonymous : 2013-04-22 15:53 ID:Heaven [Del]

>>383

Benchmark: timing 10000 iterations of fifteen_ifs, five_ifs...
fifteen_ifs: 3 wallclock secs ( 3.13 usr + 0.00 sys = 3.13 CPU) @ 3194.89/s (n=10000)
five_ifs: 2 wallclock secs ( 1.68 usr + 0.00 sys = 1.68 CPU) @ 5952.38/s (n=10000)

Code: http://pastie.org/pastes/7700042/text?key=ofajzssrzghdz6mobzwyg

In other words, the difference is totally insignificant.

385 Name: Anonymous : 2013-05-02 13:49 ID:I9C3RNUF [Del]

please remove my ip from ban-list
when i go to http://wakaba.c3.cx/
i get http 403

386 Name: Anonymous : 2013-05-25 17:24 ID:Heaven [Del]

In Kareha, is there a simple way to get, say, header.html to automatically include another HTML document? So you could have:

<div id="rules">Some rules here.</div>
<hr />
<div id="navigation">{include nav.html}</div>

Or something. I use the rules.html for my board navigation, and mid.html for announcements. This would make things a mighty sight easier!

387 Name: Anonymous : 2013-05-28 08:50 ID:OFj2WUZi [Del]

>>386
If you're doing it inside of the header and you don't want to mess around to much with the rest of the template, just do something like this

<var include("include/nav.html")>

That should work in Kareha.

388 Name: Anonymous : 2013-05-31 07:54 ID:Heaven [Del]

I heard that WAHa recommends Kareha over Wakaba for imageboards. Is this true? I use Kareha and was thinking of setting up an imageboard, but I'm not sure if I should choose Wakaba or Kareha. The speed increase seems nice, but if the author recommends against it, I'm more than happy to trust his judgement.

389 Name: Anonymous : 2013-05-31 08:31 ID:Heaven [Del]

>>388
This is just a guess, but I think he recommends Kareha because most will never need the added speed that Wakaba and a database can bring. That, and 2006-2010 4chan kinda tarnished the imageboard collective... image, so the farther away you get from that paradigm the better, I guess. There's also the fact that Kareha is newer and has more functionality in some ways.

Back when I had to make the choice in 2011, I went with Wakaba, and its worked out for me so far. I've also managed to tack on ~2000 lines of code for some more modern functionality since then too, which is something that would've been a bit more difficult with Kareha, I imagine.

390 Name: Anonymous : 2013-06-03 07:49 ID:Heaven (Image: 714x1000 jpg, 373 kb) [Del]

src/1370270980419.jpg: 714x1000, 373 kb

>>379
From what I've gathered (reminding everyone that I know absolutely nothing about programming), the post remains in log.txt which is why its IP address can still be viewed. It also appears that, while the post is removed from the HTML document, the postcount number is not lowered.

Make a thread, post two replies. Delete the last reply. Not only will that deleted post still be in log.txt, but the thread's postcount remains at 3. Because of this, you can view the post number and IP in admin.pl, but the post appears to be completely empty.

I'm assuming this behaviour is for one reason only: so that the post numbers contiue to rise up, just like they do in 2ch mode. If we delete that third post then add a reply, the new reply is post #4, not #3. The only difference is that, in 2ch mode, the post will still be visible, but its contents are replaced with 'Post deleted by user.'.

So, AFAIK, it's not a bug, but simply a way of keeping track of the amount of replies the thread has received; it only appears blank because deleted posts aren't visible in Futaba mode, but they are in 2ch mode.

391 Name: Anonymous : 2013-06-03 18:10 ID:Heaven [Del]

>>386
>>387
Note that any template code inside nav.html will not be evaluated when doing it this way. If you need this, I believe I posted a hack for it further up in the thread.

>>388
I've heard the same thing, but I don't think it's true. I'd argue that Wakaba is the better choice: it has way better mod tools than Kareha has, SQL makes life easier in the long run and I've encountered weird bugs in Kareha which have resulted in things like cached indexes erroneously displaying single threads and large amounts of posts being wiped.

392 Name: Anonymous : 2013-06-11 10:24 ID:MJr6NpE7 [Del]

http://wakaba.c3.cx/sup/css/pseud0ch.css

> .replytext em { font-style: normal; }

Why is this rule here? It stops emphasized text from showing as italic in Pseud0ch.

393 Name: !WAHa.06x36 : 2013-06-11 10:41 ID:Heaven [Del]

>>392

You're expecting anyone to remember, after all these years?

394 Name: Anonymous : 2013-06-11 18:22 ID:Heaven [Del]

>>393
I'm surprised I even noticed. It seems all the boards I visit must have fixed it.

395 Name: Tokiko : 2013-06-20 16:27 ID:bSTS9uTn [Del]

How do I get a sage checkbox?

396 Name: Tokiko : 2013-06-20 16:38 ID:bSTS9uTn [Del]

I got it!

<if $thread>No bump <input type="checkbox" name="field_b" value="sage"/></if>

397 Post deleted by user.

398 Name: Anonymous : 2013-07-21 18:41 ID:r5mDQMLQ [Del]

Is there a postcount variable?

I'm making a masterlist of threads and wanted to show the postcount in a table. I've found $curr_replies in wakaba.pl but didn't know how to specify which thread with it.

399 Name: Anonymous : 2013-07-21 20:20 ID:OFj2WUZi [Del]

>>398
Just do "SELECT COUNT(*) FROM ".SQL_TABLE.";"

400 Name: Anonymous : 2013-07-21 22:48 ID:67T7uUcY [Del]

>>399
But where would I specify the thread number?

401 Name: Anonymous : 2013-07-21 23:26 ID:Heaven [Del]

>>400
Oh, I thought you wanted ALL of the posts. Try "SELECT COUNT(*) FROM ".SQL_TABLE." WHERE parent=?;" and just put the thread number in the $sth->execute() part.

402 Name: Anonymous : 2013-07-22 15:28 ID:Heaven [Del]

>>401
Sorry, now I'm really confused. I just want to count the number of comments (from the SQL table "comments") for each parent thread.

403 Name: Anonymous : 2013-07-22 19:01 ID:OFj2WUZi [Del]

>>402
That's exactly what that does. Though if you're doing it all at once, you should probably do what I said in >>399 and calculate them yourself.

404 Name: Anonymous : 2013-07-22 22:57 ID:Heaven [Del]

>>403
Thanks for the additional clarification. I ended up settling for a basic code that needs to be manually adjusted for each new parent thread, but just in case anyone else is interested:

<?php
$con=mysqli_connect("localhost","USER","PASSWORD","TABLENAME");
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$result1=mysqli_query($con, "SELECT count(*) as total from comments where parent='1'");
$data1=mysqli_fetch_assoc($result1);

?>

<table>
<tr>
<td>001</td>
<td>
<?php echo $data1['total']; ?>
</td>
</tr>
</table>

405 Name: Anonymous : 2013-07-22 23:23 ID:Heaven [Del]

>>404
That's not really ideal for multiple reasons. First, why are you using PHP when Wakaba is written in Perl? Second, depending on how many threads you have you could be hitting the database hundreds of times for each user that views the page.

On a side note, thanks to your code, I remembered that my board's thread list does what you wanted, so I thought it might be a good idea to share my code with you, but as I read through I realized I made the same exact mistake as you. Wakaba has a sub routine called count_posts already built in, and I was calling it for each thread

406 Name: Anonymous : 2013-07-23 11:11 ID:Heaven [Del]

>>405

>why are you using PHP when Wakaba is written in Perl?

Because I know more of PHP. My knowledge of Perl is nonexistent; I've never worked with it before.

>you could be hitting the database hundreds of times for each user that views the page

Fair enough. If this were for a popular imageboard, I wouldn't recommend this method. But in a situation where you only have five posters, this manual method works well. Plus, the table from >>404 is a simplified version of the real masterlist table, which contains multiple elements ('type' and 'description') that can't be automatically generated (as they don't exist outside of the masterlist) so I can't just cycle through the parent threads.

>share my code

Oh, I'd definitely be interested in seeing it if you do fix it. Or just the unfixed code. Curious how other people (who know Perl) tackled this problem.

407 Name: Anonymous : 2013-07-23 11:38 ID:Heaven [Del]

>>406
To be completely honest, I didn't know Perl or PHP when I started messing around with Wakaba, but I've learned a ton because of the time I spent tinkering.

Anyways, it turns out posting my code isn't as simple as copying in pasting the relevant lines, since I don't know just how much I've changed over the last year. I can try implementing it in a plain version of Wakaba sometime tonight, but until then, you can try to track down what you need in my git https://github.com/marlencrabapple/Glaukaba

408 Name: Anonymous : 2013-07-23 11:49 ID:Heaven [Del]

>>407
I see. Alright, thanks for the link, I'll poke around once I'm done patching up the rest! And wow, a Summer Glau chan. Good taste.

409 Name: Anonymous : 2013-08-01 13:32 ID:Y7PnBwvC [Del]

I have the same problem as >>339
I've tried with +ExecCGI and allow from all in <Directory > and <Files > with /var/www/ /var/www/kareha.pl /var/www/kareaha.pl/*

The error I get in error.log is:
Options ExecCGI is off in this directory: /var/www/kareha.pl

Thanks in advance.

410 Name: Anonymous : 2013-08-01 13:59 ID:Heaven [Del]

>>409

You'll probably have better luck asking at some Apache forum.

411 Name: Anonymous : 2013-08-03 12:03 ID:ZBKA9Csm [Del]

I can't seem to get the quote feature to work. I have to type the ">>40" or whatever the number would be. When I click on the post number, doesn't put the quote in the comment box. I am using Wakaba. Here is the link to my imageboard. http://pyroneous.com/wakaba

412 Name: Anonymous : 2013-08-03 12:25 ID:Heaven [Del]

>>411
wakaba.js is missing.

413 Name: Anonymous : 2013-08-03 13:27 ID:ZBKA9Csm [Del]

>>412 It is named wakaba3.js, should I rename it?

414 Name: Anonymous : 2013-08-03 15:52 ID:Heaven [Del]

>>413
No, just make sure its in the right folder or fix your permissions so that its readable.

415 Name: Anonymous : 2013-08-11 11:05 ID:CSTuNhUD [Del]

How should I get rid of the "Board Look" section?

416 Name: Anonymous : 2013-09-04 17:32 ID:5LrvXA7U [Del]

Is there a way to create hyperlinks with WakabaMark? I'm assuming there is with Markdown.

It's the only reason I ever use HTML formatting, and then I have to add <p> tags myself.

417 Name: Anonymous : 2013-09-04 22:29 ID:OFj2WUZi [Del]

>>416
It does it automatically to some degree.

418 Name: Anonymous : 2013-09-05 19:29 ID:Z1FYU1zP [Del]

What can I edit so that I can put a constant PHP header on index.html in Kareha?

419 Name: Anonymous : 2013-09-06 01:16 ID:CTQK2Zwo [Del]

>>417
But it would be nice to have hyperlink text, maybe something like [[http://example.com|example]].

420 Name: Anonymous : 2013-09-08 22:57 ID:AvfT+fDg [Del]

there would be no point in doing that. it decreases the security of the users and makes hiding spam or malicious urls much simpler.

421 Name: Anonymous : 2013-09-09 10:22 ID:Bs1jM0ZK [Del]

>>420
You can already do that through the HTML mode, and a lot of spam bots already do (or try to). Plus I doubt many spam bots are set up to use WakabaMark.

It's inconvenient to humans, not robots, and if a human wants to hide a malicious URL that way they already can.

422 Name: Anonymous : 2013-09-24 06:17 ID:zEBosdfL [Del]

Has anyone made a HTML5 patch/fork before I do it myself?

423 Name: Anonymous : 2013-09-24 09:06 ID:OFj2WUZi [Del]

>>422
Its as simple as changing the doctype for the most part. That said, if you're looking for 100% "valid" html5, then yes, I've done it, along with a ton of other things that might turn you off if you're looking for a barebones experience.

https://github.com/marlencrabapple/Glaukaba

Aside from an option or two missing in global_config.pl, the installation is pretty straightforward, and everything should run as expected. I just installed it myself a week or two ago and it seems to be in a pretty useable state.

424 Name: Anonymous : 2013-10-07 05:09 ID:hjhZTxbY (Image: 785x71 jpg, 18 kb) [Del]

src/1381147756336.jpg: 785x71, 18 kb

I get a software error.

install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC

As far as I can tell I have installed the thing in my cpanel, so what gives?

425 Name: Anonymous : 2013-12-13 21:55 ID:Heaven [Del]

Stupid question: is there a reason why no column is set as the primary key in Wakaba? I don't know much about databases, but it seems like that most of web apps do it.

426 Post deleted by moderator.

427 Name: Anonymous : 2014-01-14 13:17 ID:K9Khr868 [Del]

Hi
i have installed kareha, but there are a few problems i am not sure how to deal with.

  • When running kareha.pl, i get an error that says

Software error: Can't locate captcha.pl in @INC (@INC contains: . /usr/local/lib/perl5/5.8.8/x86_64-linux /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/x86_64-linux /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl) at kareha.pl line 15, <FILE> line 7.
BEGIN failed--compilation aborted at kareha.pl line 15, <FILE> line 7.
I temporarily fixed this by commenting the line BEGIN { require 'captcha.pl'; }, but I'd like to fix it properly.

  • I can't seem to get capcodes to work (trips and secure trips work fine).
  • There is no delete or manage button.

Thanks for your help guise.

428 Name: Anonymous : 2014-01-19 19:36 ID:OGXnEN+6 [Del]

How stupid would it be to connect to another db for things like session management? I'm thinking that if I offload something that would be hitting the db pretty often so a separate database server (or a tiny sqlite db) it would decrease access times to my main db server without any consequences. Would there be any noticeable overhead or am I missing something really obvious?

429 Name: !WAHa.06x36 : 2014-01-20 11:23 ID:Heaven [Del]

>>428

There's no session management, nor any hits to the database at all unless someone posts?

430 Name: Anonymous : 2014-01-20 13:13 ID:Heaven [Del]

>>429
Sorry I wasn't clear. I'm testing out some stuff I wrote for prevalidating captchas (reCAPTCHA, not the built in one) so you don't have to spend forever uploading an image just to find out you messed up and need to start over. Its pretty simple stuff but of course in most cases it requires an extra db query. After looking into how flood detection and bans are handled its pretty obvious that this would't be that huge of a performance hit, since its pretty much just two extra queries in total, but I'm still curious if offloading it somewhere else (maybe even a simple text file) could improve performance.

431 Name: Anonymous : 2014-01-21 09:40 ID:+yM64RIQ [Del]

besides writing a new .css, what do i have to do to use custom board look?

432 Name: Anonymous : 2014-01-21 20:06 ID:Heaven [Del]

>>431
In terms of what you HAVE to do that's about it, but you can do a lot more if you really want to.

433 Post deleted by user.

434 Name: Anonymous : 2014-02-04 20:52 ID:Heaven [Del]

I'm using waka_utils.pl in another project of mine and I was wondering how safe the templating system is for allowing (paid) users to write their own. If I remember correctly its possible to run code in a template, so I'm kind of wary about just allowing them to access the template system. Is there a way to make it a little more restrictive or am I better off just writing something myself?

435 Name: Anonymous : 2014-02-04 21:04 ID:Heaven [Del]

>>434
Okay I just tried looking through the compile_template function myself and I think this should take care of it.

if(!$safemode) {
if($closing) {
if($name eq 'if') { $code.='}' }
elsif($name eq 'loop') { $code.='$$_=$__ov{$_} for(keys %__ov);}}' }
}
else {
if($name eq 'var') { $code.='$res.=eval{'.$args.'};' }
elsif($name eq 'const') { my $const=eval $args; $const=~s/(['\\])/\\$1/g; $code.='$res.=\''.$const.'\';' }
elsif($name eq 'if') { $code.='if(eval{'.$args.'}){' }
elsif($name eq 'loop')
{ $code.='my $__a=eval{'.$args.'};if($__a){for(@$__a){my %__v=%{$_};my %__ov;for(keys %__v){$__ov{$_}=$$_;$$_=$__v{$_};}' }
}
}
else {
if(($name eq 'var') and ($args =~ /^\$[a-zA-Z]+$/)) {
$code .= '$res .= eval{' . $args . '};'
}
}

Any obvious gaping holes?

436 Name: Anonymous : 2014-02-04 21:32 ID:Heaven [Del]

>>435
The only obvious gaping hole I can think of is that you've basically just created an overcomplicated sprintf().

437 Name: Anonymous : 2014-02-04 23:15 ID:Heaven [Del]

>>436
Most of it is part of the templating system already in waka_utils.pl.

438 Name: Anonymous : 2014-02-07 16:05 ID:Heaven [Del]

>>427
please answer

439 Name: Anonymous : 2014-02-13 22:07 ID:OGXnEN+6 [Del]

I'm trying to wrap my head around the templating system a little more, and I can't quite figure out how the variables passed to the constant value that defines the template are in the same scope as compile_template. How would one access the variables available to compile_template? Are they inside of some magical perl variable? I already checked @_ and all that's in their are the contents of the constant.

440 Name: Anonymous : 2014-02-13 22:27 ID:Heaven [Del]

>>439
Oh wow I think I got it on my own. I put die %__v->{title} inside of the my $sub = eval part and it printed out the value of $title.

441 Name: Anonymous : 2014-02-15 09:21 ID:Heaven [Del]

How big of a performance hit would it be to change the entire config system from constants to hashes? I'm trying to make it easier to manage multiple boards for less savvy users. Would something like

my $option = sub {
my ($board,$key) = @_;
return BOARDS->{$board}->{$key} || GLOBAL_OPTIONS->{$key};
};

for retrieving a config option be a huge performance hit or security risk?

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