Jump to content
MakeWebGames

Recommended Posts

  • 1 month later...
Posted

if u want to add field to users do this: (not using mccodes so bare with me)

add field

[mysql]ALTER TABLE `users` ADD `mailingto` INT NOT NULL [/mysql]

in mailbox.php in the send case add this where

$db->query("UPDATE `users` SET `mailingto`='{$_GET['to']}' WHERE userid='{$userid}'");

 

in header.php where ever you want it to display add

 

$mtomeqr=$db->query("SELECT `username`,`userid` FROM `users` WHERE `mailingto`={$userid}");
if($db-num_rows($mtomeqr))
{
echo "Users composing mail to you:";
while($mtome=$db->fetch_row($mtomeqr))
{
echo "<a href=\"viewuser?u={$mtome['userid']}\">{$mtome['username']},</a>";
}
}

 

there are about 3 more ways i can think of to do this..

and also ways to make it show for multiple users but this is a quick solution

u can also do this using javascript so u dont have to refresh view this

Posted

add this to globals

 

$curruri=$_SERVER['REQUEST_URI'];
if(!preg_match("/\/mailbox?to/",$curruri) { $db->query("UPDATE `users` SET `mailingto`='' WHERE userid='{$userid}'"); }

 

may need to add a slash before the question mark but keep in mind this is not tested i came up with it on the spot

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...