Tag: PHP

BB Moderation Hold plugin w/ BB Press version 1.0+

It appears that the BB Moderation Hold plugin hasn’t updated for newer versions of BB Press. The moderation links are not appearing in the admin navigation and when you click “moderate” from within the post itself as a moderator it redirects to the homepage rather than taking you to the moderation pages.

The fix for both issues is rather simple, but requires editing the php code in the plugin itself. Simply open up moderation.php and make the following tweaks:

Change:

149
 bb_admin_add_submenu(__('Topics for Moderation'), 'moderate', 'bb_moderation_hold_topic_admin_page', 'content.php' );

To:

149
 bb_admin_add_submenu(__('Topics for Moderation'), 'moderate', 'bb_moderation_hold_topic_admin_page', 'topics.php' );

Change:

150
 bb_admin_add_submenu(__('Topics for Moderation'), 'moderate', 'bb_moderation_hold_topic_admin_page', 'content.php' );

To:

150
 bb_admin_add_submenu(__('Topics for Moderation'), 'moderate', 'bb_moderation_hold_topic_admin_page', 'posts.php' );

You are basically changing both instances of ‘content.php’ to ‘topics.php’ and ‘posts.php’ respectively.

Now when you replace moderation.php on your server you should see extra links under the posts and topics sections and you should be taken to the appropriate pages when moderating.

Bookmark and Share

No Response  |  add yours »

parsing XML with PHP on Apache2 server with apache-mod_php installed

There are many examples of how to parse through an XML document using PHP out on the web by doing a quick google search. I was having problems because even while following all of those examples, I was getting the following error:

PHP Fatal error:  Call to undefined function:  xml_parser_create()

Everywhere I searched said “you need to recompile PHP and use –with-xml and it will get rid of this error. Well, I didn’t compile PHP in the first place, I installed Apache2 as an RPM in Mandrake and the PHP module (apache-mod_php) to go with it. I couldn’t find anywhere that told me how to add XML support to PHP in that case.

After many hours of searching, I finally discovered that you need to also install the php-xml RPM and the problem will go away. Seems easy enough now, but I was really having a difficult time finding the answer to this.

Bookmark and Share

No Response  |  add yours »

Search