The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
![]() |
|||||||||||||||||||||||||||
Allow Group to Read Titles / Not Content
![]() Developer Last Online: Nov 2022 ![]() ![]()
Tested and working in 3.0.3 - 3.0.7
This hack will enable you to DISABLE SHOWTHREAD according to USERGROUP.This will allow all your members to view titles and topic counts found within a section. Think of it as "window shopping". Your members will be able to read all topics from the forumdisplay.php page but, will not be allowed to read it's content unless they have permission The edits below will prevent anyone from viewing the contents of a post from within showthread, printthread, showpost, and archives. This feature can be used on a per USERGROUP and /or per FORUM basis. You, as the admin, will have complete control. You will need to modify:
MOD VERSION 1.05
Allow User To View And Post Into Their Own Threads: If you want to allow users to view and post their own threads and have access to them ... use this code in showthread, printhread, and showpost.php: Code:
// ================================================= \\ // == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ] if (!($forumperms & GTPCANREADCONTENT)AND ($thread['postuserid'] != $bbuserinfo['userid'])) { eval(print_standard_error('gtp_cannot_read')); } // == [ 00-00-2004 - GTP END ] // ================================================= \\ [hr=blue]4[/hr] Disable Thread Preview To disable thread previews on forums that user cannot read content do the following edits: FIND in functions/forumdisplay.php: Code:
// format thread preview if there is one if ($ignore["$thread[postuserid]"]) { $thread['preview'] = ''; } else if (isset($thread['preview']) AND $vboptions['threadpreview'] > 0) { $thread['preview'] = strip_quotes($thread['preview']); $thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode($thread['preview'], false, true), $vboptions['threadpreview'])); } Code:
// ================================================= \\ // == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ] $forumperms = fetch_permissions($foruminfo['forumid']); // format thread preview if there is one if ($ignore["$thread[postuserid]"] OR !($forumperms & GTPCANREADCONTENT)) { $thread['preview'] = ''; } else if (isset($thread['preview']) AND $vboptions['threadpreview'] > 0) { $thread['preview'] = strip_quotes($thread['preview']); $thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode($thread['preview'], false, true), $vboptions['threadpreview'])); } // == [ 00-00-2004 - GTP END ] // ================================================= \\ Example Of How Hack Works: I have a forum with (sub-forums) ... however, one of the sub-forums is private (for PREMIUM members only). Here's how the settings would look like. In USERGROUP MANAGER (this is a global setting) set "Group can read content?: UNREGISTERED - YES REGISTERED - YES PREMIUM - YES The global setting will be transferred to all forums; but, we have a sub-forum that is only for PREMIUM MEMBERS so... In FORUM PERMISSIONS MANAGER set private forum to: UNREGISTERED - NO REGISTERED - NO PREMIUM - YES Show Your Support
|
Comments |
#232
|
|||
|
|||
![]()
No. I get a completely blank page. No headers, etc. like this.
I looked in the html, it has nothing between the <BODY> tags. I'll check my files again later to see if I made a mistake. Edit: the link is not a valid example anymore, as I've figured it out and fixed it. |
#233
|
|||
|
|||
![]()
First I would like to thank you BIG time for this mod. Then Im wondering if any of the changes above would affect me as Im using the same vb and did the install just prior to whats mentioned above so whats the difference now and is it a must.
Ive also noticed when I logout and test the Archive out of curiosty to what was mentioned above that when I click on any of the forums that are set to no content that when I click those forums I cant see anything getting back a blank page. I would think it should show titles and get a blank page when clicking titles for content although it dosent show any titles at all. |
#234
|
|||
|
|||
![]()
Found the cause of completely blank page forum indexes and thread contents.
In /archive/index.php Code:
$forumperms = $bbuserinfo['forumpermissions'][$foruminfo['forumid']]; // ================================================= \\ // == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ] //if (!($forumperms & CANVIEW) OR !($forumperms & CANVIEWOTHERS) OR in_coventry($threadinfo['postuserid']) OR $threadinfo['isdeleted']) if (!($forumperms & CANVIEW) OR !($forumperms & CANVIEWOTHERS) OR !($forumperms & GTPCANREADCONTENT) OR in_coventry($threadinfo['postuserid']) OR $threadinfo['isdeleted']) // == [ 00-00-2004 - GTP END ] // ================================================= \\ { exit; } Code:
$forumperms = $bbuserinfo['forumpermissions'][$f]; // ================================================= \\ // == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ] //if (!($forumperms & CANVIEW) OR !($forumperms & CANVIEWOTHERS)) if (!($forumperms & CANVIEW) OR !($forumperms & CANVIEWOTHERS) OR !($forumperms & GTPCANREADCONTENT)) // == [ 00-00-2004 - GTP END ] // ================================================= \\ { exit; } I removed these 2 and I can see the archive forum index, and the thread titles are not hot-linked anymore. So the forum view is fixed. However, if I cheat and construct the archive thread url, I can still see the thread contents. To stop that, find: Code:
if ($do == 'thread') { echo print_archive_navigation($foruminfo, $threadinfo); Code:
// ================================================= \\ // == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ] $noaccess = iif(!($forumperms & GTPCANREADCONTENT), ' <em>('.$vbphrase['private'].')</em>'); if ($noaccess) { echo "<div class=\"info\">".$vbphrase['gtp_archive_private']."</div>"; exit; } // == [ 00-00-2004 - GTP END ] // ================================================= \\ |
#235
|
||||
|
||||
![]()
the zip file has been updated
|
#236
|
|||
|
|||
![]()
Great! I just installed your updates and it works fine. Thanks.
|
#237
|
|||
|
|||
![]()
Vinzphua, with your update do you have to remove the two things u showed at the top, or only add the part below it?
You didn't make it too clear. ![]() edit: nvm. |
#238
|
||||
|
||||
![]()
You should follow the installation instructions found in the zip file
If you wish to stay updated on changes you should click INSTALL. |
#239
|
|||
|
|||
![]()
Alright, I followed the new instructions in the installation file, and now the page loads blank if you click on a page where display no content is turned on.
btw, i just clicked the install button, so i'll know of updates in the future. ![]() |
#240
|
||||
|
||||
![]()
that's how the hack worked previously...
remove all modified code found in archive/index.php and start over again the new instructions takes care of this problem |
#241
|
|||
|
|||
![]()
Alright, i got it, thanks for the help.
![]() Musta missed some part of the old code. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|