Jump to content

Recommended Posts

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

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.

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";
            

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.