coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: FusDuo on August 15, 2009, 01:50:25 PM

Title: Syntax error in Custom Header
Post by: FusDuo on August 15, 2009, 01:50:25 PM
I created a custom header file, that contains OpenX 2.8.1 banner code. The banner code causes the error:
QuoteParse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /kunden/***/webseiten/cp/themes/subsilver/header.php on line 28

The banner code ist this:
<?php
  
//<!--/* OpenX Local Mode Tag v2.8.1 */-->

  
define('MAX_PATH''/kunden/129132_14055/webseiten/ads');
  if (@include_once(
MAX_PATH '/www/delivery/alocal.php')) {
    if (!isset(
$phpAds_context)) {
      
$phpAds_context = array();
    }
    
$phpAds_raw view_local(''100'_blank''''0'$phpAds_context'');
  }
  echo 
$phpAds_raw['html'];
?>

where line 28 is "  echo $phpAds_raw['html'];".

Removing that line makes the custom header work, but what is wrong within that line?
Title: Re: Syntax error in Custom Header
Post by: Nibbler on August 15, 2009, 04:29:20 PM
Nothing is wrong in that code. The error must be in the code you are not giving us.
Title: Re: Syntax error in Custom Header
Post by: FusDuo on August 15, 2009, 04:57:26 PM
I attached the complete header-file.

The moment I delete the line echo $phpAds_raw['html'];the header ist parsed without an error. But of course the banner won't show...
Title: Re: Syntax error in Custom Header
Post by: Nibbler on August 15, 2009, 08:06:34 PM
Your whole approach is wrong. Should be like this


<?php

  
//<!--/* OpenX Local Mode Tag v2.8.1 */-->

  
define('MAX_PATH''/kunden/129132_14055/webseiten/ads');
  if (@include_once(
MAX_PATH '/www/delivery/alocal.php')) {
    if (!isset(
$phpAds_context)) {
      
$phpAds_context = array();
    }
    
$phpAds_raw view_local(''100'_blank''''0'$phpAds_context'');
  }
  
echo <<<EOT

<table width="100%" height="180" border="0" cellpadding="0" cellspacing="0" background="http://www.hertha-inside.de/header_new/galerie/header_1024_06.jpg">
  <tr>
    <td height="180"> 
      <table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="91" height="93" rowspan="2"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_01.jpg" width="91" height="93"></td>
          <td width="169" height="180" rowspan="4"><a href="http://www.hertha-inside.com/4images/" target="_self"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_02.jpg" width="169" height="180" border="0"></a></td>
    <td width="7" height="163" rowspan="3"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_03.jpg" width="7" height="163"></td>
    <td width="728" height="3" colspan="8"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_04.jpg" width="728" height="3"></td>
    <td width="3" height="180" rowspan="4"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_05.jpg" width="3" height="180"></td>
  </tr>
  <tr>
          <td width="728" height="90" colspan="8" background="http://www.hertha-inside.de/header_new/galerie/header_1024_08.jpg">
              
{$phpAds_raw['html']}
         </td>
  </tr>
  <tr>
    <td width="91" height="87" rowspan="2"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_09.jpg" width="91" height="87"></td>
    <td width="185" height="70" colspan="3"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_10.jpg" width="185" height="70"></td>
    <td width="242" height="70" colspan="3"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_11.jpg" width="242" height="70"></td>
    <td width="301" height="70" colspan="2"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_12.jpg" width="301" height="70"></td>
  </tr>
  <tr>
          <td width="75" height="17" colspan="2"><a href="http://www.hertha-inside.de"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_13.jpg" width="75" height="17" border="0"></a></td>
          <td width="58" height="17"><a href="http://www.hertha-inside.de/forum/index.php" target="_self"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_14.jpg" width="58" height="17" border="0"></a></td>
          <td width="59" height="17"><a href="http://www.hertha-inside.com/4images/" target="_self"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_15.jpg" width="59" height="17" border="0"></a></td>
          <td width="58" height="17"><a href="http://www.hertha-inside.de/portal/" target="_self"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_16.jpg" width="58" height="17" border="0"></a></td>
          <td width="70" height="17"><a href="http://www.hertha-inside.de/kalender/" target="_self"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_17.jpg" width="70" height="17" border="0"></a></td>
          <td width="114" height="17"><a href="http://foerderkreis-ostkurve.de" target="_blank"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_18.jpg" width="114" height="17" border="0"></a></td>
          <td width="73" height="17"><a href="http://herthabsc.de/index.php?id=her" target="_blank"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_19.jpg" width="73" height="17" border="0"></a></td>
    <td width="228" height="17"><img src="http://www.hertha-inside.de/header_new/galerie/header_1024_20.jpg" width="228" height="17"></td>
  </tr>
  <tr>
    <td width="91" height="1" valign="top"><img src="http://www.hertha-inside.de/header_new/transparent.gif" alt="" width="91" height="1"></td>
    <td width="169" height="1" valign="top"><img src="http://www.hertha-inside.de/header_new/transparent.gif" alt="" width="169" height="1"></td>
    <td width="7" height="1" valign="top"><img src="http://www.hertha-inside.de/header_new/transparent.gif" alt="" width="7" height="1"></td>
    <td width="68" height="1" valign="top"><img src="http://www.hertha-inside.de/header_new/transparent.gif" alt="" width="68" height="1"></td>
    <td width="58" height="1" valign="top"><img src="http://www.hertha-inside.de/header_new/transparent.gif" alt="" width="58" height="1"></td>
    <td width="59" height="1" valign="top"><img src="http://www.hertha-inside.de/header_new/transparent.gif" alt="" width="59" height="1"></td>
    <td width="58" height="1" valign="top"><img src="http://www.hertha-inside.de/header_new/transparent.gif" alt="" width="58" height="1"></td>
    <td width="70" height="1" valign="top"><img src="http://www.hertha-inside.de/header_new/transparent.gif" alt="" width="70" height="1"></td>
    <td width="114" height="1" valign="top"><img src="http://www.hertha-inside.de/header_new/transparent.gif" alt="" width="114" height="1"></td>
    <td width="73" height="1" valign="top"><img src="http://www.hertha-inside.de/header_new/transparent.gif" alt="" width="73" height="1"></td>
    <td width="228" height="1" valign="top"><img src="http://www.hertha-inside.de/header_new/transparent.gif" alt="" width="228" height="1"></td>
    <td width="3" height="1" valign="top"><img src="http://www.hertha-inside.de/header_new/transparent.gif" alt="" width="3" height="1"></td>
  </tr>
</table>
</td>
  </tr>
</table>

EOT;

?>

Title: Re: Syntax error in Custom Header
Post by: FusDuo on August 15, 2009, 10:25:27 PM
Thank you!

I just copied the header that works on my sites reight now. Documentation of the changes needed is not very well in Coppermine documentation, I must say.
Title: Re: Syntax error in Custom Header
Post by: Nibbler on August 15, 2009, 11:14:55 PM
It's basic PHP knowledge, nothing specific to Coppermine.
Title: Re: Syntax error in Custom Header
Post by: Joachim Müller on August 17, 2009, 08:48:39 AM
Quote from: FusDuo on August 15, 2009, 10:25:27 PM
Documentation of the changes needed is not very well in Coppermine documentation, I must say.
If you're not fond of the existing documentation, why don't you help us to improve it? Your suggestions are welcome.