lyceum-dev AT lists.ibiblio.org
Subject: Lyceum-dev mailing list
List archive
- From: DaveG <lyceum AT solidgone.com>
- To: fusion AT ibiblio.org
- Cc: lyceum-dev AT lists.ibiblio.org
- Subject: Re: [Lyceum-dev] Widgets: MyBlogs and All Blogs
- Date: Sun, 30 Jul 2006 22:59:42 -0400
Jameson Lopp wrote:
$wpdb is a global variable, so before you start using it you should have the statement:That worked great, thanks! Here's the final code (with a few HTML tweaks):
global $wpdb;
echo $before_widget;
//----------------
global $wpdb;
$wpdb->query("
CREATE TEMPORARY TABLE bloginfo
SELECT $wpdb->blogs.id, $wpdb->blogs.slug, option_value as blogname, status
FROM $wpdb->blogs
INNER JOIN $wpdb->options ON ($wpdb->blogs.id = $wpdb->options.blog)
INNER JOIN $wpdb->posts
INNER JOIN $wpdb->post2cat ON (post_id = $wpdb->posts.ID)
INNER JOIN $wpdb->categories ON (category_id = cat_ID AND $wpdb->categories.blog = $wpdb->options.blog)
WHERE
status = 'active' AND
option_name = 'blogname'
ORDER BY post_date_gmt DESC
");
$blogs = $wpdb->get_results("SELECT DISTINCT(id), slug, blogname, status FROM bloginfo");
echo $before_title . $title . $after_title . "<ul>";
if ($blogs)
if(SUBDOMAINS)
foreach ($blogs as $b)
echo "<li><a href=\"http://$b->slug.".MAINDOMAIN."\">$b->blogname</a></li>";
else
foreach ($blogs as $b)
echo "<li><a href=\"./$b->slug\">$b->blogname</a></li>";
//----------------
echo "</ul>" . $after_widget;
-
[Lyceum-dev] Widgets: MyBlogs and All Blogs,
DaveG, 07/30/2006
-
Re: [Lyceum-dev] Widgets: MyBlogs and All Blogs,
Jameson Lopp, 07/30/2006
-
Re: [Lyceum-dev] Widgets: MyBlogs and All Blogs,
DaveG, 07/30/2006
- Re: [Lyceum-dev] Widgets: MyBlogs and All Blogs, John Joseph Bachir, 07/30/2006
-
Re: [Lyceum-dev] Widgets: MyBlogs and All Blogs,
DaveG, 07/30/2006
-
Re: [Lyceum-dev] Widgets: MyBlogs and All Blogs,
Jameson Lopp, 07/30/2006
Archive powered by MHonArc 2.6.24.