You are correct; I have updated my post with a solution (basically just check if the value of the POST'ed timezone is 'none'). Thanks!

This is a quick and dirty hack that I added to my PunBB forum and my users enjoy, so I thought I'd share it with the community. This really needs clean-up!

With this modification, users can double-click on another users post; when they do, they will be taken to the reply form with the selected post quoted. This makes replying to threads faster because you can just double click anywhere in the text of a post as opposed to clicking the tiny "Quote" link.

To try this out, open viewtopic.php and change this line (line 352 for me):

<div class="postright">

To this:

<div class="postright"<?php echo ' ondblclick="document.location=\'post.php?tid='.$id.'&qid='.$cur_post['id'].'\'"'; ?>>

Now, just double-click in the text of any post and you'll start a reply. Things you are welcome to add include making this an option that users can select to use from their profile, blocking guests from using it, and blocking it on threads that are closed or the user does not have permission to reply to. Also, expanding the double-click area to be the entire right side box for a post would be helpful.

Enjoy!

I noticed on my site that about 90% of spam signups are from users that select -12 as the timezone for their new account, and have found a simple way to block these users. The reason that these signups are all from -12 timezone is because the spammers are just using automated scripts that simply select the first choice in any drop-down that they do not recognize on a signup form. Obviously, there are smarter spammers out there and this method wont last forever but it works for now.

The simple solution is to add a new timezone called 'none' that is the first choice in the drop-down when signing up. Most users will never see this, as PunBB pre-selects the server timezone and uses that as the default; plus, who would select 'none' as a timezone? Then, in the registration code, simply add a catch for this bad timezone and force an error.

The code below is an example and is obviously very poor; I have tried to make it as simple as possible, but someone is welcome to make a better modification out of this. Indents have been removed for clarity.

In register.php, find the line (is line 185 for me):

$timezone = intval($_POST['timezone']);

Above this line, add:

if ($_POST['timezone'] == "none") message('Please select a valid timezone.');

Then, in the same file, find the line (is line 311 for me):

<br /><select id="time_zone" name="timezone">

below this, add:

<option value="none">Select one</option>

Make sure that the line you add is the first in the list of option tags. You can customize the text between the tags to change what is shown in the drop down as the top choice, just be sure that the value is set to 'none'. You may actually want to change the text in the option tags to say something other than 'Select one', as spam bots might know to skip this (but I have not seen it). For example, you could change to <option value="none">None</option> or <option value="none">I am a spammer</option> since most people wont even see it.

I actually used message($lang_prof_reg['Invalid timezone']); and added 'Invalid timezone' to the lang/English/prof_reg.php file but the above code is easier since 90% of people will never see it; if you expect multiple language signups you might want to modify your code accordingly.

Now when spam bots attempt to submit the form and pick the top choice in the drop-down, they will be blocked. This is not perfect, but again it should help cut back on many of the dumb spam bots that are out there.

Let me know if you have any comments or questions!

oops, posted this in the bug forum, please move to troubleshooting -- sorry!

I know that this was a bug on 1.2.5 that was fixed, but duplicate guest posts are popping up again on 1.2.10 for me. I've got a ton of different things added on (which isn't helping this situation, I'm sure) but can't track down the source.

Here is an example:
http://saab92x.com/viewtopic.php?pid=48446#p48446

Any ideas on where in the code this might be coming from? Thanks guys.

For those of us who keep PunBB in Subversion, the .svn directory inside of lang/ appears as a language in the drop-down inside the profile editing page, the registration page, and the administrative options page. A simple fix is to exclude .svn (or .cvs or .whatever) from the language list:

Index: admin_options.php
===================================================================
--- admin_options.php   (revision 14)
+++ admin_options.php   (working copy)
@@ -222,7 +222,7 @@
                $d = dir(PUN_ROOT.'lang');
                while (($entry = $d->read()) !== false)
                {
-                       if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry))
+                       if ($entry != '.' && $entry != '..' && $entry != '.svn' && is_dir(PUN_ROOT.'lang/'.$entry))
                                $languages[] = $entry;
                }
                $d->close();
Index: register.php
===================================================================
--- register.php        (revision 14)
+++ register.php        (working copy)
@@ -337,7 +337,7 @@
                $d = dir(PUN_ROOT.'lang');
                while (($entry = $d->read()) !== false)
                {
-                       if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry))
+                       if ($entry != '.' && $entry != '..' && $entry != '.svn' && is_dir(PUN_ROOT.'lang/'.$entry))
                                $languages[] = $entry;
                }
                $d->close();
Index: profile.php
===================================================================
--- profile.php (revision 14)
+++ profile.php (working copy)
@@ -1129,7 +1129,7 @@
                $d = dir(PUN_ROOT.'lang');
                while (($entry = $d->read()) !== false)
                {
-                       if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry))
+                       if ($entry != '.' && $entry != '..' && $entry != '.svn' && is_dir(PUN_ROOT.'lang/'.$entry))
                                $languages[] = $entry;
                }
                $d->close();

Obviously, it would be cleaner to just ignore any directory whose name begins with a . but the above code works just fine for me.

7

(0 replies, posted in Feature requests)

I tried a search, but don't have any idea what I'm looking for, so if this already exists, let me know smile

Is there any way to get PunBB to show an icon next to threads that contain pics? Many popular boards show a little camera next to threads that contain pictures; is there a PunBB mod to do the same?

Connorhd wins, thanks guys!

I gave that a shot using div style="float: left;", etc, but the boxes ended up overlaid over the top of the forum list box below. Any CSS experts have any insight that might help?

I'd like to split the announcement bar so that it shows up on the left, and an identical box with seperate content appears on the right. Basically, visually divide the announcement bar in half (with a vertical split in the middle).

I've tried using tables in header.php, but the pun class seems to mess the entire thing up -- does anyone have any ideas on how to split the bar?