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
  #242  
Old 05-16-2005, 08:19 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

attached is how the archives will look like when completed (not allowed to read)

notice there is no link?
the second image is the content page ... when someone tries to go to the page directly via the address bar -- they see nothing
Reply With Quote
  #243  
Old 05-19-2005, 08:35 AM
mfarmerhi mfarmerhi is offline
 
Join Date: Apr 2003
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Unless I'm mistaken
Quote:
Disable Thread Preview
To disable thread previews on forums that user cannot read content do the following edits:
FIND in functions/forumdisplay.php:
should be:

To disable thread previews on forums that user cannot read content do the following edits:
FIND in functions_forumdisplay.php

Great hack and exactly what I was looking for. Installed.

Only problem is in attempting to view the Archives I get this error:

Parse error: parse error, unexpected T_ELSE in /home/totalli/public_html/forum/archive/index.php on line 324

I, er... am doing this all by hand... er... on Word pad... and am having a hard time counting down 324 lines

I've double checked and don't see the error I made. Anyone (with a proper php editor) have a clue where I might look?

Thanks ahead of time.

~ Mark
Reply With Quote
  #244  
Old 05-19-2005, 11:16 AM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LOL ... yep spelling error

the error states you did an erroneous copy/paste ... the only way to fix this is to check your file
Reply With Quote
  #245  
Old 05-25-2005, 07:15 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

small typo in archive/index.php

FIND ALL INSTANCES OF: slash_method
REPLACE WITH: SLASH_METHOD
Reply With Quote
  #246  
Old 06-11-2005, 09:54 AM
mfarmerhi mfarmerhi is offline
 
Join Date: Apr 2003
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'd love this hack, but it's conflicting with the Text Message User on PM hack I already have installed.

I believe the conflict is coming in the inclues/init.php changes. Specifically the change in this hack:
Code:
Find:	'canthreadrate'     => 65536,
	'isalwaysmoderated' => 131072,
	'canseedelnotice'   => 262144
);

Replace with:
	'canthreadrate'     => 65536,
	'isalwaysmoderated' => 131072,
	'canseedelnotice'   => 262144,
// ================================================= \\
// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
	'gtpcanreadcontent'	=> 524288,
// == [ 00-00-2004 - GTP END ]
// ================================================= \\
);
conflicting with the change in the includes/init.php in "txt msg on pm":
Code:
$_USEROPTIONS = array(
	'showsignatures'    => 1,
	'showavatars'       => 2,
	'showimages'        => 4,
	'coppauser'         => 8,
	'adminemail'        => 16,
	'showvcard'         => 32,
	'dstauto'           => 64,
	'dstonoff'          => 128,
	'showemail'         => 256,
	'invisible'         => 512,
	'showreputation'    => 1024,
	'receivepm'         => 2048,
	'emailonpm'         => 4096,
	'txtmsgonpm'	  => 8192,
	'hasaccessmask'     => 16384,
	//'emailnotification' => 32768, // this value is now handled by the user.autosubscribe field
	'postorder'         => 65536,
);
If I change the includes/init.php file as directed in this "text message on pm" hack, it causes *everybody* (including those with access via masks) to receive the warning generated by the "allow users to read title but not posts" hack.

Anyone have a clue why the conflict is occurring; and more importantly how I could have both hacks working without the current conflict?
Reply With Quote
  #247  
Old 06-11-2005, 12:51 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the bitfields above have nothing to do with each other ... your problem is elsewhere
Reply With Quote
  #248  
Old 06-11-2005, 06:00 PM
mfarmerhi mfarmerhi is offline
 
Join Date: Apr 2003
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by princeton
the bitfields above have nothing to do with each other ...
Despite the fact that both "'canthreadrate' and 'postorder' are being assigned 65536?

Either hack works fine, when I remove the other hack.

But installing both together, causes both to stop working.

~ Mark
Reply With Quote
  #249  
Old 06-11-2005, 06:05 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

take a look at the instructions and you will see that there are not the same thing ... I don't even know why you are looking at $_USEROPTIONS
Reply With Quote
  #250  
Old 06-11-2005, 06:09 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't think he is following instructions. He is doing a search for : 65536 and is placing the code right after that. all 65536 are not the same.
Reply With Quote
  #251  
Old 06-11-2005, 06:13 PM
mfarmerhi mfarmerhi is offline
 
Join Date: Apr 2003
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by princeton
take a look at the instructions and you will see that there are not the same thing ... I don't even know why you are looking at $_USEROPTIONS
I'm looking at them because these hacks are clearly interferring with each other; because includes/init.php is the only thing that is changed in both hacks; because those are the only 2 changes I've made to includes/init.php (your hack and the other); because as a non-php/non-mysql trained person that's the only obvious thing that I see that appear to be using the same values; and finally, because both hacks work fine with the other is uninstalled.

Regardless, I admit that my conclusions that line is the conflict MAY BE WRONG.

So... any OTHER possible place to begin with in figuring out why your hack and the other hack conflict?

~ Mark
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 12:46 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.06595 seconds
  • Memory Usage 2,320KB
  • 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
  • (3)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