Posted by lut4rp on May 1, 2008 at 3:37pm
Jump to:
| Project: | Blommor01 |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | frjo |
| Status: | closed (fixed) |
Issue Summary
This theme needs to be ported to Drupal 6. Since I shall be using a modded version for my personal website, i shall try and port it myself. Anyone interested in helping can ping me.
Comments
#1
When I update my own site to Drupal 6 I will update this theme also. It should be before the end of the year.
#2
#3
I got most of the update ready.
I just need to swap out the old template.php code with the updated code. Old code:
function _phptemplate_variables($hook, $vars) {
switch ($hook) {
case 'page':
drupal_add_css($vars['directory'] .'/modules.css', 'theme', 'all');
drupal_add_css($vars['directory'] .'/blommor.css', 'theme', 'all');
$vars['styles'] = drupal_get_css();
break;
case 'node':
// Display info only on certain node types.
if (theme_get_setting('toggle_node_info_' . $vars['node']->type)) {
$vars['submitted'] = t('!user - <abbr class="created" title="!microdate">!date</abbr>', array(
'!user' => theme('username', $vars['node']),
'!date' => format_date($vars['node']->created),
'!microdate' => format_date($vars['node']->created,'custom', "Y-m-d\TH:i:sO")
));
}
else {
$vars['submitted'] = '';
}
if (module_exists('taxonomy')) {
$vocabs = taxonomy_get_vocabularies();
foreach($vocabs as $vocab) {
$tags = array();
$terms = taxonomy_node_get_terms_by_vocabulary($vars['node']->nid, $vocab->vid);
foreach ($terms as $term) {
$tags['taxonomy_term_'. $term->tid] = array(
'title' => $term->name,
'href' => taxonomy_term_path($term),
'attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))
);
}
if ($tags) {
$vars['tags_'. $vocab->vid] = theme('links', $tags, array('class' => 'links inline'));
}
}
}
break;
case 'comment':
if ($vars['submitted']) {
$vars['submitted'] = t('!user - <abbr class="created" title="!microdate">!date</abbr>', array(
'!user' => theme('username', $vars['comment']),
'!date' => format_date($vars['comment']->timestamp),
'!microdate' => format_date($vars['comment']->timestamp,'custom', "Y-m-d\TH:i:sO")
));
}
break;
}
return $vars;
}
My first attempt at updating the template.php file (I'm not that familiar with theme functions:)
function template_preprocess_hook(&$vars) {
switch ($hook) {
case 'page':
drupal_add_css($vars['directory'] .'/modules.css', 'theme', 'all');
drupal_add_css($vars['directory'] .'/blommor.css', 'theme', 'all');
$vars['styles'] = drupal_get_css();
break;
case 'node':
// Display info only on certain node types.
if (theme_get_setting('toggle_node_info_' . $vars['node']->type)) {
$vars['submitted'] = t('!user - <abbr class="created" title="!microdate">!date</abbr>', array(
'!user' => theme('username', $vars['node']),
'!date' => format_date($vars['node']->created),
'!microdate' => format_date($vars['node']->created,'custom', "Y-m-d\TH:i:sO")
));
}
else {
$vars['submitted'] = '';
}
if (module_exists('taxonomy')) {
$vocabs = taxonomy_get_vocabularies();
foreach($vocabs as $vocab) {
$tags = array();
$terms = taxonomy_node_get_terms_by_vocabulary($vars['node']->nid, $vocab->vid);
foreach ($terms as $term) {
$tags['taxonomy_term_'. $term->tid] = array(
'title' => $term->name,
'href' => taxonomy_term_path($term),
'attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))
);
}
if ($tags) {
$vars['tags_'. $vocab->vid] = theme('links', $tags, array('class' => 'links inline'));
}
}
}
break;
case 'comment':
if ($vars['submitted']) {
$vars['submitted'] = t('!user - <abbr class="created" title="!microdate">!date</abbr>', array(
'!user' => theme('username', $vars['comment']),
'!date' => format_date($vars['comment']->timestamp),
'!microdate' => format_date($vars['comment']->timestamp,'custom', "Y-m-d\TH:i:sO")
));
}
break;
}
return $vars;
}
As of now all I did was add function template_preprocess_hook(&$vars)
#4
I have just committed a 6-dev version of the Blommor01 theme. Please try it out and report back any problems.
#5