user777 5 сентября 2009 в 1:49 Подскажите как вывести рядом с тегом в облаке кол-во упоминаний этого тега? Drupal6 Блог Войдите или зарегистрируйтесь, чтобы отправлять комментарии
Kostyan 5 сентября 2009 в 9:33 function phptemplate_tagadelic_weighted($terms) { $count=count($terms); $fl=0; $metka=round($count/3); if ($count==20 ) { $output .= " "; foreach ($terms as $term) { $output .= l($term->name, taxonomy_term_path($term), array('attributes' => array('class' => "tagadelic", 'rel' => 'tag'))) ." (".$term->number_of_posts.") \n"; $output .= ''; $fl=$fl+1; if ( $fl == $metka || $fl == 2*$metka ) { $output .= ' '; } } $output .= " "; } else { foreach ($terms as $term) { $output .= l($term->name, taxonomy_term_path($term), array('attributes' => array('class' => "tagadelic level$term->weight", 'rel' => 'tag'))) ." \n"; } } return $output; } попробуйте вставить в template.php что то подобное, не самый лучший код правда
user777 5 сентября 2009 в 14:42 У меня не заработало, как можно получить кол-во упоминаний, ведь размер напрямую зависит от этого, может можно проще?
Kostyan 5 сентября 2009 в 16:30 function phptemplate_tagadelic_weighted($terms) { $output = ''; foreach ($terms as $term) { $output .= '<a href="' . url('taxonomy/term/'. $term->tid) . '">' . $term->name .'</a>' . $term->number_of_posts; } return $output; } вот это должно работать
user777 5 сентября 2009 в 19:22 Спасибо все работает! Единственное что не устроило - размер везде одинаковый стал, но доделаю сам. Еще раз спасибо!
Комментарии
function phptemplate_tagadelic_weighted($terms) {
$count=count($terms);
$fl=0;
$metka=round($count/3);
if ($count==20 ) {
$output .= "
foreach ($terms as $term) {
$output .= l($term->name, taxonomy_term_path($term), array('attributes' => array('class' => "tagadelic", 'rel' => 'tag'))) ." (".$term->number_of_posts.") \n";
$output .= '
';
$fl=$fl+1;
if ( $fl == $metka || $fl == 2*$metka ) {
$output .= '
}
} $output .= "
";
} else {
foreach ($terms as $term) {
$output .= l($term->name, taxonomy_term_path($term), array('attributes' => array('class' => "tagadelic level$term->weight", 'rel' => 'tag'))) ." \n";
}
}
return $output;
}
попробуйте вставить в template.php что то подобное, не самый лучший код правда
У меня не заработало, как можно получить кол-во упоминаний, ведь размер напрямую зависит от этого, может можно проще?
$output = '';
foreach ($terms as $term) {
$output .= '<a href="' . url('taxonomy/term/'. $term->tid) . '">' . $term->name .'</a>' . $term->number_of_posts;
}
return $output;
}
вот это должно работать
Спасибо все работает!
Единственное что не устроило - размер везде одинаковый стал, но доделаю сам. Еще раз спасибо!