WordPress.org

Ready to get started?Download WordPress

Forums

Mingle Forum
Changing the Recent Post Widget to only show posts from one subforum? (2 posts)

  1. Reacto
    Member
    Posted 2 years ago #

    Is it possible to do this? Want a sidebar box like the recent post one, but so it only shows new posts from one forum, with an edited title. Like, have a forum for new cups, then call the sidebar widget box New cups and make it only show posts from the "Cups" subforum? Any way to do this?

    http://wordpress.org/extend/plugins/mingle-forum/

    [ Please do not bump, it's not permitted here. ]

  2. luuthang
    Member
    Posted 2 years ago #

    Hi, you can try as follow

    --wpf.class.php
    Add this funtion

    function latest_threads_in_forum($forum = 1, $num = 5, $ul = true){
    		global $wpdb;
    		$toShow = 0;
    		$posts = $wpdb->get_results("SELECT * FROM $this->t_threads WHERE parent_id=$forum ORDER BY <code>date</code> DESC LIMIT 50");
    		if($ul) echo "<ul class='forumtwo'>";
    		foreach($posts as $post){
    			if($toShow < $num)
    			{
    				//$user = get_userdata($post->author_id);
    				if($this->have_access($this->forum_get_group_from_post($post->parent_id)))
    					echo "<li class='forum'><a href='".$this->get_paged_threadlink($post->parent_id, '#postid-'.$post->id)."'>".$this->output_filter($post->subject)."</li>";
    				$toShow += 1;
    			}
    		}
    		if($ul)echo "</ul>";
    	}

    --wpf-main.php
    Add this function

    function latest_threads_in_forum($forum = 1){
    	global $mingleforum;
    	return $mingleforum->latest_threads_in_forum($forum);
    }

    --In template file (sidebar.php)

    <?php latest_threads_in_forum(2, 5, true); ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.