Jump to content

Help ME!!


twistedindustries

Recommended Posts

So I have a list of items and I need to make it so that they show in columns of 3 and an unlimited amount of rows here is the code i am working with:

 

<?php
	$colsNbr = count( 3 );
	foreach ( $columns as $column ) {
		echo "\t\t\t<th><b></b></th>\n";
	}
?>

	</tr>
<?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>";
			}
if ($i == 3) {
			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";			
if ($i == 3) {
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>";
	}
?>

Link to comment
https://forums.phpfreaks.com/topic/97420-help-me/
Share on other sites

this is how i make my columns in my table...

 

<table>
<tr>

<?php
while($row2 = mysql_fetch_assoc($result)){       
   if ($x % 3 == 0) {// change the number to number of columns wanted
     echo '</tr><tr>';
   }
   $x++;
echo '<td>';


the info in each colum

echo '</td>';

}
?>
</tr>
</table>

Link to comment
https://forums.phpfreaks.com/topic/97420-help-me/#findComment-498492
Share on other sites

Dude, I had the EXACT same problem. Heres my code (its a games thing, you will need to edit it to you obviosuly):

<?php $dn = mysql_query("SELECT * FROM `3`") or die(mysql_error());
echo '<div class="bord"><table width="100%"><tr>';
$i = 0;
while ($row = mysql_fetch_array($dn)){

echo '<td><center><a href="?p='.$row['ID'].'"><img src="'.$row['img'].'" width="130" height="105"><br>'.$row['name'].'</center></a></td>';


$i++;
if ($i % 3 == 0 ){
echo '</tr><tr><td><hr></td><td><hr></td><td><hr></td></tr><tr>';
// Above there, i just liked hr's, if you dont want them, just change it to this line: echo '</tr><tr>';
}

}
echo '</tr></table></div>';
}
?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/97420-help-me/#findComment-498521
Share on other sites

i would just like to say, please, split your file into chunks, and include them. its easier to code, debug, post, read etc.

 

also, fair play for making that image, i dont quite know how you did it, but it would probably be easier for any debugging gurus on here to have it as text so they can copy/paste into their own wysywig (dont know how to spell ;)), they may have their own colors or debugging options etc. - just upload the file we can all download it :P

 

we definetely dont need all the code.

 

-------

 

is this page on a website? can we see the output or can you tell us what it is doing now. since to me it looks like your question was answered by your the code you posted yourself (i probably just dont understand you lol)

Link to comment
https://forums.phpfreaks.com/topic/97420-help-me/#findComment-498580
Share on other sites

Thanks man, sorry I didn't quite know how to do that, I have never attempted to post 2000+ lines of code.  FYI the program I used to make that is called SnagIt very handy little program I mainly like it because it has a function like mac (apple-shift-4) that allows you to screen shot regions of your screen. Anyway, here is a link to the zipped file:

 

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

Link to comment
https://forums.phpfreaks.com/topic/97420-help-me/#findComment-498592
Share on other sites

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.