Hi guys, Can someone give a little help here? Any idea how to fix this ? or what it means....im getting it next to downlod links in phpnuke 7.8. line 798 is: mktime ("LC_TIME", "$locale"); Code (markup): And full function: function categorynewdownloadgraphic($cat) { global $prefix, $dbi, $module_name; $result_ns = sql_query("select ns_dl_newimage_on, ns_dl_new_one, ns_dl_new_two, ns_dl_new_three from ".$prefix."_ns_downloads_new_pop", $dbi); list($ns_dl_newimage_on, $ns_dl_new_one, $ns_dl_new_two, $ns_dl_new_three) = sql_fetch_row($result_ns, $dbi); if ($ns_dl_newimage_on == 1) { $ns_view_dis = ns_dl_admin_view(2); $newresult = sql_query("select date from ".$prefix."_downloads_downloads where cid='$cat' $ns_view_dis order by date desc limit 1", $dbi); list($time)=sql_fetch_row($newresult, $dbi); echo " "; mktime ("LC_TIME", "$locale"); ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime); $datetime = strftime(""._LINKSDATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1])); $datetime = ucfirst($datetime); $startdate = time(); $count = 0; while ($count <= $ns_dl_new_three) { $daysold = date(_NSDAY1, $startdate); if ("$daysold" == "$datetime") { if ($count <= $ns_dl_new_one) { echo "<img src=\"modules/$module_name/images/new_1.gif\" alt=\""._DCATNEWTODAY."\">"; } if ($count <= $ns_dl_new_two && $count > $ns_dl_new_one) { echo "<img src=\"modules/$module_name/images/new_3.gif\" alt=\""._DCATLAST3DAYS."\">"; } if ($count <= $ns_dl_new_three && $count > $ns_dl_new_two) { echo "<img src=\"modules/$module_name/images/new_7.gif\" alt=\""._DCATTHISWEEK."\">"; } } $count++; $startdate = (time()-(86400 * $count)); } } } Code (markup): Thank you
well mktime wants next things int mktime ([ int $hour= date("H") [, int $minute= date("i") [, int $second= date("s") [, int $month= date("n") [, int $day= date("j") [, int $year= date("Y") [, int $is_dst= -1 ]]]]]]] ) where int means integer (number) source http://php.net/mktime
Hi crivion, thank you so much for your reply. But my php knowledge is very very low. Can you tell me what I need to modify in my code in order to fix the problem?
mktime is used to calculate a timestamp relative to what the current one is. It accepts data in the following format: mktime(hour,minute,second,month,day,year,dst) So in the hour section you would enter 3 hours if you wanted to timestamp of 3 hours ahead of now. Same for minutes, month, seconds, day, year. DST is set to 1 if you want Daylight Savings Time calculated and 0 if you don't. You are trying to pass LC_TIME in the first place, and that's not something PHP will accept as a value for hours.
It looks like someone accidently used mktime when they meant to use setlocale, or used the setlocale arguments when they meant to use mktimes. If it's meant to be the setlocale function, remove the quotes from around "LC_TIME". LC_TIME is a constant defined for the setlocale function. setlocale (LC_TIME, "$locale"); Code (markup):
crivion, sorry my friend, but I really dont know what to answer you... damn.... ;( This was the code that came with the cms phpnuke.
Don't thank me yet, just because those errors vanished doesn't mean it was fixed. Does everything that works with dates still work as expected ?
Check out this site to remove the mktime warning: www.4u3.biz Sorry! Can't hyperlink the site as I don't have enough posts.