twistedindustries Posted March 24, 2008 Share Posted March 24, 2008 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 Quote Link to comment Share on other sites More sharing options...
ohdang888 Posted March 24, 2008 Share Posted March 24, 2008 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 --> Quote Link to comment Share on other sites More sharing options...
twistedindustries Posted March 24, 2008 Author Share Posted March 24, 2008 I guess I don't understand how to incorporate the code is there anyway that you can show me? Quote Link to comment Share on other sites More sharing options...
ohdang888 Posted March 24, 2008 Share Posted March 24, 2008 well then you have to post your current code. now. Because its in the wee hours of the night where i am, and i'm going to bed in a few minutes. Quote Link to comment Share on other sites More sharing options...
twistedindustries Posted March 24, 2008 Author Share Posted March 24, 2008 <?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>"; } ?> Quote Link to comment Share on other sites More sharing options...
ohdang888 Posted March 24, 2008 Share Posted March 24, 2008 wow i have no idea what that is even saying.... Are you using a database?, a db is by far the easiest way Quote Link to comment Share on other sites More sharing options...
twistedindustries Posted March 24, 2008 Author Share Posted March 24, 2008 yes I am using a database. I am so lost on how this code works as well. Quote Link to comment Share on other sites More sharing options...
ohdang888 Posted March 24, 2008 Share Posted March 24, 2008 well then completely drop it.... is each picture info in a seperate row, or all in the same row? We can solve this a lot faster.... do you have AIM mine is: ohdang10 Quote Link to comment Share on other sites More sharing options...
twistedindustries Posted March 24, 2008 Author Share Posted March 24, 2008 no i don't have AIM sorry, and no its set up so that each one is between a <tr> tag Quote Link to comment Share on other sites More sharing options...
ohdang888 Posted March 24, 2008 Share Posted March 24, 2008 nooo. i mean in the database table. Quote Link to comment Share on other sites More sharing options...
twistedindustries Posted March 24, 2008 Author Share Posted March 24, 2008 each one is in its own row Quote Link to comment Share on other sites More sharing options...
ohdang888 Posted March 24, 2008 Share Posted March 24, 2008 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 --> Quote Link to comment Share on other sites More sharing options...
twistedindustries Posted March 24, 2008 Author Share Posted March 24, 2008 Im sorry but I can't get that to work it gives me an error for line 911 Quote Link to comment Share on other sites More sharing options...
twistedindustries Posted March 24, 2008 Author Share Posted March 24, 2008 screw it I figured out a way it may not be the best but it works and that is all i need right now Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.