vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   parsing variables in custom php page (https://vborg.vbsupport.ru/showthread.php?t=210354)

EWGF 04-05-2009 11:12 AM

parsing variables in custom php page
 
Stuggling to insert a whole page into the php page instead of referring to templates. I got the $legend working, but the $copy won't get parsed.

I'm guessing $copy cannot be parsed inside $legend, but I'm quite new on this. Can someone explain what's wrong with this and give a solution for this. Thanks :)

PHP Code:

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

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

// ######################### REQUIRE BACK-END ############################
$curdir getcwd();
chdir('/home/**********/htdocs/www/forum');
require_once(
'./global.php');
chdir($curdir); 

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

$copy $vbulletin->options['homeurl'];

$legend .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="nl">
<head>
<title>Legend</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
</head>
<body>

<table class="table" cellpadding="0" cellspacing="0" border="0">
<tr><td class="title" style="padding:6px">Controll</td></tr>
<tr><td class="controll"></td></tr>
</table>

<div>$copy</div>

</body>
</html>'
;

eval(
'print_output("$legend");');

?>


Lynne 04-05-2009 03:11 PM

Are you getting anything in your error_logs? (If you don't know where they are, you should ask your host.)

EWGF 04-05-2009 03:22 PM

1 Attachment(s)
No error at all. $copy just shows up as $copy in the browser.

Lynne 04-05-2009 03:40 PM

Try something like:

HTML Code:

<div>'  . $copy . '</div>

EWGF 04-05-2009 03:48 PM

Miss, you are a hero!:)

Do you btw know a site which explains more about the use of those dots and stuff?

Lynne 04-05-2009 04:17 PM

Not really. I've learned everything I know through trial and error. Lots of errors.... lots and lots and lots of them! :)


All times are GMT. The time now is 02:45 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.01080 seconds
  • Memory Usage 1,722KB
  • 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_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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