vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Different Styles and Headers. help! (https://vborg.vbsupport.ru/showthread.php?t=44312)

obiwan8472 10-05-2002 01:31 PM

Different Styles and Headers. help!
 
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
PHP Code:

    $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:
PHP Code:

    $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
PHP Code:

  $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
PHP Code:

  $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


All times are GMT. The time now is 02:20 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.04004 seconds
  • Memory Usage 1,758KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)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