affiliate visited outgoing links viewer affiliate visited outgoing links viewer
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

affiliate visited outgoing links viewer

Started by xplicit, April 02, 2006, 11:38:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xplicit

Hi all

Just to let you know I'm working on a script which is intented for registering the clicks on the outgoing links in a affiliate programm. Or to say it in other words I'm writing a script where link partners can see how much traffic I redirected to them.

This is intended for link partners and the coppermine webmaster to see if the advertisements or link are generating traffic.

The script will be in the normal coppermine environment,

Environment :

* Should work for all versions 1.3x, 1.4x
* php4 or higher
* SQL based

User rights:

* Coppermine administrator can see all the visited links and counts
* Link partners can only see the traffic for their own link (check based on theire own username/password)

Maintenance:

* Administrator can generate new ID's which will replace the normal link urls
* Administrator can assign the rights for linkpartner and the related username
* Administrator can reset the counter

Project deadline : approx end of this week.

Any suggestions for further related functions are welcome

***** UPDATED 8 APRIL : ATTACHED THE ZIPFILE *****
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

lordprodigy


xplicit

Well it looks promissing :)

The layout is based on a script I had seen before which used separte text files. Script itself is totally different but got a nice touch and feel if I may say so.

Most parts are working, but have to do a lot of finetuning but I will give you some previews of the main screen and the succesfull adding of a link in the database.

Of course the visual aspects are things to worry about at the end.

Any suggestions welcome!


Mainscreen: (https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fpicserver.student.utwente.nl%2Fi%2F9CVZL3WC92XG%2F730w&hash=d57fd7ceda5b2d115e5a3865dae4ebd1a9820697)

Succesfull added a link: (https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fpicserver.student.utwente.nl%2Fi%2F91OT9V3VWM28%2F730w&hash=3d172dbbe72c18b65af46bec07549ea8023d74e1)
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

xplicit

#3
Ok not much reactions so far  :(

Perhaps I'm the only one interested ;)

So I made some progress it's not yet coded as I want so it got hardcoded tables, and database links and only tested in 130 but the version is version independent so I'm sure it will work for the 144.

I have made a test link so feel free to play with it!!

http://timecatchers.no-ip.org/144/clickcounter.php

It's not secured so everybody van edit as much as the want, the redirect file is not present at that server so you cant use that part but all database stuff etc is working ok, it even got a nice detectiion for the urls you can enter. Also if fields like friendly name are left blank it will use the url instead and shorten it to 30 characters and add the ... to it

So ga ahead and play.

Any comments welcome
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

xplicit

#4
OK almost done :)

Just some finetuning.

Here is the code I have sofar

***** UPDATED 8 APRIL : REMOVED CODES SEE FIRST POST FOR THE COMPLETE SOURCEFILE *****
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

xplicit

#5
***** UPDATED 8 APRIL : REMOVED CODES SEE FIRST POST FOR THE COMPLETE SOURCEFILE *****
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

xplicit

#6
add after above splitted code:

***** UPDATED 8 APRIL : REMOVED CODES SEE FIRST POST FOR THE COMPLETE SOURCEFILE *****
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

xplicit

Functionality:

User rights:

* Coppermine administrator can see all the visited links and can rest, remove or edit links
* Link partners can only see the traffic for their own link and remove, reset, or modify pending on theire given rights

(in normal case you give your link partners edit rights so they can self adjust the link to them in case they watn to give focus on a special part of theire website or even move theire site)

* all accounts can be viewed by visitors but they can never edit remove or rest things (you can also if you want restrickt the vieuwing by visitors or accidental visitors by checking theire (USER_ID) in the linkpartner table but thats not coded yet but will make this this weekend)

Admins can:

Add usersrights to ID's (remove, edit, reset)
Edit remove and reset all ID's
Can add new ID's
etc etc
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

lecock

Wow, knew you were working on this.

Like I already told u, LOOKS SWEET !!!  :o
Don't know if this is useful for all af the coppermine users, mabey it's a bit TO advanced.  ;D

But i'm following this thread ! looks interesting !



xplicit

Ok got it fully working and tested now :)

But how can I post it here as a package (zip file) and remove the previous splitted parts) ??

People who are interested can PM me for the package and I will send it by email till found a solution for it

Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

Joachim Müller

click the "Additional options" link at the bottom left when composing your message, use the "browse" button to add your zip file to your posting.

xplicit

OK I'm done and within my deadline :)

Just changed today the script so it will auto detect the version 1.4x or 1.3x and use the correct database query function, also made all the database requests indepedent by using the $CONFIG functions

Complete code is packed into the zipfile attached at the first post :)

Readme instructions are included and also given here:

To install the affiliate script you have to follow these 4 steps:

1) Unzip the zipfile
2) Change in the redirectcounter.php file the location of $baseurl
3) Copy all the php files to the root of your website.
4) Make a folder in your images folder called redirect and place the images there
5) Look at your init.inc.php file and search for the following:


$CONFIG['TABLE_HIT_STATS']  = $CONFIG['TABLE_PREFIX'].'hit_stats';


Add after this :


$CONFIG['TABLE_PARTNERLINKS']  = $CONFIG['TABLE_PREFIX'].'partnerlinks';
$CONFIG['TABLE_PARTNERS']  = $CONFIG['TABLE_PREFIX'].'partners';


6) Add to your database the following (change the cpg143_ for your own table prefix)

CREATE TABLE `cpg143_partnerlinks` (
  `linkid` int(11) NOT NULL auto_increment,
  `urladres` varchar(255) collate latin1_general_ci NOT NULL default '',
  `urlname` varchar(255) collate latin1_general_ci NOT NULL default '',
  `counter` int(11) NOT NULL default '0',
  `since` date NOT NULL default '0000-00-00',
  PRIMARY KEY  (`linkid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci PACK_KEYS=0;


CREATE TABLE `cpg143_partners` (
  `number` int(11) NOT NULL auto_increment,
  `partnerid` int(11) NOT NULL default '0',
  `linkid` int(11) NOT NULL default '0',
  `remove` char(3) collate latin1_general_ci NOT NULL default '',
  `edit` char(3) collate latin1_general_ci NOT NULL default '',
  `reset` char(3) collate latin1_general_ci NOT NULL default '',
  PRIMARY KEY  (`number`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci PACK_KEYS=0;


7) Add a link in your theme to the file or just visit it directly.

Any comments or found errors welcome.

Enjoy!
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

pelhrimak

Hello i cannot create the table ..
CREATE TABLE IF NOT EXISTS svet_sessions ( session_id varchar(40) NOT NULL default '', user_id int(11) default '0', time int(11) default NULL, remember int(1) default '0', PRIMARY KEY (session_id) ) TYPE=MyISAM COMMENT='Used to store sessions'
.
CREATE TABLE IF NOT EXISTS svet_filetypes ( extension char(7) NOT NULL default '', mime char(30) default NULL, content char(15) default NULL, KEY extension (extension) ) TYPE=MyISAM COMMENT='Used to store the file extensions'

Joachim Müller


xplicit

Quote from: pelhrimak on May 08, 2006, 02:37:59 PM
Hello i cannot create the table ..
CREATE TABLE IF NOT EXISTS svet_sessions ( session_id varchar(40) NOT NULL default '', user_id int(11) default '0', time int(11) default NULL, remember int(1) default '0', PRIMARY KEY (session_id) ) TYPE=MyISAM COMMENT='Used to store sessions'
.
CREATE TABLE IF NOT EXISTS svet_filetypes ( extension char(7) NOT NULL default '', mime char(30) default NULL, content char(15) default NULL, KEY extension (extension) ) TYPE=MyISAM COMMENT='Used to store the file extensions'

This has nothing to do with this topic.

The needed tables are not anything like you posted, so it's irrelevant  comment at this subject.

Please post it at the topic where it belong to
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

thapame

I installed as per the instruction but got some error while visiting the redirect or redirectcounter page. Here is what i got:

QuoteCritical error
There was an error while processing a database query

Nibbler

Enable debug mode in config and post the mysql error message you get (not the entire debug output) when you replicate the error.

thapame

the problem is solved. Table Prefix was incorrect for the two table.