vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   THIS SCRIPT for Article Page? (https://vborg.vbsupport.ru/showthread.php?t=255329)

Sadikb 12-16-2010 11:25 AM

THIS SCRIPT for Article Page?
 
Hi

In VBCMS is there any counterpart of the SHOWTHREAD and FORUMDISPLAY this_script only for the article page?

What I want to do is to display some html only on the article page, but the code has to be put in the footer. In forums, i would simply do this in the footer template where my code is
HTML Code:

<vb:if condition="THIS_SCRIPT == 'showthread'">
blah blah blah
</vb:if>

I want to do similar but for article page. Any hints guys?

Thanks

calorie 12-16-2010 01:41 PM

There is this defined for the CMS:
Code:

define('THIS_SCRIPT', 'vbcms');
Does that work for you?

Sadikb 12-16-2010 01:53 PM

Hi Calories, thanks for your reply.

No it won't work because i want to be able to use the THIS_SCRIPT only for the article page, not for section page, not for category and not for CMS Home page.

calorie 12-16-2010 03:23 PM

Untested but maybe a plugin at the cache_templates hook:
Code:

// if we are in the CMS and the article page temple is there
// then define a constant for use in a template conditional

if (THIS_SCRIPT == 'vbcms' && in_array('vbcms_content_article_page', $cache))
{
        define('ON_ARTICLE_PAGE_ONLY', true);
}

And then the following template conditional in the footer:
Code:

<vb:if condition="defined('ON_ARTICLE_PAGE_ONLY')">
        blah blah blah
</vb:if>


Sadikb 12-16-2010 09:46 PM

Nopes it doesn't work, though the idea seems fine.

It's very late here... will try again in the morning.

tpearl5 02-18-2012 02:15 PM

I'm curious if you ever got this working?

Sadikb 02-18-2012 02:28 PM

Actually I don't remember... :)

I think I did get it to work at that time but since then I have changed almost everything on my site and so I don't know what I had done.


All times are GMT. The time now is 04:02 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.01021 seconds
  • Memory Usage 1,718KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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