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

Reply
 
Thread Tools Display Modes
  #1  
Old 02-05-2005, 06:35 PM
n1ckn4me n1ckn4me is offline
 
Join Date: Jan 2005
Location: The Netherlands
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default The making of a "new" php-file.

I've made a whole new .php file that looks about the same a the $header but instead of $forumbits I have my own phpcode. I saved it and placed it in my root....

$stylevar[htmldoctype] $headinclude $header $navbar
65">$vbphrase[mycode_title]
65"> $vbphrase[mycode_body]
$footer


What do I need to program to make it happen ?
Is it something with phpinclude_start ?
Reply With Quote
  #2  
Old 02-05-2005, 08:20 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*confused*

$header is a variable containing a parsed template (header), what you posted looks like part of an uncompiled template, you say you've created a new .php file (what's in it?) and you mention phpinclude_start.

So ... what do you actually want to achieve?
Reply With Quote
  #3  
Old 02-05-2005, 08:58 PM
n1ckn4me n1ckn4me is offline
 
Join Date: Jan 2005
Location: The Netherlands
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry for the confusion...

My Idea of phpinclude_start was that you are only to be able to make a code that you could put in your $header or $footer. What I finally want is that I want to have a .php file that doesn't contain the forums but just my own made code that I've put in phpinclude_start...

does this make it more clear ?
and most of all how is this done ?

ps. KirbyDE thanks for your respond anyways...
Reply With Quote
  #4  
Old 02-05-2005, 09:07 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No
phpinclude_start will be executed on every page.
So if you want your code to be only executed on one page it' suggest to create a new php-file

You can use this as a start:
PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''myscript');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array('mytemplate');

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// ####################################################################### 

// ** place your code here ***

eval('print_output("' fetch_template('mytemplate') . '");');
?>
Reply With Quote
  #5  
Old 02-05-2005, 09:45 PM
n1ckn4me n1ckn4me is offline
 
Join Date: Jan 2005
Location: The Netherlands
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This was just want I needed! although you didn't know what I wanted lol :P

I just have to ask what 'myscript' and 'mytemplate' is or with what I need to replace it ?

ps. thanks for the pations...
Reply With Quote
  #6  
Old 02-05-2005, 09:48 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

myscript is just an identifier (used for SQL error reports for example).
mytemplate is the Template that the script should output.

If you don't have/need a template: leave the array blank and remove the print_output line (but this will most likely be a pretty boring page then as it does not output anything )
Reply With Quote
  #7  
Old 02-05-2005, 10:12 PM
n1ckn4me n1ckn4me is offline
 
Join Date: Jan 2005
Location: The Netherlands
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm well I still don't really get it but let me sleep it over :P
I surtenly aprieciate your helping hand !!

im just a noob trying to learn
Reply With Quote
  #8  
Old 02-05-2005, 10:15 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Attach your code so we can see what you are trying to do.
Because without knowing that I can't help much more except giving general advices.
Reply With Quote
  #9  
Old 02-05-2005, 11:22 PM
n1ckn4me n1ckn4me is offline
 
Join Date: Jan 2005
Location: The Netherlands
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok you asked for it


I just didn't get it to work and that means I doing something wrong

The next code is de phpcode I want as a new .php-file... it's called "temp.php"
PHP Code:
$stylevar[htmldoctype]
<
html dir="$stylevar[textdirection]lang="$stylevar[languagecode]">
<
head>
    <!-- 
no cache headers -->
    <
meta http-equiv="Pragma" content="no-cache" />
    <
meta http-equiv="Expires" content="-1" />
    <
meta http-equiv="Cache-Control" content="no-cache" />
    <!-- 
end no cache headers -->
    <
title><phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase></title>
    
$headinclude
</head>
<
body>
$header
$navbar
<br />

<
table class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%" align="center">
<
thead>
    <!-- 
message -->
    <
tr>
        <
td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>">
            <
phrase 1="$vboptions[bbtitle]">$vbphrase[mypharse_title]</phrase></td>
    </
tr>
    <
tr>
        <
td class="alt1" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>">
            <
table width="650" align="center">
  <
tr>
    <
td align="left" valign="top"><phrase 1="/link$session[sessionurl]">$vbphrase[myphrase_body]</phrase></td>
  </
tr>
</
table>
        </
td>
    </
tr>
    <!-- / 
message -->
    </if>
 </
thead>
</
table>

$footer
</body>
</
html
Reply With Quote
  #10  
Old 02-05-2005, 11:32 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, I don't see any PHP-Code at all - only a template
Save this as a template (mytemplate for example) and use the PHP-File I posted above.
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 10:11 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.04531 seconds
  • Memory Usage 2,282KB
  • Queries Executed 13 (?)
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
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete