vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Need help on a basic Script (https://vborg.vbsupport.ru/showthread.php?t=152218)

Hendrizius 07-14-2007 01:53 PM

Need help on a basic Script
 
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:
Code:

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

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

<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

Code:

<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.

Code:

<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

Quote:

Originally Posted by Dismounted (Post 1291622)
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

Quote:

Originally Posted by Hendrizius (Post 1292555)
Thank you, how do I have to add the else Condition?

http://www.vbulletin.com/docs/html/m...e_conditionals

Hendrizius 10-11-2007 07:50 PM

Yep, I tried it, however, it doesn't work :/


All times are GMT. The time now is 12:15 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.01072 seconds
  • Memory Usage 1,731KB
  • 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_code_printable
  • (2)bbcode_quote_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