Clan Adverts

Sponsors

CT on Facebook

Latest Product

User Box

Anonymous
38.107.179.219
Nickname:

Password:

Security Code
Security Code
Type Security Code


PND Downloads Feed

Phpnuke Downloads
How to Delete or Reset yo...
How to Delete or Reset your PHPNuke Admin Account
Lost your admin password ?  Cant login to your admin account ? This s...
Back Online & Stuff
Back Online & Stuff
Look at us with our nifty website back up and running… Seriously...
How to edit the admins in...
How to edit the admins in the forums
Here is a way to make someone admin in your forums on your Evo site. I...
Demo Splash Screen
Demo Splash Screen
Ped @ Clan Themes has released a simple splash screen entrance hack. ...
Free Phpnuke Business The...
Free Phpnuke Business Theme 6
This is the 6th Business theme for Phpnuke that Clan Themes has releas...
Tricked Out Slider
Tricked Out Slider
We have seen some great new things come out of Tricked Out News and th...

Custom Work

PHP Nuke Custom Work

www.clanthemes.com :: View topic - Warning: mktime() expects parameter 1 to be long
Warning: mktime() expects parameter 1 to be long

7 Replies / 8641 Views


Post new topic   Reply to topic  

   www.clanthemes.com Forum Index » General PhpNuke

View previous topic :: View next topic


spec4
Reputation: 220.8 Add RepSubtract Rep
Local time: 2:24 AM
Location: McPherson,KS
usa.gif

Noob
Noob

0.01 posts per day
Medals: 0

Joined: Nov 03, 2007
Last Visit: 09 Jul 2008
Posts: 14
Points: 502 

Post Warning: mktime() expects parameter 1 to be long Posted: Wed May 14, 2008 4:33 am

Shop Purchases:
Day of Defeat (Sabre) Sand Php Nuke Theme · Day of Defeat (Sabre) Php Nuke Theme

So ive been working on a new site for a new but old clan. any i was making categories for downloads and got this error.

Code:
Warning: mktime() expects parameter 1 to be long, string given in /home/kolkoo/public_html/modules/Downloads/index.php on line 1080


what the heck dose it mean, i tried to Google it but all i get is other sites that have the same problem.

running: Php-nuke 8.1
Site www.kol-koo.info


Thanks.
 

 
View user's profileSend private messageVisit poster's websiteAIM AddressMSN Messenger Reply with quote

Bayler
Reputation: 856.9 Add RepSubtract Rep
votes: 10
Local time: 3:24 AM

usa.gif

Fire In The Hole
Fire In The Hole

0.16 posts per day
Medals: 1 (View more...)
Site Supporter (Amount: 1)

Joined: Nov 01, 2007
Last Visit: 08 May 2009
Posts: 275
Points: 2038 

Post Warning: mktime() expects parameter 1 to be long Posted: Wed May 14, 2008 5:11 am

the mktime() function is used to 'create' a time in the future or past

example:
mktime(0, 0, 0, date("m"), date("d"), date("Y")+1)

depending on how its being used, or what its creating ( assume a timestamp ) a variable is missing hence your parameter error.
 

You will not recieve help from me if i have to go digging for your CMS information and version, If i have to take the time to play 21 questions, then you can take the time to google! No Copyright, no support either!  
View user's profileSend private messageMSN Messenger Reply with quote

spec4
Reputation: 220.8 Add RepSubtract Rep
Local time: 2:24 AM
Location: McPherson,KS
usa.gif

Noob
Noob

0.01 posts per day
Medals: 0

Joined: Nov 03, 2007
Last Visit: 09 Jul 2008
Posts: 14
Points: 502 

Post Warning: mktime() expects parameter 1 to be long Posted: Wed May 14, 2008 6:50 am

Shop Purchases:
Day of Defeat (Sabre) Sand Php Nuke Theme · Day of Defeat (Sabre) Php Nuke Theme

I dont know if its the code or if its something to do with how it all goes into sql. the first cat alway seems to be fine but after you add another one thats when it starts to error.



Code:
function categorynewdownloadgraphic($cat) {
    global $prefix, $db, $module_name, $datetime, $locale;
    $cat = intval(trim($cat));
    $newresult = $db->sql_query("SELECT date FROM ".$prefix."_downloads_downloads WHERE cid='$cat' order by date desc limit 1");
    list($time)=$db->sql_fetchrow($newresult);
    echo " ";
    setlocale (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 <= 7) {
   $daysold = date("d-M-Y", $startdate);
        if ("$daysold" == "$datetime") {
           if ($count<=1) {
      echo "<img src=\"modules/$module_name/images/new_1.gif\" alt=\""._DCATNEWTODAY."\">";
       }
            if ($count<=3 && $count>1) {
      echo "<img src=\"modules/$module_name/images/new_3.gif\" alt=\""._DCATLAST3DAYS."\">";
       }
            if ($count<=7 && $count>3) {
      echo "<img src=\"modules/$module_name/images/new_7.gif\" alt=\""._DCATTHISWEEK."\">";
       }
   }
        $count++;
        $startdate = (time()-(86400 * $count));
    }
}
 

 
View user's profileSend private messageVisit poster's websiteAIM AddressMSN Messenger Reply with quote


Rami100735
Reputation: 0.1 Add RepSubtract Rep
Local time: 3:24 AM


Noob
Noob

0.00 posts per day
Medals: 0

Joined: May 16, 2008
Last Visit: 23 May 2008
Posts: 1
Points: 100 

Post Warning: mktime() expects parameter 1 to be long Posted: Fri May 16, 2008 7:18 pm

Ok Ive got the solution..after messing with my own Downloads section Ive come to the conclusion that, If there are no downloads under the category that is being pulled then it returns a zero set. And the functions keep processing as if it was a valid time, giving an error. I made this change to my own board and it seems to get rid of the problem.

Open modules/Downloads/index.php
Around line 1068 - Find
Code:

function categorynewdownloadgraphic($cat) {
    global $prefix, $db, $module_name, $datetime, $locale;
    $cat = intval(trim($cat));
    $newresult = $db->sql_query("SELECT date FROM ".$prefix."_downloads_downloads WHERE cid='$cat' order by date desc limit 1");


And Add after the last line
Code:

    if ($db->sql_numrows($newresult) === 0)
      return 0;


It Should Now look like
Code:

function categorynewdownloadgraphic($cat) {
    global $prefix, $db, $module_name, $datetime, $locale;
    $cat = intval(trim($cat));
    $newresult = $db->sql_query("SELECT date FROM ".$prefix."_downloads_downloads WHERE cid='$cat' order by date desc limit 1");
   //Problem Found by the Rami100735 - $newresult returns empty set if no downloads in that category
   if ($db->sql_numrows($newresult) === 0)
      return 0;
 

 
View user's profileSend private message Reply with quote

spec4
Reputation: 220.8 Add RepSubtract Rep
Local time: 2:24 AM
Location: McPherson,KS
usa.gif

Noob
Noob

0.01 posts per day
Medals: 0

Joined: Nov 03, 2007
Last Visit: 09 Jul 2008
Posts: 14
Points: 502 

Post Warning: mktime() expects parameter 1 to be long Posted: Sat May 17, 2008 2:16 am

Shop Purchases:
Day of Defeat (Sabre) Sand Php Nuke Theme · Day of Defeat (Sabre) Php Nuke Theme

Vary nice, Thank you.
 

 
View user's profileSend private messageVisit poster's websiteAIM AddressMSN Messenger Reply with quote

central
Reputation: 0.1 Add RepSubtract Rep
Local time: 8:24 AM
Location: UK
uk.gif

Noob
Noob

0.00 posts per day
Medals: 0

Joined: Dec 13, 2007
Last Visit: 31 Aug 2008
Posts: 1
Points: 100 

Post Warning: mktime() expects parameter 1 to be long Posted: Sun Aug 31, 2008 7:55 pm

Hello,

Thanks for the fix. This just happened to me for no reason and i was thinking dang what shall i do?

You fix just sorted the error out straight away.

Very Happy....

Thanks Agian!! Angel
 

 
View user's profileSend private messageVisit poster's websiteAIM AddressMSN Messenger Reply with quote


Divvy
Reputation: 0.1 Add RepSubtract Rep
Local time: 2:24 AM

blank.gif

Noob
Noob

0.00 posts per day
Medals: 0

Joined: Dec 17, 2007
Last Visit: 03 Mar 2009
Posts: 1
Points: 284 

Post Warning: mktime() expects parameter 1 to be long Posted: Tue Mar 03, 2009 6:40 pm

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
 

 
View user's profileSend private message Reply with quote

Untergang
Reputation: 642.5 Add RepSubtract Rep
votes: 6
Local time: 9:24 AM
Location: Lommel
belgium.gif

Stand-by Stand-by
Stand-by Stand-by

0.19 posts per day
Medals: 0

Joined: May 08, 2007
Last Visit: 31 Oct 2011
Posts: 346
Points: 22131 

Post Re: Warning: mktime() expects parameter 1 to be long Posted: Tue Mar 03, 2009 8:09 pm

I think you can just remove the line
Code:
mktime("LC_TIME", "$locale");
It's useless the way it's put there.
 

UDesigns.be  
View user's profileSend private messageSend e-mailVisit poster's website Reply with quote
Post new topic   Reply to topic  
   www.clanthemes.com Forum Index » General PhpNuke


 
7 Replies / 8641 Views
Page 1 of 1
All times are GMT
Display posts from previous:   
 
Jump to:  
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
You cannot attach files in this forum
You can download files in this forum