bullemhead
Forum Replies Created
-
Here is some example code that finds posts across the network based on number of comments. I think it could be altered, but I’m not sure how.
global $wpdb; global $table_prefix; // get an array of the table names that our posts will be in // we do this by first getting all of our blog ids and then forming the name of the // table and putting it into an array $rows = $wpdb->get_results( "SELECT blog_id from $wpdb->blogs WHERE public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0';" ); if ( $rows ) : $blogPostTableNames = array(); foreach ( $rows as $row ) : $blogPostTableNames[$row->blog_id] = $wpdb->get_blog_prefix( $row->blog_id ) . 'posts'; endforeach; // now we need to do a query to get all the posts from all our blogs // ordered by the number of comments and with limits applied if ( count( $blogPostTableNames ) > 0 ) : $query = ''; $i = 0; foreach ( $blogPostTableNames as $blogId => $tableName ) : if ( $i > 0 ) : $query.= ' UNION '; endif; $query.= " SELECT ID, post_type, $blogId as <code>blog_id</code> FROM $tableName WHERE post_type = 'prompt' AND post_status = 'publish' "; $i++; endforeach; $rows = $wpdb->get_results( $query ); // now we need to get each of our posts into an array and return them if ( $rows ) : $posts = array(); foreach ( $rows as $row ) : $posts[] = get_blog_post( $row->blog_id, $row->ID ); endforeach; print_r($posts); return $posts; echo ('<br /><br />'); endif; endif; endif;
So I guess what I’m looking for is the appropriate SQL query to run so I can know which blog to switch to.
Yeah it would have to be custom SQL because I can’t switch to a blog before knowing which one to switch to.
Forum: Fixing WordPress
In reply to: after upgrade to 2.3.3 upload not workingI’ll 3rd that. Haven’t been able to find anything on this.
Forum: Fixing WordPress
In reply to: Is it possible to have too many Categories?We have over 600 categories on evilvlog.com. Not useful or anything, but we use wordpress as sort of an art, some posts have 40 categories. Sometimes we add 20 new categories for a single post.
Anyhow, this is slowing down our posting considerably, I guess because it has to load all those categories.
Is there any way to get around this? (other than “don’t use so many categories”)
One of the goals of Evilvlog.com is to break wordpress, and we have succeeded many times, but we’ve found workarounds for everything but this.
Forum: Fixing WordPress
In reply to: RSS Feed Not Displaying Site ContentThanks for the reply Moshu. I knew about the /feed location, but the location I posted had been working previously. We had to reinstall WP last week due to database problems and everything got messed up.
I created 2 modified feed templates:
https://www.thepan.org/admin/wp-rss2-qt.php
https://www.thepan.org/admin/wp-rss2-wmv.phpThey are identical to the default rss2 feed, but their enclosures pull from the c2c get_custom plugin in order to distinguish between our different video types.
Anyhow, neither of them are working anymore after our reinstall, and I can’t figure out why.
Is it just a matter of having them in the wrong place?
I feel like I need to tell WordPress to go look for them and populate them somehow.
Forum: Fixing WordPress
In reply to: RSS Feed Not Displaying Site ContentSame problem here:
https://www.thepan.org/admin/wp-rss2.phpThis is really strange.
Forum: Fixing WordPress
In reply to: RSS 2.0 EnclosuresHello,
I can’t get this to work either, trying to use it for separate WMV and Quicktime feeds.
Parsing error, it says.
Wish I knew PHP so I could tell what’s going on.
Videobloggers around the world would be very happy to have a working answer to this problem!