Jump to content
MakeWebGames

2 Questions


POG1

Recommended Posts

is there a way in which i can have staff members names a different colour wherever their name is?

mabe sumin like this

if($r['user)level']==2) { $r['user_level']="<font color='green'>{$r['user_level']}</font>

 

and my other question is, in mailbox how can i change the compose and send functions so the user puts the id of the reciver and now the name...

Link to comment
Share on other sites

Re: 2 Questions

if($r['user_level']==2) print" <font color=red>[username]</font>

else

}

print" [username]

 

no that is not the right code but that points you in the right direction see if you can work it out ;)

open mailbox.php ctrl+f and search for function_send i think then replace the id to username in there

(my mailbox is different)

Link to comment
Share on other sites

Re: 2 Questions

 

if($r['user_level']==2) print" <font color=red>[username]</font>

else

}

print" [username]

 

no that is not the right code but that points you in the right direction see if you can work it out ;)

open mailbox.php ctrl+f and search for function_send i think then replace the id to username in there

(my mailbox is different)

that was a lot of help

Link to comment
Share on other sites

Re: 2 Questions

Simply put in header.php

if($r['user_level']=2){$r['username']="<font color='COLOR'>".$r['username']."</font>";}
if($r['user_level']=3){.... and so on

 

And mailbox.php for you to type the username in it would be:

if($_POST['user1'] && $_POST['user2'])
{
 die("Please do not select a contact AND enter a username, only do one.

[url='mailbox.php']> Back[/url]");
}
if(!$_POST['user1'] && !$_POST['user2'])
{
 die("You must select a contact or enter a username.

[url='mailbox.php']> Back[/url]");
}
$sendto=($_POST['user1']) ? $_POST['user1'] : $_POST['user2'];
$q=$db->query("SELECT userid FROM users WHERE username='{$sendto}'");
if($db->num_rows($q)==0)
{
 die("You cannot send mail to nonexistant users.

[url='mailbox.php']> Back[/url]");
}
$to=$db->fetch_single($q);
$db->query("INSERT INTO mail VALUES ('',0,$userid,$to,unix_timestamp(),'$subj','$msg')");

 

And for userid it would simply be:

$to= (int) $_POST['userid'];
$db->query("INSERT INTO mail VALUES ('',0,$userid,$to,unix_timestamp(),'$subj','$msg')");
Link to comment
Share on other sites

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...