Overwriting core functions
Ok I am trying to integrate bbpress here http://fanart.tv/forums/ and have a couple of questions.
I have my installation set up as such:
2.0 plugin installed
All the forum specific stuff is in the child theme.
I want to change the freshness link to be something like > topic title – 2 hours ago by kode.
My issue is that loop-forums.php uses bbp_forum_freshness_link, which in turn calls the function bbp_get_forum_freshness_link, both of which are in the core plugin, so if I edit either of these, when I upgrade the plugin my changes will dissapear, what do I need to do to overwrite it, or is there a better way to deal with it?
My second question is how would I get the amount of forums / topics / posts etc?
Currently in my header I have.
$bbforums = $wpdb->get_row(“SELECT COUNT(ID) as forum_count FROM wp_posts WHERE post_type = ‘forum’ AND post_status = ‘publish'”);
$bbtopics = $wpdb->get_row(“SELECT COUNT(ID) as topic_count FROM wp_posts WHERE post_type = ‘topic’ AND post_status = ‘publish'”);
$bbreplies = $wpdb->get_row(“SELECT COUNT(ID) as reply_count FROM wp_posts WHERE post_type = ‘reply’ AND post_status = ‘publish'”);
<h2>Forums <span class=”info-text pop”><?php echo $bbforums->forum_count.” forum(s) / “.$bbtopics->topic_count.” topic(s) / “.$bbreplies->reply_count.” post(s)”; ?></span></h2>
But this is bringing back 5 forums (correct, I have 5 public forums and 1 private forum), 7 topics (incorrect, 2 of those are from the private forum, so I guess I need to left join the forum as well), 15 posts (this is the one that is confusing me, it should be 19, or 22 if it was bringing back the private ones) My ip has changed on my home address so I can’t bring up phpmyadmin to check until my host responds, so if anyone has any ideas in the mean time, please let me know.
- You must be logged in to reply to this topic.