Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 08-07-2002, 09:18 PM
DiscussAnything DiscussAnything is offline
 
Join Date: Jan 2002
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Changing style for unregistered users

I made a new style/template set which I want to use for unregistered users. It's very limited in options, so people may be more willing to sign up.

Anyway, I can't figure out how to change the colorstyle for unregistered users. I searched through the templates and it doesn't appear to be in there. The php files are too complex for me to quickly go through.
It seems to have something to do with the styleid, and that unregistered users somehow always use style id 1. Renaming the style from Default to something else, and making the new style Default doesn't do anything.

Can anyone tell me what I need to change where? It's probably not all that big a problem, but I can't seem to figure it out.

thanks a lot in advance
Reply With Quote
  #2  
Old 08-07-2002, 09:21 PM
DiscussAnything DiscussAnything is offline
 
Join Date: Jan 2002
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is this it (global.php)?

PHP Code:
if ($getforum['styleoverride']==or $bbuserinfo['styleid']<2) { 
Do i change the <2 to the style id i want to give it?
Reply With Quote
  #3  
Old 08-07-2002, 10:04 PM
ladyfyre's Avatar
ladyfyre ladyfyre is offline
 
Join Date: Nov 2001
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK....i am not only trying to help here...but also trying to test whether or not i am actually learning or not......


TRY this in global.php:


Right above:

PHP Code:
if (isset($codestyleid) and $codestyleid!=0) { 
Put this:
PHP Code:
if ($bbuserinfo['userid']<1){  
    
$styleid=1;
}else { 

Then, Replace this:

PHP Code:
  if ($style=$DB_site->query_first("SELECT templatesetid,replacementsetid,userselect FROM style WHERE styleid='$styleid'")) {
    if (!
$style['userselect']) {
      unset(
$style);
      
$styleid=1;
    }
  } else {
    unset(
$style);
    
$styleid=1;
  }


With This:


PHP Code:
  if ($style=$DB_site->query_first("SELECT templatesetid,replacementsetid,userselect FROM style WHERE styleid='$styleid'")) {
    if (!
$style['userselect']) {
      unset(
$style);
      
$styleid=1;
    }
  } else {
    unset(
$style);
    
$styleid=1;
  }
}

Reply With Quote
  #4  
Old 08-08-2002, 04:43 PM
DiscussAnything DiscussAnything is offline
 
Join Date: Jan 2002
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

whats the difference between the latter two parts, the one i replace? Looks identical to me, other than having an extra }
Reply With Quote
  #5  
Old 08-08-2002, 04:49 PM
ladyfyre's Avatar
ladyfyre ladyfyre is offline
 
Join Date: Nov 2001
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

exactly. You don't really have to replace it, just add the extra } after that part. More than anything, i posted it that way just so that there would be an adequate frame of reference for you to know where the } went...and because that is the way i have always seen others here post stuff...as replacements, not additions.
Reply With Quote
  #6  
Old 08-08-2002, 05:32 PM
DiscussAnything DiscussAnything is offline
 
Join Date: Jan 2002
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

alrightythen, i'll let you know if it worked, thanks
Reply With Quote
  #7  
Old 08-09-2002, 06:55 PM
DiscussAnything DiscussAnything is offline
 
Join Date: Jan 2002
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

success!

thanks miss
Reply With Quote
  #8  
Old 08-09-2002, 07:00 PM
ladyfyre's Avatar
ladyfyre ladyfyre is offline
 
Join Date: Nov 2001
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OMG!!!!

You just totally made my day telling me that!!!!

/me does the happy dance.

Maybe I am not TOTALLY hopeless after all!
Reply With Quote
  #9  
Old 08-09-2002, 09:12 PM
DiscussAnything DiscussAnything is offline
 
Join Date: Jan 2002
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if you want to document this and make it idiot-proof, you could add that the 1 from "$styleid=1;" should be the id of the style you want to use for unregd users.

but other than that, it's great

[high]* DiscussAnything joins the dance [/high]
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 03:56 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.03921 seconds
  • Memory Usage 2,238KB
  • 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
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete