The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
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 |
#3
|
|||
|
|||
Thanks buddy! can I insert this anyplace in global.php3?
|
#4
|
||||
|
||||
not anyplace, but let's say many places
To be safe, you better insert it just BEFORE the last line: ?> |
#5
|
|||
|
|||
O.K...also, I haven't changed my usergroups..members would be number 2 correct?
|
#6
|
|||
|
|||
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.
|
#7
|
||||
|
||||
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, |
#8
|
|||
|
|||
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 ©2000, 2001, Jelsoft Enterprises Limited.<br> $copyrighttext </font></div><br> <!-- Do not remove this copyright notice --> |
#9
|
|||
|
|||
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 ####################### |
#10
|
||||
|
||||
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 |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|