View Full Version : How do I ignore the default css
Satviewers
02-10-2010, 02:10 AM
I have this:
vBulletin php file
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'osc_shop');
//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('oscShop',
);
// 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('' => 'osc Shopping Cart'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'osc Shopping Cart';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('oscShop');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('includeshopbody', $includeshopbody);
print_output($templater->render());
?>
Plugin Hook Location: global_start
if (THIS_SCRIPT == 'osc_shop')
{
ob_start();
include('./packages/shop/osc_shop.php');
$includeshopbody = ob_get_contents();
ob_end_clean();
}
Template: oscShop
{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}
</head>
<body>
{vb:raw header}
{vb:raw navbar}
{vb:raw includeshopbody}
{vb:raw footer}
</body>
</html>
How do I get it use the default css for the {vb:raw header}, {vb:raw navbar} and {vb:raw footer}.
But I want the {vb:raw includeshopbody} to ignore the default css.
Lynne
02-10-2010, 07:14 PM
You can't. Just don't use any of the default css. You don't need to call any of the classes defined. If some default css is getting used anyway, create your own class to apply that does whatever-it-is your own way.
Satviewers
02-11-2010, 02:45 AM
Thanks for pointing me in the right direction.
I have created a template called oscShop_headinclude, and put what is in the template headinclude into it, just to check that it working before I put my css in it.
In the Template: oscShop I changed {vb:raw headinclude} to {vb:raw oscShop_headinclude}
{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 oscShop_headinclude}
</head>
<body>
{vb:raw header}
{vb:raw navbar}
{vb:raw includeshopbody}
{vb:raw footer}
</body>
</html>
Can you tell me please what else I need to do.
Lynne
02-11-2010, 08:30 PM
Well, you'd need to render the template you created. And, if it has most of the same stuff as done in the headinclude, you probably want to do that using a hook right where that template is rendered so that the variables are all available for use.
Satviewers
02-11-2010, 10:27 PM
I have changed my
vBulletin php file to:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
$_shopfile = basename($_SERVER['SCRIPT_FILENAME'], '.php');
if (($pos = strrpos($_shopfile, '.')) !== false) {$_shopfile = substr($_shop, 0, $pos);}
define('THIS_SCRIPT', 'osc_' . $_shopfile);
//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(
'oscShop',
'oscShop_headinclude'
);
// 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('' => 'osc Shopping Cart'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'osc Shopping Cart';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('oscShop');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('includeshopbody', $includeshopbody);
$templater->register('oscShop_headinclude', $oscShop_headinclude);
print_output($templater->render());
?>
I changed in it, the $globaltemplates and $templater->
Is that correct.
Not sure what else to do.
Hope someone can help, please.
BSMedia
02-11-2010, 11:18 PM
NVM: It was already suggested
Satviewers
02-11-2010, 11:50 PM
NVM: It was already suggested
Yes, but I still need some help with it.
Can't get any further.
BSMedia
02-12-2010, 01:52 PM
Just create a custom css file for the page like page.css
Include this page.css AFTER all the standard vBulletin CSS has been called.
Redefine any definitions in page.css you want to redo.
Alternativly since you just want header, navbar and footer. You could copy and paste the code from vbulletin-chrome.css that pertains to those sections into page.css and not call any additional css files.
Satviewers
02-12-2010, 02:38 PM
I have created a Template called oscShop_headinclude.
It is a copy of headinclude with reset-fonts.css, removed. As that css was causing the problem on my integrated page.
<meta http-equiv="Content-Type" content="text/html; charset={vb:stylevar charset}" />
<meta id="e_vb_meta_bburl" name="vb_meta_bburl" content="{vb:raw vboptions.bburl}" />
<base href="{vb:raw vboptions.bburl}/" /><!--[if IE]></base><![endif]-->
<meta name="generator" content="vBulletin {vb:raw vboptions.templateversion}" />
<vb:if condition="$show['threadinfo']">
<vb:elseif condition="$show['foruminfo']" />
<meta name="keywords" content="{vb:raw foruminfo.title_clean}, {vb:raw vboptions.keywords}" />
<meta name="description" content="<vb:if condition="$pagenumber > 1">{vb:rawphrase page_x, {vb:raw pagenumber}}-</vb:if>{vb:raw foruminfo.description_clean}" />
<vb:else />
<meta name="keywords" content="{vb:raw vboptions.keywords}" />
<meta name="description" content="{vb:raw vboptions.description}" />
</vb:if>
<script type="text/javascript" src="{vb:stylevar yuipath}/yuiloader-dom-event/yuiloader-dom-event.js?v={vb:raw vboptions.simpleversion}"></script>
<script type="text/javascript" src="{vb:stylevar yuipath}/connection/connection-min.js?v={vb:raw vboptions.simpleversion}"></script>
<script type="text/javascript">
<!--
var SESSIONURL = "{vb:raw session.sessionurl_js}";
var SECURITYTOKEN = "{vb:raw bbuserinfo.securitytoken}";
var IMGDIR_MISC = "{vb:stylevar imgdir_misc}";
var IMGDIR_BUTTON = "{vb:stylevar imgdir_button}";
var vb_disable_ajax = parseInt("{vb:raw vboptions.disable_ajax}", 10);
var SIMPLEVERSION = "{vb:raw vboptions.simpleversion}";
var BBURL = "{vb:raw vboptions.bburl}";
// -->
</script>
<script type="text/javascript" src="{vb:raw vboptions.bburl}/clientscript/vbulletin-core.js?v={vb:raw vboptions.simpleversion}"></script>
{vb:raw template_hook.headinclude_javascript}
<vb:if condition="$vboptions['externalrss']">
<link rel="alternate" type="application/rss+xml" title="{vb:raw vboptions.bbtitle} {vb:rawphrase rss_feed}" href="{vb:raw vboptions.bburl}/external.php?type=RSS2" />
<vb:if condition="$show['foruminfo'] OR $show['threadinfo']">
<link rel="alternate" type="application/rss+xml" title="{vb:raw vboptions.bbtitle} - {vb:raw foruminfo.title_clean} - {vb:rawphrase rss_feed}" href="{vb:raw vboptions.bburl}/external.php?type=RSS2&forumids={vb:raw foruminfo.forumid}" />
</vb:if>
</vb:if>
<vb:if condition="$vboptions['storecssasfile']">
<link rel="stylesheet" type="text/css" href="{vb:var vbcsspath}main-rollup.css" />
<vb:else />
<link rel="stylesheet" type="text/css" href="{vb:var vbcsspath}bbcode.css,editor.css,popupmenu.css,vbul letin.css,vbulletin-chrome.css,vbulletin-formcontrols.css{vb:raw custom_global_css_reference}" />
</vb:if>
{vb:raw template_hook.headinclude_css}
How do I get the {vb:raw oscShop_headinclude} to work, that is in the Template: oscShop
{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 oscShop_headinclude}
</head>
<body>
{vb:raw header}
{vb:raw navbar}
{vb:raw includeshopbody}
{vb:raw footer}
</body>
</html>
Not sure if it is rendered correctly in the vBulletin php file.
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
$_shopfile = basename($_SERVER['SCRIPT_FILENAME'], '.php');
if (($pos = strrpos($_shopfile, '.')) !== false) {$_shopfile = substr($_shop, 0, $pos);}
define('THIS_SCRIPT', 'osc_' . $_shopfile);
//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(
'oscShop',
'oscShop_headinclude'
);
// 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('' => 'osc Shopping Cart'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'osc Shopping Cart';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('oscShop');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('includeshopbody', $includeshopbody);
$templater->register('oscShop_headinclude', $oscShop_headinclude);
print_output($templater->render());
?>
Is there a plugin that needs to be created to.
If so, what should be in it.
Thanks.
Satviewers
02-13-2010, 05:20 PM
Really need someone to help with this please.
Lynne
02-13-2010, 08:56 PM
I think I already said that if you are going to create your own headinclude template, then you need to eval it where the other headinclude template was evaled or else you need to include all the code for the headinclude template in your page. Did you do one of those? I really think this is the wrong way to go about this. And easier way, still not the way I would do it, would be to just edit the headinclude template and just put a condition around the part you don't want included (if THIS_SCRIPT == whatever).
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.