module config - Joomla! Forum - community, help and support
hi there. using joomla 2.5.7
i have module displays "most downloaded songs" on website. problem want appear in nice table form, cant figure out how to.
this module layout looks like:

this want like:

(with each link on new line)
below .php file layout of current module.
i greatful if tweak me.
i have module displays "most downloaded songs" on website. problem want appear in nice table form, cant figure out how to.
this module layout looks like:

this want like:

(with each link on new line)
below .php file layout of current module.
i greatful if tweak me.
code: select all
<?php // no direct access
defined('_jexec') or die('restricted access'); ?>
<?php
if($params->get( 'itemid' )) $itemid = "&itemid=".$params->get( 'itemid' );
else $itemid = "";
$document =& jfactory::getdocument();
$document->addstylesheet(juri::base(true).'/modules/mod_muscol_featured_top_viewed/tmpl/top_viewed.css');
$k = 0;
$max_font_size = $params->get('maxfontsize') ;
$min_font_size = $params->get('minfontsize') ;
$min_count = $top_viewed[count($top_viewed) - 1]->hits ;
$max_count = $top_viewed[0]->hits ;
$min_hits = 0 ;
$show = $params->get('show', 'artists');
switch($show){
case 'albums':
$view = 'album' ;
break;
case 'songs':
$view = 'song' ;
break;
case 'artists': default:
$view = 'artist' ;
break;
}
if($params->get('random')) shuffle($top_viewed);
for ($i=0, $n=count( $top_viewed ); $i < $n; $i++) {
$item = &$top_viewed[$i];
if($item->hits > $min_hits)
$display_font_size = ( $max_font_size - $min_font_size ) * ( $item->hits - $min_count ) / ( $max_count - $min_count ) + $min_font_size ;
else $display_font_size = $min_font_size ;
$link = jroute::_( 'index.php?option=com_muscol&view='.$view.'&id='. $item->id . $itemid);
$tagcloud .= "<a href='". $link . "' class='tag-link-".$view."-".$item->id."' title=\"".$item->name." (". $item->hits . " hits)\" rel='tag' style='font-size: ". $display_font_size . "px;line-height:".$display_font_size."px;'>". $item->name."</a> " ;
}
echo $tagcloud;
?>
hi try this...
code: select all
<?php // no direct access
defined('_jexec') or die('restricted access'); ?>
<?php
if($params->get( 'itemid' )) $itemid = "&itemid=".$params->get( 'itemid' );
else $itemid = "";
$document =& jfactory::getdocument();
$document->addstylesheet(juri::base(true).'/modules/mod_muscol_featured_top_viewed/tmpl/top_viewed.css');
$k = 0;
$max_font_size = $params->get('maxfontsize') ;
$min_font_size = $params->get('minfontsize') ;
$min_count = $top_viewed[count($top_viewed) - 1]->hits ;
$max_count = $top_viewed[0]->hits ;
$min_hits = 0 ;
$show = $params->get('show', 'artists');
switch($show){
case 'albums':
$view = 'album' ;
break;
case 'songs':
$view = 'song' ;
break;
case 'artists': default:
$view = 'artist' ;
break;
}
if($params->get('random')) shuffle($top_viewed);
$tagcloud = array();
for ($i=0, $n=count( $top_viewed ); $i < $n; $i++) {
$item = &$top_viewed[$i];
if($item->hits > $min_hits)
$display_font_size = ( $max_font_size - $min_font_size ) * ( $item->hits - $min_count ) / ( $max_count - $min_count ) + $min_font_size ;
else $display_font_size = $min_font_size ;
$link = jroute::_( 'index.php?option=com_muscol&view='.$view.'&id='. $item->id . $itemid);
$tagcloud[] = "<a href='". $link . "' class='tag-link-".$view."-".$item->id."' title=\"".$item->name." (". $item->hits . " hits)\" rel='tag' style='font-size: ". $display_font_size . "px;line-height:".$display_font_size."px;'>". $item->name."</a> " ;
}
?>
<table style="width:100%;">
<?php foreach ($tagcloud $tag) { ?>
<tr>
<td style="padding:5px;background: #eaf9ff;">
<?php echo $tag; ?>
</td>
</tr>
<?php } ?>
</table>
Comments
Post a Comment