forum.easy-joomla.org

Projects/Projekte => J! 1.0.x Serie - EasyBook => Thema gestartet von: mariof am 12. 04. 2007 06:40



Titel: Sorting entries
Beitrag von: mariof am 12. 04. 2007 06:40
I was trying to add the entries from my old guest book, all was ok untill I reached paged 39 and now each new entry is misplaced. The dates are not sorted anymore.

I tried to change the Guestbook sorting back and forth. I tried even modifying the dates of each entry but still the same thing.

Is there a way to sort the database, or fix it?

Thank you for your help.
Mario.


Titel: Sorting entries
Beitrag von: hage007 am 13. 04. 2007 15:24
Hi,

it's funny. Just some minutes ago i had the same problem as you yesterday.

I added some older entries by hand and now the sorting in frontend doesn't work anymore.

I just looked at the code but didn't find a bug or something else. (easybook.php Line: 476)
In backend the sorting is perfect. I have only 35 entries, not 39 pages...

I found one little thing:
Try this homepage to verify your unix-timestamps at column 'gbdate'
http://www.onlineconversion.com/unix_time.htm

I got some wrong dates! But the dates in backend are looking ok!

What's this? Can anyone help?
Thanks a lot...


Titel: Sorting entries
Beitrag von: mariof am 14. 04. 2007 19:10
It’s really frustrating, I love this module but I can’t use it!?

I installed the JamBook Guestbook because it has the import capabilities from EasyBook.
I imported all entries from EasyBook and they display fine in JamBook!? so I’m using now 2 guest book on my site, which is stupid (at least for me). JamBook as my old Guest book, users can view it only and EasyBook for the new one!?

I wish someone can help us in this very soon…


Titel: Sorting entries
Beitrag von: hage007 am 18. 04. 2007 08:19
Nobody is interested in our problem...


Titel: Sorting entries
Beitrag von: hage007 am 18. 04. 2007 12:45
I have the solution!

"ORDER BY gbdate"

means arder a string value ASC or DESC.

In Sept 2001 the length of the Unix-timestamp changed...

All you have to do:
take your easybook.php (components/com_easybook) and replace the existing code from line 475 with the following code:

Code:
        $date_format = '%Y%m%d';

        # Modified by Thomas Mader - Beginn
if ($is_editor) {
$database->setQuery( "SELECT *, FROM_UNIXTIME( gbdate, '".$date_format."') AS newdate FROM #__easybook"
        . "\nORDER BY newdate $eb_sorting"
        . "\nLIMIT $start,$eb_perpage"
/*
$database->setQuery( "SELECT * FROM #__easybook"
        . "\nORDER BY gbdate $eb_sorting"
        . "\nLIMIT $start,$eb_perpage" */
     
        );
} else {
        $database->setQuery( "SELECT *, FROM_UNIXTIME( gbdate, '".$date_format."') AS newdate FROM #__easybook"
        . "\nWHERE published = 1"
        . "\nORDER BY newdate $eb_sorting"
        . "\nLIMIT $start,$eb_perpage"
        /*
        $database->setQuery( "SELECT * FROM #__easybook"
        . "\nWHERE published = 1"
        . "\nORDER BY gbdate $eb_sorting"
        . "\nLIMIT $start,$eb_perpage"
        */
        );


Titel: Sorting entries
Beitrag von: mariof am 27. 04. 2007 03:26
thanks Hage for your reply but on line 475 I have this string:

   $gbicq  = mosGetParam( $_REQUEST, 'gbicq');

I couldn't find the string ($date_format) anywhere in the file (easybook.php)
Can you tell me the line that I need to change to the new code.

Thanks,


Titel: Sorting entries
Beitrag von: aravot am 02. 05. 2007 21:04
I need this but my line 475 is  # Modified by Thomas Mader - Beginn

Replacing that, gives error could you please be more specific i.e. replace this code to this.


Titel: Sorting entries
Beitrag von: floridabjoern am 03. 05. 2007 22:13
Hi, have the same problem.

Thank you for posting solutions for changing the source-code, but I don't find the correct line too. I think the best solution would be, if the easy-joomla-team would program a fix and offer an update. If somebody of this team ist reading this: Are you planning to offer an update which is fixing this problem? If yes, any idea when it will be available?

By the way: Thank you for doing a great job!

Bjoern.


Titel: Sorting entries
Beitrag von: aravot am 07. 05. 2007 18:17
I have noticed they don't reply to post return in English, guess we must learn and post in German to get a reply.


Titel: Sorting entries
Beitrag von: David [snipersister] am 07. 05. 2007 20:56
Hey guys,

sorry that i didn't responsed 'till now but i'm a little stressed currently.
The problem you talked about is one of the known bugs we want to fix in the next release. Currently it's planed to fix this in the upcoming release, which will be a (Joomla-1.5)-compatibility- and bugfixing-release.

Best regards
David


Titel: Sorting entries
Beitrag von: floridabjoern am 27. 10. 2007 15:19
I have the solution!

"ORDER BY gbdate"

means arder a string value ASC or DESC.

In Sept 2001 the length of the Unix-timestamp changed...

All you have to do:
take your easybook.php (components/com_easybook) and replace the existing code from line 475 with the following code:

Code:
        $date_format = '%Y%m%d';

        # Modified by Thomas Mader - Beginn
if ($is_editor) {
$database->setQuery( "SELECT *, FROM_UNIXTIME( gbdate, '".$date_format."') AS newdate FROM #__easybook"
        . "\nORDER BY newdate $eb_sorting"
        . "\nLIMIT $start,$eb_perpage"
/*
$database->setQuery( "SELECT * FROM #__easybook"
        . "\nORDER BY gbdate $eb_sorting"
        . "\nLIMIT $start,$eb_perpage" */
     
        );
} else {
        $database->setQuery( "SELECT *, FROM_UNIXTIME( gbdate, '".$date_format."') AS newdate FROM #__easybook"
        . "\nWHERE published = 1"
        . "\nORDER BY newdate $eb_sorting"
        . "\nLIMIT $start,$eb_perpage"
        /*
        $database->setQuery( "SELECT * FROM #__easybook"
        . "\nWHERE published = 1"
        . "\nORDER BY gbdate $eb_sorting"
        . "\nLIMIT $start,$eb_perpage"
        */
        );


Hi again,

I tried to change the cource-code again, cause with a new editor i found the correct part to be changed. but after that, the guestbook didn't work any more, there's the following error:

Parse error: syntax error, unexpected $end in /srv/www/htdocs/web228/html/planetflorida/components/com_easybook/easybook.php on line 746

Line 746 is the last line with "?>".

Any idea, what's the problem?

UPDATE:

Found a solution, but don't ask me, what the problem was. I now use notepad++ as editor, and with this I easily found the correct line for making the changes. At the first, I deleted the old code and pasted the new one completely, containing the old code as comments. Didn't work. Now I took a close look at the differences between new and old code and just changed the parts that have changed. What I got for me looked the same as the first procedure, just the comments are missing. Don't find any other difference, but now it works. If you have problems by changing the code too, try it this way, may be it will work at you too.


Powered by SMF 1.1.8 | SMF © 2006, Simple Machines LLC