balkan7 Posted January 4, 2008 Share Posted January 4, 2008 hi, i got this code for show banner: <?php //Show Banner function function showBanner($banData, $type="int"){ global $db_prefix; setBannerView($banData); if ($banData['banner_type'] == "0" AND $banData['banner_plans'] == "1"){ if (strpos($banData['banner_img'], "http://") > 0) $type = "ext"; if (!strpos($banData['banner_img'], "http://")) $type = "int"; return "<a href='".INFUSIONS."marketing_panel/banner_click.php?banner_id=".ss($banData['banner_id'])."' target='_blank' title='".ss($banData['banner_name'])."'> <img alt='".ss($banData['banner_name'])."' src='".($type=="int" ? ss($banData['banner_img']) : ss($banData['banner_img']))."' border='0' width='468' height='60' /> </a>"; } else { if ($banData['banner_type'] == "1" AND $banData['banner_plans'] == "1"){ return "<embed width='468' height='60' src='".ss($banData['banner_url'])."' />"; } } }?> if i used this code once show banner once not show, and i used many banner_plans and i need just select first banner_plans and then other codes... soryy for bad english Link to comment https://forums.phpfreaks.com/topic/84514-solved-function-for-show/ Share on other sites More sharing options...
duclet Posted January 4, 2008 Share Posted January 4, 2008 if i used this code once show banner once not show, and i used many banner_plans and i need just select first banner_plans and then other codes... soryy for bad english Yeah, I couldn't understand that at all? Exactly what is the problem? Link to comment https://forums.phpfreaks.com/topic/84514-solved-function-for-show/#findComment-430585 Share on other sites More sharing options...
balkan7 Posted January 4, 2008 Author Share Posted January 4, 2008 if i used this code once show banner once not show, and i used many banner_plans and i need just select first banner_plans and then other codes... soryy for bad english Yeah, I couldn't understand that at all? Exactly what is the problem? ever show banner ever not show banner if i used that code. Link to comment https://forums.phpfreaks.com/topic/84514-solved-function-for-show/#findComment-430591 Share on other sites More sharing options...
Barand Posted January 4, 2008 Share Posted January 4, 2008 I would certainly change these lines if (strpos($banData['banner_img'], "http://") > 0) $type = "ext"; if (!strpos($banData['banner_img'], "http://")) $type = "int"; to if (strpos($banData['banner_img'], "http://") !== false) $type = "ext"; else $type = "int"; or to $type = (strpos($banData['banner_img'], "http://") !== false) ? "ext" : "int"; Link to comment https://forums.phpfreaks.com/topic/84514-solved-function-for-show/#findComment-430708 Share on other sites More sharing options...
balkan7 Posted January 4, 2008 Author Share Posted January 4, 2008 the code is good but my mistake, also can it posible ? <?php if (isset($_POST['plus_date'])){ $plus = $data['banner_expire']; $bonus = dbquery("UPDATE ".$db_prefix."btr_banners SET banner_expire = $plus + INTERVAL 1 MONTH WHERE banner_id = ".$banner_id); if ($bonus) echo "<center>".$locale['BB_155']."<i>"".$banner_name.""</i>".$locale['BB_156'].$locale['BB_154']."\n<br /><br /></center>\n"; }?> i get this msg: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '23:14:17 + INTERVAL 1 MONTH WHERE banner_id = 1' at line 1 Link to comment https://forums.phpfreaks.com/topic/84514-solved-function-for-show/#findComment-430825 Share on other sites More sharing options...
Barand Posted January 4, 2008 Share Posted January 4, 2008 you need quotes round $plus ... SET banner_expire = '$plus' + INTERVAL 1 MONTH Link to comment https://forums.phpfreaks.com/topic/84514-solved-function-for-show/#findComment-430832 Share on other sites More sharing options...
balkan7 Posted January 5, 2008 Author Share Posted January 5, 2008 thanks working Link to comment https://forums.phpfreaks.com/topic/84514-solved-function-for-show/#findComment-430840 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.