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;
}
?>Howdy. I’ve got a buddypress, mu and bbpress site. buddypress is trying to access some forums in bbpress thru xmlrpc. Essentially sambauer’s bbpress_live widget is being used. My problem is that the connection between buddypress and bbpress is failing for some reason unknown to me.
Here’s the sequence of things going on.
buddypress wants to do some stuff in the bbpress forums so a bbpress_Live_Fetch obj is instantiated and the constructor is called. The constructor, since it’s purpose is to fetch something, tries to setup a connection between buddypress and bbpress through one of it’s member functions set_endpoint().
With me so far? We haven’t gotten to the problem yet.
set_endpoint() makes a call to a function in /wp-content/comment.php called discover_pingback_server_uri(). That function’s purpose is to do exotic stuff finding a ‘pingback server uri’ for the passed uri.
I don’t know what that is and don’t really care. I do care that the workhorse part of that function is actually a call to a new 2.7 function that goes out and GETs what is located at the url in question. When it GETs the goop back from that url, it parses it and returns a ping back server uri.
However, the function that it uses to GET goop from the passed url always returns 404 when looking for my bbpress url. It does exist.
The function wp_remote_get() when passed a valid url for bbpress such as ‘http://myfavsite.org/bbpress/’ returns 404.
Here’s the maddening part. It works on a windows development server but not on the live linux server. Same code, same .htaccess files, essentially the same httpd.conf file.
Why would wp_remote_get() return 404 for a valid url? wp_remote_get() and it’s brethren seem to be new in mu 2.7.
wpmu 2.7 r1574 is what I got runnin’
