Search Results for 'code'
-
AuthorSearch Results
-
May 1, 2009 at 7:25 am #73269
In reply to: What do you consider an “important action”?
johnhiler
MemberJust installed this on a live forum! A bit nervous, but everything seems to be working great so far.

A few questions/thoughts:
* The Moderation Log lives under the Users tab… what do you think of putting it under the Plugins or Manage tab?
* When a topic deletion is logged or marked as spam, the moderation log says, Username (key) deleted topic “Topic Name” which is great. It’s linked directly to the deleted topic though – maybe there could be an extra ?view=all appended to it?
* Is it possible to also log when topics are closed and opened?
This is super exciting – thanks for all of this!
May 1, 2009 at 4:32 am #72896In reply to: Registrations and Spam.
deadlyhifi
ParticipantThe updated plugin has been working ok except it has major flaws

1 – The user displayname is not being put into the database – therefore all new users appear as a blank when they post.
2 – registration error messages aren’t displayed. (e.g. Invalid email)
The fix was straightforward. The bb_new_user function needed updating as so:
if (!function_exists('bb_new_user')) :
function bb_new_user( $user_login, $user_email, $user_url, $user_status = 0 ) {
global $wp_users_object, $bbdb;
// is_email check + dns
if ( !$user_email = bb_verify_email( $user_email ) )
return new WP_Error( 'user_email', __( 'Invalid email address' ), $user_email );
if ( !$user_login = sanitize_user( $user_login, true ) )
return new WP_Error( 'user_login', __( 'Invalid username' ), $user_login );
// user_status = 1 means the user has not yet been verified
$user_status = is_numeric($user_status) ? (int) $user_status : 0;
$user_nicename = $_user_nicename = bb_user_nicename_sanitize( $user_login );
if ( strlen( $_user_nicename ) < 1 )
return new WP_Error( 'user_login', __( 'Invalid username' ), $user_login );
while ( is_numeric($user_nicename) || $existing_user = bb_get_user_by_nicename( $user_nicename ) )
$user_nicename = bb_slug_increment($_user_nicename, $existing_user->user_nicename, 50);
$user_url = bb_fix_link( $user_url );
$user_registered = bb_current_time('mysql');
$password = wp_generate_password();
$user_pass = wp_hash_password( $password );
$user = $wp_users_object->new_user( compact( 'user_login', 'user_email', 'user_url', 'user_nicename', 'user_status', 'user_pass' ) );
if ( is_wp_error($user) ) {
if ( 'user_nicename' == $user->get_error_code() )
return new WP_Error( 'user_login', $user->get_error_message() );
return $user;
}
$user_id = $bbdb->insert_id;
$options = bb_get_option('approve_user_registration_options');
bb_update_usermeta( $user_id, $bbdb->prefix . 'capabilities', array('waitingapproval' => true, 'member' => true) );
approve_user_registration_send_pass( $user_id, $password );
do_action('bb_new_user', $user['ID'], $user['plain_pass']);
return $user['ID'];
}
endif;although I am using a fairly hacked together install with some bleeding edge stuff in there so you may need to experiment a little.
May 1, 2009 at 3:15 am #71642In reply to: WPMU 2.7 cookie integration
dmbware
MemberI am having the same problem ! i followed the video to a T and than added the HASH. No Cookie tie at all, but I do have DB Integration. My question for you is do we add these lines of code in both config files?
define(‘COOKIE_DOMAIN’, );
and define path ?
May 1, 2009 at 2:17 am #73285In reply to: Installed: Try logging in, does nothing
Ben L.
Memberbb-config.phpApril 30, 2009 at 6:49 pm #73292In reply to: Domain transfer fails
Ben L.
MemberRemove
index.phpfrom the forum url in the files and the database.April 30, 2009 at 3:54 pm #73283In reply to: Installed: Try logging in, does nothing
Ben L.
MemberbbPress shouldn’t be tightly integrated with WordPress. There are too many things that won’t work. Try removing the line of code that includes WordPress into bbPress.
April 30, 2009 at 1:59 pm #73268In reply to: What do you consider an “important action”?
Ben L.
Member/bb-admin/admin-base.php?plugin=bbpress_moderation_suite_modlog is the only place moderation logs are. I know the way I talk about it is a bit confusing.
April 30, 2009 at 7:52 am #72202superann
MemberHi Citizenkeith, I just saw this now… you’d put the hack at the end of pm_new_message. So my function now looks like this:
function pm_new_message( $id_receiver, $id_sender, $pmtitle, $message ){
global $bbdb, $bb_table_prefix;
$created_on = bb_current_time('mysql');
$id_receiver = intval($id_receiver);
$id_sender = intval($id_sender);
$pmtitle=substr(strip_tags($pmtitle),0,64);
remove_filter('pre_post', 'post_regulation');
$message=substr($message,0,2048);
$message=force_balance_tags($message);
$message=apply_filters('pre_post',$message,0,0);
$message=apply_filters('post_text',$message,0);
$bbdb->query("INSERT INTO ".$bb_table_prefix."privatemessages
(id_sender, id_receiver, pmtitle, message, created_on)
VALUES
('$id_sender', '$id_receiver', '$pmtitle', '$message','$created_on')");
$to = bb_get_user_email($id_receiver);
$pm_link = bb_get_option('uri') . 'message.php?id=' . $bbdb->insert_id;
$message = __("You have a new private message: %1$s nFrom: %2$s nn%3$s ");
mail( $to, bb_get_option('name') . ':' . __('Private Message'),
sprintf( $message, $pmtitle, get_user_name($id_sender), $pm_link ),
'From: ' . bb_get_option('from_email')
);
}April 30, 2009 at 3:07 am #73267In reply to: What do you consider an “important action”?
johnhiler
Member1. Ah thanks for adding that!! Boo for bbPress having no hook for moving topics…
2. Ah so sorry to have missed that…

One last thought: what do you think of merging the various moderation logs into a single page? As a keymaster/mod, it’d be a lot easier to monitor what’s going on on the site if all the logs are on the same page.
Or maybe as an alternative, the various moderation logs could all have convenient links to each other?
ps I owe you a contribution – please email me at john at weddingbee dot com, and we can coordinate!
April 30, 2009 at 3:01 am #57164In reply to: Registration Email Not Being Sent – new issue
golan03
MemberIf you don’t have backpress you can also modify your bb_mail function (in bb-includes/pluggable.php)
just add the email you want as return-path.
before ::
$headers = trim(join(“rn”, $headers));
after::
$headers = trim(join(“rnReturn-Path: from@mydomain.comrn”, $headers));
It is not elegant but it works.
Remember it is hardcoded, you’ll have to change it manually if you want to change your from@mydomain.com later.
April 29, 2009 at 2:52 pm #73073In reply to: Sub subforum – Change CSS
Ben L.
MemberWith that code, the last sub forum already has
bb-last-child, and if you change<td colspan="3">to<td colspan="3" class="subsubforum">, subsubforums have a class.April 29, 2009 at 7:12 am #7823Topic: HELP?
in forum Installationalberto505
MemberHi Alberto here,
I need some help installing my Avatars and Upload Photos in my BBPress Forum. Can someone guide me on what to do?? Do I need to go into a template to add code to make the avatars display?
April 28, 2009 at 11:29 pm #73260In reply to: What do you consider an “important action”?
Ben L.
MemberUnfortunately, there are a lot of functions in the code that are 1.0-specific.
Fortunately, WordPress 2.8 is being released in May, and I can’t see bbPress 1.0 being far behind.
April 28, 2009 at 10:50 pm #73243In reply to: Error when deleting a topic
Ben L.
MemberOkay, I’ve found the problem.
Go to line
634(it should sayfunction bb_attachments_recount($post_id=0) { // update topic icon flag and sync attachment count for topic given a post_id)Right under that, add
global $bb_attachments;on a new line.April 28, 2009 at 10:36 pm #73254gmrtech
MemberAmazing. Fixed
Thanks!
April 28, 2009 at 4:04 pm #73253Ben L.
MemberFirst of all, if you already had members on the forum that aren’t on the blog, integration will lose them.
I suggest going into your database and running
DELETE FROM bb_topicmeta WHERE meta_key=wp_table_prefix LIMIT 1to remove the integration.April 28, 2009 at 3:45 pm #73071In reply to: Sub subforum – Change CSS
Ben L.
MemberI only partially understand the question. Do you want to add a
lastclass to the last forum on the page?April 28, 2009 at 1:19 pm #73161In reply to: Frightmare Haunt Forum
cldnails
MemberInteresting niche, good luck. Although, out of the box bbPress isn’t very scary looking.
April 28, 2009 at 12:29 pm #73199In reply to: diagnosing sql connections spike
_ck_
ParticipantEarly in the morning on a shared box may mean your provider doesn’t know what they are doing and is not running the daily backup in “nice” mode, therefore overloading the server.
Either that or you might have a misbehaving neighbor.
bbPress doesn’t naturally cause that kind of problem, unless you are running an older alpha which uses more queries – and some of my plugins like hidden forums had a bug in a previous version that caused extra queries – you only used 10 queries so I think you are running 0.9
If you know what you are doing, even on a shared host you can run a simple PHP program with cron checking the load every minute – the moment it starts to spike, say over 3.0, you can have it email you “ps aux” which will show you which neighbor is misbehaving, even on a shared host.
See this:
bb_init = 0.178 <<<
bbpress’s core is completely loaded at this point,plugins, everything the amount of time is okay and acceptable – 50 to 100 files have been loaded
bb_index.php_pre_db = 4.966 <<<—- this is kind of a lie, it’s not pre-db, there have been some queries…
so in 4.5 seconds or so, here’s what’s been done:
$forums = get_forums();
$topics = get_latest_topics();
$super_stickies = get_sticky_topics();it’s actually loaded all the forums and gotten the latest topics
It’s using about 8-9 queries so 4.5 seconds is absolutely terrible, almost impossible if the server is working correctly.
If your page time is normally under 1 second for that part, here’s what I think is happening.
I think your host is running a backup at that hour OR one of your neighbors on the same box is doing a remote backup to/from the server, including mysql.
That ties up the cpu and ties up mysql because the disk is thrashing and mysql is not caching at all.
To prove my theory, see if it happen every day at the exact hour.
Even more suspect would be if it happens on the hour or half hour.
By the way, why do you assume it’s “your” mysql connections that have been exhausted – it’s actually the entire server’s pool on a shared host. I suspect you have a misbehaving neighbor who is accidentally making you think it’s you that’s the problem.
April 28, 2009 at 6:53 am #54704In reply to: Display latest post from WP
Ivaylo Draganov
MemberWooHoo! A plugin accomplishing that has been just released:
https://bbpress.org/plugins/topic/wordpress-latest-post/ <— in plugin repository
http://www.atsutane.net/2009/04/wordpress-inside-bbpress-part-1.html <— author’s blog with more info on usage
Tested it and it works well on WP 2.7.1 and bbPress 0.9.4
April 28, 2009 at 3:49 am #60227In reply to: Google Analytics for bbPress
phishshticks
Memberif you edit the php file, you can manually specify your code where you see ‘##-#######-#’
April 28, 2009 at 1:58 am #73248In reply to: BBPRESS Maybe great software but my experience is
johnhiler
MemberYah I definitely agree! You have to be pretty computer literate to use bbPress… and there isn’t great support, other than us volunteers.
But it’s like that quote from Churchill: “Democracy is the worst form of government except all the others that have been tried.”
bbPress is the worst message board software ever – except for all the others I have ever tried.
April 27, 2009 at 10:04 pm #7817Topic: DAMN POST FORM!!! any ideas?
in forum Themespetertoshas
MemberHellooo!
Well, i recently change to bbpress (this rocks) and i’m trying to make a theme compatible with the current theme in my wordpress blog. It went pretty well, until i came across the post-form to create a new topic and i’m in blank…
Let me explain: i’m using the theme kakumei, and instead off the hottags on the left, i’m going with a sidebar with other features (tags, the ‘fav this’ feature, link to main forum, etc…). This works well in the front-page, in the topic, profile, and other, but i’m having some problems put this working in the post-form.php !
The way i use to style was: the sidebar in <div id=sidebar></div>, and the content (infobox, post, topic meta, etc) in <div id=”content”></div> just like the kakumei theme.
My problem with the post-form.php is the function that is used in the functions.bb-template to the ‘pre_post_form’ and ‘post_post_form’. Using the <div id=”content”></div> in the post-form.php the <div> actually appears in the middle of the code of the form in the post-form and the content dont stay aligned. Putting the <div> in the functions.bb-template, just makes the <div> repeating in the others pages where the post-form is used, and the content dont stay aligned anyway.
i’ll really appreciate if you could suggest me some ideas. tks
April 27, 2009 at 5:22 pm #73247In reply to: BBPRESS Maybe great software but my experience is
Cyndy Otty
ParticipantI suppose this is a matter of opinion, really. Granted it’s not the most user-friendly software out there and it can be much more complex to customize, but it is also a project that is in development and such things do take time to perfect.
However for what it is – a no-frills, basic forum software – it is actually exactly that right from the start.
April 27, 2009 at 5:10 am #73246In reply to: BBPRESS Maybe great software but my experience is
bruinfelix
MemberYoure right!
-
AuthorSearch Results