MyBB Community Forums

Full Version: expects parameter 6 to be long
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I get this error how can I fix it

Warning: mktime() expects parameter 6 to be long, string given in /home/balikci/public_html/inc/functions_post.php on line 554
Have you installed any modification lately?

regards
No I did not... But we have update PHP to 5.1.4
There is no mktime call in functions_post.php in a standard copy of MyBB.

What is on that line?
$age = floor((time() - mktime(0, 0, 0, $membday[1], $membday[0], $membday[2])) / 31557600);
Sorry I forgot I put Age to postbit and added this code
Code:
2. ./inc/functions_post.php dosyasını a�ıp aşağıdaki eklemeleri yapın.

PHP Kod:
if($post['avatar'] != "" && $mybb->user['showavatars'] != "no")

Above Add;

PHP Kod:
$sex = $db->fetch_array($db->query("SELECT fid3 FROM ".TABLE_PREFIX."userfields WHERE ufid='$post[uid]'"));
        
        if($post['birthday']){
            $membday = explode("-", $post['birthday']);
            $age = floor((time() - mktime(0, 0, 0, $membday[1], $membday[0], $membday[2])) / 31557600);
        }
        if($age){
            $age = "Yaş: ".$age;
        }
        if($sex == "" && $age == ""){
            $agesex = "";
        }elseif($sex == "" && $age != ""){
            $agesex = $age."<br />";
        }elseif($sex != "" && $age == ""){
            $agesex = $sex."<br />";
        }else{
            $agesex = $age.", ".$sex."<br />";
        }


Admin CP > Şablonl D�zenle Sil > Ge�erli Şablonunuz > Postbit Şablonları > Postbit b�l�m�ne giriyoruz.

$age<br /> ekliyoruz
Ok. I found the problem one of my user Dont know how has entered his age 0001-0002
You should probably verify that a birth year was supplied before trying to calculate age Big Grin
Quote:Ok. I found the problem one of my user Dont know how has entered his age 0001-0002
That's i guess and most probably because an edit from the Admin CP, a known bug which is already fixed in 1.2

regards