userlist with columns

17 years 2 months ago #30553 by mossimo
Replied by mossimo on topic Re:userlist with columns
zen wrote:

i.e. surround the code with a table like below;

[code:1]<table class="usertable" cellspacing="0" cellpadding="10">
<?php
$i = 1;
foreach($users as $user) {
$endofrow= 0;

//print $user->name;
if($ueConfig==1) {
$onclick = "onclick=\"javascript:window.location='".sefRelToAbs("index.php?option=com_comprofiler&task=userProfile&user=".$user->id)."'\"";
$style="style=\"cursor:hand;cursor:«»pointer;\"";
}

//print $lfields;
$str = null;
eval("\$str = \"$lfields\";"«»);
echo $str. "\n";
$oneintwo = $i % 5;
if ($oneintwo == 0) {
print "\t</tr><tr>\n";
$endofrow= 1;
}
$i++;
}...[/code:1]


And, in your CSS,

[code:1].usertable
{
border: solid 1px #000000;
padding: 5px;
}[/code:1]


That's the basic idea. Play around with your attributes in CSS to get the look you are after.



Thanks for the code!!
I would like to ask why it create td instead of TR first in the output...
ANd also when i set

$oneintwo = $i % 5;

this to 6 and my userlist is only 6 person its create also a new row in the table.....

here is the output

<table class="usertable" cellspacing="0" cellpadding="10">

<td valign='top'>
<a href="http://192.168.0.1/cmsj12/index.php?option=com_comprofiler&amp;task=userProfile&amp;user=99&amp;Itemid=5">

<td valign='top'>
<a href="http://192.168.0.1/cmsj12/index.php?option=com_comprofiler&amp;task=userProfile&amp;user=93&amp;Itemid=5">

<td valign='top'>
<a href="http://192.168.0.1/cmsj12/index.php?option=com_comprofiler&amp;task=userProfile&amp;user=98&amp;Itemid=5">

</tr><tr>
<td valign='top'>
<a href="http://192.168.0.1/cmsj12/index.php?option=com_comprofiler&amp;task=userProfile&amp;user=62&amp;Itemid=5">

<td valign='top'>
<a href="http://192.168.0.1/cmsj12/index.php?option=com_comprofiler&amp;task=userProfile&amp;user=97&amp;Itemid=5">

<td valign='top'>
<a href="http://192.168.0.1/cmsj12/index.php?option=com_comprofiler&amp;task=userProfile&amp;user=96&amp;Itemid=5">

</tr><tr>
<tr class="sectiontableentry1"><td colspan="1"></td></tr> </table>
<!-- <hr size="1" /> -->
<div style="width:100%;text-align:center;"><span class="pagenav">&lt;&lt; Start</span> <span class="pagenav">&lt; Prev</span>
<span class="pagenav">[1]</span> <span class="pagenav">Next &gt;</span> <span class="pagenav">End &gt;&gt;</span></div>

</td>
</tr>
</table>

And also in
else {
$colsNbr = 1+($row->col2enabled ? 1:0)+($row->col3enabled ? 1:0)+($row->col4enabled ? 1:0);
//echo "\t<tr class=\"sectiontableentry1\"><td colspan=\"".$colsNbr."\"></td></tr>";
}

i delete the red txt bec its create new row....

Do you think it will not affect the cb?

Please Log in to join the conversation.

17 years 2 months ago #30568 by zen
Replied by zen on topic Re:userlist with columns

I would like to ask why it create td instead of TR first in the output...


I didn't notice this in my output until now as it didn't affect my layout. Not sure why.

ANd also when i set $oneintwo = $i % 5;
this to 6 and my userlist is only 6 person its create also a new row in the table.....


Make sure your table is wide enough to hold 6 columns or that your columns (images in each column) are narrow enough to stay in the table as one row. You should be able to adjust the table width in your CSS.

i delete the red txt bec its create new row....
Do you think it will not affect the cb?


From my experimenting, the red text did not seem to affect this layout hack either.

Please Log in to join the conversation.

17 years 2 weeks ago #34982 by beuvema
Replied by beuvema on topic Re:userlist with columns
Has anyone tried to change the userlist in CB 1.0.2 ?

I don't seem to be able to find the code as mentiond below in this version :blush:

Please Log in to join the conversation.

16 years 11 months ago #37360 by grafixexpress
Replied by grafixexpress on topic Re:userlist with columns
would be interested in how to do this with the current version of comprofiler as well! Anyone who can tell us how to do this?

Please Log in to join the conversation.

16 years 10 months ago #38113 by tomsawyer1234
Replied by tomsawyer1234 on topic Re:userlist with columns
Can somenone post the modified files to have several columns in CB 1.0.2?

thanks in advance.

Florian

Please Log in to join the conversation.

16 years 10 months ago #38278 by mikko
Replied by mikko on topic Re:userlist with columns
I have coded a multiple row version of userlists for CB and gave the code to beat to be included in the next version of CB. If the code does not make it to the CB core, I will release it myself under GPL.

mikko

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.284 seconds

Facebook Twitter LinkedIn