Hi, I love the guestbook, very easy to install and use. Thanks for producing it. I am using version 2.0.1 on J1.7.
One suggestion - I'd like the ordering to be simpler, easier to use, or more intuitive. I am transitioning from a different website into a joomla-powered site. I have an existing set of guestbook entries, each one already has a date, subject, name and content. That I am manually entering these via the phoca backend. The process is pretty easy, straightforward.
But when displayed in the front-end, these guestbook posts are ordered according to the order in which they were entered. I really want them to be displayed, by default, according to the date on the post.
I read in various places here on the forums and also in the documentation about setting various options in "parameters", and I am not clear on exactly what this means. I cannot find a place in the administrative panels for phocaguestbook where it says "parameters".
It occurred to me that when you say "set it in parameters" maybe you are talking about a query parameter - setting the ordering in a named query parameter that is available for the purpose. I looked in the code in components/com_phocaguestbook/models/guestbook.php, and it seems my hunch is right. It appears to use the filter_order query param for the ordering. Is that right?
Looking at the code, I came to two conclusions: (a) while I am no security expert, it seems like a bad idea to simply put a query parameter into the SQL query directly, as it seems the code does (or did, at one time) via the filter_order parameter. and (b), the filter_order is now ignored anyway, and the _buildQuery method always uses "ORDER BY ordering DESC". Maybe you modified the code to avoid the SQL injection problem? I modified the code to always use "ORDER BY date DESC" and it now does what I want - the guestbook entry with the most recent date is displayed first. The oldest is displayed last.
After all this, my questions are :
1. Am I basically on target with my understanding of all of this ? If not, is there a better way to order by date? I didn't see it.
2. Consider this a change request: Can you change the default ordering on guestbook entries to "ORDER BY date"?
3. Can you change the admin panel to expose ordering options on the Guestbook entry, and make the selection of that option effective in guestbook.php? I think it's a bad idea to expose the ordering option directly in query parameters, without intelligently validating that content in some way.
If I am off base or misunderstanding I apologize; I'm not an expert joomla or PHP developer.
Thank you again for the guestbook.
Guestbook entry ordering
- Jan
- Phoca Hero

- Posts: 49138
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Guestbook entry ordering
Hi, added to feature request list.
Jan
Jan
If you find Phoca extensions useful, please support the project
-
Nimras
- Phoca Newbie

- Posts: 5
- Joined: 17 Sep 2011, 16:04
Re: Guestbook entry ordering
Well you could do WHAT I did.
I took 5194 post from the old Guestbook and moved them over in the format the new guestbook demand and then in the SQL Database I imported them, then in the front end everything looks at is should and all post are working as they should with ordering.
And the default in the front is ORDER by DATE.
I took 5194 post from the old Guestbook and moved them over in the format the new guestbook demand and then in the SQL Database I imported them, then in the front end everything looks at is should and all post are working as they should with ordering.
And the default in the front is ORDER by DATE.
-
jacoline
- Phoca Newbie

- Posts: 3
- Joined: 21 Jan 2012, 11:55
Re: Guestbook entry ordering
I can not see how to fix this ordering. It still shows the oldest first. I want the latest first.