The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Conditional if else statement and preg_match
Hello
I am trying to make a "Google Revenue Sharing" in my forum I create a new field so users can add their Adsense ID then I tried coding the if else statement but it's not working correctly and I placed this code in the new AD system that VB 4.0.4 provides.. if the user entered his adsense id, it should show his adsense ad inside his thread. if the user did not enter any adsense id (field is empty) it should show my adsense id. here is my code: HTML Code:
<vb:if condition="$show['field455']"> <div style="float:left;margin:4px"> <script type="text/javascript"> google_ad_client = "{vb:raw post.field455}"; google_ad_width = 336; google_ad_height = 280; google_ad_format = "336x280_as"; google_ad_type = "text"; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "0000FF"; google_color_text = "000000"; google_color_url = "6600CC"; </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> </div> <vb:else /> <div style="float:left;margin:4px"> <script type="text/javascript"> google_ad_client = "pub-XXXXXXXXXXXXXXXX"; google_ad_channel = "XXXXXXXXXX"; google_ad_width = 336; google_ad_height = 280; google_ad_format = "336x280_as"; google_ad_type = "text"; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "0000FF"; google_color_text = "000000"; google_color_url = "6600CC"; </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> </div> </vb:if> 2. what is the preg_match so the user should enter the correct format of the Adsense ID. pub-################thank you --------------- Added [DATE]1277495356[/DATE] at [TIME]1277495356[/TIME] --------------- any idea folks ? |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|