Search Results for 'code'
-
Search Results
-
Hi,
How can I move a topic from one forum to another programmatically? Iām hoping to send a post variable with the new forum ID, and then update the topic like so:
// Update the Status Meta After Changes are Posted if ( isset( $_POST['bbps_forum_option'] ) ) { $new_forum = $_POST['bbps_forum_option']; bbp_update_topic( $this->topic_id, $new_forum ); } // if()Thanks!
Hi,
Iām trying to retrieve a simple list of all forums on a site, for which I need to have a loop. Iām trying to create one from within a class in my plugin using this function:
public function forum_list(){ $forums = array(); if ( bbp_has_forums() ) { while ( bbp_forums() ) { bbp_the_forum(); $forum_id = bbp_get_forum_id(); $forum_name = bbp_get_forum_title(); $data = array( 'ID' => $forum_id, 'name' => $forum_name ); $forums[] = $data; } // while() } // if() return $forums; } // get_forum_list()Which is called inside the construcor like so:
$this->forums = $this->forum_list();This is telling me there is no object (Call to a member function get() on a non-object). The function works perfectly well outside the class, but inside it fails. What am I missing?
Issue came up after a user joined with with a space in his username. His profile leads to 404 when you click on his username. I researched and saw special characters and spaces aren’t allowed? Why is this and is there a simple fix rather than having to validate our code?
@lynq I hope you can help me.
As you see here, in the general section it shows the topic and posts count nicely on the correct place.
However on the sub-forums u can see the counts are just ext to the name. how can i position these so they get on the same position like the ones above?I tried to add a class here
// Parse arguments against default values $r = bbp_parse_args( $args, array( 'before' => '<ul class="bbp-forums-list">', 'after' => '</ul>', 'link_before' => '<li class="bbp-forum">', 'link_after' => '</li>', 'count_before' => '(', 'count_after' => ' )', 'count_sep' => ', ', 'separator' => ', ', 'forum_id' => '', 'show_topic_count' => true, 'show_reply_count' => true, ), 'list_forums' );Like this:
// Parse arguments against default values $r = bbp_parse_args( $args, array( 'before' => '<ul class="bbp-forums-list">', 'after' => '</ul>', 'link_before' => '<li class="bbp-forum">', 'link_after' => '</li>', 'count_before' => '<div class="counts">', 'count_after' => '</div>', //'count_sep' => ', ', //'separator' => ', ', 'forum_id' => '', 'show_topic_count' => true, 'show_reply_count' => true, ), 'list_forums' );to then style it in css, but when i try this it doesnt show the count anymore and i cANT EDIT IT IN CSS.
Hi,
How can I move a topic from one forum to another programmatically? I’m hoping to send a post variable with the new forum ID, and then update the topic like so:
// Update the Status Meta After Changes are Posted if ( isset( $_POST['bbps_forum_option'] ) ) { $new_forum = $_POST['bbps_forum_option']; bbp_update_topic( $this->topic_id, $new_forum ); } // if()Thanks!
Hi,
I’m trying to retrieve a simple list of all forums on a site, for which I need to have a loop. I’m trying to create one from within a class in my plugin using this function:
public function forum_list(){ $forums = array(); if ( bbp_has_forums() { while ( bbp_forums() ) { bbp_the_forum(); $forum_id = bbp_get_forum_id(); $forum_name = bbp_get_forum_title(); $data = array( 'ID' => $forum_id, 'name' => $forum_name ); $forums[] = $data; //} // while() } // if() return $forums; } // get_forum_list()Which is called inside the construcor like so:
$this->forums = $this->forum_list();This is telling me there is no object (Call to a member function get() on a non-object). The function works perfectly well outside the class, but inside it fails. What am I missing?