Hello, in a plugin, how can i get the current blog ID?
Thanks! :)
Hello, in a plugin, how can i get the current blog ID?
Thanks! :)
Autoreply: $wpdb->blogid... :)
Actually I believew $blog_id is also carried as a global variable though most of the system. I'm not calling it but it works when I want it to. :)
I finally figured out how to hack geekgrrl's profile picture plugin (http://geekgrl.net/2007/01/02/profile-pics-plugin-release/) to enable users to upload their own header into their theme.
All I need is a function that echoes the blogID.
I have the directory: /wp-content/blogs.dir/1.jpg, but I would like to replace the value "1" with:
/wp-content/blogs.dir/<? echo ('get_blogID'); ?>.jpg
if that were possible. I'm not a PHP-coder, but will of course post the solution, if you could help me...
Proposed solution to letting users on a wpmu-site upload their own header image into the default template:
Comment: this places alle the header pictures in blog.dir directory as 1.jpg, 2.jpg and so forth, corresponding to the blog ID of the uploader...
style="background-image:url(wp-content/blogs.dir/
<?php echo ('$wpdb->blogid') ?>.jpg);">
...
$wpdb->blogid: to be replaced with echo of the blogID...
Couldnt you just use something similar to k2's interface. It allows you to upload pictures for headers and even do a random picture.
I hacked geekgirl's profile picture to use as an avatar system. Works pretty decently.
I used a common directory and the user_ID to pull the correct picture.
WDuluoz
Yeah, but haven't got around to looking at k2+wpmu yet, expecting it to be simpler to just figure out (-> ask) how to echo the blogID...
global $blog_id;
echo $blog_id;
Nothing spectacular about that.
Thanks Lunabyte!
<div id="header"><h1><a href="<?php bloginfo('home'); ?>"
style="background-image:url(wp-content/blogs.dir/
<?php global $blog_id; echo $blog_id; ?>.jpg);">
<?php bloginfo('name'); ?>
</a></h1></div>
- gets the header image corresponding to the user that uploaded the picture...
This is nice... but one side is using the user_id and the other is using the blog_id. Now if a user makes just a username it throws everything off. Any fixes?