Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Links as book affiliate database

Quote Reply
Links as book affiliate database
I'm working on the catalog/shopping/banner integration concepts as I wait for the next release. One thing that would be awesome to include is targeted book sales from a database that is kept internal to the links system. Also, to develop a bookstore based on books you've chosen, reviewed, etc, and you can give people a choice of where to buy it.

I'm working on a database structure, and wonder if there are any other fields people would like to see in the record. Some fields are going to change, and some may be added as I add features on to this, but the affiliate codes are entered into a configuration file, and it builds each book page with a link to the various book sellers.

Code:
CREATE TABLE Links (
ID int(10) unsigned DEFAULT '0' NOT NULL auto_increment PRIMARY KEY,
Title varchar(150) NOT NULL,
URL varchar(150) NOT NULL,
Add_Date date DEFAULT '0000-00-00' NOT NULL,
Mod_Date date DEFAULT '0000-00-00' NOT NULL,
Date_Checked DATETIME DEFAULT 0,
CategoryID int(10) unsigned DEFAULT '0' NOT NULL,
Hits smallint(5) unsigned DEFAULT '0' NOT NULL,
Site_Visits smallint(5) unsigned DEFAULT '0' NOT NULL,
isNew enum ('Yes','No') DEFAULT 'No' NOT NULL,
isChanged ENUM ('Yes','No') DEFAULT 'No' NOT NULL,
isPopular enum ('Yes','No') DEFAULT 'No' NOT NULL,
Priority varchar(5),
Description text,
Desc_Long text,
Keywords varchar(250),
Rating decimal(12,2) DEFAULT '0.00' NOT NULL,
Votes smallint(5) unsigned DEFAULT '0' NOT NULL,
ReceiveMail enum('Yes','No') DEFAULT 'Yes' NOT NULL,
Status SMALLINT NOT NULL DEFAULT 0,
Author varchar(150),
Publisher varchar(150),
Details varchar(150),
Pub Date date DEFAULT '0000-00-00' NOT NULL,
Cover_Price decimal(12,2) DEFAULT '0.00' NOT NULL,
Cover_Photo varchar(150),
Cover_Photo_Height int(10) unsigned,
Cover_Photo_Width int(10) unsigned,
Cover_Thumb varchar(150),
Cover_Thumb_Height int(10) unsigned,
Cover_Thumb_Width int(10) unsigned,
Amazon_Review text,
B_n_N_Review text,
Borders_Review text,
Our_Review text,
INDEX urlndx (URL),
INDEX catndx (CategoryID),
INDEX stndx (Status)
)
~;
The URL field is really the ISBN field, I just didn't want to have to make global sweeping changes to the program at this time, when I do, it's just a rename of URL to ISBN in the table.

Details is something like "Hardcover, 226 pages" etc.

Description is the short description
Desc_Long is the long description
*_Review is the text of the various reviews of the books
if you want to use it, or a URL to link to on the book
seller's site.
"Hits" is how many times someone looked at the link
"Site Visits" is how many times a person checked the booksellers site for it.

I might add a way to track visits to each of the various bookseller sites, so you can see which are more popular and for which topics. It doesn't "cost" anything extra really, to do it that way.

I will also try to make it easy to add additional book sellers, and it _should_ be as easy as entering your ID in the set up file and adding the book sellers link format to the template. The book record _shouldn't_ have to change unless the book seller for some reason is _NOT_ using the ISBN number as the product/code number for the book. The "*_review" fiels are optional, can be deleted, or added as needed.


NOTE: This does _NOT_ go and get the books for you. You have to enter them as you would any other link, but it let's you develop a _prime_ database of the best books and steer people to them. If someone has code to go parse out the book information from sites like Amazon or B&N then it should be trivial to enter that information into the SQL database with a simple "INSERT" command.




http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/