vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=263)
-   -   Ad module conditions in vBulletin Cloud 5 (https://vborg.vbsupport.ru/showthread.php?t=324273)

solocommand 01-23-2017 07:23 PM

Ad module conditions in vBulletin Cloud 5
 
1 Attachment(s)
Hi folks,

After submitting a support request on vbulletin.com I was told to post here requesting help. We are using the hosted version of vBulletin Cloud (5.2.5) and having trouble using conditionals and variables inside an ad module. Ultimately I need access to the current thread ID if there is one to map to a topic ID with my ad provider. This was previously done as a PHP plugin in the non-hosted version.

Screenshot of the ad module is attached (with the direction that you can use conditionals and variables!)

The following code

Code:

<vb:if condition="condition"><!-- conditionals working --></vb:if>
<script type="text/javascript" src="https://cygnus-d.openx.net/w/1.0/jstag"></script>
<!-- {vb:var thread} -->
<script type="text/javascript">
console.info('thread', "{vb:raw thread}");
OX.requestAd({"auid":"498342"});
</script>

results in the following HTML output

Code:

<div class="widget-content restore axd axd_187">


<div class="axd-inner js-module__hide-if-empty ">

<div class="ad_187_inner"><vb:if condition="condition"><!-- conditionals working --></vb:if>
<script type="text/javascript" src="https://cygnus-d.openx.net/w/1.0/jstag"></script>
<!-- {vb:var thread} -->
<script type="text/javascript">
console.info('thread', "{vb:raw thread}");
OX.requestAd({"auid":"498342"});
</script></div>

</div>
</div>
</div>
<!-- *** END WIDGET widgetid:38, widgetinstanceid:187, template:widget_ad *** -->

<!-- *** START WIDGET widgetid:38, widgetinstanceid:188, template:widget_ad *** -->

Note that the <vb:if> and {vb:raw} tags are rendered in the HTML response when loading the page.

I tried to report that this wasn't working as it is supposed to be and was told to post about it here by the support staff. Any ideas? Are conditionals and variables not actually available or am I doing something wrong?

solocommand 01-23-2017 07:40 PM

According to a VB developer, template conditionals are disabled in all ad modules. Mods, feel free to close.

noypiscripter 01-24-2017 12:14 AM

The thread id is stored in the pageData.nodeid JS variable. If you are on a thread page, that nodeid is the id of the thread.

solocommand 01-24-2017 04:57 PM

Quote:

Originally Posted by noypiscripter (Post 2581260)
The thread id is stored in the pageData.nodeid JS variable. If you are on a thread page, that nodeid is the id of the thread.

Thanks! This should actually get me exactly what I need.


All times are GMT. The time now is 12:30 PM.

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.01512 seconds
  • Memory Usage 1,720KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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