Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Trying to install google adsense banner contribution


Invado

Recommended Posts

What does this error mean? Have I done something incorrect in the installation process to begin with? or am I downloading the file incorrectly?

 

Database d60273146 running on MySQL Server Farm 2

 

Error

 

SQL-query :

 

/* WARNING: This file ads a configuration group 963. First look if your database doesn't contain this configuration group yet. Otherwise you must change this first! */ ALTER TABLE configuration MODIFY configuration_value TEXT;

 

INSERT INTO configuration

VALUES (

'', 'Show Google AdSense', 'ADSENSE_SHOW', 'true', 'Show Google AdSense ads (true) or not (false)', 963, 1, NULL , NULL , NULL , 'tep_cfg_select_option(array(\'true\', \'false\'),'

), (

'', 'Adsense settings', 'ADSENSE_SETTINGS', 'google_ad_client = \"pub-8063238085883624\";\r\ngoogle_ad_width = 120;\r\ngoogle_ad_height = 240;\r\ngoogle_ad_format = \"120x240_as\";\r\ngoogle_ad_type = \"text_image\";\r\ngoogle_ad_channel =\"\";\r\ngoogle_color_border = \"FFFFFF\";\r\ngoogle_color_link = \"0000FF\";\r\ngoogle_color_bg = \"FFFFFF\";\r\ngoogle_color_text = \"000000\";\r\ngoogle_color_url = \"008000\";\r\n', 'Put your Google AdSense settings in here. Just copy the settings from your AdSense account, not the script itself! You can only copy the settings, you cannot change it in the Admin Panel. For changes use your AdSense Account and copy again.', 963, 2, NULL , NULL , NULL , 'tep_cfg_textarea('

)

 

MySQL said:

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';

 

insert into configuration values

('', 'Show Google AdSen

 

Back

Link to comment
Share on other sites

Are you trying to copy and paste the contents of the sql file into an sql query window? If so, the syntax needed will be different to running the file into the database using phpMyAdmin. Use the Browse link to locate the file and click 'Go'.

 

Vger

Link to comment
Share on other sites

Are you trying to copy and paste the contents of the sql file into an sql query window? If so, the syntax needed will be different to running the file into the database using phpMyAdmin. Use the Browse link to locate the file and click 'Go'.

 

Vger

 

 

I tried using the browse feature...

Link to comment
Share on other sites

Are you trying to copy and paste the contents of the sql file into an sql query window? If so, the syntax needed will be different to running the file into the database using phpMyAdmin. Use the Browse link to locate the file and click 'Go'.

 

Vger

 

 

I just read the line again:

 

WARNING: This file ads a configuration group 963.

First look if your database doesn't contain this configuration group yet.

Otherwise you must change this first!

 

I did look and noticed I had a group 963 for Customers info. When it says you must change this first...what does that mean? Where and what do I change it to?

Link to comment
Share on other sites

Inside the .sql file is code to install a new configuration group, and it is numbered 963 - you need to edit it to a number which is higher than any other configuration group id.

 

Vger

 

Thanks, I tried that, and it still says:

 

MySQL said:

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';

 

insert into configuration values

('', 'Show Google AdSen

 

What exactly does that mean? I am not a programmer, coder, etc...in fact, I'm not very knowledgeable on computers in general.

Link to comment
Share on other sites

There is an error in the sql file. This:

('', 'Show Google AdSense', 'ADSENSE_SHOW', 'true', 'Show Google AdSense ads (true) or not (false)', 963, 1, null, null, null, 'tep_cfg_select_option(array(\'true\', \'false\'),'),

 

should read as this:

('', 'Show Google AdSense', 'ADSENSE_SHOW', 'true', 'Show Google AdSense ads (true) or not (false)', 963, 1, null, null, null, 'tep_cfg_select_option(array(\'true\', \'false\'),');

 

Vger

Link to comment
Share on other sites

There is an error in the sql file. This:

('', 'Show Google AdSense', 'ADSENSE_SHOW', 'true', 'Show Google AdSense ads (true) or not (false)', 963, 1, null, null, null, 'tep_cfg_select_option(array(\'true\', \'false\'),'),

 

should read as this:

('', 'Show Google AdSense', 'ADSENSE_SHOW', 'true', 'Show Google AdSense ads (true) or not (false)', 963, 1, null, null, null, 'tep_cfg_select_option(array(\'true\', \'false\'),');

 

Vger

 

 

 

 

Thanks so much for putting in an effort to help me..it is still not working...this is the error message I am getting: Some text is in a different colour...is that a clue as to the error in my SQL syntax?

 

INSERT INTO configuration

VALUES (

'', 'Show Google AdSense', 'ADSENSE_SHOW', 'true', 'Show Google AdSense ads (true) or not (false)', 963, 1, NULL , NULL , NULL , 'tep_cfg_select_option(array(\'true\', \'false\'),'

)

 

MySQL said:

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';

 

insert into configuration values

 

('', 'Show Google AdSen

Link to comment
Share on other sites

Thanks so much for putting in an effort to help me..it is still not working...this is the error message I am getting: Some text is in a different colour...is that a clue as to the error in my SQL syntax?

 

INSERT INTO configuration

VALUES (

'', 'Show Google AdSense', 'ADSENSE_SHOW', 'true', 'Show Google AdSense ads (true) or not (false)', 963, 1, NULL , NULL , NULL , 'tep_cfg_select_option(array(\'true\', \'false\'),'

)

 

MySQL said:

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';

 

insert into configuration values

 

('', 'Show Google AdSen

 

 

Apparently this contribution has not caused anyone else any problems...anyone with any idea why the syntax error is showing up on mine?

Link to comment
Share on other sites

Still no luck with this contribution...something about syntax error, but apparently there is nothing wrong with it. The contribution works with everyone else.

 

Any Suggestions?

 

You dont really need to run a sql file to add a info box to contain google adds or to place a google add at all within your site.

 

Try this:

 

in your includes/column_right_or_left.php add this where you would like your add to show (you can even add it within the footer or header if you would like to.

if ($request_type == NONSSL) {   /* only show adsense in NON SSL else it causes warning */
 include(DIR_WS_BOXES . 'adds.php');
 }

 

then create a new php file called adds.php with these contents:

<?php
/*
 $Id: adds.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- adds //-->
	  <tr>
		<td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_ADDS);

 new infoBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'center',
						   'text'  => '<script type="text/javascript">YOUR JAVA SCRIPT GOES HERE</script>');

new infoBox($info_box_contents);

?>
<!-- adds_eof //-->

Then add the filename to filenames.php, and define your new box title in the english.php where the rest of your info boxes are defined.

 

then your done thats it.

 

Hope this helps,

Eric

Link to comment
Share on other sites

  • 7 months later...
Wow, that was so easy!!!

You wouldnt happen to have a code to add a banner shaped ad to the header or footer would you?

I have tried to modify it myself but no luck... still learning!

 

Cheers

Amanda

 

 

Hi Amanda,

 

That has given me also a hard time as a beginner, any way, I did add the following codes after the banner line, if you look to my site you would see couple of googles ads, you can choose one by eliminating the other one.

below is what I have added in the footer.php hope it can help. Sorry I do not have any thing for the header.

 

<?php

if ($banner = tep_banner_exists('dynamic', '468x50')) {

?>

<br>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td align="center"><?php echo tep_display_banner('static', $banner); ?></td>

</tr>

</table>

<br>

<center>

<script type="text/javascript"><!--

google_ad_client = "pub-PUT YOUR GOOGLE CODE HERE";

google_ad_width = 728;

google_ad_height = 90;

google_ad_format = "728x90_as";

google_ad_type = "text";

google_ad_channel = "";

google_color_border = "f09411";

google_color_bg = "f8f8f9";

google_color_link = "0000FF";

google_color_text = "000000";

google_color_url = "008000";

//-->

</script>

<script type="text/javascript"

src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>

<br>

<script type="text/javascript"><!--

google_ad_client = "pub-PUT YOUR GOOGLE CODE HERE";

google_ad_width = 728;

google_ad_height = 90;

google_ad_format = "728x90_as";

google_ad_type = "image";

google_ad_channel = "";

google_color_border = "f09411";

google_color_bg = "f8f8f9";

google_color_link = "0000FF";

google_color_text = "000000";

google_color_url = "008000";

//-->

</script>

<script type="text/javascript"

src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>

</center><br>

<?php

}

?>

 

 

best of luck

Ahmed

http://www.qazamart.com

Link to comment
Share on other sites

  • 2 years later...

You dont really need to run a sql file to add a info box to contain google adds or to place a google add at all within your site.

 

Try this:

 

in your includes/column_right_or_left.php add this where you would like your add to show (you can even add it within the footer or header if you would like to.

if ($request_type == NONSSL) {   /* only show adsense in NON SSL else it causes warning */
 include(DIR_WS_BOXES . 'adds.php');
 }

 

then create a new php file called adds.php with these contents:

<?php
/*
 $Id: adds.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- adds //-->
	  <tr>
		<td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_ADDS);

 new infoBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'center',
						   'text'  => '<script type="text/javascript">YOUR JAVA SCRIPT GOES HERE</script>');

new infoBox($info_box_contents);

?>
<!-- adds_eof //-->

Then add the filename to filenames.php, and define your new box title in the english.php where the rest of your info boxes are defined.

 

then your done thats it.

 

Hope this helps,

Eric

 

This was helpful :) Thanks so much!

I did not understand why i need to add file name in failname.php? I add it anyway but i do not know what is the function of it!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...