PDA

View Full Version : Need help on a basic Script


Hendrizius
07-14-2007, 01:53 PM
I would like to set up a script that changes, when Users change the style. This could be used for Advertising, changing the colour, when the Skin changes.

I am using 3 different styles so it should have an if, else, elseif function. But I am really not sure how to set it up.

Style IDs: 16, 15 and 31

Code 16:
<script type="text/javascript"><!--
google_ad_client = "pub-5644726162652543";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

Code 15:
<script type="text/javascript"><!--
google_ad_client = "pub-5644726162652543";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "336699";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

Code 31:
<script type="text/javascript"><!--
google_ad_client = "pub-5644726162652543";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
//2007-07-14: Welcome Area AD
google_ad_channel = "5574964608";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

Help is appreciated. I could paste the Code into my VB-Admanagement then easily and optimize the look of all my styles :).

So to put it into a nutshell:
If Style ID = 16 then Code 16
else if Style ID = 15 then Code 15
else if Style ID = 31 then code 31

Thank you,

Hendricius

nico_swd
07-14-2007, 05:20 PM
<if condition="$styleid == 15">

<!-- code if style id is 15 //-->

</if>

nexialys
07-14-2007, 06:04 PM
you do not need a condition, you just have to edit the proper style...

example, if you put your code in header, the template "header" of the style #15 would contain the code #15...

why is it so complicated?

Dismounted
07-15-2007, 05:33 AM
nexialys has the idea. Everyone's thinking too advanced.

Hendrizius
07-16-2007, 07:41 AM
Yea. But I would like to use it together with my VBadmanagement. Some Usergroups are not seeing ADs, that's why I need it in those IF-else conditions.

<if condition="$styleid == 15">

<!-- code if style id is 15 //-->

</if>

Thank you, how do I have to add the else Condition?

nexialys
07-16-2007, 11:26 AM
if you want to manage it from a script released here, just as in the related topic... this will be easier.

Brad
07-16-2007, 12:37 PM
nexialys has the idea. Everyone's thinking too advanced.
Not really.

There is no reason to have changes in all the sub-styles if a simple condition is used in a master template/style.

That asumes all styles are very similar of course.

nico_swd
07-16-2007, 04:50 PM
Thank you, how do I have to add the else Condition?

http://www.vbulletin.com/docs/html/main/template_conditionals

Hendrizius
10-11-2007, 07:50 PM
Yep, I tried it, however, it doesn't work :/