Well, by dissecting some other extensions, it seems calling message() interrupts the installation process, thus preventing a successful install.  Judging by the behavior though, I'd imagine that if anyone else wants to do this you might want to do any cleanup (i.e. if you created a database already before testing and calling message, you'll want to remove the database prior to calling message) as it seems message() completely terminates the flow of the script.

This is a rather simple extension that adds the user's estimated location to their profile for administrators.  Unlike the ip_geolocation extension for 1.3 (seen here), this extension uses the GeoIP extension for PHP (which you must have installed), which relies on locally-stored data rather than any remote files.

The estimated location is always displayed immediately below the IP (since it's determined by the IP), so if you have other extensions that add information to the end of the "Private information" section, the location will be shown above those.

The location is based on registration IP, so it will remain constant for each user once they register.  If there is interest (and I have time), I can see about adding something to also use GeoIP to determine the location each post was made from.

Please note that GeoIP is not 100% accurate, which is why the extension uses the term "Estimated location"!  While it's quite accurate within the US, Canada, and Western Europe, it is less so in other countries and I have noted inconsistencies within US/CA/EU IPs, especially with regards to mobile devices.  That said, this extension should still be able to at least give you a general idea of where a given user is, particularly at the country level.


Download v1.1.1 (initial release, after security fix):
https://code.google.com/p/show-user-loc … cation.zip

P.S.: The sample user in the screenshot above was an old spammer account that hadn't been cleaned up yet; I figured this was a good example where I could show the IP without compromising a genuine user's identity tongue

I'm working on an extension that requires a particular PHP extension; I'd like the manifest's <install> section to do a extension_loaded() call to make sure the PHP extension is installed, but how do I make the installation terminate (with an appropriate error) to prevent installation of the PunBB extension if the PHP extension isn't loaded?

I like the pun_stop_bots extension, but it has one weakness: when spammers figure out the answer to a question, you don't really have any way to tell which question they're getting through on.  I wrote this extension to record which question the user successfully answered during the registration process.

It records the text of the question rather than the ID, so if you modify a question later, you can still see the original question text that the user responded to when they registered; takes up a little more DB space this way but helps avoid false positives, especially when it comes to "delayed" spammers that register, sit dormant for a few weeks or months, then suddenly pop in and start spamming (while you may have changed the question in the meantime).
Only admins/mods can see the question; users do not even see it on their own profiles.



Download v1.0:

http://code.google.com/p/stop-bots-reco … &can=2


(75 replies, posted in Supported extensions)

Another nice feature would be to permit "blacklist" answers; again, I kludged it in, but it'd be nice to have official support for this.  For example, if I asked "If you are not a bot, type anything other than 'bot' in this box:", I could put "~bot" as an answer and it would reject an answer of "bot".  Again, it'd be nice to have this as a configurable feature though, where you could specify the character that inverts the answer, or maybe just have a checkbox next to the answers field that serves that function instead.

My kludge (replacing the appropriate function in functions.php), where a "~" as the first character in the answers box inverts it:

function pun_stop_bots_compare_answers($answer, $question_id)
        global $forum_db, $forum_user, $pun_stop_bots_questions, $lang_pun_stop_bots;
        $answer_list = $pun_stop_bots_questions['questions'][$question_id]['answers'];
        $inv = false;
        $result = false;

        if (substr($answer_list,0,1) == '~') {
                $answer_list = substr($answer_list,1);
                $inv = true;

        $result = in_array($answer, explode(',', $answer_list));

        if ($inv)
                return !$result;
                return $result;

One last suggestion for improvements: Record (or offer the option to) which question the user answered correctly during their registration, to help discover any "weak" questions (i.e. if spammers are consistently answering one particular question correctly, you'll be able to track that and remove/change it).  It might need to record the text of the question, otherwise if a question is updated after a user registered, it might show the wrong question when reviewing.


(75 replies, posted in Supported extensions)

I installed it in PunBB 1.4.2, but it seems to be prompting all my users to answer a question every time they post.  How can I stop this?

PunBB 1.4.2
MySQL 5.5.29
PHP 5.4.11
spawn-fcgi v1.6.3
Nginx 1.2.6

EDIT: "Worked around" it by removing the "po_form_submitted" hook from the DB and disabling/re-enabling the mod.  It would be nice for this to be a setting in the admin panel though!


(5 replies, posted in PunBB 1.3 troubleshooting)

Well, about an hour and a half later, I've finally gotten the "themed" reCAPTCHA working... and it's very cleanly integrated into the registration form smile


If someone would like to help me figure out how to build this into an extension package, I'd love to do so!


(5 replies, posted in PunBB 1.3 troubleshooting)

Well I don't know what your latest problem is, but I found that the original garbling is caused by a CSS conflict - in the <THEME>.css (as opposed to <THEME>_cs.css), there are two places that the "table-layout" attribute of tables are set to "fixed" - commenting these out un-garbles it for the most part, and doesn't seem to adversely affect the rest of the forums...

However, in Firefox, the text box for entering the challenge response is shifted over about an inch or so, and is partially hidden under other stuff.  In IE8 it looks fine.

I think a custom theme will be the solution to this; to just do away with reCAPTCHA's layout altogether and whip up a custom one that plays nicer with PunBB.  I'm working on this, but it's 4:04am and my sanity is not found -_-