Search Results for 'code'
-
AuthorSearch Results
-
May 16, 2012 at 4:24 pm #113564
In reply to: Adding Post Count / Etc. to BBPress Plugin
LIB53
MemberI’m making a post count plugin for bbpress 2.1, but the problem is that I’m new to PHP/MySQL, WordPress, and bbPress. From what I understand, I need to add a row called ‘post count’ to the usermeta table and hook the ‘bbp_theme_after_reply_form_submit_button’ action hook with a function that increases ‘post count’ by 1. I believe I must assign this newly hooked action a low priority as well so that the increase only comes after the post gets submitted into the database.
I should also add a function that builds all post counts for first time run, and even leave a button possibly called “rebuild post count” in the dashboard to run the function. Preferably, I’d like to add a feature where it can run itself every now and then to ensure things the posts are accurate.
I can count up everyone’s post count by filtering through the ‘posts’ table. All replies and topics are labeled as ‘reply’ and ‘topic’ in the post_type column, and there is a post_author column as well. Given these two columns, writing this function should be very simple. But I’m new to PHP/MySQL, and only a computer science student… So even this is a bit of work for me

Additionally, I can add another row so we can add artificial post count increase or decrease as well. Another row is needed because we don’t want the build/rebuild post count function mentioned above overwriting any increase or decrease an admin wants to have in effect. I personally need this row because I’m moving a 2yr old community off of IPB.
May 16, 2012 at 8:56 am #44809Topic: GD bbPress Tools
in forum PluginsMilan Petrovic
ParticipantGD bbPress Tools is a new free plugin for bbPress 2.0/2.1 for WordPress. Currently adds these new features:
* BBCode shortcodes support
* Quote Reply or Topic
* User signature with BBCode and HTML support
* Additional custom views
* Basic topics search results view
* Toolbar menu integration
* Limit bbPress admin side access
Plugin supports BBCodes based on the phpBB implementation. Right now, plugin has 30 BBCodes. Latest plugin version is 1.2:
http://www.dev4press.com/2012/blog/plugins-news/gd-bbpress-tools-1-2-0/
May 15, 2012 at 7:51 pm #58800In reply to: How to disable rss ?
xmasons
ParticipantI’ve found the following works well in functions.php
function disable_our_feeds() {wp_redirect(get_option('siteurl'));}add_action('bbp_feed', 'disable_our_feeds', 1);May 15, 2012 at 1:34 am #44764Topic: Line between author and post
in forum Installationscheena
MemberHello, good day to you.
I would like to ask for help please,
Check out this link
http://crankyoldmen.com/topic/profession-builder-links/
There is that link between an author and his post, is there a css code i could add to my code so it can show up?
May 14, 2012 at 7:41 pm #113551In reply to: Making sense of Full Width and shortcode
SilverNL
MemberI have exact the same problem and question!
May 14, 2012 at 5:58 pm #113550In reply to: Making sense of Full Width and shortcode
Nate
Participantanyone on this?
May 14, 2012 at 1:31 am #44731Topic: Recovering bbPress forum
in forum Troubleshooting111222klmadnfcklawnme
MemberI think I broke my forum.
I am using the plugin version of bbPress on WordPress, and recently deactivated all of my plugins trying to troubleshoot a theme error. I reactivated them, and when I go to Forums in the dashboard, “All Forums”, my forum is still there, but when I click on “View” it says:
Permission Denied
Not Found / No Access
The page you are looking for either does not exist, or you do not have the permissions to access it.
Going to http://mysite.com/forums takes me back to the main page.
Any suggestions?
May 14, 2012 at 12:08 am #110585In reply to: bbPress 2.1 – Theme Compatibility
John James Jacoby
KeymasterHow can i disable HTML and/or VISUAL editor? (2.1 plugin version)
Have you tried Settings > Forum?

Unless you’re talking about conditionally toggling the mode, in which case you’re on your own to build that as a plugin, similar to WordPress.
May 14, 2012 at 12:03 am #113561In reply to: 2.0.2 –> 2.1
John James Jacoby
KeymasterHey thanks!
Good to hear it’s working out!
May 13, 2012 at 6:39 pm #100470In reply to: v2: Simple Press importer, and first thoughts
Oleksandr Kramer
ParticipantSolved!
$wpdb->query("UPDATE wp_posts SET post_author = '0' WHERE ID =".$inserted_topic.";");May 13, 2012 at 6:39 pm #105570In reply to: v2: Simple Press importer, and first thoughts
Oleksandr Kramer
ParticipantSolved!
$wpdb->query("UPDATE wp_posts SET post_author = '0' WHERE ID =".$inserted_topic.";");May 13, 2012 at 4:14 pm #100469In reply to: v2: Simple Press importer, and first thoughts
Oleksandr Kramer
ParticipantPlease tell me what to write here
Now the author of topic is always admin.
//Topic Author - Guest (What code here?)
if(!($sp_topic->user_id))
{
echo(" Guest start topic: {$sp_posts[0]->guest_name}n");
// update_post_meta( $inserted_topic, '_bbp_anonymous_name', "{$sp_posts[0]->guest_name}" );
// update_post_meta( $inserted_topic, '_bbp_anonymous_email', "{$sp_posts[0]->guest_email}" );
// ??????
}
I am a newbie in php – use at your own risk!!!
<?php
/*
Plugin Name: Simple Press to bbPress
Plugin URI: http://www.4-14.org.uk/
Description: Import Simple Press forums to bbPress
Author: Mark Barnes
Version: 0.1
Author URI: http://www.4-14.org.uk/
using: http://site.com?bbpressimport=1&delete=1
*/
if (isset($_GET))
add_action (‘init’, ‘mbbb_init’);
function mbbb_init () {
global $wpdb;
define(‘WP_IMPORTING’, true);
//Delete existing posts
if (isset($_GET)) {
$post_ids = $wpdb->get_results(“SELECT ID from {$wpdb->posts} WHERE post_type IN (‘forum’, ‘reply’, ‘topic’)”);
if ($post_ids)
foreach ($post_ids as $post_id)
wp_delete_post ($post_id->ID, true);
}
// Import forums
$forum_map = array();
$sp_forums = $wpdb->get_results(“SELECT forum_desc, forum_name, forum_slug, forum_seq, forum_id FROM {$wpdb->prefix}sfforums ORDER BY forum_seq”);
if ($sp_forums) {
foreach ($sp_forums as $sp_forum) {
$post_id = $wpdb->get_var (“SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_value=’forum_{$sp_forum->forum_id}’ AND meta_key=’_mbbb_sp_id'”);
if (!$post_id) {
$inserted_forum = wp_insert_post( array(
‘post_author’ => get_current_user_id(),
‘post_content’ => $sp_forum->forum_desc,
‘post_title’ => $sp_forum->forum_name,
‘post_excerpt’ => ”,
‘post_status’ => ‘publish’,
‘comment_status’ => ‘closed’,
‘ping_status’ => ‘closed’,
‘post_name’ => $sp_forum->forum_slug,
‘post_parent’ => 0,
‘post_type’ => bbp_get_forum_post_type(),
‘menu_order’ => $sp_forum->forum_seq
) );
if ($inserted_forum) {
echo “Added {$sp_forum->forum_name}n”;
update_post_meta( $inserted_forum, ‘_mbbb_sp_id’, “forum_{$sp_forum->forum_id}” );
} else
echo “Failed to add {$sp_forum->forum_name}n”;
} else
$inserted_forum = $post_id;
$forum_map[$sp_forum->forum_id] = $inserted_forum;
}
}
// Import topics
$topic_count = 0;
$sp_topics = $wpdb->get_results (“SELECT forum_id, user_id, topic_name, topic_slug, topic_date, topic_id FROM {$wpdb->prefix}sftopics ORDER BY topic_date ASC”);
if ($sp_topics) {
foreach ($sp_topics as $sp_topic) {
$post_id = $wpdb->get_var (“SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_value=’topic_{$sp_topic->topic_id}’ AND meta_key=’_mbbb_sp_id'”);
$sp_posts = $wpdb->get_results (“SELECT topic_id, user_id, post_date, guest_name, guest_email, post_content, poster_ip, post_id from {$wpdb->prefix}sfposts WHERE topic_id = ‘{$sp_topic->topic_id}’ ORDER BY post_date ASC”);
if (isset($forum_map[$sp_topic->forum_id]) && $sp_posts) {
if (!$post_id) {
if(! empty($sp_posts[0]->guest_name))
{
echo(“Topic: {$sp_topic->topic_name}n”);
echo(“Guest name: {$sp_posts[0]->guest_name}n”);
$inserted_topic = wp_insert_post( array(
‘post_parent’ => $forum_map[$sp_topic->forum_id],
‘post_content’ => $sp_posts[0]->post_content,
‘post_title’ => $sp_topic->topic_name,
‘post_name’ => $sp_topic->topic_slug,
‘post_status’ => ‘publish’,
‘post_date_gmt’ => $sp_topic->topic_date,
‘post_date’ => get_date_from_gmt( $sp_topic->topic_date ),
‘post_type’ => bbp_get_topic_post_type(),
) );
if ($inserted_topic) {
update_post_meta( $inserted_topic, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );
update_post_meta( $inserted_topic, ‘_bbp_topic_id’, $inserted_topic );
update_post_meta( $inserted_topic, ‘_mbbb_sp_id’, “topic_{$sp_topic->topic_id}” );
update_post_meta( $inserted_topic, ‘_bbp_anonymous_name’, “{$sp_posts[0]->guest_name}” );
update_post_meta( $inserted_topic, ‘_bbp_anonymous_email’, “{$sp_posts[0]->guest_email}” );
} else
echo “Failed to add {$sp_forum->topic_name}n”;
}
else
{
if(!($sp_posts[0]->user_id))
echo(“Guest TOPICStart: {$sp_posts[0]->guest_name}n”);
$inserted_topic = wp_insert_post( array(
‘post_parent’ => $forum_map[$sp_topic->forum_id],
‘post_author’ => $sp_posts[0]->user_id,
‘post_content’ => $sp_posts[0]->post_content,
‘post_title’ => $sp_topic->topic_name,
‘post_name’ => $sp_topic->topic_slug,
‘post_status’ => ‘publish’,
‘post_date_gmt’ => $sp_topic->topic_date,
‘post_date’ => get_date_from_gmt( $sp_topic->topic_date ),
‘post_type’ => bbp_get_topic_post_type(),
) );
if ($inserted_topic) {
echo “Added {$sp_topic->topic_name}n”;
update_post_meta( $inserted_topic, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );
update_post_meta( $inserted_topic, ‘_bbp_topic_id’, $inserted_topic );
update_post_meta( $inserted_topic, ‘_mbbb_sp_id’, “topic_{$sp_topic->topic_id}” );
} else
echo “Failed to add {$sp_forum->topic_name}n”;
}
}
else{
echo “ADD”;
$inserted_topic = $post_id;
}
}
//Import posts
$post_count = 0;
if ($sp_posts) {
foreach ($sp_posts as $sp_post) {
$post_id = $wpdb->get_var (“SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_value=’post_{$sp_post->post_id}’ AND meta_key=’_mbbb_sp_id'”);
if (!$post_id) {
if ($post_count != 0) {
if(! empty($sp_post->guest_name))
{
echo(” Reply To: {$sp_topic->topic_name}n”);
echo(” Guest name: {$sp_post->guest_name}n”);
$inserted_post = wp_insert_post( array(
‘post_parent’ => $inserted_topic,
‘post_date_gmt’ => $sp_post->post_date,
‘post_date’ => get_date_from_gmt( $sp_post->post_date ),
‘post_title’ => ‘Reply To: ‘.$sp_topic->topic_name,
‘post_status’ => ‘publish’,
‘post_type’ => bbp_get_reply_post_type(),
‘post_content’ => $sp_post->post_content
) );
if ($inserted_post) {
update_post_meta( $inserted_post, ‘_bbp_author_ip’, $sp_post->poster_ip );
update_post_meta( $inserted_post, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );
update_post_meta( $inserted_post, ‘_bbp_topic_id’, $inserted_topic );
update_post_meta( $inserted_post, ‘_mbbb_sp_id’, “post_{$sp_post->post_id}” );
update_post_meta( $inserted_post, ‘_bbp_anonymous_name’, “{$sp_post->guest_name}” );
update_post_meta( $inserted_post, ‘_bbp_anonymous_email’, “{$sp_post->guest_email}” );
bbp_update_reply_walker( $inserted_post );
}
}
else
{
$inserted_post = wp_insert_post( array(
‘post_parent’ => $inserted_topic,
‘post_author’ => $sp_post->user_id,
‘post_date_gmt’ => $sp_post->post_date,
‘post_date’ => get_date_from_gmt( $sp_post->post_date ),
‘post_title’ => ‘Reply To: ‘.$sp_topic->topic_name,
‘post_status’ => ‘publish’,
‘post_type’ => bbp_get_reply_post_type(),
‘post_content’ => $sp_post->post_content
) );
if ($inserted_post) {
update_post_meta( $inserted_post, ‘_bbp_author_ip’, $sp_post->poster_ip );
update_post_meta( $inserted_post, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );
update_post_meta( $inserted_post, ‘_bbp_topic_id’, $inserted_topic );
update_post_meta( $inserted_post, ‘_mbbb_sp_id’, “post_{$sp_post->post_id}” );
bbp_update_reply_walker( $inserted_post );
}
}
}
else
update_post_meta( $inserted_topic, ‘_bbp_author_ip’, $sp_post->poster_ip );
} else
{
$inserted_post = $post_id;
// echo(“Guest start topic:n”);
}
$post_count ++;
}
}
// echo(“Guest start topic:{$sp_topic->user_id}n”);
update_post_meta( $inserted_topic, ‘_bbp_last_reply_id’, $inserted_post );
update_post_meta( $inserted_topic, ‘_bbp_last_active_id’, $inserted_post ? $inserted_post : $inserted_topic );
update_post_meta( $inserted_topic, ‘_bbp_last_active_time’, $inserted_post ? $sp_post->post_date : $sp_topic->topic_date );
update_post_meta( $inserted_topic, ‘_bbp_reply_count’, $post_count -1 );
update_post_meta( $inserted_topic, ‘_bbp_hidden_reply_count’, 0 );
//Topic Author – Guest (What code here?)
if(!($sp_topic->user_id))
{
echo(” Guest start topic: {$sp_posts[0]->guest_name}n”);
// update_post_meta( $inserted_topic, ‘_bbp_anonymous_name’, “{$sp_posts[0]->guest_name}” );
// update_post_meta( $inserted_topic, ‘_bbp_anonymous_email’, “{$sp_posts[0]->guest_email}” );
// ??????
}
bbp_update_topic_walker( $inserted_topic );
$topic_count ++;
}
}
global $wp_rewrite;
$wp_rewrite->flush_rules(false);
}
May 13, 2012 at 4:14 pm #105569In reply to: v2: Simple Press importer, and first thoughts
Oleksandr Kramer
ParticipantPlease tell me what to write here
Now the author of topic is always admin.
//Topic Author - Guest (What code here?)
if(!($sp_topic->user_id))
{
echo(" Guest start topic: {$sp_posts[0]->guest_name}n");
// update_post_meta( $inserted_topic, '_bbp_anonymous_name', "{$sp_posts[0]->guest_name}" );
// update_post_meta( $inserted_topic, '_bbp_anonymous_email', "{$sp_posts[0]->guest_email}" );
// ??????
}
I am a newbie in php – use at your own risk!!!
<?php
/*
Plugin Name: Simple Press to bbPress
Plugin URI: http://www.4-14.org.uk/
Description: Import Simple Press forums to bbPress
Author: Mark Barnes
Version: 0.1
Author URI: http://www.4-14.org.uk/
using: http://site.com?bbpressimport=1&delete=1
*/
if (isset($_GET))
add_action (‘init’, ‘mbbb_init’);
function mbbb_init () {
global $wpdb;
define(‘WP_IMPORTING’, true);
//Delete existing posts
if (isset($_GET)) {
$post_ids = $wpdb->get_results(“SELECT ID from {$wpdb->posts} WHERE post_type IN (‘forum’, ‘reply’, ‘topic’)”);
if ($post_ids)
foreach ($post_ids as $post_id)
wp_delete_post ($post_id->ID, true);
}
// Import forums
$forum_map = array();
$sp_forums = $wpdb->get_results(“SELECT forum_desc, forum_name, forum_slug, forum_seq, forum_id FROM {$wpdb->prefix}sfforums ORDER BY forum_seq”);
if ($sp_forums) {
foreach ($sp_forums as $sp_forum) {
$post_id = $wpdb->get_var (“SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_value=’forum_{$sp_forum->forum_id}’ AND meta_key=’_mbbb_sp_id'”);
if (!$post_id) {
$inserted_forum = wp_insert_post( array(
‘post_author’ => get_current_user_id(),
‘post_content’ => $sp_forum->forum_desc,
‘post_title’ => $sp_forum->forum_name,
‘post_excerpt’ => ”,
‘post_status’ => ‘publish’,
‘comment_status’ => ‘closed’,
‘ping_status’ => ‘closed’,
‘post_name’ => $sp_forum->forum_slug,
‘post_parent’ => 0,
‘post_type’ => bbp_get_forum_post_type(),
‘menu_order’ => $sp_forum->forum_seq
) );
if ($inserted_forum) {
echo “Added {$sp_forum->forum_name}n”;
update_post_meta( $inserted_forum, ‘_mbbb_sp_id’, “forum_{$sp_forum->forum_id}” );
} else
echo “Failed to add {$sp_forum->forum_name}n”;
} else
$inserted_forum = $post_id;
$forum_map[$sp_forum->forum_id] = $inserted_forum;
}
}
// Import topics
$topic_count = 0;
$sp_topics = $wpdb->get_results (“SELECT forum_id, user_id, topic_name, topic_slug, topic_date, topic_id FROM {$wpdb->prefix}sftopics ORDER BY topic_date ASC”);
if ($sp_topics) {
foreach ($sp_topics as $sp_topic) {
$post_id = $wpdb->get_var (“SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_value=’topic_{$sp_topic->topic_id}’ AND meta_key=’_mbbb_sp_id'”);
$sp_posts = $wpdb->get_results (“SELECT topic_id, user_id, post_date, guest_name, guest_email, post_content, poster_ip, post_id from {$wpdb->prefix}sfposts WHERE topic_id = ‘{$sp_topic->topic_id}’ ORDER BY post_date ASC”);
if (isset($forum_map[$sp_topic->forum_id]) && $sp_posts) {
if (!$post_id) {
if(! empty($sp_posts[0]->guest_name))
{
echo(“Topic: {$sp_topic->topic_name}n”);
echo(“Guest name: {$sp_posts[0]->guest_name}n”);
$inserted_topic = wp_insert_post( array(
‘post_parent’ => $forum_map[$sp_topic->forum_id],
‘post_content’ => $sp_posts[0]->post_content,
‘post_title’ => $sp_topic->topic_name,
‘post_name’ => $sp_topic->topic_slug,
‘post_status’ => ‘publish’,
‘post_date_gmt’ => $sp_topic->topic_date,
‘post_date’ => get_date_from_gmt( $sp_topic->topic_date ),
‘post_type’ => bbp_get_topic_post_type(),
) );
if ($inserted_topic) {
update_post_meta( $inserted_topic, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );
update_post_meta( $inserted_topic, ‘_bbp_topic_id’, $inserted_topic );
update_post_meta( $inserted_topic, ‘_mbbb_sp_id’, “topic_{$sp_topic->topic_id}” );
update_post_meta( $inserted_topic, ‘_bbp_anonymous_name’, “{$sp_posts[0]->guest_name}” );
update_post_meta( $inserted_topic, ‘_bbp_anonymous_email’, “{$sp_posts[0]->guest_email}” );
} else
echo “Failed to add {$sp_forum->topic_name}n”;
}
else
{
if(!($sp_posts[0]->user_id))
echo(“Guest TOPICStart: {$sp_posts[0]->guest_name}n”);
$inserted_topic = wp_insert_post( array(
‘post_parent’ => $forum_map[$sp_topic->forum_id],
‘post_author’ => $sp_posts[0]->user_id,
‘post_content’ => $sp_posts[0]->post_content,
‘post_title’ => $sp_topic->topic_name,
‘post_name’ => $sp_topic->topic_slug,
‘post_status’ => ‘publish’,
‘post_date_gmt’ => $sp_topic->topic_date,
‘post_date’ => get_date_from_gmt( $sp_topic->topic_date ),
‘post_type’ => bbp_get_topic_post_type(),
) );
if ($inserted_topic) {
echo “Added {$sp_topic->topic_name}n”;
update_post_meta( $inserted_topic, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );
update_post_meta( $inserted_topic, ‘_bbp_topic_id’, $inserted_topic );
update_post_meta( $inserted_topic, ‘_mbbb_sp_id’, “topic_{$sp_topic->topic_id}” );
} else
echo “Failed to add {$sp_forum->topic_name}n”;
}
}
else{
echo “ADD”;
$inserted_topic = $post_id;
}
}
//Import posts
$post_count = 0;
if ($sp_posts) {
foreach ($sp_posts as $sp_post) {
$post_id = $wpdb->get_var (“SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_value=’post_{$sp_post->post_id}’ AND meta_key=’_mbbb_sp_id'”);
if (!$post_id) {
if ($post_count != 0) {
if(! empty($sp_post->guest_name))
{
echo(” Reply To: {$sp_topic->topic_name}n”);
echo(” Guest name: {$sp_post->guest_name}n”);
$inserted_post = wp_insert_post( array(
‘post_parent’ => $inserted_topic,
‘post_date_gmt’ => $sp_post->post_date,
‘post_date’ => get_date_from_gmt( $sp_post->post_date ),
‘post_title’ => ‘Reply To: ‘.$sp_topic->topic_name,
‘post_status’ => ‘publish’,
‘post_type’ => bbp_get_reply_post_type(),
‘post_content’ => $sp_post->post_content
) );
if ($inserted_post) {
update_post_meta( $inserted_post, ‘_bbp_author_ip’, $sp_post->poster_ip );
update_post_meta( $inserted_post, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );
update_post_meta( $inserted_post, ‘_bbp_topic_id’, $inserted_topic );
update_post_meta( $inserted_post, ‘_mbbb_sp_id’, “post_{$sp_post->post_id}” );
update_post_meta( $inserted_post, ‘_bbp_anonymous_name’, “{$sp_post->guest_name}” );
update_post_meta( $inserted_post, ‘_bbp_anonymous_email’, “{$sp_post->guest_email}” );
bbp_update_reply_walker( $inserted_post );
}
}
else
{
$inserted_post = wp_insert_post( array(
‘post_parent’ => $inserted_topic,
‘post_author’ => $sp_post->user_id,
‘post_date_gmt’ => $sp_post->post_date,
‘post_date’ => get_date_from_gmt( $sp_post->post_date ),
‘post_title’ => ‘Reply To: ‘.$sp_topic->topic_name,
‘post_status’ => ‘publish’,
‘post_type’ => bbp_get_reply_post_type(),
‘post_content’ => $sp_post->post_content
) );
if ($inserted_post) {
update_post_meta( $inserted_post, ‘_bbp_author_ip’, $sp_post->poster_ip );
update_post_meta( $inserted_post, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );
update_post_meta( $inserted_post, ‘_bbp_topic_id’, $inserted_topic );
update_post_meta( $inserted_post, ‘_mbbb_sp_id’, “post_{$sp_post->post_id}” );
bbp_update_reply_walker( $inserted_post );
}
}
}
else
update_post_meta( $inserted_topic, ‘_bbp_author_ip’, $sp_post->poster_ip );
} else
{
$inserted_post = $post_id;
// echo(“Guest start topic:n”);
}
$post_count ++;
}
}
// echo(“Guest start topic:{$sp_topic->user_id}n”);
update_post_meta( $inserted_topic, ‘_bbp_last_reply_id’, $inserted_post );
update_post_meta( $inserted_topic, ‘_bbp_last_active_id’, $inserted_post ? $inserted_post : $inserted_topic );
update_post_meta( $inserted_topic, ‘_bbp_last_active_time’, $inserted_post ? $sp_post->post_date : $sp_topic->topic_date );
update_post_meta( $inserted_topic, ‘_bbp_reply_count’, $post_count -1 );
update_post_meta( $inserted_topic, ‘_bbp_hidden_reply_count’, 0 );
//Topic Author – Guest (What code here?)
if(!($sp_topic->user_id))
{
echo(” Guest start topic: {$sp_posts[0]->guest_name}n”);
// update_post_meta( $inserted_topic, ‘_bbp_anonymous_name’, “{$sp_posts[0]->guest_name}” );
// update_post_meta( $inserted_topic, ‘_bbp_anonymous_email’, “{$sp_posts[0]->guest_email}” );
// ??????
}
bbp_update_topic_walker( $inserted_topic );
$topic_count ++;
}
}
global $wp_rewrite;
$wp_rewrite->flush_rules(false);
}
May 13, 2012 at 1:11 am #44709Topic: Code allowed Script On BBpress Forums
in forum Installationrusswittmann
MemberWhat are you using for the code allowed option on the text field here on these forums? Id like to use on my forums as well?
May 12, 2012 at 6:39 pm #100468In reply to: v2: Simple Press importer, and first thoughts
Gautam Gupta
ParticipantIt looks like this importer doesn’t support anonymous replies. You’d have to add the appropriate conditions yourself and re-import.
May 12, 2012 at 6:39 pm #105568In reply to: v2: Simple Press importer, and first thoughts
Gautam Gupta
ParticipantIt looks like this importer doesn’t support anonymous replies. You’d have to add the appropriate conditions yourself and re-import.
May 12, 2012 at 3:11 am #113582Sniper Kitten
MemberDo you remember to change the forum slug in Setting > Forums in your dashboard? By default, both of them are using the page slug “forums” so there’re conflict between Group Forum & Sitewide Forum.
Read here for more info:
https://codex.buddypress.org/getting-started/installing-group-and-sitewide-forums/
For installing group & sitewide forums:
https://codex.buddypress.org/getting-started/installing-group-and-sitewide-forums/3/
May 11, 2012 at 11:12 pm #113583In reply to: How to hide AddThis buttons from forum topics?
JenniferNM
MemberIs there some sort of code we could put into one or more of the bbpress php files to exclude it?
May 11, 2012 at 12:51 pm #44690Topic: pagination for all topic listing
in forum Installationpagination for all topic listing in archive forum page is not working.
http://mydemozone.com/vividmagazine/web/?post_type=forum
but it is working well for topics in particular forum but in the archive-forum.php page where all topics are listing,pagination not working.
I need a help to implement pagination in the archive forum page where all topics are listed by short code and php code . but pagination not working.
May 11, 2012 at 12:46 pm #112047In reply to: breadcrumbs + shortcode
pagination is not working for topic list in archive forum page. but it is working in particular forum page.
link is here
http://mydemozone.com/vividmagazine/web/?post_type=forum
when I click on 2 then it shows page not found.
how will I set pagination for topic list in archive-forum.php page.
May 11, 2012 at 9:11 am #44679Topic: Add post-thumbnail support to forum post tye
in forum Themesjaviarques
MemberHi, I’m trying to activate post-thumbnail in
forumpost type, but it still fails. I tried with this code:function forum_post_thumbnails () {
add_theme_support( 'post-thumbnails', array( 'forum', 'topic', 'reply', 'post', 'page' ) ); // Posts and Movies
}
add_action('after_setup_theme', 'forum_post_thumbnails');But it didn’t work. Any ideas on how activate it?
Thanks
May 11, 2012 at 2:53 am #112081In reply to: [bbp-single-topic-tag] id?
dannyjimmy
ParticipantHere’s the page I have that code on:
http://anawimcc.org/practice-and-experimental-pages/links-alternative-page/
May 11, 2012 at 2:52 am #112080In reply to: [bbp-single-topic-tag] id?
dannyjimmy
ParticipantI’m having a bit of trouble with this as well. And I too am on a BP install, though it would seem to me that it shouldn’t matter.
I used it like this:
- [bbp-login]
- [bbp-single-topic-tag id="35"]
- [bbp-single-topic-tag id="link"]
- [bbp-single-topic-tag $id="35"]
- [bbp-single-topic-tag $id="link"]
- [bbp-single-topic-tag id=$topic_id]
- [bbp-single-topic-tag id=35]
(this is when I found the codex file for bbpress shortcodes at https://codex.bbpress.org/shortcodes/ and formatted accordingly)
- [bbp-single-topic-tag id=$35]
- [bbp-single-topic-tag id=$tag_id]And I got no forums rendered. Very confusing, since the last two were copy paste from the codex.
May 10, 2012 at 4:42 am #113509kennymcnett
MemberI considered Buddypress, but it’s way more robust than what I’m needing, and installing it was breaking my custom theme (jquery conflict somewhere).
Thanks for looking at this.
For anyone else out there, here’s my solution for restricting bbPress access using s2member. In short, this checks if the current user has access to the most distant ancestor of the current page. For example:
Level 1 Forum/Category > Subforum1 > Subcategory > Subforum2 > Current Topic
No matter which page they arrive at in the tree, they must have access via s2member to the top-most level. Then it’s a simple matter of assigning a ccap to that Forum, or a membership level.
1. Include the following in your functions.php file
2. Include a call to the function in EACH of your bbPress template files BEFORE the template calls for the forum content. Match the HTML structure of the error message to suit your theme. You need to include closing tags for any open divs.
3. Test!
/******* bbPress Forum Access *******/
function checkForumAccess() {
if(get_post_type() == 'forum' OR get_post_type() == 'topic' OR get_post_type() == 'reply') { // check if user is viewing a forum page. If so, continue.
//check if they have access to the top-most parent forum/category (both are Pages in wordpress). If not, show the error verbiage. If they have access, continue and show the content like normal
$parent = array_reverse(get_post_ancestors($post->ID)); // get an array of all the parent pages in order from most distant to closest.
$first_parent = get_page($parent[0]); //get the first page in the array, which is the most distant parent
$int = apply_filters(‘the_ID’, $first_parent->ID); //filter the $first_parent to get only the wordpress page/post ID, which is an integer like 49 or 565. store it as a variable $int
if (!is_page_permitted_by_s2member($int)) { // this is an s2member function. Check if the current user can access the $first_parent, via the stored page/post ID in the $int variable
// here comes your custom error message. Remember to escape any apostrophes
echo ‘
<div>
<h1 class=”entry-title”>Sorry!</h1>
<div class=”entry-content”>
<p>It looks like you don’t have access to this forum.</p>
<p>If this is an error and you should have access, please contact us here: (contact URL)
</div>
</div><!–.postWrapper–>
</div><!– #content –>
</div><!– #contentWrapper –>
</div><!– #primary –>
‘;
get_sidebar();
get_footer();
exit; // Important. This prevents the rest of the page (the secure forum content) from displaying
}
}
}
May 9, 2012 at 11:38 pm #113376chr313
MemberJust giving this a bump. I would think there was some short code etc for this functionality that I might have missed somewhere.
-
AuthorSearch Results