Support forums : Quickies

figured out some of the intro post stuff

A home for really quick one-liner thoughts about what we need to fix or do or whatever. If they spark discussion we move it, otherwise this is like post-it notes.

Moderator: Dracones

figured out some of the intro post stuff

Postby EdB » Sun Aug 15, 2010 5:13 am

Not that anyone cares, but I think I'm starting to make sense out of the 'logic' behind the intro post types.

Intro-All (1600) rules. No matter what else you have, if you have one of these it will be displayed on top of any and every page. Unless filtering wouldn't trigger an intro-post of any kind, which is weird but that's it. For example you have an intro-cat post for cat "foo" but not "bar". Someone clicks on the cat "foo" link, they get the intro-all. They can't ever get the intro-cat post. If they click on the cat "bar" link they get no intro post.

Intro-Sub (1570) takes a back seat to Intro-Main if you are on an unfiltered page, and 1600 if you are on any secondary page. Again the same odd thing about how it shows up IF there is an intro-cat for a category but not if there isn't.

Intro-Tag (1530) works like you would expect ... except for how 1600 and 1570 can show up where one of these would be expected. (technically untested but looking at code after testing through the relationship tween various intro types and intro-cat I suspect this guy will be the same.)
Intro-Cat (1520) works like you would expect ... except for how 1600 and 1570 can show up where one of these would be expected.

Intro-Main (1500) is actually kinda cool. It only shows up on a completely unfiltered page. It'll even beat out a "featured post" which isn't an intro-type but kinda sometimes acts like one.

The "featured post" feature is really odd. Intro-types get displayed differently. Like, no feedback links and stuff like that. "featured" gets put up on top of any page that doesn't have an intro-type to display, but gets the same stuff that a regular post gets plus whatever styling treatment the intro-posts might get. Like a border around it or whatever. It also displays in the normal post flow (intro posts don't) which I think is due to $featured_displayed_item_ID lasts only as long as up until the MainList is initialized again but I haven't gone after that yet.

function & get_featured_Item() is where the weird logic comes in. It goes by type number except for featured which goes by yes or no. Of course, none of them have limits on who or how many so what actually gets displayed given all the above decision making is going to be the highest item ID (I think). It might be the most recent based on display date?

Anyway there of course is some sort of logic behind it but it is not obvious or IMHO even close to intuitive. Why something would knock an intro-cat out of the way on a category-filtered page is beyond me.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: figured out some of the intro post stuff

Postby Laibcoms » Sun Aug 15, 2010 9:42 am

Yep I arrived at the same conclusion and that weird thing you mentioned too.

For most I guess, Intro-Tag and Intro-Cat will be the useful ones. A CMS-type website (instead of a blog) will make use of those heavily although I haven't seen any live site doing just that. But I can imagine it being used that way.
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: figured out some of the intro post stuff

Postby EdB » Sun Aug 15, 2010 4:20 pm

Main is a good one I think, but yeah tag and cat are the obvious valuable ones. Sub I'm not so sure I can even make up a time to use it. Same with all. Plus with sub and all basically replacing tag and cat if one of those exists ... that's just weird. I think that's an easy fix though, meaning I think sub can show up on only multi-post not-main pages. Instead of showing up on other filtered pages.

It's all about the value of $disp_detail, of which there can be (at least?) 14, of which 7 are for 404 error pages. Down side to playing in that arena is that $content_mode is also all tied up with $disp_detail, and $content_mode brings in the damned "pre-staged params" mess.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: figured out some of the intro post stuff

Postby EdB » Thu Aug 19, 2010 9:48 am

Code: Select all
    if( ! $MainList->is_filtered() )
    {    
// Restrict to 'main' and don't ever use 'all' intros:
        
$restrict_to_types '1500';
    }
    else
    {    
// Filtered...
        // echo $disp_detail;
        
switch( $disp_detail )
        {
            case 
'posts-cat':
                
$restrict_to_types '1520,1570';
                break;
            case 
'posts-tag':
                
$restrict_to_types '1530,1570';
                break;
            default:
                
$restrict_to_types '1570';
        }
    }

    
$FeaturedList->set_filters( array(
            
'types' => $restrict_to_types,
            
'orderby' => 'ptyp_ID',
            
'order' => 'ASC',
            
'limit' => 1,
        ), 
false /* Do NOT memorize!! */ );

    
// Run the query:
    
$FeaturedList->query();

    if( 
$FeaturedList->result_num_rows == )
    {
        
// don't even bother with featured post cuz it doesn't work
    
}

    
$Item $FeaturedList->get_item(); 

That makes what you see get all better IMHO. The write form needs the field for "featured post" removed so no one can ever check the box and that takes care of that. Unfortunately this doesn't solve the problem of someone can still select "intro-all" when writing or how it's listed on the post-type page.

Oh and one could also get rid of every mention of $featured_displayed_item_ID cuz it doesn't work and once the featured_post feature is gone it doesn't matter that it doesn't work.

I did it the hard way: intro-all went away and intro-sub became 1600 so 1500->1600 are the intro posts, but that's a database change. Only got a few installations to worry about so not much of a problem is where I'm at. I should probably undo that, but then I'd have to code my way around them.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: figured out some of the intro post stuff

Postby Yabs » Thu Aug 19, 2010 3:54 pm

There's loads of 1600's hard-coded into the core, all of which would need to "go away". Only change required for a QP install is to remove it from the installer although, obviously, any early players will also have to rectify their database to remove that entry.

It'll also affect the converter which will have to .... urm ... err ... hmmmm ... either ignore the post(s) with that type/change them to draft/change them to something else/warn the (forward thinking) convertee and allow them to choose an outcome ... either way, the whole lot is a badly implemented system that should be shot ... although convertees may frown at being shot for their forward thinking O:-)

¥
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: figured out some of the intro post stuff

Postby EdB » Tue Feb 19, 2013 5:26 am

basically bumping because https://code.launchpad.net/~edb/quam-plures/qp5_monster affects this area to some degree. Going through my bookmarked items, kinda bumping the ones that I think the monster branch affects or addresses...
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona


Return to Quickies

Who is online

Users browsing this forum: No registered users and 1 guest

cron