PDA

View Full Version : Show only starter's posts


gedsta
04-11-2011, 02:12 PM
Hi chaps

Does anyone know what code to use so as to just show the original thread starters posts in a thread.

This has been specifically asked for by user's and would appear in the thread tools dropdown.

I have seen it done on another forum, but it is the code etc that I would actually place into the template so to speak.

Here is the sort of code off a forum that uses it.

<td class="vbmenu_option"><img class="inlineimg" src="http://www.removed.com/forums/images/buttons/filter.gif" alt="Show only Starter's Posts" /><a href="showthread.php?t=463974&amp;do=filter" rel="nofollow">Show only Starter's Posts</a></td>

TIA

kh99
04-11-2011, 08:46 PM
You could make a plugin using hook showthread_query_postids and this code:

if ($_REQUEST['do'] == 'filter')
{
$hook_query_where .= ' AND post.userid = ' . $thread['postuserid'] . ' ';
}


I tried it but didn't do a lot of testing or anything.

gedsta
04-12-2011, 06:24 PM
You could make a plugin using hook showthread_query_postids and this code:

if ($_REQUEST['do'] == 'filter')
{
$hook_query_where .= ' AND post.userid = ' . $thread['postuserid'] . ' ';
}


I tried it but didn't do a lot of testing or anything.

Hi thanks for that.

What else would I need to do to implement this?

kh99
04-12-2011, 07:50 PM
Well I guess in template SHOWTHREAD you could search for 'thread tools menu' and then add something like this:


<tr>
<td class="vbmenu_option"><img class="inlineimg" src="$stylevar[imgdir_button]/filter.gif" alt="Show only Starters Posts" /><a href="showthread.php?t=$threadid&amp;do=filter" rel="nofollow">Show only Starters Posts</a></td>
</tr>


Of course you want to add it in the right place (inside the table def and in between existing rows or after the last one). Also, the code above assumes you've put a filter icon image in your style button directory. You could also make a phrase for the text instead of coding it in the template if you wanted.

BTW, this will display the thread with just the thread starter's posts, but it won't 'remember' that setting - once you click on something else you'll be back to seeing all the posts.

gedsta
04-12-2011, 08:13 PM
Well I guess in template SHOWTHREAD you could search for 'thread tools menu' and then add something like this:


<tr>
<td class="vbmenu_option"><img class="inlineimg" src="$stylevar[imgdir_button]/filter.gif" alt="Show only Starters Posts" /><a href="showthread.php?t=$threadid&amp;do=filter" rel="nofollow">Show only Starters Posts</a></td>
</tr>


Of course you want to add it in the right place (inside the table def and in between existing rows or after the last one). Also, the code above assumes you've put a filter icon image in your style button directory. You could also make a phrase for the text instead of coding it in the template if you wanted.

BTW, this will display the thread with just the thread starter's posts, but it won't 'remember' that setting - once you click on something else you'll be back to seeing all the posts.

Great thanks, it works so far, as per the limitations re remember that setting then so be it, it is better than what was there yesterday. :D

Thanks a lot. :up:

--------------- Added 1302655764 at 1302655764 ---------------

Doh!

Members are now moaning that on page 2 of a multi page thread, it has reverted back to standard behaviour.

Any ideas of how this could be thread wise?

As in all pages?

RedDevil
04-21-2011, 07:45 PM
Is this possible on VB4? doesnt seem to work probably different coding now from thos

kh99
04-21-2011, 08:40 PM
Doh!

Members are now moaning that on page 2 of a multi page thread, it has reverted back to standard behaviour.

Any ideas of how this could be thread wise?


Sorry, I somehow missed that post. You could try changing the above plugin code to this:

if ($_REQUEST['do'] == 'filter')
{
$hook_query_where .= ' AND post.userid = ' . $thread['postuserid'];
$highlightwords .= '&amp;do=filter';
}


That seems to make the page controls work OK but there's probably something else that won't work...

Is this possible on VB4? doesnt seem to work probably different coding now from thos

I don't know, I'm planning to set up a vb4 test site soon so maybe I'll take a look (if no one else answers by then).