News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Need some help with adbrite code

Started by riftlakes, November 05, 2009, 12:52:13 AM

Previous topic - Next topic

riftlakes

  OK..   I  wanna  use  some  adbrite  code  on  my  SMF

long  story  I do not  have  a  google  account  because   a member decided  she  was  in love  with me  on  another  site  I  run  and  when I made it real  clear  thaty  she  could  not  move   across the  country with her  3  kids  and  move  in  with me  she  went  click happy on my google  ads..  SO  I  can not  have  a  google  account  anymore..   

I am stuck  with  adbrite..   AUUURGHHH..

  well  when I insert  my adbrite  code  I   get  this  error


Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in .../Themes/default/index.template.php on line 299

290:
291:
292: <!-- Begin: AdBrite, Generated: 2009-11-04 12:07:46  -->
293: <script type="text/javascript">
294: var AdBrite_Title_Color = "000000";
295: var AdBrite_Text_Color = "000000";
296: var AdBrite_Background_Color = "E4DBBC";
297: var AdBrite_Border_Color = "6F3C1B";
298: var AdBrite_URL_Color = "008000";

299: try{var AdBrite_Iframe=window.top!=window.self?2:1;var AdBrite_Referrer=document.referrer==""?document.location:document.referrer;AdBrite_Referrer=encodeURIComponent(AdBrite_Referrer);}catch(e){var AdBrite_Iframe='';var AdBrite_Referrer='';}

300: </script>
301: <span style="white-space:nowrap;"><script type="text/jav

it  says  the  error  occurs  in  the  blue  section of  text...

I  have  compared  the  adbrite  code  to   adbrite  code  that  works  on   my  other  sites  and  syntax  wise  it  is  all the  same...
   I  got  an error  before  this  because  the  quotes  are single  around all the  color  values  such as
295: var AdBrite_Text_Color = '000000';
but I  have  corrected  that  so it  works  with  "  now  the  new  error  has  this  newb  a bit  baffled..  any  ideas???

Arantor

Please can you add a few lines above that block? I suspect the issue is that it's actually trying to run it as raw PHP.

riftlakes

cond set of info, are they logged in again?
   if ($context['user']['is_logged'])
   {
      // Is the forum in maintenance mode?
      if ($context['in_maintenance'] && $context['user']['is_admin'])
         echo '
                        <b>', $txt[616], '</b><br />';

      // Are there any members waiting for approval?
      if (!empty($context['unapproved_members']))
         echo '
                        ', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';

      // Show the total time logged in?
      if (!empty($context['user']['total_time_logged_in']))
      {
         echo '
                        ', $txt['totalTimeLogged1'];

         // If days is just zero, don't bother to show it.
         if ($context['user']['total_time_logged_in']['days'] > 0)
            echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

         // Same with hours - only show it if it's above zero.
         if ($context['user']['total_time_logged_in']['hours'] > 0)
            echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

         // But, let's always show minutes - Time wasted here: 0 minutes ;).
         echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
      }
      echo '            </span>';
   }
   // Otherwise they're a guest - this time ask them to either register or login - lazy bums...
   else
   {
      echo '            </span>
                        <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>

                        <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
                           <input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
                           <select name="cookielength">
                              <option value="60">', $txt['smf53'], '</option>
                              <option value="1440">', $txt['smf47'], '</option>
                              <option value="10080">', $txt['smf48'], '</option>
                              <option value="43200">', $txt['smf49'], '</option>
                              <option value="-1" selected="selected">', $txt['smf50'], '</option>
                           </select>
                           <input type="submit" value="', $txt[34], '" /><br />
                           <span class="middletext">', $txt['smf52'], '</span>
                           <input type="hidden" name="hash_passwrd" value="" />
                        </form>';
   }

   echo '
                     </td>

<td width="50%" align="center" valign="top" class="windowbg2">

<!-- Begin: AdBrite, Generated: 2009-11-04 12:07:46  -->
<script type="text/javascript">
var AdBrite_Title_Color = "000000";
var AdBrite_Text_Color = "000000";
var AdBrite_Background_Color = "E4DBBC";
var AdBrite_Border_Color = "6F3C1B";
var AdBrite_URL_Color = "008000";

try{var AdBrite_Iframe=window.top!=window.self?2:1;var AdBrite_Referrer=document.referrer==""?document.location:document.referrer;AdBrite_Referrer=encodeURIComponent(AdBrite_Referrer);}catch(e){var AdBrite_Iframe='';var AdBrite_Referrer='';}
<!--End Adbrite -->

</script>
<span style="white-space:nowrap;"><script type="text/jav


Arantor

var AdBrite_Iframe='';var AdBrite_Referrer='';} has ' in it. Replace both of those ' pairs with " like so:

var AdBrite_Iframe="";var AdBrite_Referrer="";}

riftlakes

 will  do  that  and  try

   the  site  is   telling me  that  they   problem  occurs  in this  portion however
try{var AdBrite_Iframe=window.top!=window.self?2:1;var AdBrite_Referrer=document.referrer==""?document.location:document.referrer;

riftlakes

ok  that  worked  to an extent..  lol  brought me  to the  next  line

error now  says

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/default/index.template.php on line 301

292: <!-- Begin: AdBrite, Generated: 2009-11-05 0:35:14  -->
293: <script type="text/javascript">
294: var AdBrite_Title_Color = "0000FF";
295: var AdBrite_Text_Color = "000000";
296: var AdBrite_Background_Color = "FFFFFF";
297: var AdBrite_Border_Color = "CCCCCC";
298: var AdBrite_URL_Color = "008000";
299: try{var AdBrite_Iframe=window.top!=window.self?2:1;var AdBrite_Referrer=document.referrer==""?document.location:document.referrer;AdBrite_Referrer=encodeURIComponent(AdBrite_Referrer);}catch(e){var AdBrite_Iframe="";var AdBrite_Referrer="";}
300: </script>

301: <span style="white-space:nowrap;"><script type="text/javascript">document.write(String.fromCharCode(60,83,67,82,73,80,84));document.write(' src="hxxp:ads.adbrite.com/mb/text_group.php?sid=1396665&zs=3732385f3930&ifr='+AdBrite_Iframe+'&ref='+AdBrite_Referrer+' [nonactive]" type="text/javascript">');document.write(String.fromCharCode(60,47,83,67,82,73,80,84,62));</script>

302: <a target="_top" href="hxxp:www.adbrite.com/mb/commerce/purchase_form.php?opid=1396665&afsid=1 [nonactive]"><img src="hxxp:files.adbrite.com/mb/images/adbrite-your-ad-here-leaderboard.gif [nonactive]" style="background-color:#CCCCCC;border:none;padding:0;margin:0;" alt="Your Ad Here" width="14" height="90" border="0" /></a></span>
303: <!-- End: AdBrite -->
304:



I  thank you  greatly  for  the  replies  and  help

riftlakes

not sur e what is  making the  "nonactive"  it  is  not  in the  code I  am  copying

   Should  I  go  through and  replace ALL the '  with "?
  Ken

Kays

You're better of to escape the single quotes (\') since some appear to be nestled inside a set of double quotes.

Try placing the code inside [code] tags to get rid of that  [nonactive]

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

riftlakes

#8
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/default/index.template.php on line 301



292: <!-- Begin: AdBrite, Generated: 2009-11-05 12:23:50  -->
293: <script type="text/javascript">
294: var AdBrite_Title_Color = "0000FF";
295: var AdBrite_Text_Color = "000000";
296: var AdBrite_Background_Color = "FFFFFF";
297: var AdBrite_Border_Color = "CCCCCC";
298: var AdBrite_URL_Color = "008000";
299: try{var AdBrite_Iframe=window.top!=window.self?2:1;var AdBrite_Referrer=document.referrer==""?document.location:document.referrer;AdBrite_Referrer=encodeURIComponent(AdBrite_Referrer);}catch(e){var AdBrite_Iframe="";var AdBrite_Referrer="";}
300: </script>

301: <span style="white-space:nowrap;"><script type="text/javascript">document.write(String.fromCharCode(60,83,67,82,73,80,84));document.write(' src="http://ads.adbrite.com/mb/text_group.php?sid=1396665&zs=3732385f3930&ifr='+AdBrite_Iframe+'&ref='+AdBrite_Referrer+'" type="text/javascript">');document.write(String.fromCharCode(60,47,83,67,82,73,80,84,62));</script>

302: <a target="_top" href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=1396665&afsid=1"><img src="http://files.adbrite.com/mb/images/adbrite-your-ad-here-leaderboard.gif" style="background-color:#CCCCCC;border:none;padding:0;margin:0;" alt="Your Ad Here" width="14" height="90" border="0" /></a></span>
303: <!-- End: AdBrite -->
304:
305: </td>



thank you  that looks  better

riftlakes

OK  I  went in  and  replaced  every  single ' with "   and  it  is   working  better..  the  page   comes up  but  everything   in the  ad  zone is  kinda  helter skelter.. but  I  am  on my  way  to  fixing  it.. thank  you

Arantor

Btw, the [not active] stuff is an anti-spam protection here on the forum.

Advertisement: