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)

Lynne 10-22-2015 09:23 PM

THIS_SCRIPT is the actual variable name, so...

HTML Code:

<vb:if condition="THIS_SCRIPT != 'custom page'">
You would get that from this area in your php page:

PHP Code:

define('THIS_SCRIPT''test'); 

Replace 'custom page' with whatever you set that variable to in your php (in the above example, it would be 'test').

I.G.O.T.A. 10-22-2015 09:53 PM

I did that and now for some reason getting this. It looks like all tags are closed, but obviously I'm missing one, lol.

The following error occurred when attempting to evaluate this template:
Unclosed Tag
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

Lynne 10-23-2015 12:09 AM

I didn't look closely at the code, but you only want the tags around the specific code you are adding to your page and don't want doubled.

HTML Code:

<vb:if condition="THIS_SCRIPT != 'custom page'">
<meta name="description" content="test">
<meta name="keywords" content="test">
<meta name="author" content="I.G.O.T.A.?">
</vb:if>


Alice 12-12-2015 03:15 PM

Quote:

Originally Posted by Lynne (Post 1920141)
They are working as defined - both of these are from the reset-fonts.css file:
HTML Code:

h1, h2, h3, h4, h5, h6 {font-size:100%;font-weight:normal;}body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td {margin:0;padding:0;}
If you want it different, give it a class and define it yourself.

Okay so I checked the css template and I found that the tags: UL, OL, LI; which are necessary for coding bullet points onto the page, are already there and properly defined, and yet, this page still will not show the properly formatting of bullet points. I have included the exact code that is present in my reset-fonts.css template below.

I would appreciate any support that you are able to provide.

Thank you,

Code:

/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align: {vb:stylevar left};}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#fff;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;}body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}select,input,button,textarea,button{font:99% arial,helvetica,clean,sans-serif;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}


Dragonsys 12-12-2015 04:14 PM

Quote:

Originally Posted by Seraphyn (Post 2560280)
Okay so I checked the css template and I found that the tags: UL, OL, LI; which are necessary for coding bullet points onto the page, are already there and properly defined, and yet, this page still will not show the properly formatting of bullet points. I have included the exact code that is present in my reset-fonts.css template below.

I would appreciate any support that you are able to provide.

Thank you,


For your list, create a custom class and use it to define the bullets

sr20de_99 05-11-2016 11:51 AM

Should the samples listed in the first post work for a custom page when people aren't logged in?

Based on what was in the first post I've created the following, which seems to only work if I'm logged in. I need to setup a custom public page for people to sign up for various events.

ACME_CUSTOM_PAGE_TEMPLATE
HTML Code:

{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
  <head>
    <title>{vb:raw vboptions.bbtitle} - {vb:raw pagetitle}</title>
    {vb:raw headinclude}
    {vb:raw headinclude_bottom}
  </head>
  <body>
    {vb:raw header}
   
    {vb:raw navbar}
   
    <h2 id="acme_bannerTitle"class="blockhead">{vb:raw bannerTitle}</h2>
    <div class="blockbody">
      <div class="blockrow">
        <div id="acmeContents">
          {vb:raw my_var}
        </div>
      </div>
    </div>

    {vb:raw footer}
  </body>
</html>

acme_vbPublic.php (This is the file that my vBulletin "Public" Tab points to.)
Code:

<?php
        $tabScriptName = 'PublicTabScript';
        $pagetitle = 'ACME Public ($pagetitle)';
        $phpFile = './acme_custom/acme_public.php';
        $navTitle = 'Public Tab';
        $bannerTitle = 'Public Page Example';

        require_once($_SERVER['DOCUMENT_ROOT'] . "/acme_custom/acme_vb.php");
?>

acme_vb.php
Code:

<?php

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

// #################### DEFINE IMPORTANT CONSTANTS #######################
        define('THIS_SCRIPT', $tabScriptName);
        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('ACME_CUSTOM_PAGE_TEMPLATE');

// 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');
        chdir($_SERVER['DOCUMENT_ROOT']);
        require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
        $navbits = construct_navbits(array('' => $navTitle));
        $navbar = render_navbar_template($navbits);

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

<?php

        ob_start();
        include($phpFile);
        $includedphp = ob_get_contents();
        ob_end_clean();

        $my_var .= $includedphp;

        $templater = vB_Template::create('ACME_CUSTOM_PAGE_TEMPLATE');
        $templater->register_page_templates();
        $templater->register('navbar', $navbar);
        $templater->register('pagetitle', $pagetitle);
        $templater->register('bannerTitle', $bannerTitle);
        $templater->register('my_var', $my_var);
        print_output($templater->render());
?>

acme_public.php
Code:

<div>
        This is my public page.
</div>

Navigation Tab Setup
https://vborg.vbsupport.ru/external/2016/05/22.png

Dave 05-11-2016 01:10 PM

Based on the code you posted, I don't see anything out of the ordinary that should cause such thing to happen.

sr20de_99 05-11-2016 01:31 PM

ARGH!!!

Nothing to see here, move along. I figured it out. My template is currently only applied to one style. When I'm not logged in and visit the page, the style where my template is not selected. When I select the style then click on my "Public" tab, then everything works.

MarkFL 05-11-2016 01:34 PM

Quote:

Originally Posted by sr20de_99 (Post 2570562)
ARGH!!!

Nothing to see here, move along. I figured it out. My template is currently only applied to one style. When I'm not logged in and visit the page, the style where my template is not selected. When I select the style then click on my "Public" tab, then everything works.

Put your site into debug mode, and then add the template to the "Master Style" so it will be auto-added to every style. :)

sr20de_99 06-02-2016 07:38 PM

OK I'm back again. Everything seems to work fine for me on my local machine, but I ran into 404 errors when trying my code on my live site.

On my live site vBulletin is loaded directly under httpdocs folder. I have placed all of my code under httpdocs/acme_custom. When I load the page all of the styling is off, and upon further investigation I have a bunch of 404 errors, and none of the standard vBulletin links like Forum or Contact Us work. If I place my custom php file (acme_vbPublic.php) in httpdocs then everything works.

I performed a chgdir prior to the globl.php, so I'm not sure where I've gone wrong.
Code:

chdir($_SERVER['DOCUMENT_ROOT']);
require_once('./global.php');

Here's a screen shot of the page and the errors:
https://vborg.vbsupport.ru/external/2016/06/9.png

If I inspect the 404 errors, the request url is http://my-site.ca/acme_custom/client...event.js?v=423

I do not reference any of those resources that have 404 errors, I'm assuming that they are part of the global.php script.

Any clues? I'd prefer to keep all of my code under the acme_custom directory.


All times are GMT. The time now is 08:33 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.01987 seconds
  • Memory Usage 1,767KB
  • 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
  • (5)bbcode_code_printable
  • (4)bbcode_html_printable
  • (1)bbcode_php_printable
  • (3)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