
balkan7
Members-
Posts
234 -
Joined
-
Last visited
Everything posted by balkan7
-
i used this code for banner expire, send msg when expire, and send msg 1 week before expire, where i wrong... kod: <?php // set banner inactive when expire and send msg whit statistic $result = dbquery("SELECT * FROM ".$db_prefix."btr_banners WHERE banner_state='1'"); while ($data = dbarray($result)) { $time = date("Y-m-d H:i:s"); if ($data['banner_expire'] < $time) { $expires = dbquery("UPDATE ".$db_prefix."btr_banners SET banner_state='0' WHERE banner_id='".$data['banner_id']."'"); $result1 = dbquery("SELECT user_id, user_name, user_email FROM ".$db_prefix."users WHERE user_id='".$data['client_id']."'"); while ($data1 = dbarray($result1)) { $user_name = $data1['user_name']; $user_email = $data1['user_email']; if ($user_email != "") { $result2 = dbquery("SELECT * FROM ".$db_prefix."btr_banners WHERE banner_id='".$data['banner_id']."'"); while ($data2 = dbarray($result2)) { $bannerXtra = explode(".", $data2['banner_clicks']); $bannerClicks = number_format($bannerXtra[0]); $bannerViews = number_format($bannerXtra[1]); if($bannerViews == 0) { $percent = 0; } else { $percent = substr(100 * $data2['banner_clicks'] / $bannerViews, 0, 5); } $to = $user_email; $subject = $locale['M_10']; $message = $locale['M'].$user_name.$locale['M_2'].$data2['banner_date']."<br />".$locale['M_3']."<br />".$locale['M_4'] . $data2['banner_name']."<br />".$locale['M_5'] . $data2['banner_clicks']."<br />".$locale['M_6'] . $bannerViews."<br />".$locale['M_7'] . $data2['banner_date']."<br />".$locale['M_8'] . $data2['banner_expire']."<br /><br /><br /><br />".$locale['M_9']; $from = "[email protected]"; mail($to,$subject,$msg, "From: [email protected]"); } } } } // send msg 1 week before expire $now = time(); $nextweek = $now+(60*60*24*7); if ($data['banner_expire'] <= $nextweek && $data['banner_expire'] >=$now) { $to = $user_email; $from = "From: [email protected]"; $msg = $locale['BB_1'];; $subject = $locale['M'].$user_name.$locale['M_10']; mail($to,$subject,$msg, "From: [email protected]"); } } ?> plz help me.
-
after banner expire set status to '0' and send msg to mail. this code wont work. <?php $result = dbquery("SELECT * FROM ".$db_prefix."btr_banners WHERE banner_state='1'"); while ($data = dbarray($result)) { $time = date("Y-m-d H:i:s"); if ($data['banner_expire'] < $time) { $expires = dbquery("UPDATE ".$db_prefix."btr_banners SET banner_state='0' WHERE banner_id='".$data['banner_id']."'"); $result = dbquery("SELECT * FROM ".$db_prefix."btr_banners LEFT JOIN ".$db_prefix."users ON ".$db_prefix."btr_banners.client_id = ".$db_prefix."users.user_id"); while ($data1 = mysql_fetch_assoc($result)) { $bannerXtra = explode(".", $data1['banner_clicks']); $bannerClicks = number_format($bannerXtra[0]); $bannerViews = number_format($bannerXtra[1]); if($bannerViews == 0) { $percent = 0; } else { $percent = substr(100 * $data1['banner_clicks'] / $bannerViews, 0, 5); } $to = $data1['user_email']; $subject = $locale['M_10']; $message = $locale['M'] .$data1['user_name'].$locale['M_2'].$data1['banner_date']."<br />".$locale['M_3']."<br />".$locale['M_4']. $data1['banner_name']"<br />".$locale['M_5']. $data1['banner_clicks']"<br />".$locale['M_6']. $bannerViews"<br />".$locale['M_7']. $data1['banner_date']"<br />".$locale['M_8']. $data1['banner_expire']"<br /><br /><br /><br />".$locale['M_9']; $from = "[email protected]"; mail($to,$subject,$msg, "From: [email protected]"); } } }?>
-
ok i wanna get this result client_id active banners 3 2 7 1 9 3 62 1
-
what i need for get result propertly ? client_id banner_status counting or sum ?
-
i wanna count from client_id how many banners are active, but wrong result whit my code: $numrows = mysql_query("SELECT client_id, COUNT(*) AS total_banners FROM ".$db_prefix."banners WHERE banner_status = '1' GROUP BY client_id"); while ($num = mysql_fetch_assoc($numrows)){ echo "<td align='center' class='small'>".$num['total_banners']."</td>"; }
-
i think is better idea ti view my code to picture:
-
soryy i need whit php looping if you can do that.
-
yes but if you can example to my code.
-
(dbarray, dbcount dbquery) are functions like dbarray = mysql_fetch_array, whatever code working propertly but rowspan not working, where i wrong whit tables?
-
i dont know where i wrong whit this code, why rowspan not wroking ? <?php echo "<table cellpading='0' cellspacing='1' width=100%' class='tbl-border'>\n<tr>\n"; echo "<td class='tbl1'>poster</td>\n<td class='tbl1'>stats</td>\n<td class='tbl1'>last</td>\n</tr>\n<tr>"; $result = dbquery("SELECT * FROM ".$db_prefix."joke ORDER BY joke_nick DESC LIMIT 0,5"); $i = 0; while($data = dbarray($result)){ $i++; $posts = dbcount("(joke_nick)", "joke", "joke_nick='".$data['joke_nick']."'"); $cats = dbcount("(joke_cat_id)", "joke_cat"); $jokes = dbcount("(joke_id)", "joke"); echo "<tr>\n<td class='tbl2'>"; echo "\n".$i.". ".$data['joke_nick']." - <span class='small2'>".$posts."</span>\n</td>\n"; } echo "<td rowspan='5' class='tbl2'>Total Category: <span class='small2'>".$cats."</span>\n<br />\nTotal Jokes: <span class='small2'>".$jokes."</span>\n</td>\n"; $result1 = dbquery("SELECT * FROM ".$db_prefix."joke ORDER BY joke_id DESC LIMIT 0,1"); while($data1 = dbarray($result1)){ echo "<td rowspan='5' class='tbl2'>".$data1['joke_description']."</td>\n"; } echo "</tr>\n</table>";?>
-
working perfect, thank you
-
yes man, i wanna count every id and every down_count and get result from down_count: if id 1 is 45 clicks and id 2 is 16 clicks (result = 61) i need this one get result from down_count field. soryy for bad english, maybe you can undestand me.
-
hi i need help to count inside clicks, exaple: id down_name down_count 1 soft1 45 2 soft2 16 ---------------------------------- i wanna get result (61) so i need function for this one !
-
soryy for reply i just wanna to know for this code can work propertly, <?php $now = time(); $nextweek = $now+(60*60*24*7); if ($data['banner_expire'] <= $nextweek) { mail($to,$subject,$msg,"From: [email protected]"); } ?> i ask this question because field banner_expire in datebase is: `banner_expire` datetime default NULL,
-
i can use this way ? <?php $now = date("Y-m-d H:i:s"); $nextweek=$now+(60*60*24*7); if ($data['banner_expire']<=$nextweek && $data['banner_expire'] >=$today) { mail($to,$from,$subject, "From: [email protected]"); } ?> i dont understand what doing variable $today ?
-
if i use this code can be work? because field in datebase are: datetime null. code: <?php $now=time(); $nextweek=$now+(60*60*24*7); if ($expiry<=$nextweek && $expiry >=$today) { mail($to,$from,$subject, "From: [email protected]"); } ?>
-
field in date base: field:banner_expire type:datetime Null: yes for expire i used this code: <?php $time = date("Y-m-d H:i:s"); if ($data['banner_expire'] < $time) { $expires = dbquery("UPDATE ".$db_prefix."btr_banners SET banner_state='0' WHERE banner_id='".$data['banner_id']."'"); }?> now if i use your code maybe not working propertly ?
-
yes but i dont have cron job if you can example to code if posible ?
-
hi guys i got in datebase 2 fields: date_start date_expire now i need check date expire before 1 week expire send to user email ...
-
yes this is propertly written but wont working to my script, i try whit another way. thanks for support...
-
i have tried again whitout result not show nothing, news text, youtube bbcode.
-
code for replace string for news, so text of news now are blank i need text for news show bbcode of youtube not show
-
i have tried but again whitout result i dont know why, not show me included text like: bla bla sdfdf now everything is blank
-
i need help if find text replace whit blank but this function not working blank all text. <?php function clearbb($text) { //youtube mod if (preg_match("/[youtube\](.*?)\[/youtube\]/", $text)) { $text = preg_replace('', '', $text); } } ?>
-
yes i my mistake start whit 0 but show banners whit 0 and 1 0 = jpg, gif 1 = swf i have tried whit that but whitout result, ever show banner ever not show <?php if ($banData['banner_type'] == "0" AND $banData['banner_plans'] == "1") ?> soryy for bad english...