Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Syntax error in Custom Header  (Read 4304 times)

0 Members and 1 Guest are viewing this topic.

FusDuo

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Syntax error in Custom Header
« 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:
Quote
Parse 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:
Code: [Select]
<?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?
Logged

Nibbler

  • Guest
Re: Syntax error in Custom Header
« Reply #1 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.
Logged

FusDuo

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Syntax error in Custom Header
« Reply #2 on: August 15, 2009, 04:57:26 pm »

I attached the complete header-file.

The moment I delete the line
Code: [Select]
echo $phpAds_raw['html'];the header ist parsed without an error. But of course the banner won't show...
Logged

Nibbler

  • Guest
Re: Syntax error in Custom Header
« Reply #3 on: August 15, 2009, 08:06:34 pm »

Your whole approach is wrong. Should be like this

Code: [Select]
<?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;

?>

Logged

FusDuo

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Syntax error in Custom Header
« Reply #4 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.
Logged

Nibbler

  • Guest
Re: Syntax error in Custom Header
« Reply #5 on: August 15, 2009, 11:14:55 pm »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Syntax error in Custom Header
« Reply #6 on: August 17, 2009, 08:48:39 am »

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 16 queries.