+ Reply to Thread
Results 1 to 5 of 5

Thread: Style inheriting into serch/members etc etc

  1. #1
    Senior Member chilliboy is on a distinguished road
    Join Date
    Jun 2001
    Location
    UK
    Age
    38
    Posts
    224

    Style inheriting into serch/members etc etc

    Hi,

    I was wondering how to get the styles applied to a forum inherited by the search/user cp pages etc etc.

    At the moment, say I got a forum "green forum" and someone clicks search from that forum, then the search page styles resort to the default styles. This looks reaaly stupid when the default style and "style for forum" colours clash. How can I make the search pages etc inherit the styles from the appropriate forum?

    Cheers

  2. #2
    Senior Member tubedogg has disabled reputation tubedogg's Avatar
    Join Date
    Feb 2001
    Location
    Medina, OH
    Age
    28
    Posts
    13,647
    There's no way to do what you suggest currently. The best you can do is allow the user to specify a style that overrides any that you have set and then everything will be in that style.

  3. #3
    Senior Member chilliboy is on a distinguished road
    Join Date
    Jun 2001
    Location
    UK
    Age
    38
    Posts
    224
    I've noticed a few people pass the styleid in their URLs

    Smachol: If you look at his signiture the $styleid is passed in the URLs eg http://www.optiboard.com/forums/index.php?s=&styleid=20 , I had a look and tried various stylesid , I noticed that if you click search, cp etc the styleid is retained. Any ideas on how this is done. I thought it may be by passing it on via the url to search.php but there vas no visible $styleid in the URL.

    Any ideas on how it is accomplished ??

    Cheers

  4. #4
    Senior Member tubedogg has disabled reputation tubedogg's Avatar
    Join Date
    Feb 2001
    Location
    Medina, OH
    Age
    28
    Posts
    13,647
    That's a different question. Yes, find out the ID of the style (Templates > Edit > mouseover the [expand list] link and look at the status bar, it will say "expandset=xx" where xx is the ID) and then append it to a URL with
    &styleid=xx
    where xx is your style id. It's then stored in a cookie. Make sure none of your forums have "override user-specificed style" set to yes.

    However this won't do what you initially asked because then if they go to another forum (say that one is supposed to be red) it will keep the green, unless you force override styles as noted above.
    Also there's no easy way to set the search link with a different style id depending on which forum you're in.

  5. #5
    Senior Member chilliboy is on a distinguished road
    Join Date
    Jun 2001
    Location
    UK
    Age
    38
    Posts
    224
    Thanks for your help.

    Just thinking: and it brings me back to my post below on "$Variables accessible to includephp" - is it possible to set to set the styleid variable in there?

    If so it brings me back to the switch statement I want to do - If I can find out which forum a user is currently in, what are its parent forums etc then I can set the $styleid by this. Also if this is executed before 'headers' are sent or more specifically cookies are sent then I should be able to accomplish what I want.

    I had a look at the functions in functions.php and found the 2/3 that I think I'm looking for:

    function getuserinfo ($userid) {
    global $DB_site;
    static $usercache;

    if (!isset($usercache[$userid])) {
    $usercache["$userid"]=$DB_site->query_first("SELECT user.*,userfield.* FROM user LEFT JOIN userfield ON userfield.userid=user.userid WHERE user.userid='$userid'");

    $usercache["$userid"]['showsignatures'] = iif(($usercache["$userid"]['options'])&SHOWSIGNATURES,1,0);
    $usercache["$userid"]['showavatars'] = iif(($usercache["$userid"]['options'])&SHOWAVATARS,1,0);
    $usercache["$userid"]['showimages'] = iif(($usercache["$userid"]['options'])&SHOWIMAGES,1,0);
    $usercache["$userid"]['showvbcode'] = iif(($usercache["$userid"]['options'])&SHOWVBCODE,1,0);
    }

    return $usercache[$userid];
    }

    AND

    // ###################### Start getforumarray #######################
    function getforumarray($forumid) {
    global $DB_site,$forumcache;

    static $forumarraycache;

    if (isset($forumarraycache["$forumid"])) {
    return $forumarraycache["$forumid"];
    } else if (isset($forumcache["$forumid"])) {
    return $forumcache["$forumid"]['parentlist'];
    } else {
    $foruminfo=$DB_site->query_first("SELECT parentlist FROM forum WHERE forumid='$forumid'");
    $forumarraycache["$forumid"]=$foruminfo['parentlist'];
    return $foruminfo['parentlist'];
    }
    }

    // ###################### Start getforumlist #######################
    function getforumlist($forumid,$field="forumid",$joiner="OR ",$parentlist="") {
    global $DB_site;

    if (!$parentlist) {
    $parentlist=getforumarray($forumid);
    }

    return "($field='".implode(explode(",",$parentlist)," ' $joiner $field='")."')";

    }

    I guess useing these will give me some variables which will indicate which forum the current user is in ($forumid is passed via url any way so I can use that).

    I don't know however what the $Variables outputed by these functions will hold.

    If you know what going on here and know how I could get the array of 'parent forums' and forum names relating to these 'forumids' I'd be really grateful.

    Cheers

+ Reply to Thread

Similar Threads

  1. Inheriting templates header and footer
    By globalstrata in forum vBulletin 3.0 How Do I and Troubleshooting Forum
    Replies: 3
    Last Post: Sun 30th May '04, 8:54pm
  2. Uploaded Style not Inheriting
    By Chroder in forum vBulletin 3.0 How Do I and Troubleshooting Forum
    Replies: 2
    Last Post: Mon 17th May '04, 2:27am
  3. Version 2.3.0 -- Serch Engine Spiderable Option?
    By Still Waters in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 2
    Last Post: Tue 20th May '03, 1:49pm
  4. forums inheriting permissions
    By Jake Bunce in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 1
    Last Post: Fri 3rd May '02, 11:52am
  5. HOW CAN I serch for double-bytes character set
    By wbonline in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 6
    Last Post: Wed 24th Oct '01, 3:47pm

Bookmarks

Posting Permissions

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