Hmm, really hard to say what can be wrong there
Jan
New entries on top
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
-
- Phoca Enthusiast
- Posts: 73
- Joined: 26 Mar 2011, 20:54
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: New entries on top
Hi, the problem is, there are many different parts (like server or database settings) which can somehow influence this, so it is really hard to say what can be wrong there. I tested this on 3 different servers without any such problem. The guide was based on user's experiences (in was made over time by different users, so there were experiences on different server by different users - tested and working after all the sql queries). So really hard to say if there is something specific on server or if there was something specific when migrating, or really hard to say.
This SQL should solve problems with ordering:
What are the values in menu link to guestbook:
- Order by
- Order direction
- Order direction
for comments
When changing them, does anything change on the site?
This SQL should solve problems with ordering:
Code: Select all
CREATE TABLE migrate AS
SELECT id,
@rowid:=@rowid+2 AS rowid,
@rowid - 1 AS lftnew,
@rowid AS rgtnew FROM jos_phocaguestbook_items,
(SELECT @rowid:=0) AS init
ORDER BY id;
UPDATE jos_phocaguestbook_items SET lft=(SELECT lftnew FROM migrate WHERE migrate.id = jos_phocaguestbook_items.id);
UPDATE jos_phocaguestbook_items SET rgt=(SELECT rgtnew FROM migrate WHERE migrate.id = jos_phocaguestbook_items.id);
- Order by
- Order direction
- Order direction
for comments
When changing them, does anything change on the site?
If you find Phoca extensions useful, please support the project
-
- Phoca Enthusiast
- Posts: 73
- Joined: 26 Mar 2011, 20:54
Re: New entries on top
Thank you Jan. I'll give this a try over the next couple of days and report back.
BTW, changing the ordering and sorting within the control panel does not change the postings on the website.
Thank you
Daryl
BTW, changing the ordering and sorting within the control panel does not change the postings on the website.
Thank you
Daryl
-
- Phoca Enthusiast
- Posts: 73
- Joined: 26 Mar 2011, 20:54
Re: New entries on top
Hello Jan,Jan wrote: ↑23 Feb 2017, 02:09 Hi, the problem is, there are many different parts (like server or database settings) which can somehow influence this, so it is really hard to say what can be wrong there. I tested this on 3 different servers without any such problem. The guide was based on user's experiences (in was made over time by different users, so there were experiences on different server by different users - tested and working after all the sql queries). So really hard to say if there is something specific on server or if there was something specific when migrating, or really hard to say.
This SQL should solve problems with ordering:
What are the values in menu link to guestbook:Code: Select all
CREATE TABLE migrate AS SELECT id, @rowid:=@rowid+2 AS rowid, @rowid - 1 AS lftnew, @rowid AS rgtnew FROM jos_phocaguestbook_items, (SELECT @rowid:=0) AS init ORDER BY id; UPDATE jos_phocaguestbook_items SET lft=(SELECT lftnew FROM migrate WHERE migrate.id = jos_phocaguestbook_items.id); UPDATE jos_phocaguestbook_items SET rgt=(SELECT rgtnew FROM migrate WHERE migrate.id = jos_phocaguestbook_items.id);
- Order by
- Order direction
- Order direction
for comments
When changing them, does anything change on the site?
I tried your sql code, but unfortunately it has errors:
Prior to running the sql I got this errors:
* An expression was expected (near()
* Unexpected token (near()
* This type of clause was previously parsed. (near SELECT)
* Unexpected token (near()
* Unrecognized keyword (near AS)
* Unexpected token. (near init)
The best taht I can tell, there is something wrong with this line:
(SELECT @rowid:=0) AS init
I don't know sql, so I can't tell if there is anything wrong or not.
Thanks
Daryl
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: New entries on top
Hi, maybe this is the reason why it does not order right as this SQL needs to run successfully to make the ordering right.
When you run it, do you get any specific SQL error (complete error)?
When you run it, do you get any specific SQL error (complete error)?
If you find Phoca extensions useful, please support the project
-
- Phoca Enthusiast
- Posts: 73
- Joined: 26 Mar 2011, 20:54
Re: New entries on top
Hello Jan,
I figured out what I did wrong on the SQL statement. Totally my fault. I failed to change the table prefix to my table prefix.
I ran the query, but that did not resolve the issue. Sure, it fixed the current out-of-order postings, but when I submitted a new test post, it again went to the end of the guestbook. The lft value is 2 and the rgt value is 3.
Any additional thoughts?
Thank you.
Daryl
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: New entries on top
Hi, this should be Ok, the posts should go to the last position in database, but the ordering in menu link to guestbook is just set to display from newest to oldest
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Enthusiast
- Posts: 73
- Joined: 26 Mar 2011, 20:54
Re: New entries on top
Jan,
I had to read your reply a few times to understand what you meant. I finally understood that I needed to look in the "Options" for the guestbook menu. I see a "Order by" and changed it to Date. That resolved this issue. I did not know that I needed to look there. Why wouldn't that be in the normal options of the guestbook?
Thank you for your help.
Daryl
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: New entries on top
Hi,
OK.
Because you can have e.g. two guestbooks and two menu links and each can have own specific settings. This override of component's options by menu link is standard Joomla! feature which adds more options when creating website with Joomla!
Jan
OK.
Because you can have e.g. two guestbooks and two menu links and each can have own specific settings. This override of component's options by menu link is standard Joomla! feature which adds more options when creating website with Joomla!
Jan
If you find Phoca extensions useful, please support the project