Commit 891f9945 authored by paul booker's avatar paul booker

initial port to drupal7

parent 7d131886
$Id$
This is the SpreadFireFox.com affiliates module. It allows a site
to setup various buttons and text links and track the clicks from
the affiliates' sites. A top block and page display who gained
the highest click with a link back to the site.
DESCRIPTION
--------------------------
Enables users to create text/image affiliate buttons and to track the clicks from the users affiliate site. A "top affiliates" and "top affiliates climbers" block and page display who gained the highest clicks and increase in clicks over a certain period of time with a link back to the affiliates site.
After upgrading to drupal 6 please update you database immediately
afterwards @ admin/reports/status.
PREREQUISITE
---------------
1. Ensure you have already specified your 'files' directory path @ admin/settings/file-system and that it is writable by apache (chmod o+w files)
2. Ensure you have specified your 'temporary' directory. I normally
put this under the 'files' directory
A request for your help....
INSTALLATION
---------------
1. Enable the affiliates module @ admin/build/modules
2. Configure the affiliates module @ admin/settings/affiliates
3 Setup the user permissions for the affiliates module @ admin/user/permissions#module-affiliates
4. Enable affiliates module blocks @ admin/build/block (The cron will need to run first)
NOTES
----------------
1. Create text/image affiliate buttons @ affiliates/admin
2. Users can collect text/image affiliate buttons @ affiliates
DEVELOPERS & SITE BUILDERS
------------------
THEMES
------------------
INTEGRATION
The affiliates module integrate with the userpoints module if installed
---------------------
UNIT TESTING
----------------------
This module does not come with unit tests. Please consider helping to build some of these. See http://drupal.org/simpletest
TODO/BUGS/FEATURE REQUESTS
----------------
- See http://drupal.org/project/issues/affiliates. Please search before filing issues in order to prevent duplicates.
UPGRADING FROM 5.0 TO 6.x
-----------------
CREDITS
----------------------------
Authored and maintained by Paul Booker <paul AT glaxstar DOT com>
If you have the time and the talent would you please consider writing
some documentation for this module , thanks for your help.
\ No newline at end of file
; $Id$
name = Affiliates
description = "A module that allows affiliate click-throughs to be tracked."
core = 7.x
files[] = affiliates.module
files[] = affiliates.js
files[] = affiliates.install
dependencies[] = profile
core = 6.x
......@@ -4,19 +4,16 @@
/**
* Implementation of hook_install().
*/
function affiliates_install() {
drupal_install_schema('affiliates');
/*function affiliates_install() {
db_query("INSERT INTO {affiliates_cats} VALUES (NULL, 'Email Signature', 'Y', 0);");
db_query("INSERT INTO {affiliates_cats} VALUES (NULL, 'Buttons', 'Y', 0);");
db_query("INSERT INTO {affiliates_cats} VALUES (NULL, 'Ad Banners', 'Y', 0);");
}
}*/
/**
* Implementation of hook_uninstall().
*/
function affiliates_uninstall() {
drupal_uninstall_schema('affiliates');
db_query("DELETE FROM {variable} WHERE name LIKE 'affiliate\_%'");
}
......@@ -42,6 +39,10 @@ function affiliates_schema() {
'affiliates_click_time' => array('click_time'),
),
'primary key' => array('id'),
'foreign keys' => array(
'user_id' => array('user' => 'uid'),
'ad_id' => array('affiliates_ads' => 'ad_id'),
),
);
$schema['affiliates_ads'] = array(
'fields' => array(
......@@ -62,6 +63,9 @@ function affiliates_schema() {
'affiliates_ads_status' => array('status'),
),
'primary key' => array('ad_id'),
'foreign keys' => array(
'cat_id' => array('affiliates_cats' => 'cat_id'),
),
);
$schema['affiliates_cats'] = array(
'fields' => array(
......@@ -80,13 +84,22 @@ function affiliates_schema() {
'previous_period_points' => array('type' => 'int', 'length' => '10' ),
),
'primary key' => array('user_id'),
'foreign keys' => array(
'user_id' => array('user' => 'uid'),
),
);
return $schema;
}
function affiliates_update_6001() {
$ret = array();
db_add_field($ret, 'affiliates_cats', 'weight', array('type' => 'int', 'length' => '3', 'not null' => TRUE, 'default' => 0));
return $ret;
db_add_field('affiliates_cats', 'weight', array('type' => 'int', 'length' => '3', 'not null' => TRUE, 'default' => 0));
return t('Added the affiliates_cats table.');
}
function affiliates_update_6002() {
db_change_field('affiliates', 'referer', 'referer', array('type' => 'varchar', 'length' => '256', 'default' => NULL));
db_change_field('affiliates_ads', 'anchor', 'anchor', array('type' => 'varchar', 'length' => '256', 'default' => NULL));
db_change_field('affiliates_ads', 'redirect', 'redirect', array('type' => 'varchar', 'length' => '256', 'default' => NULL));
return t('Added a refer field to the affiliates table & anchor and redirect fields to the affiliates_ads table.');
}
// $Id$
/**
* @file affiliates.js
*
*/
/**
* Controls Affiliates UI during the creation of new banners.
*/
Drupal.behaviors.affiliates = function() {
$('select#edit-type').change(function() {
if ($("select#edit-type").val() == 'text') {
$("#edit-image").attr('disabled', true);
$("#edit-anchor").attr('disabled', true);
}
else {
$("#edit-image").removeAttr("disabled");
$("#edit-anchor").removeAttr("disabled");
}
});
if ($("select#edit-type").val() == 'text') {
$("#edit-image").attr('disabled', true);
$("#edit-anchor").attr('disabled', true);
}
else {
$("#edit-image").removeAttr("disabled");
$("#edit-anchor").removeAttr("disabled");
}
}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment