vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   vBulletin Template Conditionals (https://vborg.vbsupport.ru/showthread.php?t=215032)

ilrglen 09-09-2009 03:44 PM

I have some ads that I want to place on my site that would be displayed according to the location of the visiting members. For example, a member from Germany would see mostly ads from German sponsors while someone from England would see mostly ads from British sponsors. But I don't know how the software could detect there location.

Quote:

Originally Posted by Redlinemotorsports (Post 1881978)
Can you be more specific?


Favourtism 09-09-2009 04:28 PM

Is it possible to insert an advert on forum_home under the second forum category using this?

HMBeaty 09-09-2009 04:40 PM

Quote:

Originally Posted by ilrglen (Post 1882117)
I have some ads that I want to place on my site that would be displayed according to the location of the visiting members. For example, a member from Germany would see mostly ads from German sponsors while someone from England would see mostly ads from British sponsors. But I don't know how the software could detect there location.

You would have to use a custom profile field to accomplish this. You may discuss this with me over instant messenger if you like.
Quote:

Originally Posted by Favourtism (Post 1882140)
Is it possible to insert an advert on forum_home under the second forum category using this?

Not completely sure, but I believe you can

Big-K 09-17-2009 02:28 PM

I want to have a particular style for posts which have been reported (i.e. reportthreadid <> 0). However, I do NOT want this style to be implemented if the thread that has been created as a result of the report has more than 1 post (i.e. if a moderator has responded to the reported thread, I want the style to be switched off).

I figure that this should be something like <if condition="get_thread_post_count($post['reportthreadid']) > 1)">...</if>, but I don't know what function to have instead of get_thread_post_count.

adamenty 10-09-2009 08:40 AM

Quote:

<if condition="in_array($forum['forumid'], array(24,25))">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="alt1" width="100%">
<center>
SSsdfsdfsdffg
</center>
</td>
</tr>
</table>
</if>
Will above one work ?

ilrglen 10-10-2009 04:42 AM

How about if I want to display an image to people from a particular country only or a group of countries? Is such a thing possible?

HMBeaty 10-10-2009 12:42 PM

Quote:

Originally Posted by ilrglen (Post 1897413)
How about if I want to display an image to people from a particular country only or a group of countries? Is such a thing possible?

Best thing I can think of for this is to create a custom profile field and base your conditional off of that. For example, if you want to show something to someone who is only in the United States, you would use:
HTML Code:

<if condition="$userinfo['fieldxx'] == 'United States'">
More code here
</if>


ilrglen 10-10-2009 01:45 PM

Quote:

Originally Posted by HMBeaty (Post 1897549)
Best thing I can think of for this is to create a custom profile field and base your conditional off of that. For example, if you want to show something to someone who is only in the United States, you would use:
HTML Code:

<if condition="$userinfo['fieldxx'] == 'United States'">
More code here
</if>


That's what I thought. Thanks. I was just hoping there might be a better way than the custom profile field because there is a limit to the number of countries a person can list. I suppose if I just list those that would make up the largest audience to my site would be the best way to go about this and then just have a selection for other. Thanks.

LuisMontemayor 11-04-2009 03:16 PM

This code help me to put a different Title for the first post only:

PHP Code:

<if condition="$post[postcount] == 1">
<else />
</if> 


cmeinck 11-05-2009 03:30 PM

I'm currently using the following code in Postbit Legacy to show ads flush right within the first post content to guests only. How do I add or modify the conditional, so that ads flush right appear on each new page of a thread. Let's say every 10 posts, it displays the ad to guests.

Code:

                <!-- message -->
<if condition="$show['guest']">
<if condition="(($post[postcount] % $vboptions[maxposts] == 1))">
      <div class="postbit_adcode">
<span style="float: right; width: 300px; height: 250px;">

MY AD CODE

</span>
</div>
</if>
</if>
                <div id="post_message_$post[postid]"class="vb_postbit">$post[message]


</div>
                <!-- / message -->



All times are GMT. The time now is 02:17 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01233 seconds
  • Memory Usage 1,750KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete