PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Error bei Einbindung eines externen Scriptes über Template


hubix
07.10.2005, 12:38
Hallo!

Ich wollte ein Hotelbewertungs-Script über ein Template ins Vb einfügen, bekomme es aber leider nicht hin...

Ich habe dieses Script (grün eingefärbt) in ein neues Template (Name des Templates: ohg) eingefügt:
$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>World.de - Hotelbewertungen</title>
<link href="http://www.openholidayguide.net/env/ohg.css" type="text/css" rel="stylesheet">
<link href="http://www.world.de/forum/ohg/ohg.css" type="text/css" rel="stylesheet">
<script language="JavaScript" src="http://www.openholidayguide.net/env/ohg.js" type="text/javascript"></script>
$headinclude
</head>
<body>
$header

<?php
$incfile='http://www.openholidayguide.net/openholidayguide.php'.
'?kid='.$_GET['kid'].
'&lid='.$_GET['lid'].
'&rid='.$_GET['rid'].
'&oid='.$_GET['oid'].
'&hid='.$_GET['hid'].
'&bid='.$_GET['bid'].
'&anz='.$_GET['anz'].
'&ro='.$_GET['ro'].
'&styp='.$_GET['styp'].
'&srvalue='.$_GET['srvalue'].
'&svalue='.urlencode($_GET['svalue']).
'&pg='.$_GET['pg'].
'&kontinent='.urlencode($_GET['kontinent']).
'&land='.urlencode($_GET['land']).
'&region='.urlencode($_GET['region']).
'&ort='.urlencode($_GET['ort']).
'&hotel='.urlencode($_GET['hotel']).
'&pid=5057_1050'.
'&url=http%3A%2F%2Fwww.*****.de%2Fforum%2Fohg'.
'&typ=anf'.
'&con=rw:1|ma:0'.$_GET['stravel'];
include($incfile);
?>

$footer
</body>
</html>


Dieses Template wird über diese neu erstellte PHP-file aufgerufen:
<?php
/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 3.0.0 Release Candidate 2 (Englisch)|| # ---------------------------------------------------------------- # ||
|| # All PHP code in this file is ©2000-2004 Jelsoft Enterprises Ltd. # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/

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

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

// ################### 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(
'ohg'
);

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

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


// draw nav bar
$navbits = array();
$parentlist = array_reverse(explode(',', $foruminfo['parentlist']));
foreach ($parentlist AS $forumID)
{
$forumTitle = $forumcache["$forumID"]['title'];
$navbits["forumdisplay.php?$session[sessionurl]f=$forumID"] = $forumTitle;
}
$navbits["openholidayguide.php"] = "ohg";
$navbits = construct_navbits($navbits);

eval('$navbar = "' . fetch_template('navbar') . '";');

// #######################################################################
// ######################## Nachfolgende Ihr eigener Code#################
// #######################################################################

eval('print_output("' . fetch_template('ohg') . '");');
?>

Wenn ich nun diese Datei (openholidayguide.php) im Browser aufrufe, bekomme ich diese Fehlermeldung angezeigt:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/html/forum/openholidayguide.php(58) : eval()'d code on line 20
Leider bin ich mit PHP net so bewandert, hab also keine Ahnung, wo der Fehler liegt :( Kann mir jemand helfen, weiss jemand was schief läuft??

viele Grüsse und dank im vorraus :)
hubix

hubix
11.10.2005, 16:03
Hallo!

Hmmm, kann mir keiner helfen?? :(

StGaensler
11.10.2005, 17:18
Frag mal bei http://vbhacks-germany.com oder bei http://vbulletin.org nach. Die können dir besser weiterhelfen.

Mystics
11.10.2005, 20:45
Du kannst in einem Template keinen PHP-Code einfügen (außer im phpinclude_* Template).

Führe doch den Code direkt in deiner PHP-Datei aus und verwende im Template nur eine entsprechende Variable.

hubix
12.10.2005, 11:12
Hallo!

Sorry, dass ich nachfrage, aber in PHP bin ich ein ziemlicher Noob, die oben von mir genannten Dateien hab ich nur mit Hilfe von hier geposteten Hilfe-Threads zusammenfriemeln können ;)

Also ich mache mir eine Datei wo dieser Code ausgeführt wird (und sonst auch kein anderer Code drin ist??):

<?php
$incfile='http://www.openholidayguide.net/openholidayguide.php'.
'?kid='.$_GET['kid'].
'&lid='.$_GET['lid'].
'&rid='.$_GET['rid'].
'&oid='.$_GET['oid'].
'&hid='.$_GET['hid'].
'&bid='.$_GET['bid'].
'&anz='.$_GET['anz'].
'&ro='.$_GET['ro'].
'&styp='.$_GET['styp'].
'&srvalue='.$_GET['srvalue'].
'&svalue='.urlencode($_GET['svalue']).
'&pg='.$_GET['pg'].
'&kontinent='.urlencode($_GET['kontinent']).
'&land='.urlencode($_GET['land']).
'&region='.urlencode($_GET['region']).
'&ort='.urlencode($_GET['ort']).
'&hotel='.urlencode($_GET['hotel']).
'&pid=5057_1050'.
'&url=http%3A%2F%2Fwww.*****.de%2Fforum%2Fohg'.
'&typ=anf'.
'&con=rw:1|ma:0'.$_GET['stravel'];
include($incfile);
?>

Und dann mit welcher Variablen im Template rufe ich dann diese Datei auf??:confused:

hubix
12.10.2005, 11:42
Ich nochmal ;)

Habe mal versucht in der index.php fogendes einzugeben:

require_once('./ohg.php');

Und in dem Template habe ich die Variable $ohg eingefügt, aber leider wird das Template ohne das Script in der neuen Datei ohg.php (da wo dieser php-Code drin ist) nicht mit angezeigt...

Das wars wohl nicht, hm... Wie macht man das, dass man eine php-Datei in das Forensystem einbindet, also eine neue Variable aufrufen kann (wenn dieser Gedankengang überhaupt richtig ist ;) )?

StGaensler
12.10.2005, 16:19
Sollte folgender Code sein: http://www.vbulletin-germany.com/forum/showpost.php?p=121929&postcount=2
Habe ich leider noch nie ausprobiert.

hubix
12.10.2005, 16:28
Ahhhh, dankeeeee!!

War ja ne schwere Geburt, aber es klappt!!! :)