Forum Replies Created

Viewing 8 replies - 16 through 23 (of 23 total)
  • Thread Starter JRGould

    (@jrgould)

    okay, so I kind of just ditched my original task that I needed this for, but managed to come around to it again. Here’s what I devised:

    You cannot use query_posts for this, I don’t know why it has not been included, but it hasn’t so I’m over it. What you need to do is put together a custom query somewhat like this:

    SELECT * FROM $wpdb->posts
    LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)
    LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
    WHERE $wpdb->posts.post_status = 'publish'
    AND $wpdb->posts.post_type = 'post'
    AND $wpdb->term_taxonomy.term_id IN ([category term_id],[tag term_id])
    AND !EXISTS(
    SELECT NULL
    FROM $wpdb->term_relationships
    LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
    WHERE $wpdb->term_relationships.object_id = $wpdb->posts.ID
    AND $wpdb->term_taxonomy.term_id IN ([excluded tag or cat term_ids])
    )

    What you’re doing here is querying for ‘terms’ whether they are categories or post tags, based on their id, so you’ll have to go into your DB and find out the ids of tags. I’m sure you could do another join of term_taxonomy and terms to be able to query based on their name but I didn’t really feel like it, plus this query is already obfuscated enough. The hard part here is excluding terms, or querying for the intersect of terms. The way I’m doing it is by running a subquery (AND EXISTS (foo) for intersects and AND !EXISTS bar) for exclusions).

    Sorry for this being kind of convoluted, it’s just something I figured out in an unrelated context so I thought I’d post it here for reference. Reply here if you want to pick my brain on the topic, or if I’m an idiot and have gone about this all wrong…

    Just posting in case this might help anybody else:

    I had this same problem (WP 2.3.2) and it came down to the fact that I either needed to disable the Audio Player (1.2.3) plugin or use PHP 5 (easy change on Mediatemple Grid Service)

    I had also tried the gzip based fixes before and that did not work… this is weird.

    Thread Starter JRGould

    (@jrgould)

    *bump*

    Anybody know of anything?

    it really seems like I should just be able to use
    query_posts("cat=6&tag=featured&showposts=5");

    As far as I could tell you can’t do this without modifying the plugin. Here’s what I have done:

    comment out all of the actions/filters in wp-content/plugins/share-this/sharethis.php that call the ‘st_add_link’ function. (here they are with their corresponding line-numbers.

    159: add_action('the_content', 'st_add_link');
    160: add_action('the_content_rss', 'st_add_link');
    175: add_filter('the_excerpt', 'st_add_st_add_link', 11);
    178: add_filter('get_the_excerpt', 'st_add_st_add_link', 11);

    and then in your template-files add this code wherever you’d like the ST icon to show up:

    <?php echo st_widget(); ?>

    For example, I only wanted the share-this icon to show up when people were actually viewing an article so I put it in my wp-content/themes/current-theme/single.php under the article content

    ahh thanks, this is starting to make sense. Unfortunately I’m on an unmanaged virtual dedicated server. So I guess the hard bit is up to me. Do you know if there is a way I can get some error information so I can troubleshoot this?

    so here’s where it gets interesting. Here’s a print_r of a post made at 8:30AM timestamped for 8:35AM and accessed at around 8:40AM

    stdClass Object
    (
        [ID] => 1388
        [post_author] => 1
        [post_date] => 2007-11-28 08:35:28
        [post_end_date] =>
        [post_date_gmt] => 2007-11-28 16:35:28
        [post_content] => Lorem ipsum dolor sit amet...
        [post_title] => Post-dated post
        [post_category] => 0
        [post_excerpt] =>
        [post_status] => future
        [comment_status] => open
        [ping_status] => closed
        [post_password] =>
        [post_name] => post-dated-post
        [to_ping] =>
        [pinged] =>
        [post_modified] => 2007-11-28 08:35:28
        [post_modified_gmt] => 2007-11-28 16:35:28
        [post_content_filtered] =>
        [post_parent] => 0
        [guid] => https://thedistrictweekly.com/backend/uncategorized/2007/11/28/post-dated-post/
        [menu_order] => 0
        [post_type] => post
        [post_mime_type] =>
        [comment_count] => 0
    )
    
     current time:2007-11-28 8:40:07

    where it gets weirder is that when I checked the dashboard at around 8:34 it said:

    Scheduled Entries:
    
        * Post-dated post in 1 min

    and when I checked it again at 8:40 it said:

    Scheduled Entries:
    
        * Post-dated post in 5 mins

    So it actually started counting up again

    in the dump of $post you’ll notice:

    [post_status] => future
    [post_date] => 2007-11-28 08:35:28
    [post_date_gmt] => 2007-11-28 16:35:28

    even though the time (printed with date()) is
    current time:2007-11-28 8:40:07

    so, I’m stumped. The part where dashboard is counting up is actually almost comical. It’s now 8:47 and dashboard says:

    Scheduled Entries:
    
        * Post-dated post in 12 mins

    any ideas?

    Oh, I should have mentioned that. I am running 2.3.1, and post-dating was working before I moved to the new server setup.

    I’m having this same problem. It just started when I moved my blog to new hosting. Could it be a permissions issue?

Viewing 8 replies - 16 through 23 (of 23 total)