I’ve just found this great tutorial on my referrers: Single unified login for multiple WordPress 2.8 installs in subdirectories using cookies
I’d suggest reading it if you’re a root cookie user
I’ve just found this great tutorial on my referrers: Single unified login for multiple WordPress 2.8 installs in subdirectories using cookies
I’d suggest reading it if you’re a root cookie user
Those with a keen eye may have noticed that my tweets / status updates didn’t start with “is” until recently that’s because posts that appeared here on my blog would look stupid and out of context, who starts a post “is” ???
To solve the problem attached is a small plugin for Alex Kings Twitter Tools, it’s a simple WordPress filter which prepends posts which begin with “is” with the author name, example:
is testing his new WP plugin.
Nick is testing his new WP plugin.
If I get some positive feedback I might publish this in WP’s plugin directory.
Installation is easy, rename twitter-tools-is.txt to twitter-tools-is.php and save it in your wp-content/plugins directory, enable the plug-in the “normal” way and job done, no further configuration required!
Whilst playing with my bad-behavior callback function, I noticed something quite crucial; plug-ins load in alphabetical order!.
I noticed that every time a new version of BB is released / upgraded I had to re-paste my callback function into bad-behavior-wordpress.php – DOH!
To get around this I decided to create a new plug-in called linickx-bb-callback.php, but I noted that the counter wasn’t increasing. Changing the file name to aaa_linickx-bb-callback.php fixed the issue, sweeeeet!
UPDATE: This Plugin has been updated, please download the update from http://wordpress.org/extend/plugins/phpbb-recent-topics/, and please comment on the new post, thanks.
This is a small update, it incorporates the patch submitted by toni to fix the widget, thanks toni
The old information still applies…
If you’re happy with v0.4 and have it running fine then don’t bother, in fact edit phpbb_recent_topics.php so that WordPress stops complaining about finding a newer version.
Download phpBB_Recent_Topics_0.4.1 from wordpress.org
What’s New?
What’s Old?
The Installation
To output the list of topics in your theme sidebar using the widget…
To output the list of topics in your theme sidebar using a template tag…
<?php
if (function_exists('phpbb_topics')) {
phpbb_topics();
}
?>
A bit about Database configuration.
If wordpress & phpBB share a DB already then set $PHPBBDB to DB_NAME and everything will be fine, else you’re going to need to GRANT the wordpress user read access to phpBB.
How to GRANT wordpress read only access to phpBB ?
If you don’t know it already you need to find your wordpress mysql user id, it’ll be in wp-config.php
define('DB_USER', 'wp_user'); // Your MySQL username
and you should have already found your phpbb database & table for the above.
You need to type the following syntax into your mysql database
GRANT SELECT ON phpbb_database.phpbb_topics TO wp_user@localhost;
this can be achieved by logging into phpmyadmin as your phpbb user, selecting SQL and pasting the correct GRANT into the text box.
Frequently Asked Questions
$results = $wpdb->get_results("SELECT * FROM $TOPIC_TABLE ORDER BY topic_time DESC LIMIT $LIMIT");
to
$results = $wpdb->get_results("SELECT * FROM $TOPIC_TABLE WHERE forum_id != 1 ORDER BY topic_time DESC LIMIT $LIMIT");
to exclude forum 1 from the list. I plan to setup a proper solution to this in the next version.
Support
I’ve always been honest about support, there isn’t any. Basically I write this for my own needs and then publish it for you to use for free. You’re more than welcome to post comments here and if you tag wordpress forum posts with “phpbb-recent-topics” I’ll reply to you there, but we all have busy lives and I make no promises on how quickly I’ll reply to you.
Link for posting in the correct phpbb-recent-topics forum
Finally Subversion
You also might be interested to know that I’ve been getting to grips with the wordpress plug-ins svn, so you can get work directly from here; and when wordpress.org re-crawls my readme the latest version will also be available on wordpress.org/extend/plugins/
UPDATE: This Plugin has been updated, please comment on the new post, thanks.
Thanks to Scott Kingsley Clark for giving me the kick I needed, but I’ve finally gotten around to updating my root Cookie plugin for WordPress, we’re now at Version 1.3 !!
The point of the plugin is to strip out the path from the cookie so that it can be referenced by other applications; wordpress 2.6 has a whole new cookie structure and this broke the old version, but I’ve been so swamped recently that it wasn’t maintained.
Scott is one of the very few nice people in the world who instead of grumbling offered up a patched plugin, actually I’ve done it a different way but I appreciate his support anyway.
You can download the plugin from wordpress.org, and there is a discussion forum to get community support.
Enjoy!
I thought I’d write a post about this error message as it’s pretty much the main reason that I ever receive comments or e-mails from the WordPress community. Sadly the complaints I receive from the community out weigh the complements, but I guess that’s life
Thank you to all those who have downloaded and enjoyed my plug-in and all those who have taken to say something nice.
The problem with this error message Missing argument 1 for phpbb_topics() is that I don’t actually know how to fix it. If you look in the source code you’ll see that I’ve tried to trap “empty variables”…
if (is_null($LIMIT)) {
$LIMIT = 5;
}
Now this approach seems to work on my server(s), and works for some people, but there are a number of people whom is doesn’t work for; unfortunately the majority of the WP community are no more technical than myself and I have never received any feedback on how to fix this.
I’m not a programmer, I’ve never claimed to be a PHP guru; as I don’t know how to fix this problem in the latest version of phpbb-recent-topics I tried to combat the problem by introducing a widget. The widget it aimed at people who don’t know php, it allows you to “drag” the list of recent topics into your sidebar, but for some reason people still prefer to edit their sidebar.php :confused:
I would to remind all readers that it quite clearly states on my announcement :
Support
I’ve always been honest about support, there isn’t any. Basically I write this for my own needs and then publish it for you to use for free. You’re more than welcome to post comments here and if you tag wordpress forum posts with “phpbb-recent-topics” I’ll reply to you there, but we all have busy lives and I make no promises on how quickly I’ll reply to you.
Currently the only solution I can offer to anyone suffering from this error message is to replace phpbb_topics() with phpbb_topics(”5″), if that doesn’t work then please accept my apologies.
If anyone would like to offer a patch for my plugin I would gladly include it and accredit appropriately.
Thanks for Reading!
UPDATE: This Plugin has been updated, please download the update from http://wordpress.org/extend/plugins/phpbb-recent-topics/, and please comment on the new post, thanks.
It’s been a year since the last release so perhaps this version should be called “about time!” v0.4 has primarily been released as a bugfix version, if you’re happy with v0.3 and have it running fine then don’t bother, in fact edit phpbb_recent_topics.php so that WordPress stops complaining about finding a newer version.
Download phpBB_Recent_Topics_0.4 from wordpress.org
What’s New?
What’s Old? – aka: Installation
To output the list of topics in your theme sidebar using the widget…
To output the list of topics in your theme sidebar using a template tag…
<?php
if (function_exists('phpbb_topics')) {
phpbb_topics();
}
?>
A bit about Database configuration.
If wordpress & phpBB share a DB already then set $PHPBBDB to DB_NAME and everything will be fine, else you’re going to need to GRANT the wordpress user read access to phpBB.
How to GRANT wordpress read only access to phpBB ?
If you don’t know it already you need to find your wordpress mysql user id, it’ll be in wp-config.php
define('DB_USER', 'wp_user'); // Your MySQL username
and you should have already found your phpbb database & table for the above.
You need to type the following syntax into your mysql database
GRANT SELECT ON phpbb_database.phpbb_topics TO wp_user@localhost;
this can be achieved by logging into phpmyadmin as your phpbb user, selecting SQL and pasting the correct GRANT into the text box.
Frequently Asked Questions
$results = $wpdb->get_results("SELECT * FROM $TOPIC_TABLE ORDER BY topic_time DESC LIMIT $LIMIT");
to
$results = $wpdb->get_results("SELECT * FROM $TOPIC_TABLE WHERE forum_id != 1 ORDER BY topic_time DESC LIMIT $LIMIT");
to exclude forum 1 from the list. I plan to setup a proper solution to this in the next version.
Support
I’ve always been honest about support, there isn’t any. Basically I write this for my own needs and then publish it for you to use for free. You’re more than welcome to post comments here and if you tag wordpress forum posts with “phpbb-recent-topics” I’ll reply to you there, but we all have busy lives and I make no promises on how quickly I’ll reply to you.
EDIT: Found a link for posting in the correct phpbb-recent-topics forum
Finally Subversion
You also might be interested to know that I’ve been getting to grips with the wordpress plug-ins svn, so you can get work directly from here; and when wordpress.org re-crawls my readme the latest version will also be available on wordpress.org/extend/plugins/
So WP2.5 is out, and I figured it was about time I squashed that load bug on phpbb_recent_topics, while I’m at it I figure I’ll wigetize it.
The problem is that the example on the automattic site doesn’t actually work! If you paste…
function widget_myuniquewidget($args) {
extract($args);
?>
<?php echo $before_widget; ?>
<?php echo $before_title
. 'My Unique Widget'
. $after_title; ?>
Hello, World!
<?php echo $after_widget; ?>
<?php
}
register_sidebar_widget('My Unique Widget','widget_myuniquewidget');
Into a blank plugin you get this in your logs…
PHP Fatal error: Call to undefined function: register_sidebar_widget()
Now I’ve not been bothered to dig out the exact reason why yet, something to do with the sidebar loading, but you need to wrap the whole lot up in an init function, so try this instead…
function widget_init_myuniquewidget() {
// Check for required functions
if (!function_exists('register_sidebar_widget'))
return;
function widget_myuniquewidget($args) {
extract($args);
?>
<?php echo $before_widget; ?>
<?php echo $before_title
. 'My Unique Widget'
. $after_title; ?>
Hello, World!
<?php echo $after_widget; ?>
<?php
}
}
// Delay plugin execution until sidebar is loaded
add_action('widgets_init', 'widget_init_myuniquewidget');
I just need to work out now, how to add wiget options to the wp-admin panel and the next verions of my plugin will be done
I found this by accident, but thought it was useful to take a note as my regular expression knowledge is basic to say the least…
function ValidateEmail($e,$v=-1) {
global $verbose;
/*
Return codes:
0: appears to be a valid email
1: didn't match pattern of a valid email
*/
if ($v==-1) { $v=$verbose; }
if (!preg_match("/^[a-z0-9.+-_]+@([a-z0-9-]+(.[a-z0-9-]+)+)$/i", $e, $grab)) {
return 1;
}
return 0;
}
Usage is simple….
if(!(empty($_POST['email']))){
$email = ValidateEmail($_POST['email'],$v=-1);
}
// check E-Mail Syntax
if ($email == 1) {
echo "Incorrect Email Address Submitted.
";
}
Thanks Shane Marriott
I thought I’d post a quick note to say thanks Tobias for letting me know that my files download area was broken, I was playing with mod_rewrite over the weekend and forgot to check that – DOH !
Anywho, all is sorted now, sorry to those that couldn’t get to my wordpress goodies!
UPDATE: This Plugin has been updated, please download the update from http://wordpress.org/extend/plugins/phpbb-recent-topics/, and please comment on the new post, thanks.
Another day, another plug-in update…..Version 0.2 never saw the light of day, after fixing my compatibility issue I moved straight into setting up the admin interface. So here we have it, a proper implementation
Installation
To output the list of topics in your theme sidebar…
<?php
if (function_exists('phpbb_topics')) {
phpbb_topics();
}
?>
A bit about Database configuration.
If wordpress & phpBB share a DB already then set $PHPBBDB to DB_NAME and everything will be fine, else you’re going to need to GRANT the wordpress user read access to phpBB.
How to GRANT wordpress read only access to phpBB ?
If you don’t know it already you need to find your wordpress mysql user id, it’ll be in wp-config.php
define('DB_USER', 'wp_user'); // Your MySQL username
and you should have already found your phpbb database & table for the above.
You need to type the following syntax into your mysql database
GRANT SELECT ON phpbb_database.phpbb_topics TO wp_user@localhost;
this can be achieved by logging into phpmyadmin as your phpbb user, selecting SQL and pasting the correct GRANT into the text box.
Upgrading from Version 0.1
Upgrading is optional. This version has two major changes: The first basically fixes the compatibility issue I have running two php ob_start processes in wordpress; the second is the introduction of a “proper” admin interface (rather than hacking the php file).
To upgrade, make a note of the following settings:
$PHPBBDB = "phpbb"; //phpBB db name $TOPIC_TABLE = "phpbb_topics"; //phpbb topics table $SITEURL = "http://www.mydomain.com/forum"; //Forum URL
Deactivate version 0.1, and follow the Installation instructions above
Frequently Asked Questions
$results = $wpdb->get_results("SELECT * FROM $TOPIC_TABLE ORDER BY topic_time DESC LIMIT $LIMIT");
to
$results = $wpdb->get_results("SELECT * FROM $TOPIC_TABLE WHERE forum_id != 1 ORDER BY topic_time DESC LIMIT $LIMIT");
to exclude forum 1 from the list. I plan to setup a proper solution to this in the next version.
Finally Subversion
You also might be interested to know that I’ve been getting to grips with the wordpress plug-ins svn, so you can get work directly from here; and when wordpress.org re-crawls my readme the latest version will also be available on wordpress.org/extend/plugins/
UPDATE: This Plugin has been updated, please comment on the new post, thanks.
I’ve been a bit slow, aja pointed out the fault a few days ago, but I’ve been a bit slow off the mark
Anyway, here’s the official announcement,
This version primarily fixed the logout issue, and yup, I’ve learnt by my mistakes it loads it gently too
I’ve recently run into a compatibility problem with my phpbb topic plugin, basically I tried to copy the code I did ( the ob_start / stop buffer thing ) and I found that the second time I ran the loop it didn’t work !
Anyway in lieu of working on an admin interface for setting up the phpbb connection I’m solving this, if anyone is having a similar issue please let me know.
Oh, and this might be of interest…
———- Forwarded message ———-
From: Nick
Date: 12-Mar-2007 11:38
Subject: Re: Recent phpBB Topics on WordPress Plugin
To: Paul StokesHi Paul,
You can do this by playing with the SQL statement in the plugin, for example
SELECT * FROM $TOPIC_TABLE WHERE forum_id != 1 ORDER BY topic_time DESC LIMIT $limitwould exclude topics from forum 1
hope that helps,
Nick
On 11/03/07, Paul Stokes wrote:
Hello,
First I must say what a great plug-in you have here!
Is there a way to keep the hidden forums topic hidden?
Thanks
-Paul
UPDATE: This Plugin has been updated, the latest version is available on wordpress.org please comment on the new post, thanks.
Written primarily for my wife to use in the future, but I’ve developed a pluging that allows you to post a list of recent phpBB threads/topics within wordpress.
If found this plugin by Brandon Alexander but it wasn’t right for my needs, firstly he looks up usernames from phpBB, now my phpBB & wordpress installs don’t share databases and I thought it was a bit of a security risk giving wordpress access to my users password hashes… and secondly that plugin gives a list of recent posts, not what I wanted, and wanted threads (topics).
This is the 1st version, the massive fault with it is that you have to edit the file (to tell it where to find phpBB), I’m not yet smart enough to include an admin interface.
Installation: Download phpbb_recent_topics.txt and save as phpbb_recent_topics.php in your wordpress plugins directory. Edit the file, and change these bits to your appropriate settings…
$PHPBBDB = "phpbb_database"; // phpBB db name $TOPIC_TABLE = "phpbb_topics"; // phpbb topics table $SITEURL = "http://www.domain.com/phpbb"; //Forum (phpbb) URL
A bit about Database configuration.
If wordpress & phpBB share a DB already then set $PHPBBDB to DB_NAME and everything will be fine, else you’re going to need to GRANT the wordpress user read access to phpBB.
How to GRANT wordpress read only access to phpBB ?
If you don’t know it already you need to find your wordpress mysql user id, it’ll be in wp-config.php
define('DB_USER', 'wp_user'); // Your MySQL username
and you should have already found your phpbb database & table for the above.
You need to type the following syntax into your mysql database
GRANT SELECT ON phpbb_database.phpbb_topics TO wp_user@localhost;
this can be achieved by logging into phpmyadmin as your phpbb user, selecting SQL and pasting the correct GRANT into the text box.
Plugin Usage.
The plugin can be used in two ways, for those who don’t like editing templates you can call (type)
{phpbb_recent_topics}
from any post or page, and it will be replaced with an list of the last 5 topics.
For those who want to include the list in a sidebar template or similar, call the following function: phpbb_topics(), something like
if ( function_exists('phpbb_topics') ) { phpbb_topics(5); }
where by the number 5 can be replaced with anything less that 10, and that’ll be the number of topics returned.
Hopefully that all makes sense, feel free to contact me with problems.
UPDATE: Comments about combatability issues here please.