vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do I call this information on a non-vB page? (https://vborg.vbsupport.ru/showthread.php?t=49604)

N9ne 03-03-2003 07:23 PM

How do I call this information on a non-vB page?
 
What do I need to do on a .php page that I have which is not in my forum dir, to get the following information...

I want to be able to use variables which will display certain things, like the minimum required post count to use a custom avatar...

Can I just include forum/global.php and have it work? Or do I need forum/admin/global.php?

I have no idea really, someone give me a clue :D.

Xenon 03-03-2003 07:56 PM

require the forum/global.php that's enough to use those global vars :)

N9ne 03-03-2003 08:42 PM

Well, it's more complicated than that for me actually...

My pages are mostly HTML...

I have a file, header.php, and a file, footer.php

I create my pages like this:

<?php include('header.php'); ?>
loads of html stuff here

sdfsdf
sdfsdf
sdfsdfsdf
<?php include('footer.php'); ?>

If I want to use these variables in the sdsdfsdflskjdflksjdf stuff in the middle, what can I do? Where do I require global.php? if I close a php tag, do I need to require global.php again when I reopen them?

Xenon 03-03-2003 08:48 PM

require global.php in the first instance of <?php ?>

you don't have to rerequire it anywhere :)

i think there was a shortcut: <?=$blabla?> to show the content of a var in the html code :)

N9ne 03-03-2003 08:51 PM

<?php
require("/****/*****/forum/global.php");
echo("blah: " .$avatarcustomposts);
?>

I just put this in its own .php file with nothing else, and it returns no results...what am I doing wrong?

Xenon 03-03-2003 08:55 PM

remove the () around the string, echo don't needs em

N9ne 03-03-2003 08:59 PM

ok another problem:

require('.forum/global.php');

This line seems to cut off all code below it (html)...

<?php
require('.forum/global.php');
?>

Anything below those 3 lines in a php file, say html, will not be shown...

Does that look right?

Xenon 03-03-2003 09:03 PM

yes, it looks right, and the html below should show up....

N9ne 03-03-2003 09:06 PM

It's not working...I've been working on this for hours now, and i'm really really annoyed. Everything looks right, but it won't work.

Here's a sample page I have:

<?php include("header.php"); ?>
<table><tr><td>
sdfsdfsdfsdfsdfsdf
</td></tr></table>

<?php
require('/***/***/***/forum/global.php');
echo $avatarcustomposts;
?>

<table><tr><td>
sdfsdfsdfsdfsdfsdf
</td></tr></table>

<?php include("footer.php"); ?>

I can't see *anything* wrong there. I've tried variations of everything, and still, no work...

I'm completely baffled...

Sebastian 03-04-2003 06:21 AM

This should work:

PHP Code:

<?php 
chdir
("/path/to/forums/");
require(
"./global.php");
include(
"/path/to/header.php"); ?>

<table><tr><td>
sdfsdfsdfsdfsdfsdf
</td></tr></table>

<?=$avatarcustomposts;?>

<table><tr><td>
sdfsdfsdfsdfsdfsdf
</td></tr></table>

<?php include("/path/to/footer.php"); ?>

you must use chdir() (change directory) otherwise you may get include errors with admin/functions.php, and the global.php include must be above your header, otherwise you will get send headers errors.


All times are GMT. The time now is 05:53 PM.

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.00951 seconds
  • Memory Usage 1,728KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete