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)

cellarius 06-08-2011 03:49 AM

You'd need much more than a simple variable. You basically need the code to get all the forum data from database.

KW802 06-08-2011 04:36 PM

Quote:

Originally Posted by Dave-ahfb (Post 2203611)
That is half the solution.

The problem then would be the second set of "default" meta tags also served up. To combat this I created a template which copies headinclude minus all the meta info, which is placed into the page templates.

This is the first time I have pulled out vb4 since the "not ready for prime time" release. Luckily after my 3rd attempt to locate my old test backups, I finally found them :).

I find myself in the same situation with trying to override a few of the default meta tags as well. Would've been good if there was a hook in headinclude for that purpose.

Lynne 06-08-2011 05:26 PM

Quote:

Originally Posted by KW802 (Post 2205127)
I find myself in the same situation with trying to override a few of the default meta tags as well. Would've been good if there was a hook in headinclude for that purpose.

There is no reason you cannot write a plugin that changes a meta tag for a page. As long as you are able to write a valid condition, you should be able to change it.

KW802 06-10-2011 04:45 PM

Quote:

Originally Posted by Lynne (Post 2205151)
There is no reason you cannot write a plugin that changes a meta tag for a page. As long as you are able to write a valid condition, you should be able to change it.

Lynne, would you mind giving an example of dynamically changing, for example, a pages meta tag (eg: description)? For example, using the code in the first post of this thread, if I was to generate a random value every time the page loads then how would I go about using that dynamic random value as the page meta description?

I can see that I can the style_fetch hook & a few other locations to have a constant meta tag override but I'm not seeing how to get a dynamic one in there for a custom page. :o

Thanks

Lynne 06-10-2011 04:56 PM

Just add this to your test.php page:
PHP Code:

      $vbulletin->options['description'] = "This is a test"

That will set the description for that page.

KW802 06-10-2011 05:08 PM

Quote:

Originally Posted by Lynne (Post 2205909)
Just add this to your test.php page:
PHP Code:

      $vbulletin->options['description'] = "This is a test"

That will set the description for that page.

Hhhhhmm.... was one of the first things I tried but was still getting the generic vB description out of the ACP. I'll try again using a more simplistic page tonight. :o

scubasteve3 06-11-2011 12:22 AM

For some reason all of my text goes above the template, above the template header. I am putting my coding after:

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

$navbits = construct_navbits(array('' => 'Test Page'));
$navbar = render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'This is a Test Page';

Lynne 06-11-2011 02:13 AM

You should have no echo statements in your coding or it will go above the template header. All output in your page should be assigned to a variable, that variable registered for use in a template, and then the variable put in the template where you want your output to show.

NgocTam 06-15-2011 01:39 PM

how to support php

CouponWCents 06-16-2011 02:57 PM

I know how to create a template but how do you "create a new file"?


All times are GMT. The time now is 09:59 AM.

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.01590 seconds
  • Memory Usage 1,746KB
  • 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_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)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