Jump to content

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


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;

 

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.