Hacking user list

17 years 11 months ago #9244 by hermanandp
Hacking user list was created by hermanandp
I am building a site for my wife and her friends to chat on
anyhow she has decided she would like member lists to be displayed in that array style of images favoured by community sites so before I make this happen in my cack handed way would I be right in asuming that the code to do this is in here-
[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&amp;task=userProfile&amp;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]

Which makes sense to me- if it is the case then I suppose I should be concentrating on [code:1]print "\t</tr>\n";[/code:1]

and making this and the opening TR conditional maybe linked to a count- there seems to be an odd and even thing already going on so that could be useful for 2 columns but maybe I could modify the whole even odd bit since we dont really need the shading done that way to count fours- since my php is ropey I will look at the books before doing this but the pseudocode would run along the lines of testing for a count of say 3 then doing the /tr tr thing.

The snippets I am looking at are in comprofiler.html section

/******************************
List Functions
******************************/

Someone please tell me- am I barking up the right tree with this one- I hate hacking at the codes of others especially from an upgrade perspective but sometimes a man has to do what a man has to do to please she who must be obeyed.

If I am in the right area with this I can move onto the joomlaboard hack she requires because she doesn't like that one bit. Since I ve only moved to joomla a few days ago from nuke/phpbb built sites this is hitting the floor running.

I ve got three or four tasks to complete-
rearranging the forum output and placing an image next to each forum to represent the topic of that forum, flags next to country names in profile (may well prove to be the easiest but we ll see)
and the displaying lists one, I had a feeling the lists one would be the toughest but I have a feeling I m onto something already. Just wanted to gauge the views of others on this.

Have a nice day,
herman

:woohoo:

Please Log in to join the conversation.

17 years 11 months ago #9274 by hermanandp
Replied by hermanandp on topic Could someone look over code for me.
I am not in the position to test this out at present but it sort of looks right:

[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&amp;task=userProfile&amp;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]

To replace the code I quoted in post above, I was wondering if someone could take a quick look over it for me to see if it is right.

The thinking is that this modified code will arrange profiles into a table 3 users accross in lists.

$oneinthree should test if three members have been displayed in list before starting a new table row.

$endofrow is hopefully a test to see if a tr is open and therefore need closing at the end of page.

Unfortunatley I am not in a position to test this to see if it works, so feedback would be appreciated,


The snippets I am looking at are in comprofiler.html section

/******************************
List Functions
******************************/

regards
herman :woohoo:

Please Log in to join the conversation.

17 years 11 months ago #9275 by hermanandp
Replied by hermanandp on topic Re:Hacking user list
Ok I ve tested this and it works, it needs a bit of prettifying in the tables to space it out a bit better but the maths seem sound.

So to produce user lists displayed as an array of images, the above hack will do it.

have a nice day
herman :woohoo:

Please Log in to join the conversation.

17 years 10 months ago #13356 by animas
Replied by animas on topic Re:Hacking user list
Will it show userlists in multiple(2) column?

Please Log in to join the conversation.

17 years 7 months ago #19772 by bennieblanco
Replied by bennieblanco on topic Re:Hacking user list
I get
Parse error: syntax error, unexpected T_STRING in /home/nocniage/public_html/cb/components/com_comprofiler/comprofiler.html.php on line 822 that is this line

eval("\$str = \"$lfields\";"«»);



when I add the hack
can you please place the whole code

thnx

Post edited by: bennieblanco, at: 2006/08/29 04:01

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.192 seconds

Facebook Twitter LinkedIn