Send message using set account. (develping, need help)

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
smileymattj
Registered User
Posts: 7
Joined: Wed Dec 12, 2007 1:54 am

Send message using set account. (develping, need help)

Post by smileymattj » Wed Dec 12, 2007 9:57 pm

My goal is to be able to send PM's or post messages using an account other than the user's.
This will be set by group permissions.
I have a account named Admin, with user_id 31

so far i am working on the privmsg, just to get it working.

check box i created in posting_body.tpl
<input type="checkbox" name="admin_send" {ADMIN_SEND} />

in privmsg.php i have:

$admin_send = !empty($HTTP_POST_VARS['admin_send']) ? $HTTP_POST_VARS['admin_send'] : "";


if ($userdata['user_level'] == ADMIN && $admin_send = 1)
{
$userdata['user_id'] = 31;
}

this works but it does not return the checkbox value form the template file properly.

User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Send message using set account. (develping, need help)

Post by A_Jelly_Doughnut » Thu Dec 13, 2007 3:51 am

This should be a comparison operator, not an assignment operator:

Code: Select all

$admin_send = 1
That is, it should be

Code: Select all

if ($userdata['user_level'] == ADMIN && $admin_send == 1) 
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish

smileymattj
Registered User
Posts: 7
Joined: Wed Dec 12, 2007 1:54 am

Re: Send message using set account. (develping, need help)

Post by smileymattj » Fri Dec 14, 2007 12:01 am

thanks jelly, that has got it checking the admin_send variable correctly now.

But i don't think my code for checking the status of the check box is correct. Should i be using GET?

User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Send message using set account. (develping, need help)

Post by A_Jelly_Doughnut » Fri Dec 14, 2007 1:46 am

Normally "isset" is used instead of "!empty" ... if the rest of your data is in $HTTP_POST_VARS, then the checkbox is there too :)
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish

Post Reply

Return to “[2.0.x] MOD Writers Discussion”