Skip to content
Commits on Source (1)
......@@ -3,7 +3,7 @@
* Plugin Name: ai-global-activity
* Plugin URI: https://git.autistici.org/noblogs/ai-global-activity-plugin
* Description: Update global activity feed
* Version: 0.0.23
* Version: 0.0.24
* Author: Autistici/Inventati
* Author URI: https://www.autistici.org/
* License: MIT
......@@ -154,8 +154,14 @@ function ai_activity_get_latest_posts($offset, $limit) {
$table_name = AI_ACTIVITY_TABLE_NAME;
$results = $wpdb->get_results($wpdb->prepare(
"
SELECT blog_id, post_id, title, author, excerpt, url, thumbnail_url, published_at
FROM {$table_name}
SELECT
a.blog_id AS blog_id, a.post_id AS post_id, a.title AS title, a.author AS author,
a.excerpt AS excerpt, a.url AS url, a.thumbnail_url AS thumbnail_url, a.published_at AS published_at
FROM {$table_name} AS a
JOIN wp_blogs AS b
ON a.blog_id = b.blog_id
WHERE
b.public = 1 AND b.spam = 0 AND b.deleted = 0 AND b.mature = 0
ORDER BY published_at DESC
LIMIT %d OFFSET %d
",
......