Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 05-20-2002, 01:45 AM
dssart dssart is offline
 
Join Date: May 2002
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 05-20-2002, 09:02 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 05-20-2002, 08:15 PM
dssart dssart is offline
 
Join Date: May 2002
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks buddy! can I insert this anyplace in global.php3?
Reply With Quote
  #4  
Old 05-20-2002, 09:11 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not anyplace, but let's say many places

To be safe, you better insert it just BEFORE the last line:
?>
Reply With Quote
  #5  
Old 05-20-2002, 09:18 PM
dssart dssart is offline
 
Join Date: May 2002
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

O.K...also, I haven't changed my usergroups..members would be number 2 correct?
Reply With Quote
  #6  
Old 05-21-2002, 12:15 AM
dssart dssart is offline
 
Join Date: May 2002
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 05-21-2002, 08:04 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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,
Reply With Quote
  #8  
Old 05-21-2002, 10:25 PM
dssart dssart is offline
 
Join Date: May 2002
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 -->
Reply With Quote
  #9  
Old 05-21-2002, 10:29 PM
dssart dssart is offline
 
Join Date: May 2002
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 #######################
Reply With Quote
  #10  
Old 05-22-2002, 07:34 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.10274 seconds
  • Memory Usage 2,250KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete