Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-25-2003, 03:40 PM
eggz eggz is offline
 
Join Date: Aug 2002
Location: UK
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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...!

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
Reply With Quote
  #2  
Old 04-25-2003, 04:48 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can just use phpinclude.
Reply With Quote
  #3  
Old 04-25-2003, 05:22 PM
eggz eggz is offline
 
Join Date: Aug 2002
Location: UK
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 04-25-2003, 07:33 PM
eggz eggz is offline
 
Join Date: Aug 2002
Location: UK
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ne1?

TIA
Ollie
Reply With Quote
  #5  
Old 04-25-2003, 07:53 PM
Kriek's Avatar
Kriek Kriek is offline
 
Join Date: Jul 2002
Location: Florida
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$getlphotos ='thumbs.php';
include(
'$getlphotos'); 
Reply With Quote
  #6  
Old 04-25-2003, 08:17 PM
eggz eggz is offline
 
Join Date: Aug 2002
Location: UK
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 04-25-2003, 09:17 PM
eggz eggz is offline
 
Join Date: Aug 2002
Location: UK
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorted it!

Used ob

Thanks neway!

Ollie
Reply With Quote
  #8  
Old 04-26-2003, 12:05 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

E.g.

PHP Code:
include("thefilename.txt"); 
- miSt
Reply With Quote
  #9  
Old 04-26-2003, 01:18 PM
gmarik's Avatar
gmarik gmarik is offline
 
Join Date: May 2002
Location: Mocsow
Posts: 1,288
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'); 

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:25 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.03975 seconds
  • Memory Usage 2,241KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete