node blog (solution 1)

plue@asterx.upc.es - April 17, 2005 - 05:30
Project:Blog Theme
Version:HEAD
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Check that node is type blog, Is a good idea...

#1

plue@asterx.upc.es - April 17, 2005 - 05:57
Title:node blog» node blog (solution 1)

a example wold be this new blog theme module (copied and modified from the original module):

function blog_theme_help($section) {
switch ($section) {
case 'admin/modules#description':
// This description is shown in the listing at admin/modules.
return t('this module changes the theme used to display a users blog to the users default');
}
}

function blog_theme_init() {
global $custom_theme;
$nid = arg(1);
$node = node_load(array('nid' => $nid));

if (arg(0)=='blog' && arg(1) != '') {
$uid = arg(1);
$themes = list_themes();
$account = user_load(array((is_numeric($uid) ? 'uid' : 'name') => $uid, 'status' => 1));
$custom_theme = $account->theme && $themes[$account->theme]->status ? $account->theme : variable_get('theme_default', 'bluemarine');
}
else if (arg(0)=='node' && is_numeric(arg(1)) && $node->type=="blog") {
$themes = list_themes();
$uid = $node->uid;
$account = user_load(array('uid' => $uid,'status' => 1));
$custom_theme = $account->theme && $themes[$account->theme]->status ? $account->theme : variable_get('theme_default', 'bluemarine');
}
}

#2

tatonca - April 20, 2005 - 23:08

I'm not sure what the request is, or what exactly you have modified. To help me out, could you indicate what you have modified, and for what reason? I'm thinking maybe this was from a forum thread somewhere?

Thanks a bunch

~Tat~

#3

tatonca - May 6, 2005 - 20:31

WIthout more information, I will have to close this issue for now. If someone can point out what has changed I will be happy to have a look. Unfortunately I don't have time to go through and compare things bit for bit right now.

Thanks

~Tat~

 
 

Drupal is a registered trademark of Dries Buytaert.