Visser Labs

Saturday, June 7, 2008

WP-Forum PHP Date function bug fix

Warning: date() expects parameter 2 to be long, string given in /htdocs/michaelvisser/wp-content/plugins/wp-forum/forum-functions.php on line 668

Look familiar? There is a bug in the current release of WP-Forum which exists in the plugin’s PHP function ul() hidden away in cookies.php of the plugin root directory. To fix this issue open cookies.php with your favourite text editor and replace…

function ul($user_id){
if(!isset($_COOKIE[’session’])){
update_usermeta( $user_id, ‘lastvisit’, time() );
return true;
}
return false;
}

with…

function ul($user_id){
if(isset($_COOKIE[’session’])){
update_usermeta( $user_id, ‘lastvisit’, time() );
return true;
}
return false;
}

Save your changes and refresh the page. All done.

Social Bookmarks

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • StumbleUpon
  • Technorati

5 Comments

  1. [...] item to note is the latest version of WordPress has a bug with the PHP ul function as noted by Michael Visser. This causes the following error to show [...]

    Pingback by Question Defense » Warning: date() expects parameter 2 to be long — August 22, 2008 @ 7:10 am

  2. AMistyCrissy said:

    Hi! I’m Crystal. I am almost 19. :)
    I guess michaelvisser.com.au – nice name for this site! ;)
    It is so interestingly here, especially in this category.
    I was surfed about 2 hours before found this forum. I think i’ll be here for a long time! :-*

    Comment by AMistyCrissy — October 9, 2008 @ 8:48 pm

  3. Hi Michael,

    your my hero for today. I never intended to look in cookie.php
    Great job … thanks .. you saved my day :)

    Comment by Roy Kronester — December 5, 2008 @ 10:47 pm

  4. Hi Roy,

    Woot! Do I get a shiny star or badge?

    Comment by Michael Visser — December 6, 2008 @ 1:24 pm

  5. Aminnanep said:

    Hi all!

    As newly registered user i only wanted to say hello to everyone else who uses this board ;-)

    Comment by Aminnanep — December 18, 2008 @ 6:43 pm

RSS feed for comments on this page.

Sorry, the comment form is closed at this time.