query("CREATE TABLE IF NOT EXISTS `".$table_prefix."adicons` (
`id` int(11) NOT NULL auto_increment,
`adURL` varchar(255) default NULL,
`adText` varchar(255) default NULL,
`adPrice` int(11) default NULL,
`adStartDate` datetime default NULL,
`adPeriodCount` int(11) default NULL,
`adStatus` int(11) default NULL,
`contactName` varchar(255) default NULL,
`contactEmail` varchar(255) default NULL,
`adRow` int(11) NOT NULL,
`adCol` int(11) NOT NULL,
PRIMARY KEY (`id`)
)");
}
if(!get_option("AI_rows"))
update_option("AI_rows",5);
if(!get_option("AI_cols"))
update_option("AI_cols",5);
if(!get_option("AI_defaultStatus"))
update_option("AI_defaultStatus",0);
if(!get_option("AI_adPrice"))
update_option("AI_adPrice",0);
if(!get_option("AI_sameURL"))
update_option("AI_sameURL",0);
if(!get_option("AI_rowsForSale"))
update_option("AI_rowsForSale",0);
if(!get_option("AI_salePrice"))
update_option("AI_salePrice",0);
if(!get_option("AI_emptyLink"))
update_option("AI_emptyLink","/");
if(!get_option("AI_emptySaleImg"))
update_option("AI_emptySaleImg",get_bloginfo('wpurl')."/wp-content/plugins/adicons/img/adbuy.jpg");
if(!get_option("AI_emptyRentImg"))
update_option("AI_emptyRentImg",get_bloginfo('wpurl')."/wp-content/plugins/adicons/img/admin.png");
}
function add_config_page() {
$adminmenu = get_bloginfo('url').'/wp-content/plugins/adicons/img/admin.png';
global $wpdb;
if ( function_exists('add_submenu_page') ) {
if ( function_exists('add_menu_page') ) {
add_menu_page('AdIcons', 'AdIcons', 1, basename(__FILE__), array('AI_Admin','config_page'), $adminmenu);
}
}}
function config_page() {
global $wpdb,$_REQUEST,$table_prefix;
include("ai_admin.php");
}
}
class AI_Interface {
function adIconShow() {
global $wpdb,$table_prefix,$adPrice;
$AI_rows=get_option("AI_rows");
$AI_cols=get_option("AI_cols");
$AI_defaultStatus=get_option("AI_defaultStatus");
$AI_adPrice=get_option("AI_adPrice");
$AI_sameURL=get_option("AI_sameURL");
$AI_rowsForSale=get_option("AI_rowsForSale");
$AI_salePrice=get_option("AI_salePrice");
$AI_emptyLink=get_option("AI_emptyLink");
$AI_emptySaleImg=get_option("AI_emptySaleImg");
$AI_emptyRentImg=get_option("AI_emptyRentImg");
$AI_showAll=get_option("AI_showAll");
if(!function_exists("vcupdate")) {
$adPrice=get_option("AI_adPrice");
}
?>
get_row("select id,adURL, adText from ".$table_prefix."adicons where adRow=$i and adCol=$t and adStatus=1");
if($q->id)
{
?>
;?>/wp-content/plugins/adicons/images/<?php echo $q->id;?>.jpg) |
 |
get_row("select id,adURL, adText from ".$table_prefix."adicons where adRow=$i and adCol=$t and adStatus=1");
if($q->id)
{
?>
onmouseup="mengTracker('adicon',this.href);" href="adURL;?>" target="_blank" title="adText;?>">;?>/wp-content/plugins/adicons/images/<?php echo $q->id;?>.jpg) |
onmouseup="mengTracker('adicon',this.href);" href="" target="_blank" title="Rent This AdIcon. Current Price: $/month"> |
get_row("select id,adURL, adText from ".$table_prefix."adicons where adRow=$i and adCol=$t and adStatus=1");
if($q->id)
{
?>
;?>/wp-content/plugins/adicons/images/<?php echo $q->id;?>.jpg) |
 |
=$i";
}
$q=$wpdb->get_results("select id,adURL, adText from ".$table_prefix."adicons where adStatus=1 $continueFrom order by adRow, adCol");
$nr=$wpdb->num_rows;
$rows=ceil($nr/$AI_cols);
$i=0;
?>
;?>/wp-content/plugins/adicons/images/<?php echo $ad->id;?>.jpg) |
";
}
}
if(($i%$AI_cols))
{
for($t=($i%$AI_cols);$t<$AI_cols;$t++)
{
?>
 |
";
}
}?>