Clan Adverts

PHP Web Host - Quality Web Hosting For All PHP Applications

 

www.clan-themes.co.uk :: View topic - Warning: mktime() expects parameter 1 to be long

 Welcome To Clan Themes 

As the board grows please remember the Search Option and we hope you find our community useful.

We also monitor Private Messages to stop members from abusing our sites system.
If you are asking for assistance please provide your site link and nuke version, Thanks.

Warning: mktime() expects parameter 1 to be long

4 Replies / 479 Views


Post new topic   Reply to topic  

   www.clan-themes.co.uk Forum Index » General PhpNuke

View previous topic :: View next topic


spec4
Reputation: 221.2
Local time: 2:58 AM
Location: McPherson,KS
usa.gif

Status: Offline
0.06 posts per day
Medals: 0

Joined: Nov 03, 2007
Last Visit: 09 Jul 2008
Posts: 19
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: 748.4
votes: 9
Local time: 3:58 AM

usa.gif

Status: Offline
1.03 posts per day
Medals: 1 (View more...)
Site Supporter (Amount: 1)

Joined: Nov 01, 2007
Last Visit: 20 Aug 2008
Posts: 311
Points: 6636 

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: 221.2
Local time: 2:58 AM
Location: McPherson,KS
usa.gif

Status: Offline
0.06 posts per day
Medals: 0

Joined: Nov 03, 2007
Last Visit: 09 Jul 2008
Posts: 19
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
Local time: 3:58 AM


Status: Offline
0.01 posts per day
Medals: 0

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

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: 221.2
Local time: 2:58 AM
Location: McPherson,KS
usa.gif

Status: Offline
0.06 posts per day
Medals: 0

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

View user's profileSend private messageVisit poster's websiteAIM AddressMSN Messenger Reply with quote
Post new topic   Reply to topic  
   www.clan-themes.co.uk Forum Index » General PhpNuke


 
4 Replies / 479 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