- Readme First! - Read and follow the rules, otherwise your posts will be closed
There are currently, 337 guest(s) and 0 member(s) that are online. You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Warning: mktime() expects parameter 1 to be long [ ]
Author
Message
Baked Nut
Nuke Cadet
Joined: May 02, 2006
Posts: 8
Location: Brisbane, Queensland, Australia
Posted:
Sun Nov 11, 2007 5:16 am
Any idea how to fix this ? or what it means....im getting it next to downlod links in phpnuke 7.8
Warning: mktime() expects parameter 1 to be long, string given in /modules/Downloads/index.php on line 1081
_________________ Visit Ozwebcity - Tech News, Community Gaming & Hosting.
Saint
Nuke Soldier
Joined: May 26, 2003
Posts: 13
Posted:
Wed Aug 13, 2008 8:26 am
See this post for a solution...
[url]http://www.clan-themes.co.uk/ftopict-3648-Warning--mktime---expects-parameter-1-to-be-long.html [/url]
Divvy
Lieutenant
Joined: Jul 25, 2004
Posts: 218
Posted:
Tue Mar 03, 2009 10:42 am
Hi guys,
I am using a different Downloads module, so the fix dont work for me...
Can someone help me? This is the error:
Quote:
Warning: mktime() expects parameter 1 to be long, string given in /home/enigmaw/public_html/tuga/modules/Downloads/index.php on line 798
line 798 is:
Code:
mktime ("LC_TIME", "$locale");
And full function:
Code:
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));
}
}
}
Thank you
_________________Sexo - Thongs - Legendas Divx
perfect-games
Site Admin
Joined: Jun 18, 2004
Posts: 217
Posted:
Tue Mar 10, 2009 1:57 pm
hi there, this is not really a bug but as nuke is based on php3/php4 code alot of things have changed and nuke code has become outdated
as the function now required timezones as a quick fix you could add
date_default_timezone_set("America/Los_Angeles"); in mainfile.php
also check php.net and edit your function if you wish it to be strict
http://ca2.php.net/function.mktime
or you could just silence the error with @mktime ("LC_TIME", "$locale");
steve
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum