n"; } ####################################### // footer Function function footer1() { global $PHP_SELF,$action; if ($action != "") { $backkg = "Back to Main Ad Rotator Page"; } else { $backkg = "Back to Site Admin Area"; } print "$backkg
nn"; } ################################################## // Main Admin Control Panel function main_menu() { global $PHP_SELF; header1(); ?>
Ad Rotator Admin Area
Add Banner All the fields make with a * are required.n"; print "
n"; } ###################################################### // Check Banner function add_plain_check() { global $name,$link,$banner,$heigth,$width,$alt,$num_exp,$prob,$window,$advert_login; if ((!$name) || (!$link) || (!$banner) || (!$heigth) || (!$width) || (!$prob) || (!$window)) { error_ad("You left a required field blank"); } if (!ereg("^http://[a-zA-Z0-9~.:/]*.[a-zA-Z]{2,3}",$link)) { error_ad("You did not enter a valid link url"); } if (!ereg("^http://[a-zA-Z0-9~.:/]*.[a-zA-Z]{2,3}",$banner)) { error_ad("You did not enter a valid banner url"); } if (!eregi_replace('[^0-9]','',$heigth)){ error_ad("You did not enter a numberical value for heigth"); } if (!eregi_replace('[^0-9]','',$width)){ error_ad("You did not enter a numberical value for width($width)"); } if (!$alt){ error_ad("You left the ALT tag filed empty"); } if (($advert_login)){ if (!is_numeric($advert_login)){ error_ad("The advertiser userid must be a number!"); } } else { $advert_login = 0; } if ($num_exp) { if ($num_exp <= 0) { error_ad("number impressions must be greater than 0"); } } } // Confirm Banner function banner_confirm($id,$name,$link,$banner,$heigth,$width,$alt,$text,$mouse_text,$num_exp,$prob,$window,$advert_login,$action) { global $PHP_SELF; $mouse_text = stripslashes($mouse_text); $text = stripslashes($text); $alt = stripslashes($alt); $mouse_text = eregi_replace('"',"'",$mouse_text); $text = eregi_replace('"',"'",$text); $alt = eregi_replace('"',"'",$alt); if ($action == "view_detailed"){ print "
Detailed Banner Info
Here is all the information that has been stored. If you wish to modify this please go back and select "Modify Banner".n"; } elseif ($action == "delete_banner_select"){ print "
Confirm Banner Delete
Are you certain you want to delete this banner. There is no coming back once a banner is deleted. Please make sure you have the correct banner before confirming.n"; $action = "delete_banner_confirm"; } else { print "
Confirm
Please make sure that all info below is correct.n"; } print "
n"; } // Add Banner Confirmed function add_plain_add() { global $PHP_SELF,$name,$link,$banner,$heigth,$width,$alt,$text,$mouse_text,$num_exp,$prob,$window,$advert_login; $mouse_text = stripslashes($mouse_text); $text = stripslashes($text); $alt = stripslashes($alt); $mouse_text = eregi_replace('"',"'",$mouse_text); $text = eregi_replace('"',"'",$text); $alt = eregi_replace('"',"'",$alt); if ($num_exp == ""){ $num_exp = 0; } $date = date("j/M/Y"); $db = db("INSERT INTO ad_info (ad_name,type,link_url,banner_url,h,w,alt,bottom_text,mouse_text,num_allow_exp,num_exp,num_clicks,prob,win,adv_user,date) values ("$name",1,"$link","$banner","$heigth","$width","$alt","$text","$mouse_text","$num_exp",0,0,"$prob","$window",$advert_login,"$date");"); print "
Banner Added
Your banner has been successfully added.
n"; print "
n"; } // Add RM function add_rich_display() { global $PHP_SELF; print "
Add Rich Media Banner
All the fields make with a * are required.n"; print "
n"; } // RM Check function add_rich_check(){ global $name,$link,$html,$num_exp,$prob,$advert_login; if (($link) && (!ereg("^http://[a-zA-Z0-9~.:/]*.[a-zA-Z]{2,3}",$link))) { error_ad("you did not enter a valid link url"); } if (!$html){ error_ad("you did not enter in any html to rotate"); } if (!$name){ error_ad("you did not enter in a name for the banner"); } if (!$prob){ error_ad("you did not enter in a prob value"); } if ($advert_login){ if (!is_numeric($advert_login)){ error_ad("The advertiser user ID must be a number!"); } } else { $advert_login = 0; } if ($num_exp){ if ($num_exp <= 0){ error_ad("number impressions must be greater than 0"); } } if (eregi('',$html) && (!$link)){ error_ad("you cannot have the special tag, <!-- Link URL --> unless you set the value for 'Link URL'"); } } // RM Verify function banner_rich_confirm($id,$name,$link,$html,$num_exp,$prob,$advert_login,$action){ global $PHP_SELF; $html = stripslashes($html); $name = eregi_replace('<',"<",$name); if ($action == "view_detailed"){ print "
Detailed Banner Info!!
Here is all the information that has been stored. If you wish to modify this please go back and select "Modify Banner".n"; } elseif ($action == "delete_banner_select"){ print "
Confirm Banner Delete
Are you certain you want to delete this banner. There is no coming back once a banner is deleted. Please make sure you have the correct banner before confirming.n"; $action = "delete_banner_confirm"; } else { print "
Confirm
Please make sure that all info below is correct.n"; } print "
n"; } ########################################################### // RM Done function add_rich_add() { global $PHP_SELF,$name,$link,$html,$num_exp,$prob,$window,$advert_login,$advert_pass; $html = addslashes($html); $html = eregi_replace("r",'',$html); $html = eregi_replace("n",'',$html); if ($num_exp == ""){ $num_exp = 0; } $date = date("j/M/Y"); $db = db("insert into ad_info (ad_name,type,link_url,banner_url,h,w,alt,bottom_text,mouse_text,html,num_allow_exp,num_exp,num_clicks,prob,win,adv_user,date) values ("$name",2,"$link","$banner","$heigth","$width","$alt","$text","$mouse_text","$html","$num_exp",0,0,"$prob","$window",$advert_login,"$date");"); print "
Banner Added
Your banner has been successfully added.
n"; print "
n"; } // Modify Banner function modify_banner_select(){ global $PHP_SELF,$action; if ($action == "delete_banner"){ $action = "delete_banner_select"; print "
Delete Banner
Please select the banner you wish to delete, please be careful.n"; } else { $action = "modify_banner_display"; print "
Modify Banner
Please select a banner to modify from the list below.n"; } print "
n"; } // Selected Banner function modify_banner_display(){ global $id,$PHP_SELF; if (!$id){ error_ad("you did not select a banner to modify"); } $db = db("SELECT ad_name,type,link_url,banner_url,h,w,alt,bottom_text,mouse_text,html,num_allow_exp,num_exp,num_clicks,prob,win,adv_user FROM ad_info WHERE ad_id = $id"); $info = mysql_fetch_row($db); if ($info[1] == 1){ modify_display_plain($info,$id); } else { modify_display_rich($info,$id); } } // Modify Banner function modify_display_plain($info,$id){ global $PHP_SELF; print "
Modify Banner
Please make changes then press 'Makes Changes' when done.n"; print "
n"; } ######################################################################## // Modify Banner Confirmed function modify_plain_add(){ global $PHP_SELF,$id,$name,$link,$banner,$heigth,$width,$alt,$text,$mouse_text,$num_exp,$prob,$window,$advert_login; $mouse_text = stripslashes($mouse_text); $text = stripslashes($text); $alt = stripslashes($alt); $mouse_text = eregi_replace('"',"'",$mouse_text); $text = eregi_replace('"',"'",$text); $alt = eregi_replace('"',"'",$alt); $name = eregi_replace('<',"<",$name); if ($num_exp == "") { $num_allow_exp = 0; } else { $num_allow_exp = $num_exp; } $db = db("UPDATE ad_info SET ad_name = "$name",type = 1,link_url = "$link",banner_url = "$banner",h="$heigth",w="$width",alt="$alt",bottom_text="$text",mouse_text="$mouse_text",html="",num_allow_exp="$num_allow_exp",prob=$prob,win=$window,adv_user=$advert_login WHERE ad_id=$id"); print "
Banner Modified
You have successfully modified the banner.
n"; print "
n"; } // Modify RM function modify_display_rich($info,$id){ global $PHP_SELF; $info[9] = stripslashes($info[9]); print "
Modify Banner
Please make required changes, then press 'Makes Changes' to effect changes.
n"; } // ============================== function modify_rich_add(){ global $PHP_SELF,$id,$name,$link,$html,$num_exp,$prob,$window,$advert_login,$advert_pass; $html = stripslashes($html); $html = addslashes($html); $html = eregi_replace("n","",$html); $html = eregi_replace("r","",$html); if ($num_exp == "") { $num_allow_exp = 0; } else { $num_allow_exp = $num_exp; } $db = db("UPDATE ad_info SET ad_name = "$name",type = 2,link_url = "$link",html="$html",num_allow_exp="$num_allow_exp",prob=$prob,adv_user = $advert_login WHERE ad_id=$id"); print "
Banner Modified
Your rich text advert has been successfully modified.
n"; print "
n"; } // ================================== function view_stats(){ global $PHP_SELF; print "
n"; } else { print " n"; } } // ========================= function view_detailed(){ global $action,$id; if (!$id){ error_ad("you did not select a banner to view"); } if ($action != "delete_banner_select"){ $action = "view_detailed"; } $db = db("SELECT ad_id,ad_name,link_url,banner_url,h,w,alt,bottom_text,mouse_text,num_exp,prob,win,adv_user,type,html FROM ad_info WHERE ad_id = "$id""); $info = mysql_fetch_row($db); if ($info[13] == 1){ banner_confirm($id,$info[1],$info[2],$info[3],$info[4],$info[5],$info[6],$info[7],$info[8],$info[9],$info[10],$info[11],$info[12],$action); } else { banner_rich_confirm($id,$info[1],$info[2],$info[14],$info[9],$info[10],$info[12],$action); } } // ========================= function delete_now(){ global $id,$PHP_SELF; if (eregi('[^0-9]',$id)){ error_ad("invalid id($id)"); } $db = db("SELECT ad_id FROM ad_info WHERE ad_id = $id"); if (!$if = mysql_fetch_row($db)){ error_ad ("no such banner"); } $db = db("DELETE FROM ad_info WHERE ad_id = $id"); print "
Banner Deleted
The selected banner has been deleted.
n"; print "
n"; } // --------------------------------- function group_add_display(){ global $PHP_SELF; print "
Create Group
You may create a group of banners. This is a selection of banners that will be displayed independently of the other banners.
"; print "
n"; } // --------------------------- function add_group_check(){ global $name,$override,$gid,$action; $name = stripslashes($name); $db = db("SELECT ad_id FROM ad_info"); while ($info = mysql_fetch_row($db)){ $num = $info[0]; } for ($i=1;$i<=$num;$i++){ if ($GLOBALS["b_$i"]){ $prob[$i] = $GLOBALS["prob_$i"]; } if ($GLOBALS["b_$i"]){ $banner[$i] = $GLOBALS["b_$i"]; } } if (!$name){ error_ad("You did not enter in a name for the group"); } if(!$banner){ error_ad("You did not select any banners to add to the group"); } if ($action == "add_group_check"){ add_group_add($prob,$banner,$write,$name); } if ($action == "modify_group_check"){ modify_group_add($prob,$banner,$name,$gid); } } // ---------------------------- function add_group_add($prob,$banner,$write,$name){ global $PHP_SELF,$SERVER_NAME; $db = db("INSERT INTO gp_name (gp_name) values ("$name")"); $db2 = db("SELECT id,gp_name FROM gp_name"); while ($total = mysql_fetch_row($db2)){ $gid = $total[0]; } $db1 = db("SELECT ad_id FROM ad_info"); while ($total = mysql_fetch_row($db1)){ $count = $total[0]; } for ($i=1;$i<=$count;$i++){ if ($banner[$i]){ $db = db("INSERT INTO gp_info (gid,ad_id,ad_prob) VALUES ("$gid",$banner[$i],$prob[$i])"); } } print "
Group Created
You have succesfully created a new group.
n"; print "
n"; } // ------------------------ function modify_group_select(){ global $PHP_SELF,$action; if ($action == "modify_group_select"){ print "
Modify Group
Please select the group you want to modify and then press 'Modify Selected Group'.n"; } else { print "
Delete Group
Please select the group you want to Delete and then press 'Delete Selected Group'. Please be carefull deleteing a group, one it is deleted then there is no coming back!n"; } print "
n"; } // ---------------------------- function modify_group_display(){ global $PHP_SELF,$gid; if (!eregi_replace('[^0-9]','',$gid)){ error_ad("you did not enter a numberical value for gid"); } print "
Modify Grouping
You may add, delete or modify probabilty of a banner from here.
n"; } ########################################################## // ------------------------ function modify_group_add($prob,$banner,$name,$gid){ global $PHP_SELF; $db0 = db("DELETE FROM gp_info WHERE gid = $gid"); $db1 = db("SELECT ad_id FROM ad_info"); while ($total = mysql_fetch_row($db1)){ $count = $total[0]; } for ($i=1;$i<=$count;$i++){ if ($banner[$i]){ $db2 = db("INSERT INTO gp_info (gid,ad_id,ad_prob) VALUES ("$gid",$banner[$i],$prob[$i])"); } } $db3 = db("UPDATE gp_name SET gp_name = "$name" WHERE id = $gid"); print "
Group Updated
You have succesfully updated the group.n"; print "
n"; } ################################################### // ------------------------ function delete_group_display(){ global $PHP_SELF,$gid; $db = db("SELECT ad_name,gp_name FROM ad_info,gp_name WHERE id = $gid"); if ($data = mysql_fetch_row($db)){ $f = 1; } if (!$f){ error_ad("no such group!!"); } print "
Confirm Delete Group
n"; } // --------------------- function delete_group_delete(){ global $gid,$PHP_SELF; if (eregi('[^0-9]',$gid)){ error_ad("invalid id($gid)"); } $db = db("DELETE FROM gp_info WHERE gid = $gid"); $db1 = db("DELETE FROM gp_name WHERE id = $gid"); print "
Group Deleted
The selected group has been deleted.
n"; print "
n"; } // -------------------------------------- function get_html_select(){ global $PHP_SELF,$SERVER_NAME,$DOCUMENT_ROOT,$PATH_TRANSLATED,$self_url; print "
Generate HTML
This page helps you get the HTML needed to display banners on your page(s).
n"; ?>
Main Rotation: code to display all banners
SSI method:
Non SSI method:
n"; ?>
Link HTML: Use this with Rich Media Banners, if you cannot add the tag <!-- Link URL --> when creating banners, but still want to track clicks, then please select the banner you want the link code for. Then place this code in your file.
This would be useful for flash files, javascript etc...
n"; ?>
Group HTML: This is the HTML that is needed to display a group. Please select the group you want to generate the HTML for.
Link HTML Here is the code need to track links for this banner,