Search Results for 'code'
-
Search Results
-
DB Error in bb_insert_topic: Incorrect integer value: '' for column 'topic_id' at row 1INSERT INTO bb_topics (
topic_id,topic_title,topic_slug,topic_poster,topic_poster_name,topic_last_poster,topic_last_poster_name,topic_start_time,topic_time,topic_open,forum_id) VALUES (”,’Your first topic’,’your-first-topic’,’1′,’admin’,’1′,’admin’,’2008-12-16 05:10:50′,’2008-12-16 05:10:50′,’1′,’1′)This problem has been around since the previous 1.0 alpha releases. The installation would say that it was successful but it would not create a topic as that error in the last stage would indicate.
The first forum is created and it says there is 1 post but upon clicking said forum it presents you with a “New Topic in this Forum” form. When you post a new topic, it gives you an error: “This topic has been closed.”
Apache 2.2.10
MySQL 5.1.0
PHP 5.2.6
Windows Server 2003
Database Collation: utf8_general_ci
Curious to know if plans exist to ever use a templating engine like Smarty in order to separate logic for design.
So that no more code and HTML are in the same file
Topic: Sanitizing user names
Hi!
I have an old issue with bbpress-wppress integration that I can’t solve.
I use this wp-plugin to sanitize user names;
What this plugin does is that whenever a user registered as “Joe” tries to log in as “joe”, “jOe”… can login.
However bbpress is not compatible with this plugin, when activited bbpress reports this error;
Catchable fatal error: Object of class stdClass could not be converted to string in
wampwwwwordpresswp-includesformatting.php on line 453In formatting.php line 453 obviously we have wordpress function sanitize_user and it seems bbpress doesn’t like to have this function modified.
I just wanted to ask if anybody knows another way to sanitize usernames because it is a pain to have all the time people complainig that they can log in because they registered as “Joe” and try to access with “joe”
On some forums you might want to remove bad html markup that’s not allowed instead of encoding it into text. Here’s a mini-plugin to do just that. It also converts
<b>into<strong>and<i>into<em>It only runs when posts are saved instead of each time they are displayed to keep things at full speed. Posts by Moderators and Administrators are not stripped.
(note: for now it doesn’t obey backticks and will strip inside them)
<?php
/*
Plugin Name: Strip Bad Markup
Plugin URI: http://bbpress.org/plugins/topic/
Description: removes tags that are not allowed in posts instead of encoding them
Author: _ck_
Author URI: http://bbShowcase.org
Version: 0.0.1
*/
add_filter('pre_post', 'strip_bad_markup',9);
function strip_bad_markup($text) {
if (!bb_current_user_can('moderate')) {
$tags=bb_allowed_tags(); $tags['br']=true; $tags['p']=true; $tags = implode('|',array_keys($tags));
$text=preg_replace(array("/<(/)?b>/si","/<(/)?i>/si"),array("<$1strong>","<$1em>"),$text);
$text=preg_replace("/</?(?!($tags)).*?>/sim","", $text);
}
return $text;
}
?>
