Syntax error in Custom Header Syntax error in Custom Header
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Syntax error in Custom Header

Started by FusDuo, August 15, 2009, 01:50:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

FusDuo

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?

Nibbler

Nothing is wrong in that code. The error must be in the code you are not giving us.

FusDuo

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...

Nibbler

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;

?>


FusDuo

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.

Nibbler

It's basic PHP knowledge, nothing specific to Coppermine.

Joachim Müller

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.