A Quick Question?

Category: Leader Board 11 years ago
Maverick, when does the week/month start in the module?

Is it like the last 7 days for week, last 30 days for month, or does the week start on a Sunday/Monday and the month start on the 1st of the month.

Thanks
Jason
Like it on Facebook, Tweet it or share this topic on other bookmarking websites.
  • Re: A Quick Question?

    by » 11 years ago


    Week starts on Monday and month starts on 1st of the month. So last week means it is Monday till Sunday.

    Follow me on twitter: https://twitter.com/corejoomla
    If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory.
    Sociable | Surveys | 
    CjForum | Polls | Answers | Quizzes | Quotes | GPS Tools


  • Re: A Quick Question?

    by » 11 years ago


    Hi Maverick,

    I have the module set for weekly points, but it did not start from fresh on Monday, but retained the previous points.

    F.Y.I. I'm using JomSocial for points.

    Regards

    Jason

  • Re: A Quick Question?

    by » 11 years ago


    Try changing the following code in modules/mod_leaderboard/helper.php at line 71
    if($mweekly == 1){//weekly

    to
    if($mweekly == '1'){//weekly

    Follow me on twitter: https://twitter.com/corejoomla
    If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory.
    Sociable | Surveys | 
    CjForum | Polls | Answers | Quizzes | Quotes | GPS Tools


  • Re: A Quick Question?

    by » 11 years ago


    Hi Maverick,

    That didn't seem to work. I edited the helper.php file, then deleted the .DATA & .LOCK files, but the monthly totals are been used, and not the weekly ones.

    Regards
    Jason

  • Re: A Quick Question?

    by » 11 years ago


    So there should be some problem with the configuration. Which version of LB you are using? Latest is 1.0.2.

    For a quick fix, disable monthly totals completely by modifying the below code
        	if($mweekly == 1){//weekly
    $where[] = "a.created >= SUBDATE(CURDATE(), INTERVAL WEEKDAY(NOW()) DAY)";
    }else{//monthly
    $where[] = "a.created >= DATE_FORMAT(NOW(), '%Y-%m-01')";
    }

    to

    $where[] = "a.created >= SUBDATE(CURDATE(), INTERVAL WEEKDAY(NOW()) DAY)";


    And for the last week results:
    modify
    	    	if($mweekly == '1'){//weekly
    $where&#91;&#93; = "a.created >= SUBDATE(CURDATE(), INTERVAL 7+WEEKDAY(NOW()) DAY) AND a.created < SUBDATE(CURDATE(), INTERVAL WEEKDAY(NOW()) DAY)";
    }else{//monthly
    $where&#91;&#93; = "a.created >= DATE_SUB(DATE_FORMAT(NOW(), '%Y-%m-01'), INTERVAL 1 MONTH) AND a.created < DATE_FORMAT(NOW(), '%Y-%m-01')";
    }

    To

    $where&#91;&#93; = "a.created >= SUBDATE(CURDATE(), INTERVAL 7+WEEKDAY(NOW()) DAY) AND a.created < SUBDATE(CURDATE(), INTERVAL WEEKDAY(NOW()) DAY)";

    Follow me on twitter: https://twitter.com/corejoomla
    If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory.
    Sociable | Surveys | 
    CjForum | Polls | Answers | Quizzes | Quotes | GPS Tools


You do not have permissions to reply to this topic.
Powered by CjForum