Alternative display for memberlist

13 years 8 months ago #9410 by hermanandp
A site I am building for my wife required a memberlist to be displayed as an array of images as is achieved on myspace, faceparty etc. Instead of displaying as a single list this hack will display images in a 3x5 table.

1. locate file- comprofiler.html
2. locate the area-
/******************************
List Functions
******************************/
3. within this find the code-


[code:1]
<?php
$i = 1;
foreach($users as $user) {
$evenodd = $i % 2;
if ($evenodd == 0) {
$class = "sectiontableentry1";
} else {
$class = "sectiontableentry2";
}
//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 "\t<tr class=\"$class\" ".$style." ".$onclick.">\n";
//print $lfields;
$str = null;
eval("\$str = \"$lfields\";"«»);
echo $str. "\n";


print "\t</tr>\n";
$i++;
}
?>
[/code:1]

and replace it with-
[code:1]
<tr>
<?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";



$oneinthree = $i % 3;
if ($oneinthree == 0) {
print "\t</tr><tr>\n";
$endofrow= 1;
}

$i++;


}

if ($endofrow == 0) {
print "\t</tr>\n";
}


?>
[/code:1]

when setting up the list (list management) do so as a single column and in community builder-configuraton-user list set the number of users to a multiple of 3 eg 12,15 or 18

for 4 columns of members profiles

replace

[code:1]$oneinthree = $i % 3;
if ($oneinthree == 0) {
print "\t</tr><tr>\n";
$endofrow= 1;
}
[/code:1]

with

[code:1]$oneinfour = $i % 4;
if ($oneinfour == 0) {
print "\t</tr><tr>\n";
$endofrow= 1;
}
[/code:1]
13 years 7 months ago #9817 by Red1000
Works great, thank you very much! I am displaying five columns, and wanted to know how to center the entire listing and add some padding... right now it appears somewhat left justified, thanks!

Post edited by: Red1000, at: 2006/04/07 09:27

Joomla 1.0.8 + CB Stable
13 years 7 months ago #9833 by damiendownload
How would i remove things like

Username:
and Status:

? I have found the language file and removed the text but the ":" still remains.
13 years 7 months ago #9851 by Red1000
In your joomla cb administrator options you can turn "titles" off in the list options for each column.

Joomla 1.0.8 + CB Stable
13 years 7 months ago #9852 by Red1000
I was also curious about how joomloapolis was making their lists look so nice... as far as where you would place the css style, etc.

Post edited by: Red1000, at: 2006/04/07 20:59

Joomla 1.0.8 + CB Stable
13 years 7 months ago #9900 by mediaguru
Can we see your site or a site with this feature implemented? I'd love to do this.

CB/Joomla golf site: www.thegolfspace.com
Geek/joomla site: www.tkserver.com

Check out my Joomla/CB projects:

* LIKE thumbs up system for "liking" content items
* Karma - CB user rating system
* Golf Score Tracker
* Jitter - status update system. "What's on your mind?"
* CB Author Plug - Shows CB author link and avatar in content items. J1.5 compatible and very customizable!

Found on my web site or in the Joomlapolis Directory !
Moderators: beatnantkrileon
Time to create page: 0.446 seconds
Facebook Twitter Google LinkedIn