vb.org Archive

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

eggz 04-25-2003 03:40 PM

calling includes
 
Sorry if this is the wrong place to post this, or my question isn't too clear - im a bit of a n00b when it comes to PHP - bring on WYSIWIG HTML and i'd be fine...! :p

Basically I'm trying to include a file (gallery latest photos FYI) from my forum home. I've created a template, forumhome_latestphotos and have placed the code for it in forum home. The table section that i've placed in the template so far shows up so I know i haven't messed that bit up :classic:

My question:

How can i get

PHP Code:

include("thumbs.php"

to parse? Do I need to edit index.php or can i just use the phpinclude template?

TYIA
Ollie

filburt1 04-25-2003 04:48 PM

You can just use phpinclude.

eggz 04-25-2003 05:22 PM

So if i wanted to make it so that wherever i put $getlphotos, it includes thumbs.php in that area, would i use something like

$getlphotos=<?php include("thumbs.php") ?>

or would i need to use eval? if i do - how?!?!?! lol

or would i have to use another method?

Ollie

eggz 04-25-2003 07:33 PM

ne1?

TIA
Ollie

Kriek 04-25-2003 07:53 PM

PHP Code:

$getlphotos ='thumbs.php';
include(
'$getlphotos'); 


eggz 04-25-2003 08:17 PM

Thanks Kriek,

Was almost going to sleep there :P

Is that meant to go in PHP Incl.?

If i put it in there i get parse errors at top of page...

so should it go in index.php?

If so, where abouts?

Thanks
Ollie

eggz 04-25-2003 09:17 PM

Sorted it!

Used ob

Thanks neway!

Ollie

Dean C 04-26-2003 12:05 PM

Also make sure you use your parentheses (the brackets) correctly.

E.g.

PHP Code:

include("thefilename.txt"); 

- miSt

gmarik 04-26-2003 01:18 PM

What do you think about this? It must work on Windows as well as on UNIX:

PHP Code:

 function DeWin($path

    if(
substr($path,1,1)==':'
        
$path=substr($path,2); 
    return 
str_replace('//','/',str_replace('\','/',$path)); 


function document_root() 

    global $HTTP_SERVER_VARS; 
    $s=&$HTTP_SERVER_VARS; 

    if(isset($s['
CMDLINE'])) return false; 

    $full=DeWin($s['
PATH_TRANSLATED']); 
    $i_am=DeWin($s['
PHP_SELF']); 
    if(substr($full,-strlen($i_am))==$i_am) 
        return substr($s['
PATH_TRANSLATED'],0,strlen($s['PATH_TRANSLATED'])-strlen($i_am)); 

    return getenv('
DOCUMENT_ROOT'); 




All times are GMT. The time now is 09:14 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.01097 seconds
  • Memory Usage 1,731KB
  • 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
  • (9)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