Skip to Content.
Sympa Menu

lyceum-users - Re: [Lyceum-users] List of blogs on a site

lyceum-users AT lists.ibiblio.org

Subject: Lyceum-users mailing list

List archive

Chronological Thread  
  • From: Mitch Marks <mitchell AT cuip.net>
  • To: "David R. Woolley" <drwool AT thinkofit.com>
  • Cc: lyceum-users AT lists.ibiblio.org
  • Subject: Re: [Lyceum-users] List of blogs on a site
  • Date: Mon, 25 Sep 2006 12:08:09 -0500 (CDT)

> Okay, I'll do that when I get a chance. For use as a function,
> probably oughta eliminate the display of headings and have it return
> a count of the blogs displayed, or something...

Here is how I adapted it for use in the portal page, on a server where the
outdated version of MySQL doesn't support the temporary table called for
in the current portal.php implementation. The changes from David R.
Woolley's code are minimal: skipping the <ul> so as not to get the bullet
points look, and along with that used <br/> instead of <li>; also skipped
the $currentblog->blog in the echo line, which produces the numbering.

---

function generate_blog_list($type){
global $wpdb;
assert('deleted'==$type || 'active'==$type);
$bloglist = $wpdb->get_col("SELECT `id` FROM `$wpdb->blogs` WHERE
`status` = '$type'");
$bloglist = implode(',',$bloglist);
$blogs = $wpdb->get_results("
SELECT `blog`, `option_value` AS `name`
FROM $wpdb->options
WHERE `option_name` = 'blogname'
AND `blog` IN
($bloglist)");
if ($blogs) {
echo "<h2>All $type blogs</h2>";
foreach( $blogs as $currentblog ) {
$url = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE
blog='$currentblog->blog' AND
option_name= 'home'");
echo " <a href=\"$url\">$currentblog->name</a><br/>";
}
echo ' ';
}
else
echo "<H2>There are no $type blogs</option>";
}

----

And used it like this:

----

generate_blog_list ('active');

On Mon, 25 Sep 2006, David R. Woolley wrote:

> At 9/25/2006 12:11 AM, John Joseph Bachir wrote:
> >thanks for the code! do you realize that there is already code to do
> >this in portal.php?
>
> I didn't! Well, actually, I guess I did at some point, but early on
> in my installation of Lyceum I configured it to start up at a default
> blog. Once I'd done that I forgot all about portal.php, and then I
> began wondering why I couldn't find an option that gives a menu of all
> blogs.
>
> I'm still just getting my feet wet with all of this.
>
>
> >anyway it's nice to make it a function so people can use it in
> >arbitrary places. ... wanna submit this idea and code in a ticket?
>
> Okay, I'll do that when I get a chance. For use as a function,
> probably oughta eliminate the display of headings and have it return
> a count of the blogs displayed, or something...
>
>
> David R. Woolley
>
> =======================================
> http://thinkofit.com/drwool/
> =======================================
>
>
> _______________________________________________
> Lyceum-users mailing list
> Lyceum-users AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/lyceum-users
>

--

Mitchell Marks
CUIP & WIT Tech Coordinator
CUIP: Chicago Public Schools / Univ. of Chicago Internet Project
WIT: Web Institute for Teachers
http://cuip.net/cuip http://tech.cuip.net/ http://wit.uchicago.edu/wit
5640 S Ellis Ave AAC-007, Univ of Chgo, Chgo IL 60637

Phones: Area 773 (O) 702-6041 (F) 702-8212 (H) 241-7166 (C) 620-6744

Email: Primary address: mitchell AT cuip.net
CPS: mmarks AT cps.k12.il.us
Alternate UofC addresses (use especially to report problems with
CUIP\WIT mail!):
mitchell AT cs.uchicago.edu and mmar AT midway.uchicago.edu
Off-campus (ISP) address: mmarks AT pobox.com

and who will put the chic back in chicago?





Archive powered by MHonArc 2.6.24.

Top of Page