userlist with columns

13 years 1 month ago #30553 by mossimo
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&task=userProfile&user=99&Itemid=5"><img src="components/com_comprofiler/plugin/language/default_language/images/tnnophoto.jpg" alt="" style="border-style: none;" /></a></td>

<td valign='top'>
<a href="http://192.168.0.1/cmsj12/index.php?option=com_comprofiler&task=userProfile&user=93&Itemid=5"><img src="images/comprofiler/gallery/butterfly.gif" alt="" style="border-style: none;" /></a></td>

<td valign='top'>
<a href="http://192.168.0.1/cmsj12/index.php?option=com_comprofiler&task=userProfile&user=98&Itemid=5"><img src="components/com_comprofiler/plugin/language/default_language/images/tnnophoto.jpg" alt="" style="border-style: none;" /></a></td>

</tr><tr>
<td valign='top'>
<a href="http://192.168.0.1/cmsj12/index.php?option=com_comprofiler&task=userProfile&user=62&Itemid=5"><img src="images/comprofiler/gallery/redflower.gif" alt="" style="border-style: none;" /></a></td>

<td valign='top'>
<a href="http://192.168.0.1/cmsj12/index.php?option=com_comprofiler&task=userProfile&user=97&Itemid=5"><img src="components/com_comprofiler/plugin/language/default_language/images/tnnophoto.jpg" alt="" style="border-style: none;" /></a></td>

<td valign='top'>
<a href="http://192.168.0.1/cmsj12/index.php?option=com_comprofiler&task=userProfile&user=96&Itemid=5"><img src="images/comprofiler/gallery/frog.gif" alt="" style="border-style: none;" /></a></td>

</tr><tr>
<tr class="sectiontableentry1"><td colspan="1"></td></tr> </table>
<!-- <hr size="1" /> -->
<div style="width:100%;text-align:center;"><span class="pagenav"><< Start</span> <span class="pagenav">< Prev</span>
<span class="pagenav">[1]</span> <span class="pagenav">Next ></span> <span class="pagenav">End >></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>";
}
[/color]
i delete the red txt bec its create new row....

Do you think it will not affect the cb?
13 years 1 month ago #30568 by zen

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.
12 years 11 months ago #34982 by beuvema
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:
12 years 10 months ago #37360 by grafixexpress
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?
12 years 10 months ago #38113 by tomsawyer1234
Can somenone post the modified files to have several columns in CB 1.0.2?

thanks in advance.

Florian
12 years 10 months ago #38278 by mikko
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
Moderators: beatnantkrileon
Time to create page: 0.442 seconds

Facebook Twitter LinkedIn