Skip to Content.
Sympa Menu

lyceum-users - Re: [Lyceum-users] Determine Blog Owner

lyceum-users AT lists.ibiblio.org

Subject: Lyceum-users mailing list

List archive

Chronological Thread  
  • From: Vix <garinungkadol AT gmail.com>
  • To: lyceum-users AT lists.ibiblio.org
  • Subject: Re: [Lyceum-users] Determine Blog Owner
  • Date: Thu, 22 Feb 2007 09:19:40 +0800

Sorry for the late reply.
Juan's code did the trick.

Will this be made into a function at some point?
And while I'm on this subject where do I add my custom functions that
I'd like to use in all blogs and the portal as well.

Vix



Message: 1
Date: Thu, 8 Feb 2007 01:32:54 -0500 (EST)
From: John Joseph Bachir <jjb AT ibiblio.org>
Subject: Re: [Lyceum-users] Determine Blog Owner
To: Juan Arias <juanito_budapest AT yahoo.es>
Cc: Vix <garinungkadol AT gmail.com>, lyceum-users AT lists.ibiblio.org
Message-ID: <Pine.LNX.4.64.0702080132340.9293 AT tribal.metalab.unc.edu>
Content-Type: text/plain; charset="iso-8859-1"

nope, there is no built-in functionality. Juan's code looks good.


On Mon, 5 Feb 2007, Juan Arias wrote:

> What information. do u have initally ? I mean, if the user is logged in, we
can have his/her $user_ID, and then, a nice
> get_currentuserinfo() may do the trick . . . That fills the global
$userdata with current user?s information from the DB, but not user?s
> blog URL, for what i have found a nifty. query, based on the global
$user_ID.
>
> But i think what u need is blog owner?s info off blog?s name, isn?t it ? I
don?t remember if i did come across some function doing that,
> but u can always make a query that returns current blog?s owner $user_ID:
>
> $user_ID_data= $wpdb->get_results("
> ??? ??? ??? SELECT DISTINCT
> ??? ??? ??? ??? $wpdb->users.ID
> ??? ??? ??? FROM $wpdb->blogs
> ??? ??? ??? ??? INNER JOIN $wpdb->usermeta ON ($wpdb->blogs.id =
$wpdb->usermeta.blog)
> ??? ??? ??? ??? INNER JOIN $wpdb->users??? ?? ON ($wpdb->users.ID =
$wpdb->usermeta.user_ID)
> ??? ??? ??? WHERE
> ??? ??? ??? ??? blogs.slug = '$current_blog_slug' // <-- U need to
initialize this variable !!
> ??? ??? ??? ??? ")
> ??? ??? ??? ;
> ? $current_blog_owners_ID = $user_ID_data[0]->ID ;
>
> And that?s it :D
>
> Juanito.
>
> PD : Im pretty sure there has to be a function that does this, but as i am
unable to track'em all, i just began to use personal queries
> for some things like this. jjb has to know? . . .
>




Archive powered by MHonArc 2.6.24.

Top of Page