Posts Tagged ‘code’

phpBB Hook to remove success messages

Tuesday, February 16th, 2010

Time for another phpBB hook, this time the aim is to remove the messages which irritate some people when a post has been made and instead redirect the user immediately to the default choice. A few considerations had to be made with this, firstly the administration panel is off limits as this uses messages for success and failure in some places. Secondly any page which goes back to itself by default is made confusing if there isn’t a confirmation, so these aren’t automatically redirected; a good example of this being the UCP preferences. (more…)

PHP function: is_serialized()

Friday, October 23rd, 2009

I needed a way to detect if some values were serialized or not, annoyingly PHP does not provide a method for this. I’d also rather not perform unserialize() on everything to check for a serialized string in the name of efficiency, so instead I came up with a simple function to detect serialized data. The result of my endeavours is a function that checks a string for basic makers of the PHP serialization form, it only checks the variables type and not any deeper values inside arrays or objects, if this preliminary testing is successful then unserialize() is invoked to provide the final proof. The unserialized form is available as an option argument passed by reference and the return value is a boolean, true for boolean or false otherwise. You can find the function on Gist or below. (more…)

Another phpBB Hook

Sunday, April 5th, 2009

Further to my entry last month about a phpBB Hook to disable the post queue for certain users, I’ve written a really quick one to enable phpBB’s debugging mode for founder users. Debug mode is usually enabled by using the constants DEBUG and DEBUG_EXTRA in the configuration file but these can be defined anywhere. The only downside debugging information will only be available after the hook is included, however this is sufficient to get the page generation time, memory usage etc. in the footer which is what I was after. (more…)

phpBB Post Queue

Sunday, March 15th, 2009

In phpBB 3.0.3 we added the possibility to queue posts of users who had a post count lower than an administrator defined threshold, this works very well at keeping spam out of the public eye on your board. But on the board I administer which is primarily for university students who all have their own university e-mail address it penalises new users who I as the board administrator trust. To get around this, I will be applying a small modification to our board during the next maintenance period which I thought I will share with you. (more…)

Wordpress archives

Tuesday, March 3rd, 2009

I’ve been running my blog since late 2005 as such my archives had been getting a little bit unwieldy in the sidebar and stretching the page to extraordinary heights. I’ve reduced this clutter with some very small changes. First I dug around only to find out that Wordpress doesn’t support fetching the monthly archives for one year, so I had to apply some filter foomongery. I discovered somebody else has done something similar, not quite as nice personally but it works.
(more…)