News:

Join the Facebook Fan Page.

Main Menu

Help on include

Started by sadiqbaig, January 02, 2006, 04:44:17 AM

Previous topic - Next topic

sadiqbaig

i have added include in index.template.php

but i m getting parse error



</head>
<body>';

<?php include("/home/waplinks/public_html/up.php"); ?>

?>





// Otherwise, they might want to [logout]...
else
echo '
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108] . '"  border="0" />' : $txt[108]), '</a>';
}

<?php include("/home/waplinks/public_html/down.php"); ?>

?>



up.php



<?php

if (function_exists('smfshout'))
  
smfshout();

// Simplify this..
$themes getThemeData();
if (!empty(
$themes))
{
echo 
'
<form action="'
$scripturl ,'" name="themeForm">
<select name="theme" name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 ? 0 : 1);">'
;
foreach(
$themes as $theme)
echo 
'
<option value="?theme='
$theme['id'] ,'">' .$theme['name'] . '</option>';
echo 
'
</select>
</form>'
;
}

echo
'
  <iframe src="http://sadiqbaig.sonnerie.net/external/DrtTop/searchengine/searchEngine.php?a=sadiqbaig&bgcolor=8CC63F&c=UK" WIDTH="120" HEIGHT="38" BORDER="0" MARGINWIDTH="0" MARGINHEIGHT="0" HSPACE="0" VSPACE="0" FRAMEBORDER="0" SCROLLING="no"></IFRAME>'
;

echo
'
<script type="text/javascript"><!--
google_ad_client = "pub-7787046119435229";
google_ad_width = 728;
google_ad_height = 15;
google_ad_format = "728x15_0ads_al_s";
google_ad_channel ="";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>'
;



echo
'
<center>
<form method="get" action="http://www.google.co.uk/custom" target="google_window">
<table bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">

<input type="text" name="q" size="50" maxlength="255" value=""></input>
<input type="submit" name="sa" value="Google Search"></input>
<input type="hidden" name="client" value="pub-7787046119435229"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="safe" value="active"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input>
<input type="hidden" name="hl" value="en"></input>
</td></tr></table>
</form>
</center>'
;



echo
'
<script type="text/javascript"><!--
google_ad_client = "pub-7787046119435229";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as_rimg";
google_cpa_choice = "CAAQ8aaVzgEaCPJg3qtkyXM9KOm293M";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>'
;



?>





down.php



<?php

// This neat function finds and returns info about all of our themes.
function getThemeData()
{
global 
$db_prefix$user_info$scripturl$settings$options$modSettings;
$themes = array();
// Get all of our themes.
$request db_query("
SELECT value, ID_THEME
FROM 
{$db_prefix}themes
WHERE variable = 'name'
AND ID_THEME != 
$settings[theme_id]. (empty($modSettings['theme_default']) ? '
AND ID_THEME != 1' 
'') . "
ORDER BY value"
__FILE____LINE__);
while (
$row mysql_fetch_assoc($request))
{
$themes[] = array(
'id' => $row['ID_THEME'],
'name' => $row['value'],
);
}
return 
$themes;
}

?>




plz help

i want to use include so that its easy for me

to add it in all themes

Sheepy

Try removing <?php and ?> on the include line.  You don't need them since you're already in php at those two lines.

Dannii

That won't work though, as you're trying to use the function getThemeData before it's been defined. Can't you put the function in down.php in up.php?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

sadiqbaig


for the theme changer script

the script which is there in down.php

must b at the end

n before ?> closing index.template.php


Advertisement: