vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Links for Registered Users Only (https://vborg.vbsupport.ru/showthread.php?t=81467)

Deaths 05-13-2005 10:00 PM

Links for Registered Users Only
 
Very simple hack, as requested here.

What does it do?
All links can only be viewed by registered members.

Time to install: 5 minutes, if not less
Files to edit: 1

Open up includes/functions_bbcodeparse.php, and find:
PHP Code:

return "<a href=\"$rightlink\" target=\"_blank\">$text</a>"

Replace with:
PHP Code:

global $bbuserinfo;
if (
$bbuserinfo[userid] != 0)
{
return 
"<a href=\"$rightlink\" target=\"_blank\">$text</a>";
}
else
{
return 
"Guests cannot view links. You must <a href='register.php'>register</a> to see links.";


Thats it :).

NOTE:
If you are using Floris' standard URL hyperlink opening in same window, the first step is:

Find
PHP Code:

return "<a href=\"$rightlink\">$text</a>"

If you are using Postcache, you might need to rebuild it.

Please click install if used!

techhouse 05-14-2005 10:10 AM

Big big thanks for useful hack!

Deaths 05-14-2005 11:11 AM

No problem ;).

shiva 05-15-2005 05:01 AM

Nice. Wondering about something. If I just want this to show for a select amount of usergroups, like admins, mods and a special usergroup just to view, while non members and regular members can not view, how would I do that please?

Deaths 05-15-2005 07:21 AM

You can replace
PHP Code:

$bbuserinfo[userid] != 

With
PHP Code:

in_array($bbuserinfo[usergroupid], array(X,Y,Z)) 

Change the x, the y and the z to the usergroupids that are allowed to view the links.
You can add more usergroups to the list, like this: array(W,X,Y,Z)

If you's like to enter a list of usergroups that are NOT allowed, please a little ! in from of the in_array, like this:
PHP Code:

!in_array($bbuserinfo[usergroupid],.... 

And change the x, the y and the z to usergroups that are not allowed to view the links.

Hope that helps :).

shiva 05-15-2005 07:22 AM

Thanks, will try it soon. :)

xtreme-mobile 05-16-2005 07:22 PM

fantastic hack :)

thanks for that :)

HarryBO 05-20-2005 05:00 PM

Nice One,thx!

Deaths 05-25-2005 04:49 AM

No proble guys, glad you like it :)

Ugur CETIN 05-25-2005 01:40 PM

Very good modification. Thnx. ;)

techhouse 05-31-2005 07:54 AM

Link still visible if the post is created in html (non bbcode) :(
Any idea?

logofreax 06-19-2005 08:22 AM

Hi, i´ve tested this great Hack but got one Question.

Is it possible that only lLinks in Threads can be disabeled and Links in Signatures are still to see?

At the Moment this Hack make all Links impossible to see, altough them in Signatures.

Thanx for help

Greets from Germany

jesus likes pie 06-20-2005 01:07 PM

will it hide it if they are viewing the archive?

lanc3lot 06-22-2005 03:44 AM

Hello...Can the links be hided also from users that they havent activated their account? (and so only registered users can see them)

Thnx in advance

Deaths 06-25-2005 06:10 AM

Quote:

Originally Posted by techhouse
Link still visible if the post is created in html (non bbcode) :(
Any idea?

I wouldn't know a solution to that, sorry.

Deaths 06-25-2005 06:12 AM

Quote:

Originally Posted by logofreax
Hi, i?ve tested this great Hack but got one Question.

Is it possible that only lLinks in Threads can be disabeled and Links in Signatures are still to see?

At the Moment this Hack make all Links impossible to see, altough them in Signatures.

Thanx for help

Greets from Germany

Yes, I've put a conditional on the whole [url] BBCode.
I wouldn't know how to hide them for posts only, I don't think there is a variable which shows where the BBCode is currently parsed.

Anyone?

Deaths 06-25-2005 06:14 AM

Quote:

Originally Posted by lanc3lot
Hello...Can the links be hided also from users that they havent activated their account? (and so only registered users can see them)

Thnx in advance

Yes, you can change
PHP Code:

if ($bbuserinfo[userid] != 0)


to
PHP Code:

if ($bbuserinfo[userid] != OR $bbuserinfo[userid] != X)


and replace X by the usergroup from which you want to hide the links aswell.
Not sure whether this works or not, but you can try.

lanc3lot 06-25-2005 11:46 AM

Quote:

Originally Posted by Deaths
Yes, you can change
PHP Code:

if ($bbuserinfo[userid] != 0)


to
PHP Code:

if ($bbuserinfo[userid] != OR $bbuserinfo[userid] != X)


and replace X by the usergroup from which you want to hide the links aswell.
Not sure whether this works or not, but you can try.

Nope it didnt:(

When i did that, the code didnt worked at all (neither for the userid 0) :(

CyberRanger 07-08-2005 07:48 PM

Quote:

Originally Posted by Deaths
You can add more usergroups to the list, like this: array(W,X,Y,Z)

Nice hack. One question on setting it with usergroups. I can only seem to get it to work if that is the user's primary usergroup. Can it also check "Additional Usergroups"?

Thanks!

Fallback 07-21-2005 07:40 PM

this hack doesnt seem to work if the user puts a URL in BBCODE [URL] and BBCODE [URL] tags... Is there a fix?

Deaths 08-18-2005 11:41 AM

Quote:

Originally Posted by westpointer
Nice hack. One question on setting it with usergroups. I can only seem to get it to work if that is the user's primary usergroup. Can it also check "Additional Usergroups"?

Thanks!

Not sure whether this will work:

Replace
PHP Code:

$bbuserinfo[userid] != 

with
PHP Code:

!is_member_of(X,Y,Z); 

Where X Y and Z can be primary/secondary/anything groups.

stinger2 08-18-2005 09:05 PM

can this work on 3.5 RC2

sajjid 09-02-2005 01:54 PM

Code:

return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";
in 3.5 RC2 this is in forums/includes/class_bbcode.php
it works but it hides links from everyone trying to figure conditions but so far no luck.

xtreme-mobile 09-11-2005 10:12 AM

great hack added to my second board

but 1 question!!!

it stopps you from seeing the link however before you go into the thread if you hover the mouse over the thread title it shows the link any fix for that?

regards

dean

stan111 09-14-2005 10:58 AM

Quote:

Originally Posted by xtreme-mobile
great hack added to my second board

but 1 question!!!

it stopps you from seeing the link however before you go into the thread if you hover the mouse over the thread title it shows the link any fix for that?

regards

dean

i have no idea how to write code to fix that but you can turn off that mouse over thingy by going to Admin CP ---> Vbulletin Options -----> Forum Display Option (forumdisplay) -----> set "Length of Thread Preview Text" to be 0

i did that to my forum
btw: the mouse over is kinda annoying. it made me dizzy :lol: so turning it off is not a big deal to me

xtreme-mobile 09-14-2005 04:12 PM

nice one cheers for that :D

stan111 09-14-2005 06:50 PM

just have this installed and the img code wont work with this
i have to uninstall it now

very nice and simple mod :thumbup:

Yorixz 09-15-2005 05:44 PM

Hopefully someone will find out what the conditions in vB3.5 are supposed to be, I'd like to implent something like this for quotes/codes, just like on vB.org here ;)

omega332432 09-15-2005 06:51 PM

What happens if theres a [url] around an [img] and this hack is installed?

sajjid 09-16-2005 11:02 AM

ok for this to work in vb 3.5 rc 3 do the following in
forums/includes/class_bbcode.php
find
Code:

return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";
and replace it with
Code:

if ($vbulletin->userinfo['userid']) 

return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";

else 

return "Guests cannot view links. You must <a href='register.php'>register</a> to see links.";
}


Yorixz 09-17-2005 11:21 AM

Quote:

Originally Posted by sajjid
ok for this to work in vb 3.5 rc 3 do the following in
forums/includes/class_bbcode.php
find
Code:

return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";
and replace it with
Code:

if ($vbulletin->userinfo['userid']) 

return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";

else 

return "Guests cannot view links. You must <a href='register.php'>register</a> to see links.";
}


Do you also happen to know what the condition would be to only allow people in a usergroup higher than, say 6?

smokering 09-26-2005 01:42 AM

nice addon thank you much

Andyrew 10-04-2005 09:27 PM

What code for 3.5 gold tried the above but even i the admin cannot view links. ??

Thanks

AyeCapn 05-09-2006 09:14 PM

:cool:

can this be adapted in someway to prevent non-registered users from viewing signatures?

dragonlove 03-06-2007 04:24 AM

vB Version: 3.0.7

This hack is too old, where is the new one that works with 3.6.5 ?

tyler_d 03-11-2007 05:41 AM

Quote:

Originally Posted by dragonlove (Post 1196851)
vB Version: 3.0.7

This hack is too old, where is the new one that works with 3.6.5 ?

yeah, would love to know this too

katie hunter 05-30-2007 11:18 PM

I tried it but it didn't work i use vBulletin 3.6.7 PL1)


All times are GMT. The time now is 04:46 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01493 seconds
  • Memory Usage 1,826KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (12)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (37)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete