Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC-Affiliate


henri

Recommended Posts

I would kindly offer payment if someone can assist me on this. Please contact me if you can help me out

 

Take a look at www.retrological.com

 

It seems to function ok although I have not tested it fully, I am more concerned about it trashing the look of my site just now!

Can anyone offer any help to where i need to look to get this sorted out? Two things:

 

1. the affiliate is not inside a box as it should be on the left menu

2. when you click any of the affiliate options the site format trashes out completely with graphics and links everywhere

 

thanks in advance for any help someone may able to offer me

 

I am not sure what do you mean about 1st thing, so can you just please tell me how it suppose to look like?

 

Anyway I think the 2nd thing is more important and the problem as I can see it is that your php files for affiliate program is messed up with html codes (tags)? I had similar problems while I was working with my site and only way I can manage it is too print down to entire HTML code of that page thats messed up and follow HTML tags (<table>, </table>, <td>, </td> etc.) and than you see where the problem is? Anyway another thing to do is to see what html tags generates your affiliate program and see if that matched with your header, footer, column left and right html tags, when you merge them in one page, if you do not understand here is the whole idea:

 

You MUST have exact number of opening HTML tags for table, row or cell (<table>, <tr>, <td>) as closing tags for them (</table>, </tr>, </td>). So in you site (one page) this numbers don't match so you get that! You get one table tag opened in header and closed in affiliate file, but it should be closed in footer file - for example!

 

If you are not familiar with all this, I am willing to help you, so you can pm, anytime or ask here, it doesn't matter!

Link to comment
Share on other sites

I am getting this error on the main site when i click to show the affiliate_signup.php or any of the other main pages, admin is fine no errors from what i can see its just the main site.

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /public_html/includes/header.php:137) in /public_html/includes/boxes/categories.php on line 13

 

Can anyone help now a bit stuck

Link to comment
Share on other sites

I could not find this info.

 

Have affiliate program running for 3 years and have 2 questions:

 

1) How to "prune" affiliate clicks - I have over 1000pages of them...?

 

 

2) Is there a way to stop registering "clicks" from robots - those are 90% of all the registered clicks...

 

thank you

Link to comment
Share on other sites

Hello All,

 

I just installed this Affiliates Mod. I also have HTC, STS, SEO-G and Coupons. Anyways, I have this error on my affiliate_affiliate.php page. I've seen some fixes for it in this topic, but I'm not sure how to apply it. Anyways, here's the warning text:

 

Fatal error: Cannot redeclare affiliate_check_url() (previously declared in /home/geekfitt/public_html/includes/functions/affiliate_functions.php:17) in /home/geekfitt/public_html/includes/functions/affiliate_functions.php on line 19

 

Can anyone help? Thank you in advance!

 

Best,

 

Chris

Link to comment
Share on other sites

This should be simple solution. Anyway the problem is that your page call affiliate_functions.php twice. So you should look up in the affiliate_affiliate.php and in affiliate_application_top.php if you have this:

 

require(DIR_WS_FUNCTIONS . 'affiliate_functions.php');

 

If you have in both files than you should delete or comment out that line in affiliate_affiliate.php. The main thing is that affiliate_function.php must be required only ONCE! So all affiliate pages includes affiliate_application.php, and than in that case only affiliate_application.php shoud require affiliate_functions.php.

 

If this is not helping you,(but it has to), than you should see where and what file require or includes affiliate_functions.php. Just make sure that page is included only ONCE!

Link to comment
Share on other sites

This should be simple solution. Anyway the problem is that your page call affiliate_functions.php twice. So you should look up in the affiliate_affiliate.php and in affiliate_application_top.php if you have this:

 

require(DIR_WS_FUNCTIONS . 'affiliate_functions.php');

 

If you have in both files than you should delete or comment out that line in affiliate_affiliate.php. The main thing is that affiliate_function.php must be required only ONCE! So all affiliate pages includes affiliate_application.php, and than in that case only affiliate_application.php shoud require affiliate_functions.php.

 

If this is not helping you,(but it has to), than you should see where and what file require or includes affiliate_functions.php. Just make sure that page is included only ONCE!

 

Is it okay to just change it to require_once?

 

Thanks for your help!

 

Chris

Link to comment
Share on other sites

I really don't know if affiliate_application_top will require that file if you put require_once in affiliate_application_top, but why would you do that, you can simply delete that line, if you have it in affiliate_application_top.php, because of this:

 

affiliate_affiliate.php (require) affiliate_application_top.php (require) affiliate_functions.php,

 

so basicly every affiliate_xxxxx.php file can get to affiliate_functions.php through affiliate_application_top.php and ONLY once which is important, so you don get redeclare function error!

Link to comment
Share on other sites

Thank you Cunga Lunga for your advice. I have another problem. I can't get any of the pop-ups to work. I have STS. I've looked at the other posts here regarding STS and Pop-ups, but I still can't understand exactly what these other people did to fix this problem. If anyone has gotten this to work, please explain it to me. I get this warning when I click on some of the pop-ups:

 

Warning: require(affiliate_help_18.php) [function.require]: failed to open stream: No such file or directory in /home/geekfitt/public_html/root.php on line 145

 

Fatal error: require() [function.require]: Failed opening required 'affiliate_help_18.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/geekfitt/public_html/root.php on line 145

 

And sometimes I get the problem that other people were talking about, which is some pop-ups just lead to a blank template. I also have SEO-G installed. Thank you in advance!

 

Best,

 

Chris

Link to comment
Share on other sites

Henri,

 

I'm writing you because I'm hoping you might have an answer for me. I am new to osCommerce and though I have an osCommerce site, I do not know its file structure that well or PHP. I have designed an online shop that works with a hybrid model of drop-shipping vendors and direct shipping.

 

My challenge is to figure out how to keep the shipping costs low when you have a customer purchasing multiple products from multiple vendors. This would mean each product would carry a separate shipping charge and when added all together, the costs would be too high. The alternative is to add shipping into the price of each item and only charge for priority shipping when requested. However, this would not make me price competitive.

 

Please let me know if you know of a solution for this shipping issue. And, if there is anything in osCommece that can be adjusted to better accommodate these shipping challenges?

 

Thank you in advance for all your help.

 

Respectfully,

 

Demitry D.

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

Can anyone point me to the latest oscAffiliate download? I know this makes me look stupid, but is a LOADED version a full version or one that required oscAffiliate to already be installed and is going over the top of it?

 

Thanks in advance

 

Brian

Link to comment
Share on other sites

CONFIGURE OSC OSCOMMERCE - STEP BY STEP :

 

0. BACKUPp database and files point 3, 4, 5

 

1. MYSQL ALTERATIONS

- Upload affiliate.sql using phpmyadmin in cpanel, select oscommerce database, choose import and browse the affiliaste.sql and click go. SUCCESS

 

2. UPLOAD all contribution file : osCAffiliate2.6 to correspondeing folders

But I found in contribution file : Admin/Images/Categories/affiliate.gif ---- in my server there's Admin/Images, no Categories folder so I mkdir new folder (categories) and upload affiliate.gif

 

3. CATALOG ALTERATIONS

- In application_top.php in the catalog/includes directory...DONE

- In checkout_process.php in the catalog directory find line...DONE

- In catalog/includes/column_left.php... DONE

 

4. ADMIN ALTERATIONS

- In index.php in the admin directory find line....DONE

- In application_top.php in the admin/includes....DONE

- In column_left.php in the admin/includes directory...DONE

 

5. Install

- catalog/product_info.php....ADD...DONE

- catalog/includes/filenames.php...ADD...DONE

 

6. Forgot to upload the updated file point no. 3, 4, 5 to my server and directly went to osc admin area. Found in configuration/Affiliate Program and setup the basic info

 

7. Suddenly remember to upload files point 3, 4, 5 to server and Do it quickly

 

BUT after finish all 7 step above, my admin + store both BLANK.

 

 

Any idea what went wrong? Many thank in advance

 

 

PS : 8. Restore all files point 3, 4, 5 to old one and my site and Admin are recover

Edited by wimanto
Link to comment
Share on other sites

9. Upload again files 3, 4, 5

 

And STILL BLANK both.

 

10. My site only use single language (Indonesian) so I restore English at Localization/LAnguage and set it to default.

 

11. If I did point 8, my site+admin is OKE but if I upload again files point 3,4,5 - result always BLANK. I've done it several times.

 

Can anyone help?

Link to comment
Share on other sites

SOLVE!. Language matter.

 

12. Add new file affiliate_indonesia.php (copy affiliate_enlish.php) in admin/include/languages

 

13. Add new folder indonesia (copy folder english) in admin/include/languages (will become admin/include/languages/indonesia)

 

14. Add new file affiliate_indonesia.php in catalog/includes/languages

 

15. Add new folder indonesia in catalog/includes/languages (will become catalog/includes/languages/indonesia)

Link to comment
Share on other sites

I wonder if anyone could help with this error:

 

Warning: require(affiliate_help_1.php) [function.require]: failed to open stream: No such file or directory in /home/geekfitt/public_html/root.php on line 145

 

Fatal error: require() [function.require]: Failed opening required 'affiliate_help_1.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/geekfitt/public_html/root.php on line 145

 

 

Here's my root file, if it matters:

 

<?php
/*
//----------------------------------------------------------------------------
// Copyright © 2006-2007 Asymmetric Software - Innovation & Excellence
// Author: Mark Samios
// [url="http://www.asymmetrics.com"]http://www.asymmetrics.com[/url]
// SEO-G Root page
// Main handler script
// Includes part of the includes/application_top.php from osCommerce to
// initialize the database.
//----------------------------------------------------------------------------
// Script is intended to be used with:
// osCommerce, Open Source E-Commerce Solutions
// [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]
// Copyright © 2003 osCommerce
//----------------------------------------------------------------------------
// Released under the GNU General Public License
//----------------------------------------------------------------------------
// MAKE SURE THE FOLLOWING SECTION IS COPIED DIRECTLY FROM YOUR OWN 
// catalog\includes\application_top.php and then set the $g_relpath, $g_server
// variables in this file such that:
//----------------------------------------------------------------------------
 if ($request_type == 'NONSSL') {
   define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
   $g_relpath = HTTP_SERVER . DIR_WS_CATALOG;
   $g_server = HTTP_SERVER;
 } else {
   define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);
   $g_relpath = HTTPS_SERVER . DIR_WS_CATALOG;
   $g_server = HTTPS_SERVER;
 }
//----------------------------------------------------------------------------
// Also note the $request_type has to be determined accurately between
// SSL and NON-SSL pages.
// See also documentation for details for this line:
//  $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';
//----------------------------------------------------------------------------
*/
//----------------------------------------------------------------------------
//-MS- Beginning of application_top.php section
//----------------------------------------------------------------------------
// start the timer for the page parse time log
 define('PAGE_PARSE_START_TIME', microtime());

// set the level of error reporting
 error_reporting(E_ALL & ~E_NOTICE);

// check if register_globals is enabled.
// since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
// >>> BEGIN REGISTER_GLOBALS
//  if (function_exists('ini_get')) {
//    ini_get('register_globals') or exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.');
//  }
// <<< END REGISTER_GLOBALS

// Set the local configuration parameters - mainly for developers
 if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');

// include server parameters
 require('includes/configure.php');

 if (strlen(DB_SERVER) < 1) {
   if (is_dir('install')) {
     header('Location: install/index.php');
   }
 }

// define the project version
 define('PROJECT_VERSION', 'osCommerce 2.2-MS2');

// set the type of request (secure or not)
 $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

// set php_self in the local scope
 if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];

 if ($request_type == 'NONSSL') {
   define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
   $g_relpath = HTTP_SERVER . DIR_WS_CATALOG;
   $g_server = HTTP_SERVER;
 } else {
   define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);
   $g_relpath = HTTPS_SERVER . DIR_WS_CATALOG;
   $g_server = HTTPS_SERVER;
 }

// include the list of project filenames
 require(DIR_WS_INCLUDES . 'filenames.php');

// include the list of project database tables
 require(DIR_WS_INCLUDES . 'database_tables.php');

// customization for the design layout
 define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)

// include the database functions
 require(DIR_WS_FUNCTIONS . 'database.php');

// make a connection to the database... now
 tep_db_connect() or die('Unable to connect to database server!');

// set the application parameters
 $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
 while ($configuration = tep_db_fetch_array($configuration_query)) {
   define($configuration['cfgKey'], $configuration['cfgValue']);
 }

//----------------------------------------------------------------------------
//-MS- End of application_top.php section
//----------------------------------------------------------------------------

//----------------------------------------------------------------------------
// SEO-G Section starts here. This part is required for proper operation 
// Do not override the code below
//----------------------------------------------------------------------------
 require(DIR_WS_CLASSES . 'seo_url.php');
 $g_seo_url = new seoURL;
 $osc_url = $osc_params = $osc_parse = '';
 if( $g_seo_url->get_osc_url($g_server . $_SERVER['REQUEST_URI'], $osc_url, $osc_params, $osc_parse) ) {
   $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'] = $_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME'] = $osc_parse['path'];
   if(basename($_SERVER['PHP_SELF']) == 'root.php' ) {
     echo '<b>SEO-G Error</b>: Invalid Self-Request - Check recorded URLs';
     exit();
   }
   $tmp_array = array();
   for($i=0, $j=count($osc_params); $i<$j; $i++ ) {
     $array_equal = explode('=', $osc_params[$i]);
     if( is_array($array_equal) ) {
       if( isset($array_equal[1]) ) {
         $tmp_array[$array_equal[0]] = $array_equal[1];
       } else {
         $tmp_array[$array_equal[0]] = '';
       }
     }
   }
   $tmp_array = array_merge($HTTP_GET_VARS,$tmp_array);
   // Synchronize global arrays.
   $HTTP_GET_VARS = $_GET = $tmp_array;
   unset($tmp_array);
   // Synchronize query string variables
   $HTTP_SERVER_VARS['QUERY_STRING'] = $_SERVER['QUERY_STRING'] = implode('&',$osc_params);
   $g_script = basename($PHP_SELF);
   // Signal SEO-G translation.
   $g_seo_flag = true;
   require(basename($PHP_SELF));
 } elseif( file_exists(basename($osc_parse['path']))) {
   $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'] = $_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME'] = $osc_parse['path'];
   if(basename($_SERVER['PHP_SELF']) == 'root.php' ) {
     echo '<b>SEO-G Error</b>: Invalid Self-Request, passed URI Request: ' . $_SERVER['REQUEST_URI'];
     exit();
   }
   $g_script = basename($PHP_SELF);
   $g_seo_flag = true;
   require(basename($osc_parse['path']));
 } else {
   // Script not found. Initiate redirection
   header("HTTP/1.1 " . SEO_DEFAULT_ERROR_HEADER);
   header('Location: ' . $g_relpath . SEO_DEFAULT_ERROR_REDIRECT);
   //echo STORE_NAME . ' - Page was moved';
 }
 exit();
?>

Link to comment
Share on other sites

hey everyone.....ok, i dont know if its only me, or if everyone else has this problem.....when using the affiliate mod, and an affiliate makes a sale....if the customer checks out using paypal, there is no tracking of the affiliate, so you dont know how much you owe who...thoughts?

 

 

KAY>>>>>>>

what do you see here <affiliate_functions.php on line 19>

 

you may be able to remove that line of code from teh file, or, vice versa, remove the code from the page the error is coming from. All it is telling you is that there is already a page callling the same line of code, function, etc, so it is being duplicated

Link to comment
Share on other sites

  • 2 weeks later...

I have osc affiliate 2.02 installed (Yep an oldie, but it was working fine)

I installed the category banners addon contrib so that i could have links to my categories as well as individual products

 

However the banners are shown correctly, but the link for category banners is as follows:

 

http://www.outdoorbits.com/index.php?ref=1...ate_banner_id=4

 

i.e. its a variable tagged onto index.php but doesnt appear to be any code within index.php about that ref variable etc so all that happens is the homepage of our site is shown instead !

 

What code is there supposed to be within index.php to detect and refer the banner ?

Link to comment
Share on other sites

Hi

 

I'm just trying to set up v2.6 on oSC 2.2 Milestone 2, the admin side appears to be set up ok apart from it not uploading a new banner to the images directory. It saves the settings but not the image.

 

Also when I fill in the sign up page for a new affiliate it won't let me go any further, it just keeps showing the filled in form.

 

I am not getting any error messages and I have looked through this thread but cannot come up with an answer.

 

Has anybody got any suggestions?

 

Regards

 

Mike

Link to comment
Share on other sites

grr, sometimes it lets me edit, sometimes it doesnt

 

ok, so the error above is coming up on the summary page,

when i click the 'start billing' under payment i get this

 

1054 - Unknown column 'AFFILIATE_PAYMENT_ORDER_MIN_STATUS' in 'where clause'

 

SELECT a.affiliate_id, sum(a.affiliate_payment) FROM affiliate_sales a, orders o WHERE a.affiliate_billing_status != 1 and a.affiliate_orders_id = o.orders_id and o.orders_status >= AFFILIATE_PAYMENT_ORDER_MIN_STATUS and a.affiliate_date <= '2006-04-20' GROUP by a.affiliate_id having sum(a.affiliate_payment) >= 'AFFILIATE_THRESHOLD'

 

[TEP STOP]

 

and when i click on the News i get this

 

1146 - Table 'sailboats1.affiliate_news_contents' doesn't exist

 

select news_id, affiliate_news_headlines as headline, affiliate_news_contents as content, news_status from affiliate_news, affiliate_news_contents where news_id = affiliate_news_id and affiliate_news_languages_id = '1' order by date_added desc

 

[TEP STOP]

 

I dropped all of the affiliate tables in phpmyadmin and ran the .sql again and got this...

 

Error

SQL-query:

 

INSERT INTO configuration_group

VALUES ( 900, 'Affiliate Program', 'Options for the Affiliate Program', 50, 1 )

MySQL said:

 

#1062 - Duplicate entry '900' for key 1

 

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/servage_net/secure/admin/phpMyAdmin-2.6.1/libraries/common.lib.php on line 685

but it did create these tables

affiliate_affiliate

affiliate_banners

affiliate_banners_history

affiliate_clickthroughs

affiliate_news

affiliate_newsletters

affiliate_payment

affiliate_payment_status

affiliate_payment_status_history

affiliate_sales

Ok I see all of you have the same problem in the mysql data base

What this mean Duplicate entry '900' for key 1

This mean you have exude the sql file more than one time

The man how set the file forget something it's a drop statement

For the configuration_group

To solve the problem go to the phpmuadmin you can see the table configuration_group in the right chose the first choice brose

You will in the end of the table under configuration_group_id you will see the number 900 check all the coulme and delete it then exude the sql file again

This is the code you can use for drop it

DELETE FROM `configuration_group` WHERE `configuration_group`.`configuration_group_id` =900 LIMIT 1;

it will fix it

Link to comment
Share on other sites

I have osc affiliate 2.02 installed (Yep an oldie, but it was working fine)

I installed the category banners addon contrib so that i could have links to my categories as well as individual products

 

However the banners are shown correctly, but the link for category banners is as follows:

 

http://www.outdoorbits.com/index.php?ref=1...ate_banner_id=4

 

i.e. its a variable tagged onto index.php but doesnt appear to be any code within index.php about that ref variable etc so all that happens is the homepage of our site is shown instead !

 

What code is there supposed to be within index.php to detect and refer the banner ?

 

 

Yes you are right - i have solved this problem in my installation - will take a look for the solution later and post it here

Link to comment
Share on other sites

Yes you are right - i have solved this problem in my installation - will take a look for the solution later and post it here

 

Cheers Setani

 

I had more of a look and it looks like the index.php includes application_top.php which in turn includes affiliate_application_top.php which looks like its where the ref variable should be pulled from, but can't see whats going wrong

Link to comment
Share on other sites

PLease check you includes/affiliate_application_top.php

 

as i know, they were some missing informations for the cpath vars

 

here is the content of my working one

 

<?php
/*
 $Id: affiliate_application_top.php,v 2.00 2003/10/12

 OSC-Affiliate

 Contribution based on:

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

 Copyright (c) 2002 - 2003 osCommerce

 Released under the GNU General Public License
*/


// Set the local configuration parameters - mainly for developers
require(DIR_WS_INCLUDES . 'affiliate_configure.php');

 require(DIR_WS_INCLUDES . 'affiliate_configure.php');
 require(DIR_WS_FUNCTIONS . 'affiliate_functions.php');

// define the database table names used in the contribution
 define('TABLE_AFFILIATE', 'affiliate_affiliate');
 define('TABLE_AFFILIATE_NEWS', 'affiliate_news');

// if you change this -> affiliate_show_banner must be changed too
 define('TABLE_AFFILIATE_BANNERS', 'affiliate_banners');
 define('TABLE_AFFILIATE_BANNERS_HISTORY', 'affiliate_banners_history');
 define('TABLE_AFFILIATE_CLICKTHROUGHS', 'affiliate_clickthroughs');
 define('TABLE_AFFILIATE_SALES', 'affiliate_sales');
 define('TABLE_AFFILIATE_PAYMENT', 'affiliate_payment');
 define('TABLE_AFFILIATE_PAYMENT_STATUS', 'affiliate_payment_status');
 define('TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY', 'affiliate_payment_status_history');

// define the filenames used in the project
 define('FILENAME_AFFILIATE_SUMMARY', 'affiliate_summary.php');
 define('FILENAME_AFFILIATE_LOGOUT', 'affiliate_logout.php');
 define('FILENAME_AFFILIATE', 'affiliate_affiliate.php'); 
 define('FILENAME_AFFILIATE_CONTACT', 'affiliate_contact.php');
 define('FILENAME_AFFILIATE_FAQ', 'affiliate_faq.php');
 define('FILENAME_AFFILIATE_ACCOUNT', 'affiliate_details.php');
 define('FILENAME_AFFILIATE_DETAILS', 'affiliate_details.php');
 define('FILENAME_AFFILIATE_DETAILS_OK', 'affiliate_details_ok.php');
 define('FILENAME_AFFILIATE_TERMS','affiliate_terms.php');
 define('FILENAME_AFFILIATE_TERMS_POPUP','affiliate_terms_popup.php');
 define('FILENAME_AFFILIATE_NEWS', 'affiliate_news.php');
 define('FILENAME_AFFILIATE_NEWSLETTER', 'affiliate_newsletter.php');

 define('FILENAME_AFFILIATE_HELP_1', 'affiliate_help1.php');
 define('FILENAME_AFFILIATE_HELP_2', 'affiliate_help2.php');
 define('FILENAME_AFFILIATE_HELP_3', 'affiliate_help3.php');
 define('FILENAME_AFFILIATE_HELP_4', 'affiliate_help4.php');
 define('FILENAME_AFFILIATE_HELP_5', 'affiliate_help5.php');
 define('FILENAME_AFFILIATE_HELP_6', 'affiliate_help6.php');
 define('FILENAME_AFFILIATE_HELP_7', 'affiliate_help7.php');
 define('FILENAME_AFFILIATE_HELP_8', 'affiliate_help8.php');
 define('FILENAME_AFFILIATE_HELP_9', 'affiliate_help9.php');
 define('FILENAME_AFFILIATE_HELP_10', 'affiliate_help10.php');
 define('FILENAME_AFFILIATE_HELP_11', 'affiliate_help11.php');
 define('FILENAME_AFFILIATE_HELP_12', 'affiliate_help12.php');
 define('FILENAME_AFFILIATE_HELP_13', 'affiliate_help13.php');
 define('FILENAME_AFFILIATE_HELP_14', 'affiliate_help14.php');
 define('FILENAME_AFFILIATE_HELP_15', 'affiliate_help15.php');
 define('FILENAME_AFFILIATE_HELP_16', 'affiliate_help16.php');
 define('FILENAME_AFFILIATE_HELP_17', 'affiliate_help17.php');
 define('FILENAME_AFFILIATE_HELP_18', 'affiliate_help18.php');
 define('FILENAME_AFFILIATE_HELP_19', 'affiliate_help19.php');
 define('FILENAME_AFFILIATE_HELP_20', 'affiliate_help20.php');
 define('FILENAME_AFFILIATE_HELP_21', 'affiliate_help21.php');
 define('FILENAME_AFFILIATE_HELP_22', 'affiliate_help22.php');
define('FILENAME_AFFILIATE_BANNERS_CATEGORY', 'affiliate_banners_category.php');
 define('FILENAME_AFFILIATE_BANNERS_BUILD_CAT', 'affiliate_banners_build_cat.php');
 define('FILENAME_AFFILIATE_VALIDCATS', 'affiliate_validcats.php');
 define('FILENAME_AFFILIATE_INFO', 'affiliate_info.php');
define('TABLE_AFFILIATE_NEWS_CONTENTS', 'affiliate_news_contents');
 define('FILENAME_AFFILIATE_BANNERS', 'affiliate_banners.php');
 define('FILENAME_AFFILIATE_BANNERS_BANNERS', 'affiliate_banners_banners.php');
 define('FILENAME_AFFILIATE_BANNERS_BUILD', 'affiliate_banners_build.php');
 define('FILENAME_AFFILIATE_BANNERS_PRODUCT', 'affiliate_banners_product.php');
 define('FILENAME_AFFILIATE_BANNERS_TEXT', 'affiliate_banners_text.php');
 define('FILENAME_AFFILIATE_SHOW_BANNER', 'affiliate_show_banner.php');

 define('FILENAME_AFFILIATE_REPORTS', 'affiliate_reports.php');
 define('FILENAME_AFFILIATE_CLICKS', 'affiliate_clicks.php');
 define('FILENAME_AFFILIATE_VALIDPRODUCTS', 'affiliate_validproducts.php');

 define('FILENAME_AFFILIATE_PASSWORD', 'affiliate_password.php');
 define('FILENAME_AFFILIATE_PASSWORD_FORGOTTEN', 'affiliate_password_forgotten.php');

 define('FILENAME_AFFILIATE_LOGOUT', 'affiliate_logout.php');
 define('FILENAME_AFFILIATE_SALES', 'affiliate_sales.php');
 define('FILENAME_AFFILIATE_SIGNUP', 'affiliate_signup.php');

 define('FILENAME_AFFILIATE_SIGNUP_OK', 'affiliate_signup_ok.php');
 define('FILENAME_AFFILIATE_PAYMENT', 'affiliate_payment.php');

// include the language translations
 require(DIR_WS_LANGUAGES . 'affiliate_' . $language . '.php');

 $affiliate_clientdate = (date ("Y-m-d H:i:s"));
 $affiliate_clientbrowser = $HTTP_SERVER_VARS["HTTP_USER_AGENT"];
 $affiliate_clientip = $HTTP_SERVER_VARS["REMOTE_ADDR"];
 $affiliate_clientreferer = $HTTP_SERVER_VARS["HTTP_REFERER"];

 if (!$HTTP_SESSION_VARS['affiliate_ref']) {
tep_session_register('affiliate_ref');
tep_session_register('affiliate_clickthroughs_id');
if (($HTTP_GET_VARS['ref'] || $HTTP_POST_VARS['ref'])) {
  if ($HTTP_GET_VARS['ref']) $affiliate_ref = (int)$HTTP_GET_VARS['ref'];
  if ($HTTP_POST_VARS['ref']) $affiliate_ref = (int)$HTTP_POST_VARS['ref'];
  if ($HTTP_GET_VARS['products_id']) $affiliate_products_id = (int)$HTTP_GET_VARS['products_id'];
  if ($HTTP_POST_VARS['products_id']) $affiliate_products_id = (int)$HTTP_POST_VARS['products_id'];
  if ($HTTP_GET_VARS['cPath']) $affiliate_cat_id = (int)$HTTP_GET_VARS['cPath'];
  if ($HTTP_POST_VARS['cPath']) $affiliate_cat_id = (int)$HTTP_POST_VARS['cPath'];
  if ($HTTP_GET_VARS['affiliate_banner_id']) $affiliate_banner_id = (int)$HTTP_GET_VARS['affiliate_banner_id'];
  if ($HTTP_POST_VARS['affiliate_banner_id']) $affiliate_banner_id = (int)$HTTP_POST_VARS['affiliate_banner_id'];

  if (!$link_to) $link_to = "0";
  $sql_data_array = array('affiliate_id' => $affiliate_ref,
						  'affiliate_clientdate' => $affiliate_clientdate,
						  'affiliate_clientbrowser' => $affiliate_clientbrowser,
						  'affiliate_clientip' => $affiliate_clientip,
						  'affiliate_clientreferer' => $affiliate_clientreferer,
						  'affiliate_cat_id' => $affiliate_cat_id,
						  'affiliate_products_id' => $affiliate_products_id,
						  'affiliate_banner_id' => $affiliate_banner_id);
  tep_db_perform(TABLE_AFFILIATE_CLICKTHROUGHS, $sql_data_array);
  $affiliate_clickthroughs_id = tep_db_insert_id();

  // Banner has been clicked, update stats:
  if ($affiliate_banner_id && $affiliate_ref) {
	$today = date('Y-m-d');
	$sql = "select * from " . TABLE_AFFILIATE_BANNERS_HISTORY . " where affiliate_banners_id = '" . $affiliate_banner_id  . "' and  affiliate_banners_affiliate_id = '" . $affiliate_ref . "' and affiliate_banners_history_date = '" . $today . "'";
	$banner_stats_query = tep_db_query($sql);

 // Banner has been shown today
	if (tep_db_fetch_array($banner_stats_query)) {
	tep_db_query("update " . TABLE_AFFILIATE_BANNERS_HISTORY . " set affiliate_banners_clicks = affiliate_banners_clicks + 1 where affiliate_banners_id = '" . $affiliate_banner_id . "' and affiliate_banners_affiliate_id = '" . $affiliate_ref. "' and affiliate_banners_history_date = '" . $today . "'");
  // Initial entry if banner has not been shown
  } else {
	$sql_data_array = array('affiliate_banners_id' => $affiliate_banner_id,
							'affiliate_banners_products_id' => $affiliate_products_id,
							'affiliate_banners_affiliate_id' => $affiliate_ref,
							'affiliate_banners_clicks' => '1',
							'affiliate_banners_history_date' => $today);
	tep_db_perform(TABLE_AFFILIATE_BANNERS_HISTORY, $sql_data_array);
  }
}

// Set Cookie if the customer comes back and orders it counts
setcookie('affiliate_ref', $affiliate_ref, time() + AFFILIATE_COOKIE_LIFETIME);
}
if ($HTTP_COOKIE_VARS['affiliate_ref']) { // Customer comes back and is registered in cookie
  $affiliate_ref = $HTTP_COOKIE_VARS['affiliate_ref'];
}
 }

////
// Compatibility to older Snapshots

// set the type of request (secure or not)
 if (!isset($request_type)) $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

// Emulate the breadcrumb class
 if (!class_exists(breadcrumb)) {
class breadcrumb {
  function add($title, $link = '') {
	global $location;
	$location='» <a href="' . $link . '" class="headerNavigation">' . $title . '</a>';
  }
}
$breadcrumb = new breadcrumb;
 }
?>

 

But i´m not sure if this was the only changes i have made . if im right, you have to check also the

file affiliate_banners_build_cat.php and affiliate_banners_build.php. Reason for is, that in the version 2.7

teh generated links in one of this files doesnt link to the right picture.

Edited by shetani
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...