Im not sure if this goes here or the help section but i posted it here because its about PHP, I need some help fixing some problems with my Blog, Heres a few i get: 1. Strict Notice: gmmktime() [function.gmmktime]: You should be using the time() function instead in system/plugins/twitter/twitter.plugin.php line 319 2. on Warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Friday, July 17th, 2009|at 6:53am) at position 23 (|): Unexpected character in system/classes/habaridatetime.php line 123 Notice: Trying to get property of non-object in system/admin/comments_items.php line 17 Warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Friday, July 17th, 2009|at 6:53am) at position 23 (|): Unexpected character in system/classes/habaridatetime.php line 123 Notice: Trying to get property of non-object in system/admin/comments_items.php line 17 http://iholyelement.org/blog/admin/comments?status=0" class="edit-date" title=" Warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Friday, July 17th, 2009|at 6:53am) at position 23 (|): Unexpected character in system/classes/habaridatetime.php line 123 Fatal error: Call to a member function format() on a non-object in /homepages/18/d175004659/htdocs/hosting/exile/live/iholyelement/live/blog/system/admin/comments_items.php on line 17 3. And just some ones like that... If you want to be more help could some PHP guru add me on MSN? iHolyElement@live.com < add it xD Thanks!
It happens when an invalid parameter or string is passed to time() or gmmktime() functions. See php.net to see what are the invalid format to pass to those time functions. something like $a = time("blah"); of course generates "Failed to parse time string" error.
Thats what went wrong with the Twitter one, I change gmmktime() to time() and it worked, Where can i change it for
This is in comments_items.php line 17: <span class="date pct15"><span class="dim"><?php _e('on'); ?></span> <a href="<?php URL:ut('admin', array('page' => 'comments', 'status' => $comment->status, 'year' => $comment->date->year, 'month' => $comment->date->mon )); ?>" class="edit-date" title="<?php _e('Search for other comments from '. $comment->date->format('M, Y')) ?>"><?php $comment->date->out('M d, Y');?></a></span>
For the line123, it seems you are sending invalid data which cannot be accpeted to create a new habaridatetime. You need to change $time to equal a valid string which can be accepted. At the moment it would seem that $time = "Friday, July 17th, 2009|at 6:53am"; but you need to change this to a valid String for use in the conversion (It seems the | character in particular is not accepted), but seeing as I don't know what the HabariDateTime constructor is expecting i can't tell you exactly what format the String needs to be in. As for the line17 i'm not too sure, but to try and debug it, remove this from the line17: title="<?php _e('Search for other comments from '. $comment->date->format('M, Y')) ?>" Code (markup): and see if the error is still appearing. So you can narrow down the problem to a specific piece of code.
I found out whats causing the problem. I need to delete the | to something else like - or simply nothing, I need some help finding it though, I cant find it! Heres whats on habaridattime.php line 123 HELP! Thanks.
Did you read my post, I told you that the $time you are sending to this function is causing this problem. Now I don't know what date/time format the function HabariDateTime is expecting but you need to modify $time before you send it to the function. So basically you need to find the function HabariDateTime (unless its a PHP function) and find out what date/time format it is expecting, then before line 123 you need to modify $time to equal what it is expecting. I'd take a guess at that you'd need to delete everything after and including the | character. To do this immediatly before line123 add: $pos = strpos($time, "|"); $pos -= 1; $time = substr_replace($time, "", $pos); PHP:
How about: $pos = strpos($time, "|"); echo "<h1>The position is: $pos</h1>"; $time = substr_replace($time, "test", $pos); PHP: I know this will not work just interested in the error it gives