Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 04-11-2011, 02:12 PM
gedsta gedsta is offline
 
Join Date: Feb 2006
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 04-11-2011, 08:46 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 04-12-2011, 06:24 PM
gedsta gedsta is offline
 
Join Date: Feb 2006
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
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?
Reply With Quote
  #4  
Old 04-12-2011, 07:50 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 04-12-2011, 08:13 PM
gedsta gedsta is offline
 
Join Date: Feb 2006
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
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.

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?
Reply With Quote
  #6  
Old 04-21-2011, 07:45 PM
RedDevil's Avatar
RedDevil RedDevil is offline
 
Join Date: Mar 2008
Location: Cumbria, UK
Posts: 310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this possible on VB4? doesnt seem to work probably different coding now from thos
Reply With Quote
  #7  
Old 04-21-2011, 08:40 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by gedsta View Post
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 View Post
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).
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:35 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.07144 seconds
  • Memory Usage 2,228KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_code
  • (1)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete