UBB.Dev
Posted By: dman_dup1 email a moderator in a custom pal box - 10/25/2003 2:26 AM
I would like to make a custom pal box with each moderators name in it so when a user clicks on the name, it brings up an email page to that person. I have 6.4b1 with the IIP. Any ideas on what to type in there? Thanks.
Posted By: omegatron Re: email a moderator in a custom pal box - 10/25/2003 2:43 AM
That is rather an easy thing to do.

You need to query the database and grab all the moderator's and list them in a pal box.

This query would grab all mods names from the database.

SELECT U_Name FROM w3t_Users WHERE U_Groups LIKE '%-2-%'

I am just thinking outloud here

You can then use the suggestions in this post to email a user. There is a link with a very easy explanation on how to use the sendmail function for email with a sample script.

https://www.ubbdev.com/forum/showflat...5/o/all/fpart/1
Posted By: dman_dup1 Re: email a moderator in a custom pal box - 10/25/2003 3:21 AM
Thanks Omegatron. LOL That is WAY over my head. I'll have to hire that one out.
Posted By: omegatron Re: email a moderator in a custom pal box - 10/25/2003 3:53 AM
Okay well the above query would be more like this

SELECT U_Name,U_Email FROM w3t_Users WHERE U_Groups LIKE '%-2-%'

That would grab both Username and Email

You could make it simple and just list username and link an email client to load with the mailto:$email statement

Or the more complex way would be to actually write up a form which would bring up another page to email the mods in a generic mod page.

If you need further assistance you can contact me privately.

Here is an example of a very easy pal box that brings up mod names and a link to email. Things can get alot more complicated from there

<?
echo <<< template

$tbopen
<tr>
<td align="left" class="tdheader">
Email Moderator's
</td>
</tr>

template;

$query = "
SELECT U_Username,U_Email
FROM {$config['tbprefix']}Users
WHERE U_Groups LIKE '%-2-%'
";
$result = mysql_query($query)or die("Query failed");

while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$Mod = $line["U_Username"];
$Email = $line["U_Email"];


echo <<< template

<tr>
<td align="center" class="lighttable">
<a href="mailto:$Email">$Mod</a>
</td>
</tr>

template;

}
mysql_free_result($result);

echo <<< template

$tbclose

template;
?>
Posted By: omegatron Re: email a moderator in a custom pal box - 10/25/2003 12:44 PM
The above in a custompalbox with a few aestetic changes.

Attached File
97786-custombox5pal.txt  (15 downloads)
© UBB.Developers