Jump to content

How to edit this code to display images in vertically instead of horizontal


scottie35t

Recommended Posts

i'm not sure how to make a break in this code, so the jaward images in this code below, shows multiple images in a vertical format (instead of showing them side by side horizontally). Because the images are wide, it takes up to much space if I show them horizontally? Should I use a page break, span or other? <br>, <p>, or somethiong else? My coding knowledge is basic, so if you can tell me the specific location to place it in the code below, it would be very helpful.. :).

 

 

// 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;

 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.