View Full Version : Different Styles and Headers. help!
obiwan8472
10-05-2002, 01:31 PM
I have designed a Default Style for my board which has a banner in the header and custom buttons for Register, My Profile etc...
Now.. I created a new Template (so members can have a choice) but after creating a new Replacement Set and Template I lost the look of my board (its got custom menus etc..)
So. I made it run off the oringinal templates BUT it wont change colours then! eek.
What I want to do... is have 2 (maybe more) different styles with different Headers in them.
Is this possible? do I need a hack?
A little help please folks!
Thanx!
Jon
Xenon
10-05-2002, 02:51 PM
hmm, must it be ASAP or can you wait?
because vb3 has divided the header and footer from the templateset , so you can create new styles with different headers and footers, but they all use the same normal templates
obiwan8472
10-05-2002, 03:00 PM
If theres a way I can do it now, it would be good. I am reopening my site next Saturday you see.
When is vb3 due out?
Xenon
10-05-2002, 03:05 PM
no dateline is set...
well you can hack the gettemplate function to always use the same templateset id except for header/footer
btw. colorchanges have nothing to do with differen templatesets if you've set up the colors in your style.
templates just use replacementvars to get the right colors...
obiwan8472
10-05-2002, 03:12 PM
Thanx for your help.
Is there a thread that explains how to hack gettemplate ?
(new to vb u see. :D)
Xenon
10-05-2002, 03:34 PM
hmm, i think there isn't one out as i know..
you have to change two things or your queryammount would rise..
ok, open admin/functions.php find $gettemp=$DB_site->query_first("SELECT template FROM template WHERE title='".addslashes($templatename)."' AND (templatesetid=-1 OR templatesetid=" . intval($templatesetid). ") ORDER BY templatesetid DESC LIMIT 1");
change it to:
$gettemp=$DB_site->query_first("SELECT template FROM template WHERE title='".addslashes($templatename)."' AND (templatesetid=-1 OR templatesetid=1 OR templatesetid=" . intval($templatesetid). ") ORDER BY templatesetid DESC LIMIT 1");
then find
$temps=$DB_site->query("SELECT template,title
FROM template
WHERE (title IN ('$templateslist')
AND (templatesetid=-1 OR templatesetid=" . intval($templatesetid) . "))
".iif ($loadmaxusers,"OR (title = 'maxloggedin')","")."
".iif ($loadbirthdays,"OR (title = 'birthdays')","")."
ORDER BY templatesetid");
and change it to
$temps=$DB_site->query("SELECT template,title
FROM template
WHERE (title IN ('$templateslist')
AND (templatesetid=-1 OR templatesetid=1 OR templatesetid=" . intval($templatesetid) . "))
".iif ($loadmaxusers,"OR (title = 'maxloggedin')","")."
".iif ($loadbirthdays,"OR (title = 'birthdays')","")."
ORDER BY templatesetid");
where i've inserted templatesetid=1 make sure that your main setid is 1, if its another id, change it to that in my code ;).
then you can create new styles with new templatesets. every template you make custom in your new set would be taken from the new set, everyone you let be original would take from templatesetid=1. if there isn't one it'll use the global one
obiwan8472
10-05-2002, 03:48 PM
Brilliant!
Thankyou so much. It works.
Thanks for your time. :) :)
Xenon
10-05-2002, 03:53 PM
:)
you're welcome
FleaBag
10-17-2002, 12:50 AM
Thanks for this Xenon. :)
Xenon
10-17-2002, 09:07 AM
you're welcome :)
FleaBag
10-28-2002, 02:41 PM
Hmmmm doesn't seem to be working when I tried to implement it. It's just creating sets as normal.
Xenon
10-28-2002, 02:47 PM
well it should, as you can see at obiwan.
be sure your maintemplateset has the lowest setid of the templatesets
FleaBag
10-28-2002, 03:14 PM
I don't understand what you mean...
Xenon
10-28-2002, 03:17 PM
ORDER BY templatesetid
that's why your default templatesetid must be the lowest.
all custom header/footer templatesets must have a higher setid
FleaBag
10-30-2002, 05:07 PM
Right, I installed this hack and my default style started using the global style. I don't understand? :(
Hmmm great, just realised my default style has now been deleted [of which I have no backup].
Xenon
10-30-2002, 05:10 PM
huh?
try to reverse sort order:
ORDER BY templatesetid DESC
FleaBag
10-30-2002, 05:34 PM
That mean's nothing to me I'm sorry... How do I do that? And the style is gone from my database.
Xenon
10-31-2002, 10:37 AM
you have to change the ORDER part in the query into the new part
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.