Support forums : You can sense the bug

Featured Post kinda messed up

Not like "it smells funny when I click that". This is for bugs that don't show an error but something just doesn't seem right or ends up doing something you think is wrong. It doesn't show you an error but you know something ain't right.

Moderator: Dracones

Featured Post kinda messed up

Postby Laibcoms » Sun Sep 26, 2010 1:59 pm

The featured post is kinda messed up in date ordinance. Two featured post (ie check box checked) on the same page, but the one showing up in the featured post spot is an older article. Check here: http://laibcoms.com/?blog=1&paged=3

Posting it here for now, will check in detail later (sleepy already and first day of work tomorrow again).
QuamPlures Template: Paninap Themes
Add me: Google+
Blogs: The Hæven of John; gameshogun
Laibcoms
Dracone
User avatar
 
Posts: 111
Joined: Thu Jan 14, 2010 5:29 am
Location: Philippines, Asean

Re: Featured Post kinda messed up

Postby Laibcoms » Mon Sep 27, 2010 12:22 pm

Okay, I can't establish anything, I checked and everytime I thought I found the reason, something else will debunk it.

Page 2 and Page 3 shows a featured post from blog4.
- So I thought the "featured post" is basing it there.
But when I moved to Page 4, it is showing a featured post from blog3 instead.
- So it wasn't related to "blogXX"

I then remembered I manually moved post from old b2e to QP and I did not follow the exact order that the posts were posted.
- So I thought, maybe the FP is basing it's decisions from the "Post ID"
-- But then, on Page 4, a featured post that was posted after my manual migration is being superseded by another post. Eg. PostID=10 is not the one at the featured post spot in Page 4, what is there is PostID=08.

One thing is consistent, pages 2 and onwards are showing and older "featured post" instead of the most recent one on that particular page.

And the only thing I can deduce is that the featured post is not using the date and time of the post when determining which post is the most recent.

I don't know about the code, didn't look there, more likely than that I won't be able to follow it much.
QuamPlures Template: Paninap Themes
Add me: Google+
Blogs: The Hæven of John; gameshogun
Laibcoms
Dracone
User avatar
 
Posts: 111
Joined: Thu Jan 14, 2010 5:29 am
Location: Philippines, Asean

Re: Featured Post kinda messed up

Postby Yabs » Tue Sep 28, 2010 8:26 am

If you enable debug you should be able to see the sql that's run to get the featured item ;)

¥
I may have opened the door but you entered of your own free will

Image Techno Babble II
Image Tacky Pad 3
Yabs
Dracone
User avatar
 
Posts: 896
Joined: Sat Nov 21, 2009 9:59 am

Re: Featured Post kinda messed up

Postby Laibcoms » Tue Sep 28, 2010 11:50 am

Thanks. Here's additional info based on debug:

On http://laibcoms.com/?blog=1&paged=4
** Blog=1 is an aggregate blog only. **

There are 3 posts marked as "featured" (Post Edit setting).

What is being displayed in the "featured post" spot is:
- "The Avengers: Cameos, Hints, Clues, and Teasers" dated 05.03.2010 19:47:47 with PostID=145 of Blog=3

The other 2 posts are:
- "[Movie] Resident Evil 4: Afterlife" dated 09.12.10 22:00:54 with PostID=241 of Blog=3
- "(Update) Chikka v5 Now Available" dated 08.26.10 12:34:39 with PostID=239 of Blog=4


I'm not exactly sure what to look out for, I searched different strings like "feature", "order", and all looks normal or basic. Then I searched for the PostIDs of the posts marked as "featured" and these came up:

Code: Select all
Query #12: ItemList2::count_total_rows()
SELECT COUNT( DISTINCT post_ID)
FROM qp_items__item INNER JOIN qp_postcats ON post_ID = postcat_post_ID INNER JOIN qp_categories ON postcat_cat_ID = cat_ID
WHERE ( cat_blog_ID IN (1,2,3,4,5))
  AND (( post_ptyp_ID IS NULL
  OR post_ptyp_ID NOT IN (1000,1500,1520,1530,1570,1600,2000,3000) ))
  AND (post_datestart <= '2010-09-28 18:06:31')
  AND ( ( ( post_status = 'private'
  AND post_creator_user_ID = 1 )
  OR post_status IN ('published','protected') ) )

Query #13: ItemList2::Query() Step 1: Get ID list
SELECT DISTINCT post_ID
FROM qp_items__item INNER JOIN qp_postcats ON post_ID = postcat_post_ID INNER JOIN qp_categories ON postcat_cat_ID = cat_ID
WHERE ( cat_blog_ID IN (1,2,3,4,5))
  AND (( post_ptyp_ID IS NULL
  OR post_ptyp_ID NOT IN (1000,1500,1520,1530,1570,1600,2000,3000) ))
  AND (post_datestart <= '2010-09-28 18:06:31')
  AND ( ( ( post_status = 'private'
  AND post_creator_user_ID = 1 )
  OR post_status IN ('published','protected') ) )
ORDER BY post_datestart DESC, post_ID DESC
LIMIT 9, 3

Query #14: ItemList2::Query() Step 2
SELECT *
FROM qp_items__item
WHERE post_ID IN (241,240,239)
ORDER BY post_datestart DESC, post_ID DESC


Query #21: ItemList2::count_total_rows()
SELECT COUNT( DISTINCT post_ID)
FROM qp_items__item INNER JOIN qp_postcats ON post_ID = postcat_post_ID INNER JOIN qp_categories ON postcat_cat_ID = cat_ID
WHERE ( cat_blog_ID IN (1,2,3,4,5))
  AND (post_ptyp_ID IN (1570,1600))
  AND (post_datestart <= '2010-09-28 18:06:31')
  AND ( ( ( post_status = 'private'WHERE post_ID IN
  AND post_creator_user_ID = 1 )
  OR post_status IN ('published','protected') ) )

Query #22: ItemList2::Query() Step 1: Get ID list
SELECT DISTINCT post_ID
FROM qp_items__item INNER JOIN qp_postcats ON post_ID = postcat_post_ID INNER JOIN qp_categories ON postcat_cat_ID = cat_ID
WHERE ( cat_blog_ID IN (1,2,3,4,5))
  AND (post_ptyp_ID IN (1570,1600))
  AND (post_datestart <= '2010-09-28 18:06:31')
  AND ( ( ( post_status = 'private'
  AND post_creator_user_ID = 1 )
  OR post_status IN ('published','protected') ) )
ORDER BY post_datestart DESC, post_ID DESC
LIMIT 3
Rows: 0 – Time: 0.0003s (0.66%)
Query #23: ItemList2::Query() Step 2
SELECT *
FROM qp_items__item
WHERE 0

Query #24: ItemList2::count_total_rows()
SELECT COUNT( DISTINCT post_ID)
FROM qp_items__item INNER JOIN qp_postcats ON post_ID = postcat_post_ID INNER JOIN qp_categories ON postcat_cat_ID = cat_ID
WHERE ( cat_blog_ID IN (1,2,3,4,5))
  AND (( post_ptyp_ID IS NULL
  OR post_ptyp_ID NOT IN (1000,1500,1520,1530,1570,1600,2000,3000) ))
  AND (post_datestart <= '2010-09-28 18:06:31')
  AND ( ( ( post_status = 'private'
  AND post_creator_user_ID = 1 )
  OR post_status IN ('published','protected') ) )
  AND (post_featured <> 0)

Query #25: ItemList2::Query() Step 1: Get ID list
SELECT DISTINCT post_ID
FROM qp_items__item INNER JOIN qp_postcats ON post_ID = postcat_post_ID INNER JOIN qp_categories ON postcat_cat_ID = cat_ID
WHERE ( cat_blog_ID IN (1,2,3,4,5))
  AND (( post_ptyp_ID IS NULL
  OR post_ptyp_ID NOT IN (1000,1500,1520,1530,1570,1600,2000,3000) ))
  AND (post_datestart <= '2010-09-28 18:06:31')
  AND ( ( ( post_status = 'private'
  AND post_creator_user_ID = 1 )
  OR post_status IN ('published','protected') ) )
  AND (post_featured <> 0)
ORDER BY post_datestart DESC, post_ID DESC
LIMIT 9, 3

Query #26: ItemList2::Query() Step 2
SELECT *
FROM qp_items__item
WHERE post_ID IN (145,143,232)
ORDER BY post_datestart DESC, post_ID DESC


Information of those postIDs
241 (featured post) - 09.12.2010 22:00:54 - Blog=3
240 ( regular post ) - 09.11.2010 00:21:57 - Blog=2
239 (featured post) - 08.26.2010 12:34:39 - Blog=4
232 (featured post) - 02.11.2010 16:50:26 - Blog=4
145 (featured post) - 05.03.2010 19:47:47 - Blog=3
143 (featured post) - 02.28.2010 20:05:46 - Blog=3

I don't know if two queries of ItemList2 are supposed to happen. It looks to me like the second query superseded the first query, so the featured post that is displayed is postID 145 instead of 241.
QuamPlures Template: Paninap Themes
Add me: Google+
Blogs: The Hæven of John; gameshogun
Laibcoms
Dracone
User avatar
 
Posts: 111
Joined: Thu Jan 14, 2010 5:29 am
Location: Philippines, Asean

Re: Featured Post kinda messed up

Postby EdB » Sun Oct 03, 2010 12:23 am

Didn't read everything in the post above this, but here are some hints. It always likes the most recent special (intro-type or featured-checkbox) the best AND if it displays a featured-checkbox post it remembers that post ID and doesn't do it again ... but the logic happens again. That's semi-sorta part of how it all fails to work. And why I disable that "feature" by removing the checkbox option from the write page. I can handle the intro post types with a wee bit of better logic, but having it say "this time there is no intro-type so I better check to see if there is a featured post that I haven't already used" is too much to straighten out for any theoretical gain that might come from the featured item feature.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: Featured Post kinda messed up

Postby Laibcoms » Sun Oct 03, 2010 10:03 am

EdB wrote:Didn't read everything in the post above this, but here are some hints. It always likes the most recent special (intro-type or featured-checkbox) the best AND if it displays a featured-checkbox post it remembers that post ID and doesn't do it again ... but the logic happens again. That's semi-sorta part of how it all fails to work. And why I disable that "feature" by removing the checkbox option from the write page. I can handle the intro post types with a wee bit of better logic, but having it say "this time there is no intro-type so I better check to see if there is a featured post that I haven't already used" is too much to straighten out for any theoretical gain that might come from the featured item feature.


Hmm... I didn't quite understood some or most of it. But if I say that "the most recent 'featured-post/checkbox' should be on top per page' then that will mean going back to the old logic that you changed/removed, correct? Shouldn't it be that way since it's a "featured-post/checkbox", that is putting aside the intro-type stuff first.

The featured-post/checkbox works in the first page of QP - the new post with the featured-checkbox checked gets posted where it should be. But it stops being that way (ie "most recent") once a visitor/reader clicks on page 2,3,4, and so on. If I understood the new system correctly, this would mean that, if I make an old post a "featured-post/checkbox" and change the date to the "current" date, outdating any other post, it will not get posted at the first page correctly?

hehe, I'm confused. I'm coming from the "most recent" perspective.
QuamPlures Template: Paninap Themes
Add me: Google+
Blogs: The Hæven of John; gameshogun
Laibcoms
Dracone
User avatar
 
Posts: 111
Joined: Thu Jan 14, 2010 5:29 am
Location: Philippines, Asean

Re: Featured Post kinda messed up

Postby EdB » Sun Oct 03, 2010 4:13 pm

I'm not sure what's in core or not at this moment, but I never even tried to remove the bits that says "if you have no intro-type then check for a featured post". For my personal purposes I simply hide the "featured item" checkbox so that the logic(?) will never result in anything.

The next piece of the puzzle seems to be how the code says "if you have a featured item then memorize the ID so it won't be used again", which seems to result in the opportunity for a different (older?) featured item to be used in that slot. In other words it doesn't say "you already did featured so give up on it". Instead it says "you already did THAT item as featured so give up on that item and use a different one if you have another".

To me it is really bad to mix the intro-type status with the checkbox option. That's why I have effectively wiped out the checkbox for my purposes. I do recall that somewhere around here is a thread that helps explain to me why multiple featured items is a good idea, but I haven't gone near (a) finding that and (b) doing something about the logic behind it all.

Personally I'd rather fix the "anyone can make a post be any intro-type thus effectively obsoleting whatever another author said was intro-type" which is a sloppy way to say that if you as ID#1 made an intro-all post then me as a blogger on your installation could make a new one that would be seen instead of yours. My idea for a solution is complicated and never made sense in my head so I haven't even tried. Basically if you already have an intro-main or intro-sub (I have no intro-all anymore) in the database then it can't be used again. Problem is intro-cat and intro-tag items have to be submitted to the database before you can know if there already is one for that particular cat or tag then ... I dunno.

ANYWAY just getting the intro-foo logic figured out was bad enough. Topping it off with featured was so sucky I figured I'd just not bother having featured. Bad answer perhaps, but it certainly removed the confusion surrounding how it works ;)
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: Featured Post kinda messed up

Postby Laibcoms » Mon Nov 01, 2010 4:38 am

EdB, I've been thinking about this for sometime and maybe it is the best way forward: "featured post" should be [1] exclusive to the first page only; or [2] in every page there is one and the same featured post that is showing up.

I'm thinking it's a good solution instead of going back to the old code. Those two solutions because it will prevent confusion from a reader's point-of-view, since with the current code, pages 2 onwards displays a "featured post" that can be way older than the other featured post displayed on that same page.

Is that possible?
QuamPlures Template: Paninap Themes
Add me: Google+
Blogs: The Hæven of John; gameshogun
Laibcoms
Dracone
User avatar
 
Posts: 111
Joined: Thu Jan 14, 2010 5:29 am
Location: Philippines, Asean


Return to You can sense the bug

Who is online

Users browsing this forum: No registered users and 1 guest

cron