vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Custom Pages (https://vborg.vbsupport.ru/showthread.php?t=222256)

Sergio68 09-01-2009 10:56 PM

Custom Pages
 
I'm trying to integrate my E-Commerce engine into vbulletin using customized pages, but I'm doing something wrong with the code.

I can make pages works but for some reason the vbulletin quick men? isn't working

Usually I use my engine e-commerce software by loading an header and a footer to wrap the engine itself, something like here : http://www.musclenutrition.com/carrello.php

Include header
php e-commerce code
include footer

With the vbulletin I did it like that :

Header :
PHP Code:

<?php

error_reporting
(E_ALL & ~E_NOTICE); 
define('NO_REGISTER_GLOBALS'1); 
define('GET_EDIT_TEMPLATES'true); 
define('THIS_SCRIPT''adv_index'); 
// ============================================
// Enter the full path to your forum here
// Example: /home/vbadvanced/public_html/forum
// ============================================

$forumpath '/home/webdir/www/www.bodyweb.com/forums';

// ============================================
// No Further Editing Necessary!
// ============================================

if (!is_dir($forumpath))
{
    echo 
'Invalid forum path specified! Please edit this file and be sure to include the correct path for your $forumpath variable.';
    exit;
}

chdir($forumpath);
$phrasegroups = array();
$globaltemplates = array();
$actiontemplates = array();
$specialtemplates = array();

require_once(
'./includes/vba_cmps_include_template.php');
require_once(
'./global.php');
// $vbulletin->options['homeurl'];
if(!isset($_POST)) {
  
extract($HTTP_POST_VARS);
  
extract($HTTP_GET_VARS);
  
extract($HTTP_COOKIE_VARS);
  
extract($HTTP_ENV_VARS);
  
extract($HTTP_SERVER_VARS);
} else {
  
extract($_POST);
  
extract($_GET);
  
extract($_COOKIE);
  
extract($_ENV);
  
extract($_SERVER);
}      
//$_GET["titolopagina"];
        
$navbits = array(); 
        
$navbits[''] = "$titolopagina"
        
$navbits construct_navbits($navbits); 
         eval(
'$navbar = "' fetch_template('navbar2') . '";'); 
      echo
"$stylevar[htmldoctype]
<html dir='
$stylevar[textdirection]' lang='$stylevar[languagecode]'>
<head>
<title>
$vboptions[bbtitle] -  $titolopagina - </title>
$headinclude
<script type='text/javascript' src='forums/clientscript/vbulletin_global.js'></script>
<script type='text/javascript' src='forums/clientscript/vbulletin_menu.js '></script>
</head>
$header
$navbar
<table width='100%' border='0' cellspacing='1' cellpadding='8'>
  <tr>
    <td align='center'><a href='http://www.bodyweb.com'><strong>SuperStore</strong></a></td>
    <td align='center'><a href='http://www.bodyweb.com/prodotti.php'><strong>Prodotti</strong></a></td>
    <td align='center'><a href='http://www.bodyweb.com/prodotti.php'><strong>Marche</strong></a></td>
    <td align='center'></td>
    <td align='center'><a href='http://www'><strong>Spedizioni</strong></a> - <a href='http://www'><strong>Pagamenti</strong></a> - <a href='http://www.bodyweb.com/tracking.php'><strong>Tracking</strong></a></td>
    <td align='center'><a href='http://www.bodyweb.com/carrello.php'><strong>Carrello</strong></a><a href='http://www.bodyweb.com/carrello.php'> <img src='http://www.bodyweb.com/forums/images/bodyweb/buttons/chart_bw.png' border='0' align='middle' ></a></td>
  </tr>
</table>


<br />
<table class='tborder' cellpadding='6' cellspacing='1' border='0' width='100%' align='center'>
<tr>
<td colspan='2' class='tcat'><div align='center'>
$titolopagina</div></td>
</tr>
<tr valign=top height='5' >
<td width='50%' height='5' align='center' valign='top' class='alt1'>
  <div align='center'>"
;
      
?>

Php e-commerce code

Footer :
PHP Code:

   <?php
 
     
echo" <br /><br />
  </div></td>
</tr>
</table>
$footer
</body>
</html>"
;
      
      
?>

That's the result : http://www.bodyweb.com/carrello.php
Everything is working but not the quick VB menu.

If I built a page like that it's working but I can't include any PHP :
PHP Code:

<?php
// ++=========================================================================++
// || vBadvanced CMPS v3.0.1 (vB 3.6 - vB 3.7) - 173
// || ? 2003-2008 vBadvanced.com - All Rights Reserved
// || This file may not be redistributed in whole or significant part.
// || http://vbadvanced.com
// || Downloaded 10:56, Wed Sep 17th 2008
// || 125950173_405237028456
// ++ ========================================================================++

error_reporting(E_ALL & ~E_NOTICE);
define('THIS_SCRIPT''adv_index');
define('VBA_PORTAL'true);
define('VBA_SCRIPT''CMPS');

// ============================================
// Enter the full path to your forum here
// Example: /home/vbadvanced/public_html/forum
// ============================================

$forumpath '/home/webdir/www/www.bodyweb.com/forums';

// ============================================
// No Further Editing Necessary!
// ============================================

if ($forumpath)
{
    if (!
is_dir($forumpath))
    {
        echo 
'Invalid forum path specified! Please edit this file and be sure to include the correct path for your $forumpath variable.';
        exit;
    }

    
chdir($forumpath);
}

$phrasegroups = array();
$globaltemplates = array();
$actiontemplates = array();
$specialtemplates = array();

require_once(
'./includes/vba_cmps_include_template.php');
require_once(
'./global.php');
   eval(
'$navbar = "' fetch_template('navbar2') . '";'); 
 
// print_portal_output($prodotti);
eval('print_output("' fetch_template('carrello') . '");');
?>

Then in a template called template i insert this code and some example text
PHP Code:

$stylevar[htmldoctype]
<
html dir="$stylevar[textdirection]lang="$stylevar[languagecode]xmlns="http://www.w3.org/1999/xhtml">
<
head>
<if 
condition="$pages['name'] == 'home'">
    <
meta http-equiv="Cache-Control" content="no-cache" />
    <
meta http-equiv="Pragma" content="no-cache" />
    <
meta http-equiv="Expires" content="0" />
</if>

<
title>$vboptions[hometitle] <if condition="$pagetitle">- $pagetitle</if></title>

$headinclude

</head>
<
body>

$header

$navbar


<br /><br /><br /><br />
<
div align="center" >Example Text</div>
<
br /><br /><br /><br />    

$footer

</body>
</
html

What am I doing wrong?

--------------- Added [DATE]1251927233[/DATE] at [TIME]1251927233[/TIME] ---------------

Any idea?
I'll pay to fix this.

https://vborg.vbsupport.ru/showthread.php?t=222250


All times are GMT. The time now is 09:39 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.01092 seconds
  • Memory Usage 1,763KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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