Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Hide Post Buttons Details »»
Hide Post Buttons
Version: 1.00, by tubedogg tubedogg is offline
Developer Last Online: Dec 2016 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 05-15-2002 Last Update: Never Installs: 21
 
No support by the author.

Another small hack, this one requested by cessna140.

It will remove the New Thread and/or Post Reply buttons from showthread and forumdisplay if the user does not have permission to post a New Thread and/or Post a Reply.

Again, it's really quite simple. Download the attached file and follow the instructions.

Please no PMs, email, ICQ, or AIM about this hack. It will be ignored.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-16-2002, 04:12 AM
RDX1 RDX1 is offline
 
Join Date: Apr 2002
Posts: 497
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not bad... wont install it tho - no need
Reply With Quote
  #3  
Old 05-16-2002, 04:38 AM
cessna140 cessna140 is offline
 
Join Date: Feb 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome! Thanks for the quick response. I have installed it but have a problem. I have vB 2.2.5.

Your instructions state:
Quote:
---------------------------------------------------------------
= = = = = = = S H O W T H R E A D . P H P = = = =
---------------------------------------------------------------
__Find__
updateuserforum($thread['forumid']);

__Right after that add__
// ****** //
$showthreadbutton = 1;
if (!$getperms['canpostnew']) {
$showthreadbutton = 0;
}

$showreplybutton = 1;
if (!$getperms['canreplyown'] or (!$getperms['canreplyothers'] and ($thread['postuserid']!=$bbuserinfo['userid'] or $bbuserinfo['userid'] == 0))) {
$showreplybutton = 0;
}
if (!$thread['open'] == 0 and ($bbuserinfo['userid'] == 0 or $bbuserinfo['usergroupid'] != 6 or !ismoderator($thread['forumid']))) {
$showreplybutton = 0;
}

if ($showthreadbutton == 1) {
eval("\$threadbutton = \"".gettemplate("showthread_threadbutton")."\"; ");
} else {
$threadbutton = " ";
}
if ($showreplybutton == 1) {
eval("\$replybutton = \"".gettemplate("showthread_replybutton")."\";" );
} else {
$replybutton = " ";
}
// ****** //
In showthread.php there are two occurances of updateuserforum($thread['forumid']);. The first on line ~86 the second on line ~468.

I placed the code after the first one I came across, saved/uploaded the file and checked the result. The buttons were gone from the top of the thread but not the bottom. So I inserted the code after the second occurance, saved/uploaded and tried again. Same result, the buttons are still at the bottom of the thread.

Any ideas? Thanks again.
Reply With Quote
  #4  
Old 05-16-2002, 04:46 AM
tubedogg's Avatar
tubedogg tubedogg is offline
 
Join Date: Oct 2001
Location: Medina, OH
Posts: 785
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You wanted the second occurance, correct.

I missed one bit of the instructions, you need to do some additional stuff in the showthread template. Download the new file and do the second find/replace under showthread template. That will fix it.
Reply With Quote
  #5  
Old 05-16-2002, 05:54 AM
cessna140 cessna140 is offline
 
Join Date: Feb 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey tubedogg,

Quote:
Originally posted by tubedogg
You wanted the second occurance, correct.
Not sure what you meant by this? If you meant at the Thread level, no I would rather not have any buttons show if the person is not allowed to post/reply.

Quote:
I missed one bit of the instructions, you need to do some additional stuff in the showthread template. Download the new file and do the second find/replace under showthread template. That will fix it.
I downloaded the file again but did not notice anything different. I searched for a second occurance in the showthread template but did not see one. The only duplicate occurance of anything in your instructions was in the showthread.php file. Is that what you were referring to?

This hack works at the Main Forum level but not at the Thread level. Here are some screen shots that might better explain what I'm referring to.

The top part of the image shows unhacked normal operation at Forum level.

The middle part of the image shows a Forum, after installing your hack, where the visitor does not have permission to post. Notice there is no New Thread button! Perfect.

The bottom part of the image shows an individual thread with the buttons still showing even though the visitor does not have permission to post there. What needs to be done to make those disappear? This also ties in to another hack somewhere on vb.org that hides the New Thread button on a Closed thread. Can all of these situations be covered in one hack?
Reply With Quote
  #6  
Old 05-16-2002, 06:19 AM
DWZ's Avatar
DWZ DWZ is offline
 
Join Date: Dec 2001
Posts: 207
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

augh! the color! it burns my eyes!
Reply With Quote
  #7  
Old 05-16-2002, 07:04 AM
tubedogg's Avatar
tubedogg tubedogg is offline
 
Join Date: Oct 2001
Location: Medina, OH
Posts: 785
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Following the instructions for the second find&replace under "showthread template" in the file from will fix your problem.
Reply With Quote
  #8  
Old 05-16-2002, 09:39 AM
inphinity's Avatar
inphinity inphinity is offline
 
Join Date: Oct 2001
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice hack

but correct me if i'm wrong but i think you missed some bits from the instructions

add two new templates:

showthread_threadbutton
PHP Code:
<a href="newthread.php?s=$session[sessionhash]&action=newthread&forumid=$forum[forumid]"><img src="{ newthreadimage}" border="0" alt="Post New Thread"></a
(remove space after { )

showthread_replybutton
PHP Code:
<a href="newreply.php?s=$session[sessionhash]&action=newreply&threadid=$threadid"><img src="$replycloseborder="0" alt="Post A Reply"></a
and in showthread.php i would probably add

PHP Code:
$templatesused .= ',showthread_replybutton,showthread_threadbutton'
just under

PHP Code:
// ##############################################################################
// ############################# SHOW THREAD ####################################
// ##############################################################################

$templatesused 'showthread_ratingdisplay,postbit_search,postbit_buddy,postbit_useremail,icq,aim,yahoo,postbit_homepage,postbit_profile,postbit_ip_show,postbit_ip_hidden,postbit,postb
it_sendpm,postbit_avatar,postbit_offline,postbit_online,postbit_editedby,postbit_signature,postbit_attachment,postbit_attachmentimage,showthread_adminoptions,showthread_threadrate,show
thread_pollresults_voted,showthread_pollresults_closed,showthread_firstunread,showthread_nextnewestthread,showthread_nextoldestthread,forumrules,showthread'

Reply With Quote
  #9  
Old 05-16-2002, 04:55 PM
cessna140 cessna140 is offline
 
Join Date: Feb 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

tubedogg,

Thanks for taking the time. I've got half of it working...


Quote:
Originally posted by tubedogg
Following the instructions for the second find&replace under "showthread template" in the file from will fix your problem.
First, this hack does work at the forum level. :laugh:

The problem is, the new thread and reply buttons are still showing at the thread level as depicted in the bottom of the previously attached image. :disappointed:

Not to be a pain but, I have followed your instructions to the letter, several times, and can't get it to work. Obviously, I am missing something! Could I impose on you to write new instructions specifically to what I am not getting? Exactly what needs to be replaced and where in order to hide the new thread and reply buttons in threads that I do not have permission to post/reply?

Perhaps as inphinity suggests, there are more steps to this?

Again, thanks!
Reply With Quote
  #10  
Old 05-16-2002, 07:52 PM
tubedogg's Avatar
tubedogg tubedogg is offline
 
Join Date: Oct 2001
Location: Medina, OH
Posts: 785
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is taken verbatim from the instructions file and is what you need to do to make the thread buttons disappear.

__Find__
Code:
	<!-- Thread nav and post images -->
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="100%"><smallfont color="#EEEEFF" class="thtcolor"><b>Thread</b></smallfont></td>
		<td><a href="newthread.php?s=$session[sessionhash]&action=newthread&forumid=$forum[forumid]"><img src="https://vborg.vbsupport.ru/images/newthread.gif" border="0" alt="Post New Thread"></a></td>
		<td><normalfont>&nbsp;&nbsp;</normalfont></td>
		<td><a href="newreply.php?s=$session[sessionhash]&action=newreply&threadid=$threadid"><img src="$replyclose" border="0" alt="Post A Reply"></a></td>
	</tr>
	</table>
	<!-- /Thread nav and post images -->
__Replace with__
Code:
	<!-- Thread nav and post images -->
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="100%"><smallfont color="#EEEEFF" class="thtcolor"><b>Thread</b></smallfont></td>
		<td>$threadbutton</td>
		<td><normalfont>&nbsp;&nbsp;</normalfont></td>
		<td>$replybutton</td>
	</tr>
	</table>
	<!-- /Thread nav and post images -->
__Find__
Code:
		<td><a href="newthread.php?s=$session[sessionhash]&action=newthread&forumid=$forum[forumid]"><img src="https://vborg.vbsupport.ru/images/newthread.gif" border="0" alt="Post New Thread"></a></td>
		<td><normalfont>&nbsp;&nbsp;</normalfont></td>
		<td><a href="newreply.php?s=$session[sessionhash]&action=newreply&threadid=$threadid"><img src="$replyclose" border="0" alt="Post A Reply"></a></td>
__Replace with__
Code:
		<td>$threadbutton</td>
		<td><normalfont>&nbsp;&nbsp;</normalfont></td>
		<td>$replybutton</td>
Reply With Quote
Reply


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 07:53 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06182 seconds
  • Memory Usage 2,315KB
  • Queries Executed 23 (?)
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
  • (4)bbcode_code
  • (4)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete