Jump to content

Is there a way to make this display in columns?


twistedindustries

Recommended Posts

The question I have pertains to the code on lines 860-891.  I simply want to display the information in three columns per row rather than one, how do I do this?

 

Here is the file:

http://www.visionsminis.com/zipped.zip

 

Here is a link to the page:

http://visionsminis.com/CMS/index.php?option=com_comprofiler&task=usersList&listid=4&Itemid=6

my example earlier should have worked just fine...

 

<table class="new_games"><!-- the Hold Table-->
<tr><td>
<?php
mysql_select_db("picture") or die(mysql_error());
$result = mysql_query("SELECT  * FROM table ORDER BY date_added DESC LIMIT 6")or die(mysql_error());  

$x = 0;

echo '<table><tr>';// the picture table
while($row2 = mysql_fetch_assoc($result)){       
   if ($x % 3 == 0) {
     echo '</tr><tr>';
   }
   $x++;

   echo '<td>';
   echo '<a href="game.php?title=';// start of picture
   echo $row2['title'].'">';
   echo '<IMG SRC="picture/';
   echo $row2['game_picture_url'];
   echo '"'.' WIDTH="90"'.' HEIGHT="90">'.'</a>'.'<br>';//end of poicture
   echo '<a href ="page.php?car=';//start of link code
   echo $row2['car'];
   echo '">';
   echo $row2['title'];
   echo '</a></br>;// end of link code

   echo '</td>';
}
?>
</tr>
</table><!-- End icture table -->
</td></tr>
</table><!-- End hold table -->

<?php
	$i = 0;
	if (is_array($users) && count($users)>0) {
		foreach($users as $user) {
			$class = "sectiontableentry" . ( 1 + ( $i % 2 ) );		// evenodd class

			if($ueConfig['allow_profilelink']==1) {
				$style = "style=\"cursor:hand;cursor:pointer;\"";
				$style .= " id=\"cbU".$i."\"" ;
				// $style .= " onclick=\"javascript:window.location='".sefRelToAbs("index.php?option=com_comprofiler&task=userProfile&user=".$user->id.$option_itemid)."'\"";
			} else {
				$style = "";
			}
			if ( $user->banned ) {
				echo "\t\t<tr class=\"$class\"><td colspan=\"".$colsNbr."\"><span class=\"error\" style=\"color:red;\">"._UE_BANNEDUSER." ("._UE_VISIBLE_ONLY_MODERATOR.") :</span></td></tr>";
			}

			echo "\t\t<tr>\n";	
  
			foreach ( $columns as $column ) {
				echo "\t\t\t<td valign='top'>" . HTML_comprofiler::getUserListCell( $user, $column, $allFields, $option_itemid ) . "</td>\n";			

echo "\t\t</tr>\n"; 
}

			echo "\t\n";
			$i++;
		}
	} else {
		echo "\t\t<tr class=\"sectiontableentry1\"><td colspan=\"".$colsNbr."\">"._UE_NO_USERS_IN_LIST."</td></tr>";
	}
?>

Then my code works fine.

 

just adapt the ['column'] to whatever needed.

<?php
//contect to db
mysql_select_db("picture") or die(mysql_error());//select db
$result = mysql_query("SELECT  * FROM table LIMIT 6")or die(mysql_error());  

$x = 0;

echo '<table><tr>';// the picture table
while($row = mysql_fetch_assoc($result)){       
   if ($x % 3 == 0) {// THIS IS WHAT YOU WANT. DON'T CHANGE THIS
     echo '</tr><tr>';
   }
   $x++;

   echo '<td>';
   echo '<a href="game.php?title=';// start of picture
   echo $row['title'].'">';
   echo '<IMG SRC="picture/';
   echo $row['game_picture_url'];
   echo '"'.' WIDTH="90"'.' HEIGHT="90">'.'</a>'.'<br>';//end of poicture
   echo '<a href ="page.php?car=';//start of link code
   echo $row['car'];
   echo '">';
   echo $row['title'];
   echo '</a></br>;// end of link code

   echo '</td>';
}
?>
</tr>
</table><!-- End picture table -->

 

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.