Time Stamp problem in my site http://wetogether.info

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 02-26-2008, 11:00 PM
netfreak's Avatar
Casual Pligger
Pligg Version: 1.0.0
Pligg Template: digital nature
 
Join Date: Dec 2006
Posts: 52
I have already received many bug report and email for my site wetogether / Published News which is used by pligg version 9.8.2. The site was running fine but suddenly I am getting this type of problem. However, let me explain the problem >>

When anybody submit any story it sets up the time 2 Days ago. But actually the time is the running time. I don't know much about pligg system but I am pretty sure its about time stamp. Some how the time is being set 2 days back from its actual posting time.

please have a look on this you will understand wetogether / Upcoming

Help is very much needed

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 11:16 PM
Banned
 
Join Date: Feb 2008
Posts: 6
Go to:

libs/util.php

replace your unixtimestamp function witht his:

Code:
function unixtimestamp($timestamp){
    if(strlen($timestamp) == 14)
    {
        $time = substr($timestamp,0,4)."-".substr($timestamp,4,2)."-".substr($timestamp,6,2);
        $time .= " ";
        $time .=  substr($timestamp,8,2).":".substr($timestamp,10,2).":".substr($timestamp,12,2);
        return strtotime($time);
    }else{
        return strtotime($timestamp);
    }
}
make sure you backup what you currently have first.

Altronix.
Reply With Quote
  #3 (permalink)  
Old 02-26-2008, 11:59 PM
netfreak's Avatar
Casual Pligger
Pligg Version: 1.0.0
Pligg Template: digital nature
 
Join Date: Dec 2006
Posts: 52
Thanks for your reply.

But I could find only this extra few lines in my current libs/utils.php file and those are >>

Code:
else {
		if(strlen($timestamp) == 0) {
			return 0;
Though I have changed those by replacing your given code, but still things are not OK.

What should I do?
Reply With Quote
  #4 (permalink)  
Old 03-02-2008, 12:38 AM
netfreak's Avatar
Casual Pligger
Pligg Version: 1.0.0
Pligg Template: digital nature
 
Join Date: Dec 2006
Posts: 52
I have replaced that code but still not working.

Is there anything what I can do to solve the problem ?

Help needed..
Reply With Quote
  #5 (permalink)  
Old 03-03-2008, 04:22 AM
netfreak's Avatar
Casual Pligger
Pligg Version: 1.0.0
Pligg Template: digital nature
 
Join Date: Dec 2006
Posts: 52
I am still suffering that particular problem...

Is there anybody who could solve this problem?
Reply With Quote
  #6 (permalink)  
Old 03-06-2008, 12:10 AM
netfreak's Avatar
Casual Pligger
Pligg Version: 1.0.0
Pligg Template: digital nature
 
Join Date: Dec 2006
Posts: 52
Huh...
Finally the problem is solved.. its such a great released..
The thread may mark as solved..
Reply With Quote
  #7 (permalink)  
Old 04-02-2008, 05:47 PM
New Pligger
 
Join Date: May 2007
Posts: 24
how did u solve this netfreak ?
Reply With Quote
  #8 (permalink)  
Old 07-28-2008, 07:20 AM
New Pligger
 
Join Date: Jul 2008
Posts: 19
Does anyone know how to solve this in Pligg 9.9??

ALL the timestamps are entered wrong in the database, in such a way that every single entry you send appears as "posted X hours ago" when you've just sent it, and this can range considerably (sometimes 4 hours ago, sometimes 20 hours ago).

I've checked the database and the dates are just being entered wrong (it's not a "rendering" problem when seeing the item, but a storage problem, which I believe to be worse).

Any solution yet?
Reply With Quote
  #9 (permalink)  
Old 08-17-2008, 05:32 AM
ozlegolas's Avatar
Casual Pligger
Pligg Version: 1.0.4
 
Join Date: Apr 2008
Posts: 55
Same problem here

Any help will be appreciated
Reply With Quote
  #10 (permalink)  
Old 08-17-2008, 10:20 AM
ozlegolas's Avatar
Casual Pligger
Pligg Version: 1.0.4
 
Join Date: Apr 2008
Posts: 55
I believe server time causes this problem, so I resolved the problem by substracting the time offset from time difference.

in utils.php, where the time difference is calculated
PHP Code:
function txt_time_diff($from$now=0){
    global 
$main_smarty;
    
    
$txt '';
    if(
$now==0$now time();
    [
COLOR="Red"]$diff=$now-$from;[/COLOR]
    
$days=intval($diff/86400);
    
$diff=$diff%86400;
    
$hours=intval($diff/3600);
    
$diff=$diff%3600;
    
$minutes=intval($diff/60);

    if(
$days>1$txt  .= " $days ".$main_smarty->get_config_vars('PLIGG_Visual_Story_Times_Days');
    else if (
$days==1$txt  .= " $days ".$main_smarty->get_config_vars('PLIGG_Visual_Story_Times_Day');

    if(
$days 2){
        if(
$hours>1$txt .= " $hours ".$main_smarty->get_config_vars('PLIGG_Visual_Story_Times_Hours');
        else if (
$hours==1$txt  .= " $hours ".$main_smarty->get_config_vars('PLIGG_Visual_Story_Times_Hour');
    
        if(
$hours 3){
            if(
$minutes>1$txt .= " $minutes ".$main_smarty->get_config_vars('PLIGG_Visual_Story_Times_Minutes');
            else if (
$minutes==1$txt  .= " $minutes ".$main_smarty->get_config_vars('PLIGG_Visual_Story_Times_Minute');
        }
    }
    
    if(
$txt==''$txt ' '$main_smarty->get_config_vars('PLIGG_Visual_Story_Times_FewSeconds') . ' ';
    return 
$txt;

changed $diff=$now-$from; to $diff=$now-$from-14400;

4 hours(14400 sn) time offset
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Monetizing your Pligg Install lateefx Questions and Comments 39 07-08-2010 12:24 PM
problem with time tranvietanh123 Questions and Comments 4 08-17-2008 12:10 AM
URGENT: Have 80% Pligg Design Done, Need Experienced Programmer/Designer to finish it anothercollegestudent Questions and Comments 3 11-07-2007 02:39 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development