Hello Guest
No Avatar
Sign In to Remove
Posts: 
15
Reputation: 
2
Posted: August 12, 2011, 5:49 AM
  • Group: Member
Hey there,

I am now writing on a new page for my forum to allow users to register something. I think I know how to make the fields they can tipe in something and it is saved to the MySQL-Database of my forum. But now I want to make it so, that the post automatically gets the users name, like posting in a thread, so a user sends his form and there is automatically filled in his name.

And if possible I would like to make the sended forms only able to be seen in by some administrator of my forum.
To make the thing a little bit clearer:
Posts: 
400
Reputation: 
20
Posted: August 12, 2011, 7:43 AM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
I am not going to do this for you, Just guide you in the right direction...

To get the current user just use:
Code: [Select]
$context['user']['name']
You can find out all the variables in the context by just putting this somewhere in your php code:
Code: [Select]
echo '<pre>';
print_r($context);
echo '</pre>';

You can make your page using these instructions: http://www.simplemachines.org/community/index.php?topic=390247.0

Just include all the content you want to display wrapped in:
Code: [Select]
if ($context['user']['is_admin'])
{

 }
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
15
Reputation: 
2
Posted: August 12, 2011, 2:30 PM
  • Group: Member
Thats allready everything I wanted  :D Thanks for the fast and great help, you made my day the third time allready ;D
Posts: 
400
Reputation: 
20
Posted: August 13, 2011, 12:52 AM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
Thats allready everything I wanted  :D Thanks for the fast and great help, you made my day the third time allready ;D

No Problem!
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
62
Reputation: 
9
Posted: August 13, 2011, 4:30 AM
  • Group: Member
You, my friend deserve a + for that ;)
Posts: 
15
Reputation: 
2
Posted: August 13, 2011, 6:21 AM
  • Group: Member
Thanks for the help! I sucessfully managed to create a page with a form a user can fill out and which is saved to the database. Tomorrow I will start with creating the page where the admin can read those forms. Thanks a lot! (can't repeat that often enough)
Posts: 
400
Reputation: 
20
Posted: August 13, 2011, 6:53 AM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
Thanks for the help! I sucessfully managed to create a page with a form a user can fill out and which is saved to the database. Tomorrow I will start with creating the page where the admin can read those forms. Thanks a lot! (can't repeat that often enough)

No Problem!

agent47 was referring to the + button
<3 Nerve, Sk8, Labradoodle, Austin
anything