Search Results for 'code'
-
Search Results
-
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?
Topic: CSS questions
Hi there,
I use the Genesis framework. In the Genesis theme there is a CSS part that sets the global margins..entry { margin-bottom: 40px; padding: 50px 60px; }I managed to change a lot of the CSS by learning trial and error. I managed to change lot of the CSS of bbPress, but I don’t now how to change specific global things only affecting the bbPress forum.
How can I change only the margings and the font type of the forum, without affecting the rest of the site (Genesis CSS).
Your help is highly appreciated š
I wish to show the description of each forum in the forum list as seen here:
http://forum.unified-automation.com/If someone could point me towards the file and/or function I need to add/amend, I’d be eternally grateful.
I have it laid out with the child forums listed as shown by following this example but when I last tried to show the description along side it, I got the WSOD (my php sucks).
Thanks to any and all!
WP version 4.0
bbPress version 2.5.4