(2006-02-18, 10:08 PM)Ryan Gordon Wrote: [ -> ]Nightmare your 3.5 of Ad Rotation system is screwed up.
function do_ads()
{
global $db, $templates, $footer, $banner;
$blah = "0";
while ($blah != "1"){
$count = $db->query("SELECT MAX(aid) AS aid FROM ".TABLE_PREFIX."ads");
$num = $db->fetch_array($count);
$ran = rand(1,$num['aid']);
//Echo "Random: ".$ran."<br />";
//Echo "Finish?: ".$blah."<br />";
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."ads WHERE aid='".$ran."'");
$ads = $db->fetch_array($query);
//echo "Mode: ".$ads['mode']."<br />";
//echo "Aid: ".$ads['aid'];
if ($ads['aid'] == $ran and $ads['mode'] != "3" and $ads['mode'] != "4"){
$blah = "1";
}
}
if ($ads['mode'] == 2){
$new = $ads['shown']+1;
if ($new < $ads['max']){
$db->query("UPDATE ".TABLE_PREFIX."ads SET shown='".$new."' WHERE aid='".$ran."'");
}else{
$db->query("UPDATE ".TABLE_PREFIX."ads SET mode='4' WHERE aid='".$ran."'");
}
}
eval("\$banner = \"".addslashes($ads['code'])."\";");
}
It creates an infiniate loop, because $blah Will ALWAYS Be NOT Equal 1. I suggest updating your script as soon as possible. You should really test out your plugins on your own boards before you release them you know. I've had to deactivate this plugin because my forums wouldnt work.
if you look at this code:
if ($ads['aid'] == $ran and $ads['mode'] != "3" and $ads['mode'] != "4"){
$blah = "1";
}
you will see that as long as the $mode is not 3 or 4, then $blah will be equal to 1, you really should think about what your saying before you release your comments you know,.
Hi nitemare, I have installed your plugin on my forum with no problems, and find it very useful but I would like to make a request if possible please.
1. Have the banners rotate one after each other. (instead of having to refresh the board to see the next banner)
2. Select a time limit for each banner to be shown in rotation (default 5 seconds) then it changes to the next one in order.
3. Able to change the order of banners, just by inputting a specific number then save
That's it really, if this was included then it will be an amazing plugin.
Thanks
anyway i can set the ads on the top instead of the bottom?
tnx
also, put the ads on lite(archive) mode?
You can place the ads wherever you want by editing the index template.
Simply move the {$banner} variable to a different place.
Hello, I seem to be getting this error I have reinstalled the file 2 times
The following warnings occurred:
Warning [2] mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 50 - Line: 437 - File: inc/db_mysql.php PHP 5.2.10 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/db_mysql.php 437 mysql_result
/inc/plugins/ads.php 88 DB_MySQL->fetch_field
[PHP] ads_globals
/inc/class_plugins.php 101 call_user_func_array
/global.php 95 pluginSystem->run_hooks
/index.php 18 require_once
Warning [2] mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 52 - Line: 437 - File: inc/db_mysql.php PHP 5.2.10 (Linux)
I have placed the {$banner} on the footer and even tried on the header/index no luck =( Any help is greatly appreciated
I'm getting the same error! I had to disable the plugin in order to block the errors showing on my site at
http://www.Bleezed.com
It would be great if these errors were fixed. They seemed to start after I did a Database Backup with MyBB. Also would be great if there was an option to choose between displaying the ads at the top or bottom of the site. When it was working, it was a great plugin.
Cheers
Steve
(2009-11-26, 02:42 AM)PAIN Wrote: [ -> ]Hello, I seem to be getting this error I have reinstalled the file 2 times
The following warnings occurred:
Warning [2] mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 50 - Line: 437 - File: inc/db_mysql.php PHP 5.2.10 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/db_mysql.php 437 mysql_result
/inc/plugins/ads.php 88 DB_MySQL->fetch_field
[PHP] ads_globals
/inc/class_plugins.php 101 call_user_func_array
/global.php 95 pluginSystem->run_hooks
/index.php 18 require_once
Warning [2] mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 52 - Line: 437 - File: inc/db_mysql.php PHP 5.2.10 (Linux)
I have placed the {$banner} on the footer and even tried on the header/index no luck =( Any help is greatly appreciated
(2009-11-30, 06:31 PM)bleezed Wrote: [ -> ]I'm getting the same error! I had to disable the plugin in order to block the errors showing on my site at http://www.Bleezed.com
It would be great if these errors were fixed. They seemed to start after I did a Database Backup with MyBB. Also would be great if there was an option to choose between displaying the ads at the top or bottom of the site. When it was working, it was a great plugin.
Cheers
Steve
I also meet the problem, I guess that because both we don not import the banner pictures to database, so the problem happening.
Hi, nitemare.
How to add the banner pics in Admin CP.
I had tried to add the url of banner pics, and failed.
when i put the file ads.php in inc/plugin directory and referesh mybb then following errors comes
Please make sure IN_MYBB is defined."); } $plugins->add_hook("global_start", "ads_globals"); $plugins->add_hook("admin_config_menu", "ads_nav"); $plugins->add_hook("admin_config_action_handler", "ads_actionhandler"); $plugins->add_hook("admin_load", "ads_admin"); function ads_info() { return array( "name" => "Ad Randomizer system", "description" => "This Pluging will display an ad on the main page from a database", "website" => "http://nitemare.ca", "author" => "Nitemare", "authorsite" => "http://nitemare.ca", "version" => "5.0.2", "guid" => "80d9be40af59e71edb421b93e820b10f", "compatibility" => "14*" ); } function ads_install(){ global $db; $db->query("CREATE TABLE ".TABLE_PREFIX."ads
(aid
int(11) NOT NULL auto_increment,code
text NOT NULL,mode
int(11) NOT NULL default '0',shown
int(11) NOT NULL default '0',max
int(11) NOT NULL default '0',PRIMARY KEY (aid
)) ;"); } function ads_is_installed() { global $db; if($db->table_exists("ads")){ return true; } return false; } function ads_activate(){ require MYBB_ROOT.'/inc/adminfunctions_templates.php'; find_replace_templatesets( "footer", '#'.preg_quote('
').'#', '
Can any one help me please
how do i access the admin area for the "AD RANDOMIZER SYSTEM"?