vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Create your own vBulletin page (https://vborg.vbsupport.ru/showthread.php?t=228112)

pjkcards 10-25-2011 08:30 PM

How can I not show the footer advertisement (in AdminCP>Advertising>Manage Ads) on this custom vB page? Thanks!

Lynne 10-25-2011 09:25 PM

Quote:

Originally Posted by pjkcards (Post 2261521)
How can I not show the footer advertisement (in AdminCP>Advertising>Manage Ads) on this custom vB page? Thanks!

You would need to put a condition around your footer add to not show it on this page.

pjkcards 10-27-2011 04:36 AM

Quote:

Originally Posted by Lynne (Post 2261550)
You would need to put a condition around your footer add to not show it on this page.

Thanks. So the page.php has this:
Code:

define('THIS_SCRIPT', 'thankyou');
So I setup this conditional:
Code:

<vb:if condition="THIS_SCRIPT != 'thankyou'">
the ad stuff here
</vb:if>

And when I visit page.php, the ad stuff still shows up. What am I missing here? Thanks

sivaganeshk 10-27-2011 05:30 AM

(try this)

PHP Code:

<vb:if condition="THIS_SCRIPT != 'page'">
the ad stuff here
</vb:if> 

----------------------------------------------------------------------------------------------------------------------

did u put the code in Manage advertisement right?

kh99 10-27-2011 02:43 PM

Quote:

Originally Posted by pjkcards (Post 2261939)
Thanks. So the page.php has this:
Code:

define('THIS_SCRIPT', 'thankyou');
So I setup this conditional:
Code:

<vb:if condition="THIS_SCRIPT != 'thankyou'">
the ad stuff here
</vb:if>

And when I visit page.php, the ad stuff still shows up. What am I missing here? Thanks


That all looks right to me, you shouldn't be seeing the ad stuff on that page. Where did you put the define() line? It needs to be before the require_once('global.php') line.

pjkcards 10-27-2011 06:55 PM

sivaganeshk: I tried what you suggested and it didn't work.

kh99: Yep, it is before the require_once('global.php'). Here is the code for the page:
Code:

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT', 'thankyou');
define('CSRF_PROTECTION', true); 
// change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array('custom_thankyou',
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
// if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line
// chdir ('/path/to/your/forums');
require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = construct_navbits(array('' => 'Order Complete'));
$navbar = render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'Order Complete';

// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######

$templater = vB_Template::create('custom_thankyou');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());

?>

I put the conditions in the AdminCP > Advertising > Manage Ads, and in the ad HTML box. Here is the text in the ad HTML box
Code:

<vb:if condition="THIS_SCRIPT != 'thankyou'">
<center>
script to display advert
</center>
</vb:if>

Any ideas as to why this isn't working? I'm stumped.

kh99 10-27-2011 08:28 PM

Quote:

Originally Posted by pjkcards (Post 2262113)
I put the conditions in the AdminCP > Advertising > Manage Ads, and in the ad HTML box.

[S]Oh, that's probably it - you can only use conditions in a template. You'd need to find the ad variable in the footer template and put the condition tags around that instead.[/S]

Edit: this was wrong - you *can* use conditions in the ad code, as it says on the ad editing page.

pjkcards 11-02-2011 06:56 AM

Quote:

Originally Posted by kh99 (Post 2262124)
[S]Oh, that's probably it - you can only use conditions in a template. You'd need to find the ad variable in the footer template and put the condition tags around that instead.[/S]

Edit: this was wrong - you *can* use conditions in the ad code, as it says on the ad editing page.

I thought I could, but I don't know of any other reason for this not working. If you have any other ideas, please let me know. Thanks.

Lynne 11-02-2011 03:59 PM

I added an ad to my test site with that condition around it (only my test page has THIS_SCRIPT set to test) and it worked just fine. Do you have any other conditions set for the ad?

Krosi1906 11-06-2011 02:11 PM

edit

---
for delete
---


All times are GMT. The time now is 01:48 AM.

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.02931 seconds
  • Memory Usage 1,754KB
  • 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
  • (6)bbcode_code_printable
  • (1)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (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