vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Changing style for unregistered users (https://vborg.vbsupport.ru/showthread.php?t=42037)

DiscussAnything 08-07-2002 09:18 PM

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

DiscussAnything 08-07-2002 09:21 PM

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?

ladyfyre 08-07-2002 10:04 PM

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;
  }
}



DiscussAnything 08-08-2002 04:43 PM

whats the difference between the latter two parts, the one i replace? Looks identical to me, other than having an extra }

ladyfyre 08-08-2002 04:49 PM

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.

DiscussAnything 08-08-2002 05:32 PM

alrightythen, i'll let you know if it worked, thanks

DiscussAnything 08-09-2002 06:55 PM

success!

thanks miss

ladyfyre 08-09-2002 07:00 PM

OMG!!!!

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

/me does the happy dance.

Maybe I am not TOTALLY hopeless after all!

DiscussAnything 08-09-2002 09:12 PM

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]


All times are GMT. The time now is 10:52 AM.

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.02260 seconds
  • Memory Usage 1,736KB
  • 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
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete