All pastes #566509 Raw Edit

Kilandor

public php v1 · immutable
·published 2007-06-14 14:01 UTC
rendered paste body
$curmonth = date('m');$lastmonth = date('m');$lastmonth = ($lastmonth == 01 || $lastmonth == 1) ? 12 : --$lastmonth;$lastmonth = (strlen($lastmonth)==1) ? "0".$lastmonth : $lastmonth;$sql_update_linksadd = sed_sql_query("SELECT sl_id, sl_inc, sl_out, sl_allinc, sl_allout, sl_month FROM sed_link_items WHERE sl_month='".$lastmonth."'");$linksadd_check = sed_sql_numrows($sql_update_linksadd);if ($linksadd_check>0)	{		echo "DOING UPDATE<BR>";		while($row = sed_sql_fetcharray($sql_update_linksadd))			{								sed_sql_query("UPDATE sed_link_items SET sl_allinc=sl_allinc+".$row['sl_inc'].", sl_allout=sl_allout+".$row['sl_out'].",sl_inc=0, sl_out=0, sl_month=".$curmonth." WHERE sl_id=".$row['sl_id']." LIMIT 1");			}		sed_log('Cleaner plugin Reset all Links Incomming/Outgoing Counts for Month'.$lastmonth.'','adm');	}