我不知道如何在这段代码中中断,所以下面这段代码中的下巴图像以垂直格式显示多个图像(而不是水平并排显示它们)。因为图像很宽,如果我水平显示它们会占用很多空间?我的编码知识很基础,所以如果你能告诉我具体的位置,那将非常有帮助.. :)。我也不确定是否应该使用分页符
或 a
, span 或其他。
// Hack for jAwards integration, displays some medals of the user for Kunena 1.6
$number_medals = 10; // number of medals to show
$query = "SELECT b.image, b.name"
. "\n FROM #__jawards_awards AS a"
. "\n LEFT JOIN #__jawards_medals AS b ON b.id = a.award"
. "\n WHERE a.userid=". $this->profile->userid
. "\n ORDER BY RAND() LIMIT ".$number_medals;
$database = &JFactory::getDbo();
$database->setQuery( $query );
$medals = $database->loadObjectList();
// URL links to the jAwards-Tab for Community Builder which displays all
// medals of the user - change to another URL of needed
$awards_url=JRoute::_('index.php?option=com_comprofiler&task=userProfile&user='.$this->profile->userid."&tab=getawardstab");
// CSS-class "ja_medals" allows individual styling of medal images and
// container. "nobr" keeps the medals from breaking apart, display them
// in one row.
$msg_jawards = "<div class=\"ja_medals\"><nobr>";
foreach ($medals as $med){
$msg_jawards.= "<a href=\"$awards_url\" title=\"$med->name\">"
. "<img style='border:0px;padding:0px;' src=\"".KUNENA_JLIVEURL."/images/medals/".$med->image ."\" alt=\"".$med->name."\" />"
. "</a>";
}
$msg_jawards.="</nobr></div>";
unset($medals);
echo $msg_jawards;
?>