Search Results for 'code'
-
AuthorSearch Results
-
May 16, 2012 at 5:32 pm #100471
In reply to: v2: Simple Press importer, and first thoughts
jotaace
ParticipantHi AlexKramer,
Sorry but i can’t find the way to use the plugin. Would you mind to post a little instructions on its usage? I only know how to paste the code in a txt file, renaming as php, zipping and installing as a plugin.
And where to paste the code lines of your previous post in the plugin, please?
I’ll be very grateful if I really can import my forum.
Thanks in advance.
May 16, 2012 at 5:32 pm #105571In reply to: v2: Simple Press importer, and first thoughts
jotaace
ParticipantHi AlexKramer,
Sorry but i can’t find the way to use the plugin. Would you mind to post a little instructions on its usage? I only know how to paste the code in a txt file, renaming as php, zipping and installing as a plugin.
And where to paste the code lines of your previous post in the plugin, please?
I’ll be very grateful if I really can import my forum.
Thanks in advance.
May 16, 2012 at 4:53 pm #55256In reply to: Check if a user is logged in?
qmic76
MemberI want to hide page links in my main header navigation from non registered members, then have them show up after the user has logged in.
I’m currently using custom menu manager and wp-members for plugins. The custom menu manager allows me to set which page links show up in the assigned navigation menu (ie: only “about” and “register” are shown on home page the other page links are hidden), but it doesn’t recognize whether the user is logged in or not and the hidden page links are not shown after you’ve logged in still. With wp-members plugin I have the “members” and “project” pages set to block access unless logged in, but this only effects the page access, the nav link for those pages were still showing up in the main navigation until I used the menu manager plugin which hid them totally not conditionally based on log in status which is what I want.
Is there a php block of code to use or plugin you guys recommend that handles nav link access/visibilty based on log in status? I’m at total loss. Please help me. Visit my site mks76.com/wp/
May 16, 2012 at 4:24 pm #113564In 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/
-
AuthorSearch Results