vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Request: Members/Non-Members templates..how? (https://vborg.vbsupport.ru/showthread.php?t=38825)

dssart 05-20-2002 01:45 AM

Request: Members/Non-Members templates..how?
 
Hi everyone,

I've been trying to figure this one out for awhile on my own, but can't get it 100%. I need a separate forum template for registered members. I have an app I want to launch via a button, but only want registered users to see the button, or be able to use it. If anyone can tell me exactly how to do it ( I'm guessing I need to edit the global.php file and insert the name of the 2nd template somewhere ) my thanks will go out to you.

dssart

Logician 05-20-2002 09:02 AM

if ($bbuserinfo[usergroupid]==X)
{
$special_button='<a href="http://site.com/yoururl.html"><img src="http://www.site.com/images/yourimage.gif" border="0"></a>';
}
else
{
$special_button='';
}

(Replace X with the usergroup id that can see the button)

Now insert variable $special_button to any template you want.

Enjoy! ;)

Logician

dssart 05-20-2002 08:15 PM

Thanks buddy! can I insert this anyplace in global.php3?

Logician 05-20-2002 09:11 PM

not anyplace, but let's say many places :)

To be safe, you better insert it just BEFORE the last line:
?>

dssart 05-20-2002 09:18 PM

:) O.K...also, I haven't changed my usergroups..members would be number 2 correct?

dssart 05-21-2002 12:15 AM

Can't get it to work..nothing at all shows up. I tried changing usergroup ids to every number, nothing..tried placing it in different areas of global.php3, nothing..I know the board is seeing it..I took a bit of code out to see if the board would recognize an error and it did.

Logician 05-21-2002 08:04 AM

Unless you used the button in header or footer templates, it should work. To use it eg. in header template apply the code, right before:

// ###################### Start templates #######################

in global.php.
(Tested and working here)

If it does not work for you, please post exactly the code you inserted, where you inserted, template name you applied and how you applied to that template..

Regards,

dssart 05-21-2002 10:25 PM

O.K., I can't get it still..I was planning to use it in my footer template so it shows up at the bottom of all pages of registered users..here's the footer template:

</td>
</tr>
</table>
<!-- /content area table -->
<!--Do not remove this copyright notice -->
<br>
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#999966">
Powered by: vBulletin Version $templateversion<br>
$special_button<br>
Copyright &copy;2000, 2001, Jelsoft Enterprises Limited.<br>
$copyrighttext </font></div><br>
<!-- Do not remove this copyright notice -->

dssart 05-21-2002 10:29 PM

Here's global.php3, I have my actual website URL inserted where appropriate..

// ###################### Referrer Stuff #########################

// Referer stuff
if ($bbuserinfo['userid']==0 and $usereferrer and !$bbreferrerid and $referrerid) {
if ($r_id = $DB_site->query_first("SELECT userid FROM user WHERE userid = '".addslashes($referrerid)."'")) {
vbsetcookie("bbreferrerid",$r_id[userid]);
}
}

if ($bbuserinfo[usergroupid]==3)
{
$special_button='<a href="http://mywebsite.com"><img src="http://mywebsite.com/forum/database.gif" border="0"></a>';
}
else
{
$special_button='';
}

// ###################### Start templates #######################

Logician 05-22-2002 07:34 AM

This code is ok and works.. If it does not work for you, check:

1- usergroupid: Does it usergroup 3 you want to show the button. Double check..In my board board members are usergroup 2 for instance..Change it to 6 and see if you (Admin) can see the button

2- Your url: http://mywebsite.com/forum/database.gif? Valid?

Regards,
Logician


All times are GMT. The time now is 02:42 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.01110 seconds
  • Memory Usage 1,732KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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