1
lotus-eater
how to develope a pm (private message) page
  • 2004/8/31 22:25

  • lotus-eater

  • Just popping in

  • Posts: 9

  • Since: 2004/6/8 1


My members wish to have a page listing all registered members. They want the ability to pm users by clicking their name on the page.

Has anyone done this before, or know how to do it?

2
Stewdio
Re: how to develope a pm (private message) page
  • 2004/8/31 22:32

  • Stewdio

  • Community Support Member

  • Posts: 1560

  • Since: 2003/5/7 1


Activate the Memberlist module included with XOOPS. Don't forget about group perms.

3
lotus-eater
Re: how to develope a pm (private message) page
  • 2004/9/1 0:27

  • lotus-eater

  • Just popping in

  • Posts: 9

  • Since: 2004/6/8 1


Right, but how can I display the actual list of members directly without searching.


4
Stewdio
Re: how to develope a pm (private message) page
  • 2004/9/1 0:55

  • Stewdio

  • Community Support Member

  • Posts: 1560

  • Since: 2003/5/7 1


I know it's a rather cumbersome setup as it is right now, but all that needs to be done is to hit the submit button without entering anything in the search fields. You'll then be taken to the members page.

You could add a link to the code that takes the user there by editing the code in the appropriate areas, but I'm not sure where off hand. Some digging around in the module files will reveal some info. Perhaps others may have hacked around a bit and ill post their findings for you.

5
DonXoop
Re: how to develope a pm (private message) page

If you wanted a fancier page you might use a custom query. I have a few I created in Tinycontent. I use it for listing members of special groups.

Here's some code for listing registered members. I didn't put the PM link in there but that is easy to add or the user can PM from the link that appears after they click and view the member's detail page. You would need to edit this to taste and set your database prefix if it isn't "xoops_". This code doesn't account for a large number of records so your page could get very long unless you add some paging code.
Quote:

global $xoopsDB;

$query = 'SELECT A.uid,uname AS U_Name, name AS Full_Name,
user_from AS Location, A.user_yim AS Member
FROM xoops_users AS A
LEFT JOIN xoops_groups_users_link AS B ON A.uid = B.uid
WHERE (
B.groupid =2
)
ORDER BY A.uname
';

$result = mysql_query($query);

echo " <b>· Registered Members ·</b>
If you would like to update your account information you can click on your name and edit your profile.
<br /><hr />";

echo "<table cellpadding=0 border=1><tr>
<th>User Name</th><th>Real Name</th><th>Member #</th><th>Location</th></tr>";

while ($data = mysql_fetch_object($result)) {
echo "<tr>
<td><a href=\"/userinfo.php?uid=$data->uid\">$data->U_Name</a></td>
<td>$data->Full_Name</td>
<td>$data->Member</td>
<td>$data->Location</td>
</tr>";
}
echo "</table>";

6
solo71
Re: how to develope a pm (private message) page
  • 2004/9/1 8:28

  • solo71

  • Module Developer

  • Posts: 941

  • Since: 2003/1/29


I can suggest you to use blockutils, a module gathering some original blocks.

Amongst them, you can have a user list. Check the preferences of the block for options.


7
Sm0ka
Re: how to develope a pm (private message) page
  • 2004/9/1 9:25

  • Sm0ka

  • Just popping in

  • Posts: 41

  • Since: 2003/12/25


I have a sugestion:

u can use XOOPS Brasil GroupShow hack to have ALL ur users listed in a page, with their avatar and the pm icon already showing next to their nickname

GroupShow hack is very easy to use, u can download it HERE and if you have any problems, just drop us a line (english is ok to be used) and we'll help u.

This hack is displayed in a block, so u'll need to specify the block to be shown in a certain page. Again, if you don't know how, XT will guide u.

8
sturgis
Re: how to develope a pm (private message) page
  • 2004/9/4 14:05

  • sturgis

  • Just popping in

  • Posts: 4

  • Since: 2004/8/11


I stole donxoops post and modified it do have pm's listed, as well as a link to yahoo messenger so you can send messages that way if they have an acct. As the previous poster stated, don't used this if you have a ton of users since it has no paging.

If anyone could show me how to modify it to add paging I'd be tickled, but at this time I'm not a good enough programmer to have a clue how to do that.

It shouldn't be too difficult to add an icq online/offline indicator as well as a yahoo one.

Hope this helps someone out

Oh BTW, I am using this with the TinyD module




global $xoopsDB;
$query = 'SELECT A.uid,uname AS U_Name, name AS Full_Name, user_from AS Location, A.user_yim AS Yahoo, A.uid AS User FROM xoops_users AS A LEFT JOIN xoops_groups_users_link AS B ON A.uid = B.uid
WHERE (
B.groupid =2
)
ORDER BY A.uname';

$result = mysql_query($query);
// Top message, and start of table including column heads
echo "<b>· Registered Members ·</b>
<li>Click on your name and edit your profile
<li>Click a yahoo id to send a message<hr />";
echo "<table cellpadding=0 border=0>
<tr>
<th>User Name</th>
<th>Full Name</th>
<th>PM</th>
<th>Yahoo</th>
<th>Location</th>
</tr>";

// loop through the data and echo each cell 1 row per loop
while ($data = mysql_fetch_object($result)) {
echo "<tr ><td><a href=\"/userinfo.php?uid=$data->uid\">$data->U_Name</a></td>";
echo "<td >$data->Full_Name</td>";

// I did the pm part in chunks rather than one big echo because I found it easier to
// see where I left stuff out or screwed things up ;)L.
echo "<td> <a href=\"http://hshs85.cloudy.biz/pmlite.php?send2=1&to_userid=$data->User\" target=_blank";

// This part should degrade nicely. If a user has javascript turned off
// it'll return false and open the window anyway though size may not be default 450 x 380
echo " onclick=\"window.open(this.href,'pms','width=450,height=380');return false;\"";
echo "><img src=\"http://hshs85.cloudy.biz/images/icons/pm.gif\" alt=\"Send Private Message to $data->U_Name\" /></a></td>";

if ($data->Yahoo !="") {
echo "<td ><center><A HREF=\"http://edit.yahoo.com/config/send_webmesg?.target=$data->Yahoo\">
$data->Yahoo</a></center></td>";
}
else {
echo "<td><center>Not Listed</center></td>";
}
if ($data->Location!="") {
echo "<td >$data->Location</td></tr>";
}
else {
echo "<td>Not Listed</td></tr>";
}
}
echo "</table>";

9
sturgis
Re: how to develope a pm (private message) page
  • 2004/9/7 19:11

  • sturgis

  • Just popping in

  • Posts: 4

  • Since: 2004/8/11


If I wanted to use the above script, but modify it so that it only shows certain parts if the viewer is admin, how would I go about that? I'm clueless as far as the auth checks go. An example would do wonders for me!
TIA

Login

Who's Online

218 user(s) are online (170 user(s) are browsing Support Forums)


Members: 0


Guests: 218


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits