vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Show only starter's posts (https://vborg.vbsupport.ru/showthread.php?t=261837)

gedsta 04-11-2011 01:12 PM

Show only starter's posts
 
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.

PHP Code:

<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 07:46 PM

You could make a plugin using hook showthread_query_postids and this code:

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 05:24 PM

Quote:

Originally Posted by kh99 (Post 2183581)
You could make a plugin using hook showthread_query_postids and this code:

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 06:50 PM

Well I guess in template SHOWTHREAD you could search for 'thread tools menu' and then add something like this:

Code:

    <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 07:13 PM

Quote:

Originally Posted by kh99 (Post 2183955)
Well I guess in template SHOWTHREAD you could search for 'thread tools menu' and then add something like this:

Code:

    <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 [DATE]1302655764[/DATE] at [TIME]1302655764[/TIME] ---------------

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 06:45 PM

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

kh99 04-21-2011 07:40 PM

Quote:

Originally Posted by gedsta (Post 2183963)
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:

Code:

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...

Quote:

Originally Posted by Red-Devil (Post 2187141)
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).


All times are GMT. The time now is 07:04 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03822 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete