vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   require_once breaking custom page... (https://vborg.vbsupport.ru/showthread.php?t=108626)

kontrabass 02-22-2006 02:34 PM

require_once breaking custom page...
 
With VB 3.0, I used this php script to display the contents of a custom template:
Code:


<?php

require_once("/home/talkbass/public_html/tab/tabscript.php");


// ## Changes Directory so it can accesss vBulletin IF we are outside the forums folder, if not this is not nessary ##
chdir("/home/talkbass/public_html/forum/");

// ## Error Reporting ( we use error reporting in php so we can control the display of error messages
// ## we will use this because all vBulletin files follow the same error reporting rules) ##
error_reporting(E_ALL & ~E_NOTICE);

// ## this action here cache's the templates so that everytime their needed a querry wont be needed to run
// ## the names in there are just the template names :), there must be a comma after everyone but the last ##
$globaltemplates = array('content_tab');

// ## Grabs global.php this grabs vbulletins global.php so we can use the most basic of vBulletins functions ##
require_once("./global.php");
// ## this calls to print out one main template ##

eval('print_output("' . fetch_template('content_tab') . '");');

However, now with 3.5.3, the script above only outputs the template content if a user is logged into the forums. AND, if I take out the "require_once("/home/talkbass/public_html/tab/tabscript.php");" line, it works fine for logged-in, and non-logged-in users alike. Wierd! Any ideas why? I need that require line!

TIA!

Paul

paulomt1 02-23-2006 02:03 AM

I've the same problem.

Marco van Herwaarden 02-23-2006 08:12 AM

Difficult to anser without knowing the contents of that file.

kontrabass 03-01-2006 02:20 PM

The file is just basic php code, some snippits:

Code:

if ($action==bandlist)
        {
        $output = "<b>Bands:</b>";
        $output .= "<br><br>";
        $tabdir = "/home/talkbass/tab/$letterdir";
        if(!($dp = opendir($tabdir))) die ("Cannot open $tabdir");
        while($file = readdir($dp)) $filenames[] = $file;
        closedir($dp);

        sort($filenames);
        for($i=0; $i < count($filenames); $i++)
        {

        if($filenames[$i] != '.' && $filenames[$i] != '..')
                $output .= "<a href=\"http://www.talkbass.com/tab/tabview.php?action=songlist&letterdir=$letterdir&band=$filenames[$i]\">$filenames[$i]</a><br>";
        }

Basically it assignes text strings to $output variables, these vars are then displayed via the template.

Marco van Herwaarden 03-02-2006 07:30 AM

Try placing the require of your script after the global.php.

kontrabass 03-02-2006 02:06 PM

Quote:

Originally Posted by MarcoH64
Try placing the require of your script after the global.php.

No luck. This breaks the page for everyone.

kontrabass 04-18-2006 04:03 PM

bump? Any ideas before I give up? :( :)


All times are GMT. The time now is 07: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.01066 seconds
  • Memory Usage 1,726KB
  • 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_code_printable
  • (1)bbcode_quote_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