Skip to Content.
Sympa Menu

lyceum-dev - Re: [Lyceum-dev] Widgets: MyBlogs and All Blogs

lyceum-dev AT lists.ibiblio.org

Subject: Lyceum-dev mailing list

List archive

Chronological Thread  
  • From: John Joseph Bachir <jjb AT ibiblio.org>
  • To: DaveG <lyceum AT solidgone.com>
  • Cc: lyceum-dev AT lists.ibiblio.org
  • Subject: Re: [Lyceum-dev] Widgets: MyBlogs and All Blogs
  • Date: Sun, 30 Jul 2006 23:03:17 -0400 (EDT)

great stuff. dave, if you post this somewhere downloadable on the web (maybe along with an explanator blog post) we'll feature it on the lyceum blog.

maybe a more important issue--- are folks still wanting a lyceum plugin svn repository?

we should definitely have a mailing list.

john



On Sun, 30 Jul 2006, DaveG wrote:

Jameson Lopp wrote:
$wpdb is a global variable, so before you start using it you should
have the statement:

global $wpdb;

That worked great, thanks! Here's the final code (with a few HTML tweaks):

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 mailing list
Lyceum-dev AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/lyceum-dev


--
John
----
aim/yim/msn/jabber.org: johnjosephbachir
713.494.2704
irc://irc.freenode.net/lyceum
http://lyceum.ibiblio.org/
http://blog.johnjosephbachir.org/




Archive powered by MHonArc 2.6.24.

Top of Page