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

Reply
 
Thread Tools
Allow Group to Read Titles / Not Content Details »»
Allow Group to Read Titles / Not Content
Version: 1.05, by Princeton Princeton is offline
Developer Last Online: Nov 2022 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 01-12-2004 Last Update: 05-24-2005 Installs: 146
 
No support by the author.

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:
  • includes/init.php
  • includes/adminfunctions_forums.php
  • admincp/resources.php
  • admincp/usergroup.php
  • showthread.php
  • archive/index.php
  • printthread.php
  • showpost.php
  • archive.css
Add 3 new phrases.
MOD VERSION 1.05
  • Fixed issues concerning the archives - eg. blank page was displayed ... now, thread links are viewable but not active (if not allowed).
MOD VERSION 1.01
  • now with personal NOT ALLOWED message
  • Easier to install
  • now add the ability to allow users to view their own posts/threads (view below code)
  • archive section changed to NOT display links to content that is not READABLE
  • added a message to archive section if user cannot read content
[hr=blue]4[/hr]
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 ]
// ================================================= \\
NOTE: You may have to use "$threadinfo['postuserid]" on some of the pages.

[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']));
    }
REPLACE IT WITH:
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 ]
// ================================================= \\
[hr=blue]4[/hr]
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

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

Comments
  #202  
Old 03-08-2005, 04:45 PM
YLP1 YLP1 is offline
 
Join Date: Aug 2004
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by princeton
BITFIELD is referring to the 'permissions' we set in the init.php page.

If it's working elsewhere ... it means that you made an error when copy/paste.

Check the current file and make sure you have everything the same as in the instructions.

YES. By removing the code from printthread.php users will be able to see your content.
I found the problem there was a missing here's how the instructions look:
Quote:
'canthreadrate' => 65536,
'isalwaysmoderated' => 131072,
'canseedelnotice' => 262144
// ================================================= \\
// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
,'gtpcanreadcontent' => 524288 // VIEW THREAD
// == [ 00-00-2004 - GTP END ]
// ================================================= \\
);
Here's what I changed to get it to work:
Quote:
'canthreadrate' => 65536,
'isalwaysmoderated' => 131072,
'canseedelnotice' => 262144,
// ================================================= \\
// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
<I removed the comma from here>'gtpcanreadcontent' => 524288, // VIEW THREAD
// == [ 00-00-2004 - GTP END ]
// ================================================= \\
);

Thanks again for your help.
Reply With Quote
  #203  
Old 03-08-2005, 04:48 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

glad everything worked out
Reply With Quote
  #204  
Old 03-09-2005, 02:37 PM
YLP1 YLP1 is offline
 
Join Date: Aug 2004
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alas, I have a new problem.....I have once again gone over all the modifications. What is happening to me (admin) and other admins/mods is viewing a deleting post.

I have double checked and confirmed that mods/admins can view deleted posts but when we click on on the "viewpost" this is the error we are getting:

Quote:
Robin, you do not have permission to access this page. This could be due to one of several reasons:

Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
I'm a newbie and not sure how to get the permissions to view deleted posts for mods/admins. Presently I only allow mods/admins to see the deleted posts.

Any help is greatly appreciated.
Reply With Quote
  #205  
Old 03-09-2005, 03:54 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

check your showpost.php edits and make sure it is identical to the code found in the instructions
Reply With Quote
  #206  
Old 03-09-2005, 05:48 PM
YLP1 YLP1 is offline
 
Join Date: Aug 2004
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by princeton
check your showpost.php edits and make sure it is identical to the code found in the instructions

Thank you, Thank you, Thank you!!!! I had old code in that showpost.php file....

Big Hugs!!!

Hmmm, would you happen to know why the InlineMod isn't working with this hack?
Reply With Quote
  #207  
Old 03-09-2005, 06:45 PM
matd62 matd62 is offline
 
Join Date: Jun 2004
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

installed and working great! one question...im not sure if this has anything to do with this hack but i noticed that when im logged in as a regular memeber i can veiw the thread topics like im supposed to be able to but i noticed that if i leave my mouse over the tile of the thread it displays some of the info in that post. the thing is my posts in this section are just a few lines of text so its important that they cannot see that. is there anything i can do to disable the info popup window?
Reply With Quote
  #208  
Old 03-09-2005, 08:02 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

matd62,

see if this will work....
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']));
	}
REPLACE IT WITH:
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 ]
// ================================================= \\
I don't have this hack installed on my test site so let me know if the above works. thanks
Reply With Quote
  #209  
Old 03-10-2005, 02:31 AM
rjordan's Avatar
rjordan rjordan is offline
 
Join Date: Sep 2004
Posts: 326
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am finding that if you have any secondary groups set to not be allowed to not view topics then it will deny access. This is regardless of whether or not the primary (or any other secondary) does have permission. Has anyone else seen this?

(BTW: Great catch there, matd62!)
Reply With Quote
  #210  
Old 03-10-2005, 11:15 AM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by rjordan
I am finding that if you have any secondary groups set to not be allowed to not view topics then it will deny access. This is regardless of whether or not the primary (or any other secondary) does have permission. Has anyone else seen this?

(BTW: Great catch there, matd62!)
If hack installation is correct it will work as any other vb permissions...

Primary groups are used to qualify members as a certain type, and secondary groups are used to grant permissions that are available to multiple types of members.

One YES will override all NO's.
Reply With Quote
  #211  
Old 03-10-2005, 11:29 AM
Vampyre's Avatar
Vampyre Vampyre is offline
 
Join Date: Jun 2003
Location: Down Under
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, Princeton.
Works well.
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 09:45 AM.


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.14916 seconds
  • Memory Usage 2,324KB
  • Queries Executed 25 (?)
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
  • (5)bbcode_code
  • (6)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
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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