I am trying to install this mod on my phpBB forum that adds a Adsense ad after the first post. The mod is a simple 2 code change mod. I keep getting this error though.

Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home/texascam/public_html/forum/viewtopic.php on line 1757

Here is the code it is referring to starting at line 1750

	);
	if($i == $ad_after)
   {
      $row_color = ( !($num % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
      $row_class = ( !($num % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
      $num ++;

  $mini_post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '#ad';
  $template->assign_block_vars('postrow', array(
     'ROW_COLOR' => '#' . $row_color,
     'ROW_CLASS' => $row_class,
     'POST_DATE' => $post_date,
     'POST_SUBJECT' => 'Advertisement',
     'MINI_POST_IMG' => $mini_post_img,
     'POSTER_NAME' => 'Advertisement',
   'POSTER_RANK' => 'Advertiser',
     'MESSAGE' => '<div align=&quot;center&quot;>Ad code here</div>',
     'L_MINI_POST_ALT' => $mini_post_alt,
     'U_MINI_POST' => $mini_post_url,
     'U_POST_ID' => 'ad')
  );

I hope someone can please help me.

-Thanks

    I think you copy paste something wrong.

    This piece of code:

    &quot;viewtopic.$phpEx?&quot;

    needs to be rewritten to this:

    "viewtopic.$phpEx?"

    I think. But I don't really know anything about phpBB.

    Greets,

    Marvin.

      I didn't copy it wrong. After looking at the directions I see that is the way they posted it in the instructions. So the above fixed that one problem but now I am getting

      Parse error: syntax error, unexpected '.' in /home/texascam/public_html/forum/viewtopic.php on line 1757

      which is on the same line so here is how it looks now.

      if($i == $ad_after)
         {
            $row_color = ( !($num % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
            $row_class = ( !($num % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
            $num ++;
      
        $mini_post_url = append_sid(viewtopic.$phpEx? . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '#ad';
        $template->assign_block_vars('postrow', array(
           'ROW_COLOR' => '#' . $row_color,
           'ROW_CLASS' => $row_class,
           'POST_DATE' => $post_date,
           'POST_SUBJECT' => 'Advertisement',
           'MINI_POST_IMG' => $mini_post_img,
           'POSTER_NAME' => 'Advertisement',
         'POSTER_RANK' => 'Advertiser',
           'MESSAGE' => '<div align=&quot;center&quot;><script type="text/javascript"><!--
      google_ad_client = "pub-8048181801684156";
      google_ad_width = 728;
      google_ad_height = 90;
      google_ad_format = "728x90_as";
      google_ad_type = "text_image";
      google_ad_channel ="0017356771";
      google_color_border = "ECF1EF";
      google_color_bg = "ECF1EF";
      google_color_link = "56849B";
      google_color_text = "000000";
      google_color_url = "56849B";
      //--></script>
      <script type="text/javascript"
        src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
      </script></div>',
               'L_MINI_POST_ALT' => $mini_post_alt,
               'U_MINI_POST' => $mini_post_url,
               'U_POST_ID' => 'ad')
            );

      Getting closer if someone can please help me. The line in the code above is this one

        $mini_post_url = append_sid(viewtopic.$phpEx? . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '#ad';

      -Thanks

              $mini_post_url = append_sid('viewtopic.' . $phpEx . '?' . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '#ad'; 

        if $phpEx contains a period, so for example '.php' vs 'php', then remove the . inside the quotes surrounding viewtopic.

          Thank You so much guys, thank did it and it works now

          -Thanks Again

            Write a Reply...