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. ;)


All times are GMT. The time now is 03:33 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.01899 seconds
  • Memory Usage 1,734KB
  • 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
  • (6)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete