Amazon Rotator


Subject: Amazon Rotator
Hi,

This is my first mod that I installed and adapt to 1.2.0.27 IP. I am not sure, this is a right place to post it, but please correct me if it's in wrong place. I want to share with anyone interest in it :) and want any Pro take a look at it and correct me if there is any error / bug :)

What is this mod?
Spoiler: [ Show ]


Run Tables
Code: [Download] [Hide] [Select]
CREATE TABLE `phpbb_amazon1` (
`amazon1_id` MEDIUMINT( 8 ) NOT NULL AUTO_INCREMENT ,
`amazon1_description` TEXT,
`amazon1_code` TEXT,
PRIMARY KEY ( `amazon1_id` )
) TYPE = MYISAM ;

CREATE TABLE `phpbb_amazon2` (
`amazon2_id` MEDIUMINT( 8 ) NOT NULL AUTO_INCREMENT ,
`amazon2_description` TEXT,
`amazon2_code` TEXT,
PRIMARY KEY ( `amazon2_id` )
) TYPE = MYISAM ;

CREATE TABLE `phpbb_amazon3` (
`amazon3_id` MEDIUMINT( 8 ) NOT NULL AUTO_INCREMENT ,
`amazon3_description` TEXT,
`amazon3_code` TEXT,
PRIMARY KEY ( `amazon3_id` )
) TYPE = MYISAM ;



Install Instructions:
OPEN includes/page_header.php
FIND (around line 994)
Code: [Download] [Hide] [Select]
//
// The following assigns all _common_ variables that may be used at any point
// in a template.
//
$template->assign_vars(array(

ADD BEFORE
Code: [Download] [Hide] [Select]
//
// BEGIN AMAZON #1
//
################################################################################
# Choose a random banner from the database
$sql = "SELECT * FROM phpbb_amazon1 ORDER BY RAND();";
# Run the above Query
$result = mysql_query($sql);
# End of querying
################################################################################
# Give the variables the data if the SQL query worked
if ($result){
$row = mysql_fetch_array($result);
$code1 = $row["amazon1_code"];}
# If it failed, give it defaults
else{
$code1 = ("Data Unavailable");}
# End of variable setting
################################################################################
# Give the variable the code
$amazon1 = "$code1";
# End of variable setting!
################################################################################
//
// END AMAZON #1
//

//
// BEGIN AMAZON #2
//
################################################################################
# Choose a random banner from the database
$sql = "SELECT * FROM phpbb_amazon2 ORDER BY RAND();";
# Run the above Query
$result = mysql_query($sql);
# End of querying
################################################################################
# Give the variables the data if the SQL query worked
if ($result){
$row = mysql_fetch_array($result);
$code2 = $row["amazon2_code"];}
# If it failed, give it defaults
else{
$code2 = ("Data Unavailable");}
# End of variable setting
################################################################################
# Give the variable the code
$amazon2 = "$code2";
# End of variable setting!
################################################################################
//
// END AMAZON #2
//

//
// BEGIN AMAZON #3
//
################################################################################
# Choose a random banner from the database
$sql = "SELECT * FROM phpbb_amazon3 ORDER BY RAND();";
# Run the above Query
$result = mysql_query($sql);
# End of querying
################################################################################
# Give the variables the data if the SQL query worked
if ($result){
$row = mysql_fetch_array($result);
$code3 = $row["amazon3_code"];}
# If it failed, give it defaults
else{
$code3 = ("Data Unavailable");}
# End of variable setting
################################################################################
# Give the variable the code
$amazon3 = "$code3";
# End of variable setting!
################################################################################
//
// END AMAZON #3
//



FIND
Code: [Download] [Hide] [Select]
'U_LOGIN_LOGOUT' => append_sid($u_login_logout),

ADD AFTER
Code: [Download] [Hide] [Select]
'AMAZON_1' => $amazon1,
'AMAZON_2' => $amazon2,
'AMAZON_3' => $amazon3,


Amazon.rar
Description: Amazon Rotator 
Download
Filename: Amazon.rar
Filesize: 11.15 KB
Downloaded: 171 Time(s)

Profile PM  
Subject: Re: Amazon Rotator
xmenfile wrote: [View Post]
I am not sure, this is a right place to post it, but please correct me if it's in wrong place.


Moved to customization forum :wink:


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.1092s (PHP: 16% SQL: 84%)
SQL queries: 12 - Debug Off - GZIP Enabled