PDA

View Full Version : Allow Group to Read Titles / Not Content


Pages : [1] 2

Princeton
01-12-2004, 10:00 PM
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.cssAdd 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 content4
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:
// ================================================= \\
// == [ 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.

4
Disable Thread Preview
To disable thread previews on forums that user cannot read content do the following edits:
FIND in functions/forumdisplay.php:
// 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_bbc ode($thread['preview'], false, true), $vboptions['threadpreview']));
}REPLACE IT WITH:
// ================================================= \\
// == [ 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_bbc ode($thread['preview'], false, true), $vboptions['threadpreview']));
}
// == [ 00-00-2004 - GTP END ]
// ================================================= \\ 4
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

NTLDR
01-13-2004, 10:11 PM
Good to see proper use of bit fields :)

I'd just like to point out that quickly looking at this I can see three easy ways of getting around it: 1) Use print thread to view the entire thread without registering 2) use the archive to view the entire thread without registering 3) use threaded/hybrid mode if enabled. My apologies if any of the above 3 arn't true, but they all spring to mind after glancing at the code ;)

Princeton
01-14-2004, 01:09 AM
Good to see proper use of bit fields :)

I'd just like to point out that quickly looking at this I can see three easy ways of getting around it: 1) Use print thread to view the entire thread without registering 2) use the archive to view the entire thread without registering 3) use threaded/hybrid mode if enabled. My apologies if any of the above 3 arn't true, but they all spring to mind after glancing at the code ;) thank you ... I completely forgot about the printthread and archives.
I have updated the file and instructions. The new version is v.1.2.

I do not use nor do I have access to thread/hybrid. (I completely removed the templates from my site.) This will have to be tested by someone who uses these features.

If anyone uses this hack can you confirm that it works?

Boofo
01-14-2004, 02:34 AM
What do we do if we have another hack installed already using that bit field? And can this be done on a per forum basis? There are a couple of forums I need left open for unregistered users to view the messages.

Princeton
01-14-2004, 02:41 AM
multiply the last bitfield value by 2 ... another way to look at it is add up all the previous numbers.

this is an inclusion to the existing permission system ... yes, you can use on a per forum basis. (that's the whole idea)

follow the direction on the file (last section)

Boofo
01-14-2004, 02:58 AM
multiply the last bitfield value by 2 ... another way to look at it is add up all the previous numbers.

this is an inclusion to the existing permission system ... yes, you can use on a per forum basis. (that's the whole idea)

follow the direction on the file (last section)
How high can the bit fields actually go then? Is there a limit?

NTLDR
01-14-2004, 10:32 AM
To prevent thread/hybrid and linear all with one edit just place the showthread.php block of code above:

if ($threadedmode == 0)

That should work I think :)

@Boofo: I'd assume the limit is restricted by the upper limit that PHP can use on your platform (around 2147483647 for integers, no idea if it will work with floats as I haven't tested).

Princeton
01-14-2004, 12:27 PM
To prevent thread/hybrid and linear all with one edit just place the showthread.php block of code above:

if ($threadedmode == 0)

That should work I think :)

@Boofo: I'd assume the limit is restricted by the upper limit that PHP can use on your platform (around 2147483647 for integers, no idea if it will work with floats as I haven't tested).
duh! thank you. I don't know what I was thinking.

I just added the threaded/hybrid mode back onto my site and everything is working. I like how the hybrid mode looks like ... maybe I'll leave it as an option for my members.

Boofo
01-14-2004, 01:09 PM
@Boofo: I'd assume the limit is restricted by the upper limit that PHP can use on your platform (around 2147483647 for integers, no idea if it will work with floats as I haven't tested).
How would you use floats?

NTLDR
01-14-2004, 01:13 PM
If a int is to big to be an int then it automatically becomes a float :)

Littlebit
01-14-2004, 02:34 PM
Thanks Princeton! I had just inquired about this very thing on vb.com! View Posts Usergroups Option (http://www.vbulletin.com/forum/showthread.php?t=92160)

Installing now :)

gmarik
01-14-2004, 07:35 PM
Jesus - it's too much hacking - is there any quicker way?

Princeton
01-15-2004, 02:40 PM
Jesus - it's too much hacking - is there any quicker way? Yep, it's mostly one line edits. The archive, printthread, and showthread have to be modified for this to work as intended.

You can always take a short cut - do the first few steps and add a conditional into your postbit to allow GROUP. However, this defeats the purpose as the system will still query the database.

My goal is usability and optimization nothing less.

HiDeo
01-15-2004, 04:34 PM
Very good hack, I'll install soon :D

lange
01-16-2004, 12:03 AM
The Custom Permissions is not working for registred members.


By example, I can't get:

Can View Forum Yes

Can View Others' Threads Yes

Can See Deletion Notices Yes

Can Search Forum Yes

Can Use Email to Friend Yes

Can Download Attachments Yes

Post Permissions:
Can Post Threads No

Can Reply to Own Threads No

Can Reply to Others' Threads No

Always Moderate This Group's Posts No

Can Upload Attachments No

Can Rate Threads Yes

Group can read content? No (but I want 'Yes'. It is always enable to No)

Princeton
01-16-2004, 01:58 AM
can you be more specific?
can you modify the field in admincp/usergroup.php?s=&do=edit&usergroupid=2?
can you modify the field in admincp/forumpermission.php?do=quickforum?

lange
01-16-2004, 03:05 AM
Can you modify the field in admincp/usergroup.php?s=&do=edit&usergroupid=2?

Yes


Can you modify the field in admincp/forumpermission.php?do=quickforum?

No I can't modify the Group can read cotnent ? It is enable to 'No'. I can't change it to Yes.

Princeton
01-16-2004, 03:37 AM
try this fix ...
Above in includes/adminfunctions_forums.php; (around LINE 185)
I have canreadcontent it should be gtcanreadcontent. Hopefully, that will fix your problem.

PS. I just updated the attachment to v.1.5

lange
01-16-2004, 04:27 AM
Checked the permissions and all is OK now (forums & subforums).

This hack should be include in next release. It's a must.

Click install


Thx Princeton

esfron
01-17-2004, 12:58 PM
I installed it and it works fine for me! Clicked Install.

Thanks

Megatekno
01-17-2004, 03:49 PM
Hello,

This solution adorned me simple assé for check resulted.

In the file includes / functions_forumlist.php has the line 161 to replace

if (!($forumperms & CANVIEW) OR !($forumperms & CANVIEWOTHERS))

By

if (!($forumperms & CANVIEW))

In the file forumdisplay.php has the line 454 to replace

if (!($forumperms & CANVIEWOTHERS))

By

if (!($forumperms))

Can it work on the basis of forum by forum, that is we can activate or deactivate such or such forum by perissions, as it was the case for version vb2.x

Princeton
01-17-2004, 03:57 PM
huh?

yes, it works on a per forum basis

rms10
02-12-2004, 12:58 AM
Nice hack:) What would we have to change to keep them from reading the titles too?

Princeton
02-12-2004, 01:24 AM
you don't need this hack to achieve what you want ... look into vb's default permissions and prevent group from viewing the forum

rms10
02-12-2004, 01:12 PM
Actually, I do:)
I have a situtation where hazard report information is placed in a forum. The thread may affect all the groups or a combination of those groups. If a hazard does not affect a group it is important to keep the existence of the title and information from them.

If I prevent groups from just seeing the forum as you stated it would require me to have multiple forums which could get out of hand. ie.. 300 reports would equal 300 forums.

If I was able to hide the thread using your hack then I would only have 1 forum for all groups to go to and the groups would only be able to view titles and threads they are given access too.

BTW thanks for the fast reply :)

Princeton
02-12-2004, 10:45 PM
You do not need a hack to accomplish what you want. You can prevent a group from viewing threads created by others using vb's default permissions system.

If this is not what you where asking there is no need to continue reading.:)

For example, if userA, who belongs to groupA, creates a thread it does not mean that userB, who belongs to groupB, will have access to view the thread. (vice-versa)

You control this by setting permissions to specific usergroups for specific forums.

The usergroup section in your vb cpanel will allow you to set DEFAULT settings permissions per group. However, you can change the permissions per group/ per forum by going into the Forums & Moderators / Forum Permissions and modify permissions for each group as you see fit.

rms10
02-13-2004, 02:54 AM
Thanks for the response. I can see why we have the confusion. I thought the admin could post a thread and then dictate who could see it. What I am lookin for is something that will alow me to post threads in a forum that 6 different groups have access too. With said threads I need to be able to let from 1 to 6 groups see each one depending on status given to the thread. Group 1 and 2 might be able to see thread 1 for instance while group 1, 3 and 6 might see thread 2 and so forth.

Thanks again for taking the time to respond :)

Princeton
02-13-2004, 04:13 PM
If I understand this correctly, you want to determine who gets to view thread upon submitting a new thread (based on the status poster chooses)?

Since you have "200 reports", it is wise to group/organize. One forum will give you a headache in the long run.

What I recommend ....
1. Since you have 6 groups, I suggest creating 6 different forums. Set the proper permissions for each group.
2. Create a new FORM (similar to newthread form) that will use the "status" value as a replacement for forumid.
for example
<select name="f" tabindex="1">
<option value="33">status green</option>
<option value="34">status red</option>
</select>
if the thread poster chooses green the thread will be submitted into forumid 33

rms10
02-14-2004, 06:28 PM
Thanks princeton :)

That is really not an option for me because the designated groups must be able to read and respond to the posts made by anyone that has access to the thread

Snappa
03-26-2004, 12:37 AM
Jesus - it's too much hacking - is there any quicker way?

lmao!!!

sabret00the
04-03-2004, 02:15 PM
is this/can this be used to just "override the visiable but must be registered to view threads" option or is it all hardcoded?

the reason i ask is because i don't want unactive usergroups viewing the threads either.

sabret00the
04-03-2004, 02:17 PM
also what's the difference between this and this one (https://vborg.vbsupport.ru/showthread.php?t=59859&page=1&pp=40)?

Princeton
04-03-2004, 04:58 PM
this hack utilizes vb's forum permissions system
It will allow you to enable view of showthread to specific usergroups and still display threadbit to everyone.

For example, if you have Premium Members (donations) and one benefit of being a Premium Member is that they get access to specific areas. Well, this hack will allow users to "window shop" view what is in these areas before becoming a Premium Member. This hack can be used to convert Registered Members into Premium Members.

esfron
04-28-2004, 09:06 PM
Is it working on 3.0.1 ?

Princeton
04-28-2004, 09:11 PM
I have yet to update my files to 3.0.1 so I cannot say. :(

sorry

sabret00the
05-08-2004, 02:03 PM
is this/can this be used to just "override the visiable but must be registered to view threads" option or is it all hardcoded?

the reason i ask is because i don't want unactive usergroups viewing the threads either.just to clarify, it will add a new option in the http://site/forums/admincp/resources.php?

Princeton
05-08-2004, 02:47 PM
yes, it does

keep in mind that I have not updated this to the latest GOLD release ...

TundraSoul
05-12-2004, 04:33 AM
The most useful hack I've installed in a long time. Good job!

Princeton
05-12-2004, 12:47 PM
TundraSoul,
thank you ... did you install this hack on vb's latest version?

MaxScript
05-15-2004, 08:38 PM
i made the edits, i'll upload them tonight ....

Princeton
05-15-2004, 09:27 PM
thanks MaxScript ... appreciate it. I've been busy working on a few projects. :up:

TundraSoul
05-19-2004, 06:38 AM
I'm still just using regular 3.0

TundraSoul,
thank you ... did you install this hack on vb's latest version?

sabret00the
06-27-2004, 01:58 PM
this working fine on 3.0.1?

Princeton
06-27-2004, 02:59 PM
yes, it works fine in 3.01
I will update the file by the end of this week. (Only minor changes.)

sabret00the
06-28-2004, 12:21 PM
would you advice me to wait till then?

Princeton
06-28-2004, 01:22 PM
No, you do not have to wait ... the changes are minimal.
You've been here long enough to understand what needs to be done.

It's mostly just rewriting the instrutions/location of lines.

sabret00the
06-28-2004, 04:25 PM
nice one, thanks princeton :)

sabret00the
06-29-2004, 11:02 PM
arghhhhhh i thought this was on a per forum basis rather than across the whole boards, any plans to add that to this princeton?

Princeton
06-29-2004, 11:05 PM
it is on a per forum basis -- you need to go into FORUM PERMISSIONS and add/edit your permissions for that "forum"

You can edit...
USERGROUP permissions & FORUM permissions

sabret00the
06-29-2004, 11:10 PM
i just noticed, sorry about that :o

StoneHalo
07-01-2004, 09:17 AM
Trying to install this hack but can't find the following:


++++++++++++++++++++++++++++++++++
FIND IN includes/adminfunctions_forums.php; (around LINE 185)
print_yes_no_row($vbphrase['always_moderate_posts'], 'forumpermission[isalwaysmoderated]', $forumpermission['isalwaysmoderated'], $extra);
print_yes_no_row($vbphrase['can_upload_attachments'], 'forumpermission[canpostattachment]', $forumpermission['canpostattachment'], $extra);
print_yes_no_row($vbphrase['can_rate_threads'], 'forumpermission[canthreadrate]', $forumpermission['canthreadrate'], $extra);
REPLACE WITH:
print_yes_no_row($vbphrase['always_moderate_posts'], 'forumpermission[isalwaysmoderated]', $forumpermission['isalwaysmoderated'], $extra);
print_yes_no_row($vbphrase['can_upload_attachments'], 'forumpermission[canpostattachment]', $forumpermission['canpostattachment'], $extra);
print_yes_no_row($vbphrase['can_rate_threads'], 'forumpermission[canthreadrate]', $forumpermission['canthreadrate'], $extra);
// ########## GT OPTION ###########
print_yes_no_row($vbphrase['can_read_content'], 'forumpermission[gtcanreadcontent]', $forumpermission['gtcanreadcontent'], $extra);
// ########## END GT OPTION #######
++++++++++++++++++++++++++++++++++
My includes/adminfunctions_forums.php only has 141 lines!

Princeton
07-01-2004, 12:34 PM
Please read the instructions and past post carefully...
As of June 23rd adminfunctions_forums is 207 lines unmodified.

FIND:
print_yes_no_row($vbphrase['can_rate_threads']

ADD BELOW:

// ================================================= \\
// == [ ALLOW GROUP TO READ TITLES - GTP BEGIN ]
print_yes_no_row($vbphrase['can_read_content'], 'forumpermission[gtcanreadcontent]', $forumpermission['gtcanreadcontent'], $extra);
// == [ 07-01-2004 - GTP END ]
// ================================================= \\

Noiz Pollution
07-02-2004, 02:17 PM
yes, it works fine in 3.01
I will update the file by the end of this week. (Only minor changes.)
Anything new with this?

Princeton
07-02-2004, 08:19 PM
Instructions have been updated for vB 3.01

enjoy :)

NOTE: This is only an "instructions update" - if you already have this hack installed do not worry.

bigreefer
07-07-2004, 09:39 PM
Great Hack,

i use VB 3.0.3 and istalled this hack.
sience I can?t read any Postings. I set in Usergroup "ADMIN" "Can read Contet" to Yes and also in the Forum permission. But if I click a Thread i can?t show it.

Now i can?t show any threads in my Forum :(

Can you help me ?

bigreefer
07-09-2004, 04:43 AM
Hello, nobody can halp me ?

H2k
07-09-2004, 07:02 AM
I have install this hack ... there is no group can enter any forum i try to go to the Mang Group and i modify them and i go to Forums pormiss and still the same there is no group even the admin

Thankyou

bigreefer
07-11-2004, 08:07 AM
Hello ?
Plz. help. I must install this hack or my forum can´t go online :´(

Snatch
07-11-2004, 12:28 PM
I have the same Probelm. I placed all groups to "yes can read" and also the forum rights to but nobody can the Threads read.

I used this hack in VB 3.0.1 without
Problems but in 3.0.3 it will not work.

Princeton
07-11-2004, 05:11 PM
sorry, guys -- just got back from a hard-drive crash.

Things I have to do before I post a new version:
1. I have to download 3.03 (downloading now)
2. I have to compare new files with my current files.

Once I have this complete I will update the instructions.

Snatch
07-11-2004, 06:06 PM
sorry, guys -- just got back from a hard-drive crash.

Things I have to do before I post a new version:
1. I have to download 3.03 (downloading now)
2. I have to compare new files with my current files.

Once I have this complete I will update the instructions.


Ups HDD-crash. that is not god.
Sorry for stressing you.

I pleased to get the 3.0.3 hack :)

Greets Snatch

luroca
07-11-2004, 07:16 PM
Install in 3.0.3 Ok :)

Princeton
07-11-2004, 09:22 PM
Instructions have been updated for version 3.03

If you have this hack installed and it's given you problems, I suggest starting from scratch.
Do not take no shortcuts as you will have problems.

This version has been tested by me and a few people with success.

For those who wanted images (couldn't understand what this hack does) --- I have uploaded a few images.

I recommend you do not remove the
// ================================================= \\
// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
// replaced code gets commented not removed

// == [ 00-00-2004 - GTP END ]
// ================================================= \\
comments. This will help you later when you have to upadate your files.

wrongful
07-12-2004, 04:08 PM
I am sure that this part is just a template edit, but how would I make it so that if a user doesn't have permissionto view thread content, the title of the threads on showthread would only appear as text, without their hyperlinks.

Princeton
07-12-2004, 04:50 PM
If they don't have permission the "user" will not be able to see the title in showthread.

You probably mean removing the link from threadbit and forumhome_lastpostby template.
If this is what you mean you can use:

<if condition="($forumperms & GTPCANREADCONTENT)">
{if can read}
<else />
{if cannot read}
</if>


I hope that helps.
Oh, by the way - if you do this the end-user may become confused. eg. they will probably think that something is wrong with your site

I recommend adding a cue or a short message if you decide to do this.

The default way at least gives them some kind of feedback. Thus, they know that they do not have the proper permissions.

Noiz Pollution
07-14-2004, 08:37 PM
This is working great on my test forums, 1 question though (I haven't seen it asked in the thread so far), does this allow search engine bots to access threads? And if not how can I grant them access? I'd like google to be able to index the pages and the content but only allow users to read the threads if they're registered.

Cheers,
Robert

Noiz Pollution
07-16-2004, 03:09 PM
*bump*

Princeton
07-16-2004, 03:24 PM
it could be possible I guess...

Find a script/hack that will temporarily place "users" in usergroups by IP or user agent.

Noiz Pollution
07-16-2004, 04:17 PM
it could be possible I guess...

Find a script/hack that will temporarily place "users" in usergroups by IP or user agent.
I was thinking more of altering the if statements which show the no permission pages, I'm just not sure what to add to them.

Princeton
07-16-2004, 04:33 PM
yes, that's possible - do a match for useragent - if (preg_match(useragent)) allow;
If you find something that works post it here ... I'm sure others may find it useful.

one thing you have to think about is that google displays "cached" pages; thus, you have to prevent google from cacheing your site.

Noiz Pollution
07-18-2004, 09:49 PM
Hmmm, I can't see caching being a huge issue, I know I myself never bother looking at cached pages and don't imagine a huge percentage of other users do either unless they're totally determined to access information only available in 1 place.

As for the if statement, I'm not entirely sure how I'd go about that without some kind of example, my PHP knowledge is quite limited.

Cheers,
Robert

Noiz Pollution
07-19-2004, 03:20 PM
I tried changing// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
if (!($forumperms & GTPCANREADCONTENT)
{
print_no_permission();
}
// == [ 00-00-2004 - GTP END ]
// ================================================= \\to this// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
if (!($forumperms & GTPCANREADCONTENT) OR !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si", $_SERVER['HTTP_USER_AGENT']))
{
print_no_permission();
}
// == [ 00-00-2004 - GTP END ]
// ================================================= \\after seeing the useragent details in [this thread (https://vborg.vbsupport.ru/showthread.php?t=59859)] but I noticed that the inktomi spider was still being denied access when it hit showthread.php, any ideas?


Cheers,
Robert

Princeton
07-19-2004, 04:16 PM
I'm not sure why it wouldn't ... but try using the html entity of @ which is @

Another thing ... if you are going to bypass GTPCANREADCONTENT for search engines you should only allow it within the ARCHIVES.

FYI
I don't recommend this as it is easy to circumvent.

nintendo
07-20-2004, 01:47 AM
Where can I get the instructions for 3.01?

Noiz Pollution
07-20-2004, 12:09 PM
I'm not sure why it wouldn't ... but try using the html entity of @ which is @

Another thing ... if you are going to bypass GTPCANREADCONTENT for search engines you should only allow it within the ARCHIVES.

FYI
I don't recommend this as it is easy to circumvent.
I've tried this, just waiting for a bot to turn up although I'm not holding my breath.


Cheers,
Robert

Princeton
07-20-2004, 03:39 PM
Where can I get the instructions for 3.01? the instructions are similar just some minor modifications - you can probably install this with no problems

Princeton
07-20-2004, 04:02 PM
Yea, I don't think it will do anything. But, if the "modification" works on the other hack it will work with this hack.

Are you sure inktomi did not 'index' the showthread page? I recommend waiting for a few weeks to really "see" if the search engines are able to index showthread.

Without actually testing your modification I cannot 'see' what is wrong -- since, I do NOT think this modification is "safe" - I cannot be of much help to you.

However, I do wish you luck with your small modification.
I've tried this, just waiting for a bot to turn up although I'm not holding my breath.


Cheers,
Robert

Ronso Rage
07-30-2004, 07:07 PM
Just a small question, i am needing a hack to disallow people from viewing certain threads in a forum, not dependant on usergroup as they span across several usergroups and all will have certain threads they won't be allowed to see, so if i add a secondary usergroup to them and exclude this one, will it exclude them from seeing the thread (including admins and for the purposes of the game it is for a superadmin (myself, that is))

wrongful
07-30-2004, 08:03 PM
Just curious:

I have about 16 usergroups and over thirty individual forums. Although I have the hack installed for a while now, I am still running into situations where I missed a usergroup permission to allow them to see thread content in a forum they are supposed to see.

What I need is a query to set all users to be able to see all content in all forums, and then from there I will go and set the permissions.

Princeton
07-30-2004, 08:54 PM
Just a small question, i am needing a hack to disallow people from viewing certain threads in a forum, not dependant on usergroup as they span across several usergroups and all will have certain threads they won't be allowed to see, so if i add a secondary usergroup to them and exclude this one, will it exclude them from seeing the thread (including admins and for the purposes of the game it is for a superadmin (myself, that is)) this hack is per forum/usergroup; not per thread

I believe there is a "Private Thread" hack

Princeton
07-30-2004, 09:32 PM
Just curious:

I have about 16 usergroups and over thirty individual forums. Although I have the hack installed for a while now, I am still running into situations where I missed a usergroup permission to allow them to see thread content in a forum they are supposed to see.

What I need is a query to set all users to be able to see all content in all forums, and then from there I will go and set the permissions. try something like:
[USE AT OWN RISK - NOT TESTED ]

$query = "UPDATE " . TABLE_PREFIX . "user SET options = options - $_FORUMPERMISSIONS[gtpcanreadcontent] WHERE options & $_FORUMPERMISSIONS[gtpcanreadcontent]";
OR
$query = "UPDATE " . TABLE_PREFIX . "user SET options = options - $_FORUMPERMISSIONS[gtpcanreadcontent] WHERE NOT options & $_FORUMPERMISSIONS[gtpcanreadcontent]";

I'm not sure if it works.

I just took some code from /admincp

nando415
08-02-2004, 09:55 PM
good hack. thanks

blubber12
08-18-2004, 04:06 AM
'canthreadrate' => 65536,
'isalwaysmoderated' => 131072,
'canseedelnotice' => 262144
// ================================================= \\
// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
,'gtpcanreadcontent' => 524288 // VIEW THREAD
// == [ 00-00-2004 - GTP END ]
// ================================================= \\
);

This particular replacement in init.php caused a big problem for me...especially since my glasses are not as strong as they should be LOL. If you notice, you have the comma before the gpt code, not after the last number above. This kept giving me parse errors until I finally found the damn little thing LOL.

Princeton
08-18-2004, 01:17 PM
I'm glad you got it to work. :D

The comments exist to

give you an indication of where modifications have taken place.
help when you are upgrading your vB files.
easily search for modified code.

blubber12
08-18-2004, 04:48 PM
I didn't mean the comments, I meant the comma...in the wrong place :)

lange
08-19-2004, 07:51 AM
Working on 3.0.3. It's a great hack. Clicks install.

Thanks

cinq
09-15-2004, 01:45 AM
Will this prevent spidering ?

Princeton
09-15-2004, 02:06 PM
Yes, It will prevent spidering of the contents of showthread.php.
It's part of the permission-based system so whoever you give "permission" to VIEW will have access to read contents.

Lionel
09-26-2004, 05:00 AM
I am still using 3.01. I installed, tested and it is working. There was a small discrepancy.

it says in usergroup.php to look for:

'canusesignature' => 1,
'cannegativerep' => 1,
'canuserep' => 1,

in my copy I am missing the last two above line and have

'canmodifyprofile' => 1, 'canthreadrate' => 1, 'canpostattachment' => 1, 'canpostpoll' => 1, 'canvote' => 1, 'canwhosonline' => 1, 'allowhidden' => 1, 'showeditedby' => 1, canseeprofilepic' => 1,
'canusesignature' => 1,

so I placed the line below right after and it works.

// ================================================= \\
// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
'gtpcanreadcontent' => 1
// == [ 00-00-2004 - GTP END ]
// ================================================= \\

Now I tried to install the vbookie hack which instructs to place
like below (which is the same as in my version)


'canmodifyprofile' => 1, 'canthreadrate' => 1, 'canpostattachment' => 1,
'canpostpoll' => 1, 'canvote' => 1, 'canwhosonline' => 1,

// +++ vBookie
'canpostvbookieevent' => 1, 'caneditothersvbookieevents' => 1, 'canbet' => 1,
// --- vBookie

so the whole thing looks like that

// set default yes permissions (bitfields)
$ug_bitfield = array(
'showgroup' => 1, 'canview' => 1, 'canviewmembers' => 1,
'canviewothers' => 1, 'cagetattachment' => 1, 'cansearch' => 1,
'canmodifyprofile' => 1, 'canthreadrate' => 1, 'canpostattachment' => 1,
'canpostpoll' => 1, 'canvote' => 1, 'canwhosonline' => 1,

// +++ vBookie
'canpostvbookieevent' => 1, 'caneditothersvbookieevents' => 1, 'canbet' => 1,
// --- vBookie
'allowhidden' => 1, 'showeditedby' => 1, 'canseeprofilepic' => 1,
'canusesignature' => 1,
// ================================================= \\
// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
'gtpcanreadcontent' => 1
// == [ 00-00-2004 - GTP END ]
// ================================================= \\
);

After I did, the two hacks started to interfere with each other, not responding to the selected radio buttons, disabling each other randomly.

Please, do you have the version 3.01 for usergroup.php?
I also posted the complete line in vbookie forum.
https://vborg.vbsupport.ru/showthread.php?p=556044#post556044

Help!

Lionel
09-26-2004, 02:13 PM
Looks like I got it. It was a matter of both using the same bitfield. I simply doubled the Allowed Hack bitfield. At least the permissions are holding.

Princeton
09-26-2004, 04:06 PM
thanks for the update

Lionel
09-26-2004, 04:11 PM
And thank you for the hack. That solves a lot of things for me.

M.C.
09-28-2004, 05:10 PM
sorry if i missed it but if thread preview enabled you can read a bit of first post content even if "Group can read content?" - NO! Can you fix it please! ;)

Princeton
09-28-2004, 09:18 PM
the idea behind this is to give viewers a small peak of what is inside--the title and preview can provide this ...

modify the character limit for thread preview if you want it removed

wma
10-13-2004, 10:05 PM
Hi,

thx for the finest hack i have build in :-)

in the first test cases it works fine and bring me more flexibility.

but, how can i select a seperately error messages, if a "non read user" want to read topics from a closed forum? i want to put some urgent information on this site, how a user can get access to the closed forum. so i dont want to take the standard error page.

is there any way ?

have thanks !

tom :banana:

amcd
10-17-2004, 08:37 PM
installed on 3.0.3 Gold

works like a charm

deb0
10-25-2004, 10:38 PM
I am almost finished installing this hack, when clicking usergroup manager, I get this error

"
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in E:\hshome\wiltechs\afrochat.net\forums\admincp\use rgroup.php on line 127"

Here is what I have on line 127 in Bold and Italics:

// == [ 00-00-2004 - GTP END ]
// ================================================= \\
[I]'shoutpost' => 1,
'shoutedit' => 1,
'shoutdelete' => 1,

Princeton
10-25-2004, 11:14 PM
Parse Errors are usually caused by something that you have overlooked. For example, a comma, semi-colon, closing bracket, etc is missing or out of place.

I see that you have other hacks installed .. this may be the reason why you are having trouble.

To find your error, I recommend that you go over your code and make sure everything is exactly the way I have it on the hack instructions.

I'm guessing that your problem is in the init.php file.

deb0
10-25-2004, 11:16 PM
I fixed it! Error in ini.php and usergroup.php.

Even though it was terribly frustrating, I don't feel justified in complaining since so much modding had to be done.

Great job dude! Install!

Princeton
10-25-2004, 11:16 PM
thanks for the update :)

Watson
10-29-2004, 01:00 AM
thanks for this hack, does wonders for me forums :D

* Watson installs

Princeton
10-31-2004, 07:13 PM
thanks for the feedback Watson :)

deb0
11-03-2004, 02:04 AM
When logged in as a non administrator, I can access about 3 threads, then I get access denied with a user account. I also noticed that when this is happening, the user's ip adress is listed twice, once as the username and the other as guest.

Princeton
11-03-2004, 09:08 PM
I can't help without a url.

Recheck your permissions and make sure it's set right.

amcd
11-06-2004, 03:39 AM
I tried changing// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
if (!($forumperms & GTPCANREADCONTENT)
{
print_no_permission();
}
// == [ 00-00-2004 - GTP END ]
// ================================================= \\to this// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
if (!($forumperms & GTPCANREADCONTENT) OR !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si", $_SERVER['HTTP_USER_AGENT']))
{
print_no_permission();
}
// == [ 00-00-2004 - GTP END ]
// ================================================= \\after seeing the useragent details in [this thread (https://vborg.vbsupport.ru/showthread.php?t=59859)] but I noticed that the inktomi spider was still being denied access when it hit showthread.php, any ideas?


Cheers,
Robert


it should be "AND" instead of "OR" in the follwing line:

if (!($forumperms & GTPCANREADCONTENT) OR !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si", $_SERVER['HTTP_USER_AGENT']))

am i right?

i changed the line w/o thinking, and promptly shut off access to everybody.

Zacharicus
11-30-2004, 10:25 PM
Message removed..

Princeton
12-01-2004, 01:05 AM
I'm off on a rocky start.. The following code doesn't exist in my includes/init.php file!

'canthreadrate' => 65536,
'isalwaysmoderated' => 131072,
'canseedelnotice' => 262144
);
you removed the message..
I'm guessing that you found it. :up:

wma
12-01-2004, 09:06 PM
Hi,

thx for the finest hack i have build in :-)

in the first test cases it works fine and bring me more flexibility.

but, how can i select a seperately error messages, if a "non read user" want to read topics from a closed forum? i want to put some urgent information on this site, how a user can get access to the closed forum. so i dont want to take the standard error page.

is there any way ?


have thanks !

tom :banana:

hallo again,

is there no way for a seperate error site ?

thanks
tom

amcd
12-02-2004, 01:42 AM
i havent tried this, so dont take this at face value, but i think this should work

in showthread.php, change

if (!($forumperms & GTPCANREADCONTENT))
{
print_no_permission();
}


to


if (!$forumperms)
{
print_no_permission();
}
elseif (!GTPCANREADCONTENT)
{
print_my_no_permission();
}


You will have to write this new function, "print_my_no_permission" by yourself. You can take inspiration from the default vBulletin function.

Similar changes will have to be made to showpost, archive and printthread.


Hope this helps.

Princeton
12-03-2004, 12:43 PM
hallo again,

is there no way for a seperate error site ?

thanks
tom
Download the new version ... I made the necessary changes for you to have your own personal message. enjoy:D

Princeton
12-03-2004, 01:24 PM
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:
// ================================================= \\
// == [ 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.

Omega Prime
12-14-2004, 07:22 PM
I installed this hack and seem to have the following issue (it's probably a very minor thing I'm overlooking):

I have a few forum which I'd like to show the threads and not the titles. In the admincp, I have the forum permissions set so that guests can see the forum and titles, but I set the "can see content" to no. For whatever reason, it still shows the content, even when the option was set to no. When I edit the guest usergroup to disallow thread viewing, all threads are then invisible to guests.

Anyone know what I'm overlooking? I'm sure it's a very simple thing that I didn't notice...

Princeton
12-14-2004, 09:18 PM
You mean show title NOT content ???
This hack displays title ... content is displayed when proper permissions are given.

You need to set your Group can read content? setting in USERGOUP MANAGER (global settings) and FORUM PERMISSIONS MANAGER (individual forum settings).

cinq
12-15-2004, 07:33 AM
Just to confirm, this hack can let you allow specific usergroups to only view titles of the threads ( and not the contents ) in all forums ?

Princeton
12-15-2004, 12:07 PM
this hack will show titles to everyone in forumdisplay.php but not content in showthread.php ...

you can prevent people from seeing the title (in forumdisplay) by using conditionals (I believe it's posted somewhere on previous posts)

Omega Prime
12-15-2004, 12:36 PM
You mean show title NOT content ???
This hack displays title ... content is displayed when proper permissions are given.

You need to set your Group can read content? setting in USERGOUP MANAGER (global settings) and FORUM PERMISSIONS MANAGER (individual forum settings).

The attachements show what I'm talking about. I have the usergroups set so they can see the threads, but without content (since when I set it to "no" for viewing threads, the entire forum appears empty). For a per-forum basis, I have it so only a few forums appear empty, while the others are open to anyone. When I set it so guests can view the thread title but not content (which I believe is the purpose of this hack), I can still view the forums that I'm trying to deny viewing the threads themselves.

cinq
12-15-2004, 12:50 PM
this hack will show titles to everyone in forumdisplay.php but not content in showthread.php ...

you can prevent people from seeing the title (in forumdisplay) by using conditionals (I believe it's posted somewhere on previous posts)

No, i want everyone to see the titles ( thats the whole point of window shopping aint it :D ).
What I mean is all I have to do is just set to allow certain usergroups ( which i want to allow access to see the content ) to be able to see content , yes ?
I dont want to have to do it for every single forum but across the board.

For eg. for all the forum sections on my board, all can see titles, but i only want the registered folks to be able to see content of all threads.

Can this be done ?
Sorry if this sounds silly, am rather confused after reading all the posts in this thread.

Princeton
12-15-2004, 12:53 PM
(since when I set it to "no" for viewing threads, the entire forum appears empty) huh??
When I set it so guests can view the thread title but not content (which I believe is the purpose of this hack), I'm having a hard time grasping what you are trying to say.
Can you provide a url to your site; the forum in question, etc??

This hack will display showthread content if a user has permission. It has nothing to do with forumdisplay.php 'titles'.
threads = forumdisplay.php (title will show to everyone)
content = showthread.php (will show only if user has permission)

Have you copied any code from previous posts? If so, please reinstall without any changes.

Princeton
12-15-2004, 12:54 PM
No, i want everyone to see the titles ( thats the whole point of window shopping aint it :D ).
What I mean is all I have to do is just set to allow certain usergroups ( which i want to allow access to see the content ) to be able to see content , yes ?
I dont want to have to do it for every single forum but across the board.

For eg. for all the forum sections on my board, all can see titles, but i only want the registered folks to be able to see content of all threads.

Can this be done ?
Sorry if this sounds silly, am rather confused after reading all the posts in this thread.
yes, thats exactly what this hack is for --> "window shopping"

cinq
12-15-2004, 01:09 PM
Thanks again princeton, will install it later ! :D:D

Omega Prime
12-16-2004, 12:34 AM
huh??
I'm having a hard time grasping what you are trying to say.
Can you provide a url to your site; the forum in question, etc??

This hack will display showthread content if a user has permission. It has nothing to do with forumdisplay.php 'titles'.
threads = forumdisplay.php (title will show to everyone)
content = showthread.php (will show only if user has permission)

Have you copied any code from previous posts? If so, please reinstall without any changes.

I haven't used any additional coding other than what's in the instructions. What I've been trying to say is that I'm trying to do what this hack is supposed to allow ("window shopping") in certain forums, yet the forums which I'd like to disallow showthread viewing still show the content even when I change "can view content?" to no.

Princeton
12-16-2004, 01:02 AM
I haven't used any additional coding other than what's in the instructions. What I've been trying to say is that I'm trying to do what this hack is supposed to allow ("window shopping") in certain forums, yet the forums which I'd like to disallow showthread viewing still show the content even when I change "can view content?" to no.
please provide me with a url and the forum in question

Roxie
12-16-2004, 07:25 AM
Is there a way to add a message into the beginning of all threads created in certain forums to prevent message previewing?

For instance, when guests view my premium forums they can do a message preview. I would like for a message to be attached at the top of the first post of all threads created in that forum. Ex: This message was posted in a premium forum and contains private information. Sharing this message with non-premium members violates our terms of service.
And then the message would continue.

That way, guest previewing would only see the standard message and not the real one.

Make sense? Possible?

cinq
12-16-2004, 07:53 AM
Ok just installed this but I think the instructions are not very clear.
The file edits went fine, I am refering to the last bit ( all can be done in Admincp bit )

2 things :

Firstly. for the custom no permission error, perhaps you should mention changing the phrase
gtp_cannot_read to suit your personal needs.

Secondly, for this section :

Upon completion, you must set this option to "Yes" for each USERGROUP that exists. (This will allow everyone to view contents of showthread.php.)

You must update each existing usergroup for this to take effect or they will not be able to see showthread.php

1. Enter "USERGROUPS/USERGROUP MANAGER" found in vB Control Panel
2. Edit each group - check YES on "Group can read content?"
3. Update each group by pressing the UPDATE button found at the bottom.

Setting every usergroup's 'Group can read content' setting to YES basically makes everything readable ain't it ?
Perhaps you should mention, set this setting to NO if you do not want that particular usergroup access to read the content in all the forums ?

Just off the top of my head, unless I failed to understand this hack properly.
:)

cinq
12-16-2004, 11:09 AM
Hmm now I am confused again, are we supposed to set the forum permission bit AS WELL ?

Some of my registered members are reporting getting the error ( despite setting in the usergroup permissions for registered users to allow them to see the content ).

:(

Princeton
12-16-2004, 11:23 AM
Your'e assuming that people need a helping hand every step ...
I'm assuming that people will know what to do (even if they take an educated guess).

I like your suggestion so I will change the instructions as followed:
Upon completion, you must set your desired setting for each USERGROUP that exists.
"YES"--will allow users to view contents of showthread.php.
"NO"--will NOT allow users to view contents of showthread.php.

You must update each existing usergroup for this to take effect or they will not be able to see showthread.php

1. Enter "USERGROUPS/USERGROUP MANAGER" found in vB Control Panel
2. Edit each group - check YES on "Group can read content?" to allow members to view content; check NO to NOT ALLOW members to view content.
3. Update each group by pressing the UPDATE button found at the bottom.

Princeton
12-16-2004, 11:32 AM
Here's an example of how this 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

cinq
12-16-2004, 11:41 AM
So if on my boards, I want ALL the forums and subforums contents to be viewable only to registered members, all I have to do is just set the Usergroup manager setting for registered - YES

and do not have to do anything in forum permissions manager.

Correct ?

Sorry for sounding stupid princeton, I appreciate your help :)

cinq
12-16-2004, 11:45 AM
Hmm, not too sure if this is a bug or not, but in forums where you cannot post REPLIES, this hack stops anyone from viewing the content, regardless if the usergroup has been set to YES.

Could you check this ?

Princeton
12-16-2004, 11:49 AM
So if on my boards, I want ALL the forums and subforums contents to be viewable only to registered members, all I have to do is just set the Usergroup manager setting for registered - YES

and do not have to do anything in forum permissions manager.

Correct ?

Sorry for sounding stupid princeton, I appreciate your help :) if everything is done correctly YES that is all you would need to do

i think ... sorry, it's been a while since I released this hack

Princeton
12-16-2004, 11:53 AM
hey, cinq...
Do you want to hide the forums?
or
Do you want to hide the thread content (showthread.php)? (This option displays all the threads of forum within forumdisplay.php.)

There is a big difference...

Can you send me a url to your site? PM the info if you do not want to post it.

cinq
12-16-2004, 11:55 AM
Ok I found out what's the problem ( i think ).
It's when you customize the particular usergroups permissions in the forum permissions prior to this hack installation.

If you check, the Group can read content is set default to NO , even if you had set it to YES in usergroup manager previously.

So something to look out for.
Other than that, i think this is running a-ok :D

cinq
12-16-2004, 12:00 PM
hey, cinq...
Do you want to hide the forums?
or
Do you want to hide the thread content (showthread.php)? (This option displays all the threads of forum within forumdisplay.php.)

There is a big difference...

Can you send me a url to your site? PM the info if you do not want to post it.

Nope, I want to do what your hack does, show the titles on forumdisplay, but hide the content ( to those Groups that cannot view the contents ) of the showthread :)

Princeton
12-16-2004, 12:19 PM
post this code in forumdisplay.php above your forum description

<if condition="!($forumperms & GTPCANREADCONTENT)">
<h1>No, you can't read!</h1></if>
If this appears (found within the forum) you thread content will NOT display in showthread.php.

Ok I found out what's the problem ( i think ).
It's when you customize the particular usergroups permissions in the forum permissions prior to this hack installation. yes, this will definately cause the hack to fail AND may cause the previous hack to fail also ... you need to change the bitfield value so that it follows chronologically

cinq
12-16-2004, 12:23 PM
... you need to change the bitfield value so that it follows chronologically

Not too sure what you mean by this, but I simply set the Group can see content field to YES for those forum sections which I had custom permissions on, and it is working fine now :)

Thanks for this hack princeton :D

Princeton
12-16-2004, 12:23 PM
Is there a way to add a message into the beginning of all threads created in certain forums to prevent message previewing?

For instance, when guests view my premium forums they can do a message preview. I would like for a message to be attached at the top of the first post of all threads created in that forum. Ex: This message was posted in a premium forum and contains private information. Sharing this message with non-premium members violates our terms of service.
And then the message would continue.

That way, guest previewing would only see the standard message and not the real one.

Make sense? Possible?
use this code:
<if condition="!($forumperms & GTPCANREADCONTENT)">
<p>This message was posted in a premium forum and contains private information. Sharing this message with non-premium members violates our terms of service.</p></if>

Princeton
12-16-2004, 12:35 PM
Not too sure what you mean by this, but I simply set the Group can see content field to YES for those forum sections which I had custom permissions on, and it is working fine now :)

Thanks for this hack princeton :D
My apologies cinq ... I just re-read your prior post and I misunderstood.
I'm glad everything is working.

If I ever get around to it I may submit my ALLOW GROUP TO VIEW POST hack. Really handy if you want to disallow GROUP from reading (posts > ($post[postcount] > 1)) if they are not the original author of thread.

Roxie
12-16-2004, 03:12 PM
use this code:
<if condition="!($forumperms & GTPCANREADCONTENT)">
<p>This message was posted in a premium forum and contains private information. Sharing this message with non-premium members violates our terms of service.</p></if>

Awesome that this is possible; however, I'm not sure where I should add this code? Thanks so much for your work.

Princeton
12-16-2004, 04:06 PM
Awesome that this is possible; however, I'm not sure where I should add this code? Thanks so much for your work. add it to your forumdisplay TEMPLATE right after your forum description

Roxie
12-16-2004, 05:14 PM
Okay, this adds it to the header on the page. I want it to appear at the top of the first post...maybe possible?

Princeton
12-16-2004, 05:34 PM
top of the first post that doesn't make sense ...

NO post will be fetched if the user doesn't have permission. In other words, in showthread.php the user CANNOT see anything therefore the system will not fetch anything. The custom error message will show in it's place.

If you are still lost (OR, I am not understanding you correctly) please post a snapshot of how/where you want this message to display ... it will help both of us. I will then tell you if it's possible.

Roxie
12-16-2004, 06:26 PM
When you hover over a thread title, it gives a preview of the post. This is a wonderful feature for my members who have access, but sucks for those that aren't supposed to be able to read. I have it set to show the first 100 characters...this is why I would like that message to be at the top of all the posts in certain forums so that they will only see that when they preview. I hope this makes sense.

Oreamnos
12-19-2004, 07:53 AM
Princeton

This hack works perfectly. Especially with the little code snippet that allows the user who posted the thread to view/edit their own post!

Also, the instructions were beyond easy. Thanks for taking the time to make it so easy.

Eric

Princeton
12-19-2004, 01:02 PM
When you hover over a thread title, it gives a preview of the post. This is a wonderful feature for my members who have access, but sucks for those that aren't supposed to be able to read. I have it set to show the first 100 characters...this is why I would like that message to be at the top of all the posts in certain forums so that they will only see that when they preview. I hope this makes sense.
So instead of the NO PERMISSION TO READ MESSAGE, you want the first $vboptions[threadpreview] characters available on each post (in showthread.php) if user does not have permission.

It's doable but it will require more hacking and that's something that I want to prevent with this hack. FYI: The more hacking involved the more people will be afraid to implement it.

If that's not what you wanted please provide a screenshot of where you want this "message". Also, when you say "message" do you mean the preview or the error message?

Oreamnos
12-19-2004, 05:09 PM
I had this hack running perfectly. Then I went into admincp and made some usergroup and forum permission changes and now NOBODY can view any forum. The permission error being generated is the gtp_cannot_read error.

So i replaced the hacked scripts with the originals that I got when i bought a license of vB. Everything worked fine then. So i re-installed this hack and i am back to the same problem. NOBODY has permission to view any threads. I have checked that "Group can read content?" has been set to Yes where necessary. I have checked all usergroup and forum permissions and i can't see where the problem is. I have re-installed the script twice!

http://eslhq.com/esl_forums

Please help, i am starting to panic...
eric

Princeton
12-19-2004, 09:23 PM
Oreamnos,
Under USERGROUP MANAGER set CAN READ to YES ... in FORUM PERMISSIONS MANAGER set CAN READ to NO for specific usergroup within a specific forum.

This will prevent usergroup from reading anything within that forum; but, will allow them to read content within other forums.

FYI
The USERGROUP MANAGER is used for GLOBAL settings (the entire site).
The FORUM PERMISSIONS MANAGER is used to modify usergroup settings withing a specific forum.

Oreamnos
12-20-2004, 12:09 AM
Princeton,

still no luck. I went through my usergroups and set everyone CAN READ to yes. the i set everyone to NO except admins and on special usergroup on forum permissions.

Now the admin can view everything but the other usergroups are still unable to view any of the forums, even the public forums.

i am using the special code to allow the person who posted the thread the ability to view their thread. // ================================================= \\
// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
if (!($forumperms & GTCANREADCONTENT) AND ($thread['postuserid'] != $bbuserinfo['userid']))
{
eval(print_standard_error('gtp_cannot_read'));
}
// == [ 00-00-2004 - GTP END ]
// ================================================= \\

I have also tested using this $thread['postuserid'] and this $threadinfo['postuserid']. still no luck.

Here is an example of how my Registered Usergroup Permissions look (Note Can read content is the new permission category):
Can Post Threads
Yes
Can Reply to Own Threads
Yes
Can Reply to Others' Threads
Yes
Can Edit Own Posts
Yes
Can Delete Own Posts
No
Can Move Own Threads
No
Can Open / Close Own Threads
No
Can Delete Own Threads
No
Always Moderate This Group's Posts
No
Can Rate Threads
Yes
Can read content.
Yes

And here is the permissions for a public forum for Registered Users
Can Post Threads
Yes
Can Reply to Own Threads
Yes
Can Reply to Others' Threads
Yes
Always Moderate This Group's Posts
No
Can Upload Attachments
Yes
Can Rate Threads
Yes
Can read content.
Yes

Besides these 2 permission settings, are there others?

Thanks
Eric

Oreamnos
12-20-2004, 12:11 AM
EDIT
It seems the admin got permission for a few views and then received the Permission Denied message...

Princeton
12-20-2004, 01:06 AM
Do you have any other hacks installed? If so... this is where your problem lies.

If you send me username/password (FTP) and username/password of site I will take a look at it. Send me info via my site's (www.gthelp.com) contact form -- do not post it here.

Oreamnos
12-20-2004, 01:08 AM
I will send you that information now. Thanks!

Oreamnos
12-20-2004, 01:19 AM
Princeton, the information has been sent using you "Contact Us" form. Please verify that you got the information soon so I know it is in good hands. Thanks!

Roxie
12-20-2004, 03:21 AM
So instead of the NO PERMISSION TO READ MESSAGE, you want the first $vboptions[threadpreview] characters available on each post (in showthread.php) if user does not have permission.

It's doable but it will require more hacking and that's something that I want to prevent with this hack. FYI: The more hacking involved the more people will be afraid to implement it.



Yes. That's what I meant. Thanks anyway. :)

Princeton
12-20-2004, 04:59 PM
Princeton, the information has been sent using you "Contact Us" form. Please verify that you got the information soon so I know it is in good hands. Thanks!
Oreamnos,
Your all set ... your problem was copying a modification on a prior post--not the hack itself.

I will update the post ... thank you.

Omega Prime
12-22-2004, 01:08 PM
I finally figured out what I did wrong (and a very foolish/newb mistake):

I forgot to upload the modified showthread.php! I dunno why I didn't realize it sooner, but once I did that, the hack worked flawlessly! Thanks, princeton!

/me clicks Install

Princeton
12-22-2004, 01:22 PM
I finally figured out what I did wrong (and a very foolish/newb mistake):

I forgot to upload the modified showthread.php! I dunno why I didn't realize it sooner, but once I did that, the hack worked flawlessly! Thanks, princeton!

* Omega Prime clicks Install
LOL
I'm glad everything is fixed. Good job!

setpro
12-27-2004, 05:41 PM
I have installed this hack and everything seems to work except the "Show Printable Version" option under Thread Tools comes back with the message that I've assigned to those who can browse thread titles but cannot access to thread themselves.

In other words no matter what user permission level, any attempt to " Show Printable Version" returns a message telling the user that he does not have permission to do this.

Any suggestions/help is appreciated.

Princeton
12-27-2004, 07:24 PM
Remove the code from printhread and try it again ... make sure the BITFIELD is the same as that in your init.php file. eg. gtpcanreadcontent NOT gtcanreadcontent (missing P)

Also, make sure you did not leave or overwrite any code...

setpro
12-27-2004, 10:05 PM
Remove the code from printhread and try it again ...

I replaced the modified printthread.php with the original printthread.php and everything seems to be working properly. I cannot view "Show Printable Version".

Do I think I need to do anything else to maintain the integrity of the mod?

Thank you for your help.

Princeton
12-27-2004, 11:38 PM
it looks like something is wrong with your printthread file (http://www.setpro.com/forums/printthread.php?t=5875) ... right now it's showing a parse error--meaning you left something out

Make sure you are following directions found in the INSTRUCTIONS ... most "problems" that people have are because they try to do things in a rush ... place close attention to REPLACE WITH and/or ADD BELOW.

The printthread.php modification is ADD BELOW and will not work properly if you replace the existing code.

TLSNetwork
12-30-2004, 07:21 AM
What am i missing here , if i try and set a usergrioup i get a mysql error: Unknown column 'gtpcanreadcontent' in 'field list'

Was i ment to run a query to create this ???

Duh never mind might help if i transfer init over

Princeton
12-30-2004, 01:33 PM
What am i missing here , if i try and set a usergrioup i get a mysql error: Unknown column 'gtpcanreadcontent' in 'field list'

Was i ment to run a query to create this ???

Duh never mind might help if i transfer init over
Undo what you just did and install the hack over again ... this time make sure you read the instructions carefully

Copy / Paste completely
REPLACE WITH / ADD BELOW

mojo8850
12-30-2004, 07:35 PM
Hi Friend's.. Im New Here.. :nervous:

Can Someone Tell Me Clearly On Where I Put This Code: -
I Know It's In /forum/forumdisplay.php

What I Dont Know Is Where I Place It Exactly ?

<if condition="!($forumperms & GTPCANREADCONTENT)">
<h1>No, you can't read!</h1></if>

Also Is This Code Requied I Mean Do I Really Need This Code:..

I Also Want To Know I Have Been Reading These Posts On This Hack.. I've Donwloaded This Hack About 2 Days Ago, IS IT UP TO DATE WITH ALL THE BUGS HEALED..!

Another Problem I Have Is This, I Have Followed Instructions Clearly..
One Thing Is Wrong CHECK THE ATTACHMENT:

The Test Is'nt Showing..

Help Please..! :tired: :tired: :tired:

amcd
12-30-2004, 08:06 PM
Your blank text problem in adminCP is bcos u have probably not added the phrase

I dont exactly understand your first problem, so cant help u there

IMHO, this is one of the best hacks i have come accross, and the instructions are very clear. Are u using 3.0.3 or some older version of vBulletin?

mojo8850
12-30-2004, 08:17 PM
Your blank text problem in adminCP is bcos u have probably not added the phrase

I dont exactly understand your first problem, so cant help u there

IMHO, this is one of the best hacks i have come accross, and the instructions are very clear. Are u using 3.0.3 or some older version of vBulletin?
Ok..

I Want To Know Where I Exactly Place That CODE (IN QUTOES). In That File..
I Am Using 3.0.3..

Also Like You Just Said I NEED TO ADD THE PHRASE.
Exactly Where Do I Place It..

Princeton
12-30-2004, 08:19 PM
Hi Friend's.. Im New Here.. :nervous:

Can Someone Tell Me Clearly On Where I Put This Code: -
I Know It's In /forum/forumdisplay.php

What I Dont Know Is Where I Place It Exactly ?



Also Is This Code Requied I Mean Do I Really Need This Code:..

I Also Want To Know I Have Been Reading These Posts On This Hack.. I've Donwloaded This Hack About 2 Days Ago, IS IT UP TO DATE WITH ALL THE BUGS HEALED..!

Another Problem I Have Is This, I Have Followed Instructions Clearly..
One Thing Is Wrong CHECK THE ATTACHMENT:

The Test Is'nt Showing..

Help Please..! :tired: :tired: :tired:
No, you do not need to use that piece of code ... it's only used for testing.

Yes, the instructions are up to date and this hack works flawlessly. Any problems are due because of errors done on installers end. For example, you have not installed the phrases for this hack.

Do not use any code found on previous posts.

Please follow instructions ...
If you need "personal" help I will gladly install the hack for a $20 donation (paypal link found in instructions)

Princeton
12-30-2004, 08:20 PM
to add phrases you need to go into your admincp / Languages & Phrases / Phrase Manager

click ADD NEW PHRASE

mojo8850
12-30-2004, 08:28 PM
to add phrases you need to go into your admincp / Languages & Phrases / Phrase Manager

click ADD NEW PHRASE
Ok..

What Do I Put In The Following Text Box's..

Phrase Type

Varname

Text

I'll Appreciate It..

mojo8850
12-30-2004, 08:32 PM
I Think I've Sorted It...

Thankyou I Will Donate..

lange
01-02-2005, 02:56 PM
Hi,

This hack seems no more working with 3.0.3 + init.php patch (3.0.4).

I can't read the messages. I got the following merror message:

xxxxxxxx, 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.

Am I alone ?

Princeton
01-02-2005, 03:50 PM
I haven't yet upgraded to 3.0.4; but, I do not see anything in the new init.php file that will prevent this hack from working.

Do you have any other hacks installed? ie. any other modifications to init.php??
Please recheck and make sure you have not missed or deleted code that you should not have.


I noticed that you are an early installer of this hack ... make sure the BITFIELD is GTPCANREADCONTENT and not GTCANREADCONTENT (p missing). I recommend reinstalling this hack completely.

Place close attention to the REPLACE WITH or ADD BELOW ... many people are overwriting code when instructions say ADD BELOW.

lange
01-02-2005, 04:30 PM
- Yes, I have others hacks installed (not much). Without the new init.php, this hack is working fine.

Maybe, the problem is from this fix 3.0.3: http://www.vbulletin.com/forum/bugs.php?do=view&bugid=3147


"...make sure the BITFIELD is GTPCANREADCONTENT and not GTCANREADCONTENT (p missing)."...

Where is it ?

Princeton
01-03-2005, 02:25 PM
Where is it ?
Check the hack instructions ... I'm gonna test this on 3.0.4 today. Will get back to you later.

Princeton
01-03-2005, 02:42 PM
I just installed the hack in 3.0.4 and everything is working fine.

ick
01-06-2005, 03:41 PM
I'm getting error messages from popup links, like postcount #173 above:
------------
To have access to the contents of this thread, you must be a PREMIUM MEMBER. To learn more about our membership please visit our 'Membership Options' section.
------------
Other links are fine. I'm using vb 3.0.4 and mod version 1.01

Princeton
01-06-2005, 04:02 PM
I'm getting error messages from popup links, like postcount #173 above:
------------
To have access to the contents of this thread, you must be a PREMIUM MEMBER. To learn more about our membership please visit our 'Membership Options' section.
------------
Other links are fine. I'm using vb 3.0.4 and mod version 1.01
Follow instructions carefully .. this hack has been tested in 3.0.4.

Please be specific ....
I don't understand what you are trying to say.

What errors? What page? Url? etc.

ick
01-06-2005, 05:19 PM
Sorry, i have replaced wrong code to showpost.php
Everything is fine now, thank you.

Oreamnos
01-07-2005, 11:41 PM
Has anyone got it working on 3.0.5?

Princeton
01-08-2005, 06:41 PM
Has anyone got it working on 3.0.5?
recheck your code ... you probably overwritten/removed some code on update

Oreamnos
01-08-2005, 10:42 PM
recheck your code ... you probably overwritten/removed some code on update
I haven't tried to install it yet. just checking that it works in 3.0.5 before i do :)

Princeton
01-23-2005, 01:39 PM
I haven't tried to install it yet. just checking that it works in 3.0.5 before i do :)
this hack will work on 3.00 - 3.06

DjDevil
01-23-2005, 01:56 PM
EDIT: problems solved...

higabyte
01-26-2005, 03:21 PM
ok i searched through most of these post and didnt see my issue so maybe i just did something wrong, but my only issue I can seem to find right now is when you click the number link ie in the top right of the post it has what number post that is, my members, even me as an adminstrator, get the warning message saying you need to be a premium member in order to view the post...

for instance, if you view (it works):
http://board.accordtuner.com/showthread.php?t=18756

now, that was the first post, so there is a "#1" on the top right of that post, but if you click that or try to link someone to just that post you get the error message (doesnt work):
http://board.accordtuner.com/showpost.php?p=217697&postcount=1

did i do something wrong? anyone have any ideas?

Thanks!!!

Princeton
01-26-2005, 04:14 PM
ok i searched through most of these post and didnt see my issue so maybe i just did something wrong, but my only issue I can seem to find right now is when you click the number link ie in the top right of the post it has what number post that is, my members, even me as an adminstrator, get the warning message saying you need to be a premium member in order to view the post...

for instance, if you view (it works):
http://board.accordtuner.com/showthread.php?t=18756

now, that was the first post, so there is a "#1" on the top right of that post, but if you click that or try to link someone to just that post you get the error message (doesnt work):
http://board.accordtuner.com/showpost.php?p=217697&postcount=1

did i do something wrong? anyone have any ideas?

Thanks!!!
Is everything else working fine (other sections)??

If so, recheck your showpost file and make sure you copy/paste everything as found in instructions. In the showpost are IT SAYS TO "BELOW ADD".
You'll probably have to check your printhread file also.

higabyte
01-26-2005, 11:57 PM
that was exactly it, in my rush today i overwrote it instead of added below, thank you!!

lange
02-02-2005, 05:08 PM
Is it working with 3.0.3 ?

Princeton
02-02-2005, 05:13 PM
yes, it works ... some commas may be on different lines -- other than that, it's all the same

gregwatson
02-02-2005, 05:16 PM
Just had this installed on a vBulletin 3.06 site ... works like a champ! And if you are busy like me ... you can't beat a $20 donation to have it installed for you!!!!!!!

Princeton
02-02-2005, 05:43 PM
Just had this installed on a vBulletin 3.06 site ... works like a champ! And if you are busy like me ... you can't beat a $20 donation to have it installed for you!!!!!!!
thanks Greg ... appreciate the donation :D

trulylowcarb
02-08-2005, 11:59 PM
I have been wanting exactly this for so long.... I have a premium recipe forum and without guests being able to drool over the tiles, it just doesn't work as it should, this will solve everything!!! can't wait to try it !!! but I have some "other issues" to resolve first.... THANKS SO MUCH FOR SHARING THIS.

trulylowcarb
02-09-2005, 12:46 AM
I meant to ask you - does this allow users to enter and edit closed threads in the premium forums even if they are not premium members? and can't see the rest of the threads in that same forum?
I might like to offer that, since the recipes in the one forum I refer to are the creations of my members....

bigmonay2k
02-18-2005, 12:54 AM
I was going to install this but got lil scared, lol
your files
'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 // VIEW THREAD
// == [ 00-00-2004 - GTP END ]
// ================================================= \\
);


mine unit look like this

'canthreadrate' => 65536,
'isalwaysmoderated' => 131072,
'canseedelnotice' => 262144,
'canseeraters' => 0,
);
0

Princeton
02-18-2005, 02:17 AM
use the following...


'canthreadrate' => 65536,
'isalwaysmoderated' => 131072,
'canseedelnotice' => 262144,
'canseeraters' => 0,
// ================================================= \\
// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
'gtpcanreadcontent' => 524288,
// == [ 00-00-2004 - GTP END ]
// ================================================= \\
);

bigmonay2k
02-25-2005, 12:40 AM
thanks...can I change the color??like red or blue??

Jazzee
02-28-2005, 01:27 PM
If I upgrade to 3.0.7, will I have to reinstall this?

Princeton
02-28-2005, 01:33 PM
Yes ... any modifications done to old files will be overwritten upon uploading new files ...

If you are asking about the database ... NO ... this hack has nothing to do with the database.

Jazzee
02-28-2005, 01:45 PM
Thank you. I'll wait to upgrade. It seems my boards are not at risk for the security issue fixed by 3.0.7 anyway.

YLP1
03-08-2005, 03:56 AM
Remove the code from printhread and try it again ... make sure the BITFIELD is the same as that in your init.php file. eg. gtpcanreadcontent NOT gtcanreadcontent (missing P)

Also, make sure you did not leave or overwrite any code...

I was having the same problem in 3.0.7 version when trying to view the printable version. I as admin and all members were getting no permission errors.

So I did as instructed above with the printhread.php and now all can see the printable version but I don't know what you mean by bitfield being the same as the init.php file.

Can you explain to this newbie? ;)

Also, by reverting back to the original printhread.php (removing the hack code) will this be a hole for people to get around the hack?

Thanks in advance for any help.

Princeton
03-08-2005, 11:34 AM
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.

YLP1
03-08-2005, 02:56 PM
I have read this entire thread and being a newbie I am completely lost as it relates to allowing google, msn, etc. bots to crawl the content. I would be very grateful if someone can show me how to edit this hack (where what, etc.) to allow this to happen.

Thanks in advance for any help on this.

Princeton
03-08-2005, 03:03 PM
I have read this entire thread and being a newbie I am completely lost as it relates to allowing google, msn, etc. bots to crawl the content. I would be very grateful if someone can show me how to edit this hack (where what, etc.) to allow this to happen.

Thanks in advance for any help on this.
This hack does not allow anyone access to content unless they have permission.
Google, crawlers, etc ... do not have permission as they are not members.

You can hack this mod to allow crawlers but this will allow people to see your content.

YLP1
03-08-2005, 04:45 PM
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:
'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:
'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.

Princeton
03-08-2005, 04:48 PM
glad everything worked out

YLP1
03-09-2005, 02:37 PM
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:

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.

Princeton
03-09-2005, 03:54 PM
check your showpost.php edits and make sure it is identical to the code found in the instructions

YLP1
03-09-2005, 05:48 PM
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? ;)

matd62
03-09-2005, 06:45 PM
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?

Princeton
03-09-2005, 08:02 PM
matd62,

see if this will work....
FIND in functions/forumdisplay.php:
// 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_bbc ode($thread['preview'], false, true), $vboptions['threadpreview']));
}

REPLACE IT WITH:
// ================================================= \\
// == [ 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_bbc ode($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

rjordan
03-10-2005, 02:31 AM
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!)

Princeton
03-10-2005, 11:15 AM
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.

Vampyre
03-10-2005, 11:29 AM
Thanks, Princeton. :)
Works well. ;)

Lionel
03-10-2005, 11:44 AM
Hello, when a non authorized user attemps to view the archive or to print, instead of a blank page, can it be an error page?

matd62
03-11-2005, 01:41 AM
princeton...excellent work my friend! worked great. much appreciated!

wma
03-30-2005, 08:06 PM
03. Dec 2004, 14:43: Download the new version ... I made the necessary changes for you to have your own personal message. enjoy:D


sorry for delay: have many thanks for this good work! will try it after update to 3.0.7.; tomorrow :-)

tom

Pain86
04-01-2005, 06:00 PM
hi, i just installed this mod and it works ok.. but when new members sign up they still cant view threads as if they werent registerd... please help ASAP please please please :(

wma
04-02-2005, 06:03 AM
hi, i just installed this mod and it works ok.. but when new members sign up they still cant view threads as if they werent registerd... please help ASAP please please please :(
hi,

look at the manual: "You must update each existing usergroup for this to take effect or they will not be able to see showthread.php"

have you update all groups ?

greetz tom

Princeton
04-04-2005, 03:59 PM
hi, i just installed this mod and it works ok.. but when new members sign up they still cant view threads as if they werent registerd... please help ASAP please please please :(

also, make sure you copy/pasted the code correctly ... I suggest you go back and redo the install and place close attention to what you are removing/adding

T_Montana
04-09-2005, 10:52 PM
little problem here......i did everything and uploaded the files...went to make new phrases and get this error when tryin to go to admincp.....i know it's something easy......anyone know?

Warning: main(./includes/init.php): failed to open stream: No such file or directory in site.com/forums/admincp/global.php on line 18

Fatal error: main(): Failed opening required './includes/init.php' (include_path='.:/usr/local/lib/php') in site.com/forums/admincp/global.php on line 18

Princeton
04-09-2005, 11:08 PM
you definately made an error when you copied/pasted ...
recheck the instructions ... make sure you copied/pasted correctly and that you didn't overwrite or removed code that you shouldn't have

OR

check your init.php file .. .make sure the copied code is correct ... and that a comma (only one) is after each 'bitfield' (permission)

for example .. in some installation there already is a comma after
'canseedelnotice' => 262144,
if this is the case with you than the code should look like this
'canseedelnotice' => 262144,
// ================================================= \\
// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
'gtpcanreadcontent' => 524288 // VIEW THREAD
// == [ 00-00-2004 - GTP END ]
// ================================================= \\
and not like this
'canseedelnotice' => 262144,
// ================================================= \\
// == [ ALLOW GROUP TO READ TITLE / NOT CONTENT - GTP BEGIN ]
,'gtpcanreadcontent' => 524288 // VIEW THREAD
// == [ 00-00-2004 - GTP END ]
// ================================================= \\
notice the double commas

if you need help ... pm me

NetRover
04-30-2005, 02:40 PM
Can this hack be used so that guests and anyone not logged in can only view the subjects of the threads but allow access to one support forum for unregistered users who can't register/log-in?

Princeton
04-30-2005, 02:43 PM
yes, you control this via the usergroup settings

whelck
05-06-2005, 12:15 AM
great hack, though I would suggest making "Yes" the default setting instead of "No." This locked everyone out of my forums while I found all the other permissions.

edbri871
05-14-2005, 08:36 PM
Well this is what Ive been looking for and have a couple quick questions...

The main reason I have wanted this is Ive noticed Google has crwaled the thread titles within our forums and obiviosly cannot see the ones that are closed to guests. Ive wanted to not only allow guests to see the tiltles but also for Google to crawl them as does with the other forums currently open to guests although I cannot have/allow guests to read them so this seems the perfect sloution and great in addition for the window shopping also. So then the question is simple will it allow Google to crawl the titles as it does now with the other forum that are open to guests then.

Also any difference to this
http://www.vbulletin.com/forum/showthread.php?t=110119

Princeton
05-14-2005, 08:46 PM
This hack will not allow google to crawl the thread content ... you will need to modify it.

The reason why I have not done so nor will I support it is because you can be banned by Google for such practice. Also, if Google can view it everyone else can view it--if they know what they are doing.

Allowing Google to crawl the contents of thread is as easy as adding an if/else statement.

Yes, this feature will be available on vb 3.5 as far as I can tell.

edbri871
05-14-2005, 09:01 PM
Actually I dont want Google to crawl the thread content.
I only want Google to crawl the titles/forum not content.

Princeton
05-14-2005, 09:04 PM
LOL, sorry -- yes, this is exactly what you need

vinzphua
05-15-2005, 01:09 PM
Notes about installing in vb 3.0.7. I'm pretty sure none of these were changed by any previous mods.

In includes/init.php

'canseedelnotice' => 262144
has an extra comma.
'canseedelnotice' => 262144,

In archive/index.php

if (!($forumperms & CANVIEW) OR !($forumperms & CANVIEWOTHERS) OR in_coventry($threadinfo['postuserid']) OR $threadinfo['isdeleted'])

has become
if (!($forumperms & CANVIEW) OR !($forumperms & CANVIEWOTHERS) OR in_coventry($threadinfo['postuserid']) OR $threadinfo['isdeleted'] OR !$threadinfo['visible'])

echo "\t<li><a href=\"" . (!slash_method ? 'index.php?' : '') . "t-$thread[threadid].html\">$thread[title]</a>" . iif($pda, " <i>(" . construct_phrase($vbphrase['x_replies'], $thread['replycount']) . ")</i>") . "</li>\n";
has become
echo "\t<li><a href=\"" . (!SLASH_METHOD ? 'index.php?' : '') . "t-$thread[threadid].html\">$thread[title]</a>" . iif($pda, " <i>(" . construct_phrase($vbphrase['x_replies'], $thread['replycount']) . ")</i>") . "</li>\n";

Princeton
05-15-2005, 01:17 PM
Notes about installing in vb 3.0.7. I'm pretty sure none of these were changed by any previous mods.

In includes/init.php

'canseedelnotice' => 262144
has an extra comma.
'canseedelnotice' => 262144,

In archive/index.php

if (!($forumperms & CANVIEW) OR !($forumperms & CANVIEWOTHERS) OR in_coventry($threadinfo['postuserid']) OR $threadinfo['isdeleted'])

has become
if (!($forumperms & CANVIEW) OR !($forumperms & CANVIEWOTHERS) OR in_coventry($threadinfo['postuserid']) OR $threadinfo['isdeleted'] OR !$threadinfo['visible'])

echo "\t<li><a href=\"" . (!slash_method ? 'index.php?' : '') . "t-$thread[threadid].html\">$thread[title]</a>" . iif($pda, " <i>(" . construct_phrase($vbphrase['x_replies'], $thread['replycount']) . ")</i>") . "</li>\n";
has become
echo "\t<li><a href=\"" . (!SLASH_METHOD ? 'index.php?' : '') . "t-$thread[threadid].html\">$thread[title]</a>" . iif($pda, " <i>(" . construct_phrase($vbphrase['x_replies'], $thread['replycount']) . ")</i>") . "</li>\n";
I have not upgraded the addon to 3.0.7.

I will add your changes as soon as possible.

thank you

vinzphua
05-15-2005, 11:01 PM
I have not upgraded the addon to 3.0.7.

I will add your changes as soon as possible.

thank you
As a user that is not suppose to see thread contents, when I browse the archive, I can see the forum index, but I get a blank page when i click on a forum. I also get a blank page when I try to view a thread. I haven't had time to figure out why yet. If someone figures it out first, please post.

Incidently, the instructions in the zip file lists archive/global.php as one of the files to modify, but there are no detailed instructions to do that.

Thanks for putting all that work on this mod. :)

Princeton
05-15-2005, 11:13 PM
you have made an error ... go back and make sure you have not copied/pasted over code that you shouldn't have--this is where everyone has problems

I will upload the new instructions for 3.0.7 by tomorrow night -- the changes are small but sometimes the small things can drive you crazy :)

Princeton
05-15-2005, 11:14 PM
you mean ... like this: https://vborg.vbsupport.ru/archive/index.php/f-33.html

vinzphua
05-15-2005, 11:23 PM
No. I get a completely blank page. No headers, etc. like this (http://www.aquaticquotient.com/forum/archive/index.php/f-24.html).

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.

edbri871
05-16-2005, 04:44 AM
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.

vinzphua
05-16-2005, 11:27 AM
Found the cause of completely blank page forum indexes and thread contents.

In /archive/index.php
$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;
}
and
$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;
}
makes the script exit and hence the blank pages.

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:
if ($do == 'thread')
{
echo print_archive_navigation($foruminfo, $threadinfo);
and add below it:
// ================================================= \\
// == [ 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 ]
// ================================================= \\


This fixes the archive thread view for me... hope it didn't break anything.

Princeton
05-16-2005, 02:52 PM
the zip file has been updated

vinzphua
05-16-2005, 03:23 PM
Great! I just installed your updates and it works fine. Thanks.

edbri871
05-16-2005, 07:34 PM
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. :o

edit: nvm.

Princeton
05-16-2005, 07:41 PM
You should follow the installation instructions found in the zip file

If you wish to stay updated on changes you should click INSTALL.

edbri871
05-16-2005, 07:59 PM
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. :)

Princeton
05-16-2005, 08:07 PM
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

edbri871
05-16-2005, 08:17 PM
Alright, i got it, thanks for the help. :)

Musta missed some part of the old code.

Princeton
05-16-2005, 08:19 PM
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 :D

mfarmerhi
05-19-2005, 08:35 AM
Unless I'm mistakenDisable 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 :rolleyes:

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

Princeton
05-19-2005, 11:16 AM
LOL ... yep spelling error :D

the error states you did an erroneous copy/paste ... the only way to fix this is to check your file

Princeton
05-25-2005, 07:15 PM
small typo in archive/index.php

FIND ALL INSTANCES OF: slash_method
REPLACE WITH: SLASH_METHOD

mfarmerhi
06-11-2005, 09:54 AM
I'd love this hack, but it's conflicting with the Text Message User on PM (https://vborg.vbsupport.ru/showthread.php?p=664967) hack I already have installed.

I believe the conflict is coming in the inclues/init.php changes. Specifically the change in this hack:
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":
$_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?

Princeton
06-11-2005, 12:51 PM
the bitfields above have nothing to do with each other ... your problem is elsewhere

mfarmerhi
06-11-2005, 06:00 PM
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

Princeton
06-11-2005, 06:05 PM
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

Lionel
06-11-2005, 06:09 PM
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.

mfarmerhi
06-11-2005, 06:13 PM
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