كود PHP:
[b]$formname = "form";[/b]
[b]if ($_REQUEST['do'] == $formname)[/b]
[b]{[/b]
[b]$vbulletin->input->clean_array_gpc('p', array([/b]
[b]'normalanswer1' => STR,[/b]
[b]'radioanswer1' => STR,[/b]
[b]'radioanswer2' => STR,[/b]
[b]'radioanswer3' => STR,[/b]
[b]'radioanswer3other' => STR,[/b]
[b]'answer1' => STR,[/b]
[b]'answer2' => STR,[/b]
[b]'answer3' => STR,[/b]
[b]'longanswer1' => STR,[/b]
[b]'action' => STR[/b]
[b]));[/b]
[b]$normalanswer1 =& $vbulletin->GPC['normalanswer1'];[/b]
[b]$radioanswer1 =& $vbulletin->GPC['radioanswer1'];[/b]
[b]$radioanswer2 =& $vbulletin->GPC['radioanswer2'];[/b]
[b]$radioanswer3 =& $vbulletin->GPC['radioanswer3'];[/b]
[b]$radioanswer3other =& $vbulletin->GPC['radioanswer3other'];[/b]
[b]$answer1 =& $vbulletin->GPC['answer1'];[/b]
[b]$answer2 =& $vbulletin->GPC['answer2'];[/b]
[b]$answer3 =& $vbulletin->GPC['answer3'];[/b]
[b]$longanswer1 =& $vbulletin->GPC['longanswer1'];[/b]
[b]// #######################################################################[/b]
[b]// ######################## CUSTOMIZE VARIABLES ##########################[/b]
[b]// #######################################################################[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]////// BEGIN CUSTOMIZATION BELOW////////////////////////////////////////////////////////////////////[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//USERGROUPS ALLOWED[/b]
[b]//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array.[/b]
[b]//You may remove this feature by adding a '//' before the 'if'.[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b] if (!in_array($vbulletin->userinfo['usergroupid'], array(2,5,6,7))) print_no_permission();[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//NAME OF TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS أسماء القوالب - إستخدم هذه القوالب إذا كنت إضافة أكثر من فورم[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]// Name of the main template[/b]
[b]$maintemplate = "form";[/b]
[b]// Name of the answer template[/b]
[b]$answertemplate = "formanswers";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//CHOOSE WHETHER YOU WANT FORM TO BE POSTED IN A NEW THREAD, NEW POLL, REPLY TO EXISITING THREAD, PMed OR EMAILED[/b]
[b]//خيارات إضافة الطلبات في موضوع جديد ، تصويت ، مشاركة على موضوع ، رسالة خاصة ، أو رسالة بريدية[/b]
[b]///////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//ENABLE FORM TO BE POSTED - 1 = yes, 0 = no لتفعيل الفورم 1 = نعم ، 0 = لا[/b]
[b]$formforum = "0";[/b]
[b]//FORUM TO POST NEW THREAD IN حدد رقم القسم المراد اضافة الموضوع فيه. فم بالتغيير على الرقه 14 الى رقم القسم المراد[/b]
[b]$formforumid = "14";[/b]
[b]//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no غير الرقم الى 1 اذا كنت تريد تفعيل التصويت[/b]
[b]$formpoll = "0";[/b]
[b]$polloption[1] = "نعم";[/b]
[b]$polloption[2] = "لا";[/b]
[b]$polloption[3] = "ربما";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//ENABLE FORM TO REPLY TO EXISTING THREAD - 1 = yes, 0 = no غير الرقم الى 1 اذا كنت تريد الطلب يضاف الى موضوع[/b]
[b]$formreply = "0";[/b]
[b]//EXISTING THREAD ID FOR FORM TO REPLY IN حدد الموضوع الذي تريد الطلب يضاف اليها[/b]
[b]$formreplythreadid = "12345";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//ENABLE FORM TO BE PMED - 1 = yes, 0 = no لإرسال الطلبات على الرسائل الخاصه غير الرقم الى 1[/b]
[b]$formpm = "1";[/b]
[b]//USERNAME TO PM TO اكتب اسم العضو الذي تريد تصل اليه الطلبات[/b]
[b]$formpmname = "Casper";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//ENABLE FORM TO BE EMAILED - 1 = yes, 0 = no غير الرقم الى 1 اذا اردت ارسال الطلبات على البريد[/b]
[b]$formemail = "1";[/b]
[b]//EMAIL ADDRESS TO EMAIL TO حدد الايميل المراد[/b]
[b]$formemailaddress = "C.asper@msn.com";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//REDIRECT OPTIONS: بعد تقديم الطلب ماذا تريد ان تفعل[/b]
[b]// 0 - thank you message (thread, reply, pm, or email) رسالة شكر[/b]
[b]// 1 - redirect to post (thread or reply) الإنتقال الى الموضوع او المشاركه[/b]
[b]// 2 - redirect to thread (thread only) الانتقال الى الموضوع[/b]
[b]// 3 - redirect to forum (thread only) الانتقال الى القسم[/b]
[b]// 4 - redirect to editpost to upload attachments (thread or reply) الانتقال الى الموضوع مع التعديل عليه لإضافة مرفقات[/b]
[b]//[/b]
[b]// Feel free to change the thank you message if you choose option 0[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]$redirectoption = "0";[/b]
[b]$errormessage = "شكراً لك لتقيدم طلب الاشراف للنهوض بشبكة ومنتديات صباحو. وستقوم الإدارة بمراسلتك قريباً."; //This is the thank you message[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no غير الرقم الى 1 اذا اردت فرض اجابة جميع الاسئلة[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]$answerall = "0";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//TITLE OF FORM (do not use quotation marks or you will get a parse error) عنوان الفورم[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]$formtitle = "ركن طلبات الإشراف";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//TITLE OF THREAD/POST/PM/EMAIL (do not use quotation marks or you will get a parse error)[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]$posttitle = "$formtitle";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//PURPOSE OF FORM (do not use quotation marks or you will get a parse error) شرح للفورم[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]$formpurpose = "هذا الملف تم عمله لإستقبال طلبات الإشراف.";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error) سؤال عام[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]$normalquestion1 = "القسم المراد الإشراف عليه؟";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error) سؤال خياري[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]$radioquestion1 = "الجنس؟";[/b]
[b]// The following choices must NOT have quotation marks[/b]
[b]$radiochoice1a = "ذكر";[/b]
[b]$radiochoice1b = "إنثى";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//RADIO BOX CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error) سؤال خياري بثلاث خيارات[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]$radioquestion2 = "مدة التسجيل؟";[/b]
[b]// The following choices must NOT have quotation marks[/b]
[b]$radiochoice2a = "اسبوع";[/b]
[b]$radiochoice2b = "شهر";[/b]
[b]$radiochoice2c = "سنه";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error) سؤال خياري مع الشرح اذا كانت اجابتك بنعم[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]$radioquestion3 = "هل تستحق الإشراف؟";[/b]
[b]// The following choices must NOT have quotation marks[/b]
[b]$radiochoice3a = "نعم";[/b]
[b]$radiochoice3b = "لا";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//QUESTION 1 (do not use quotation marks or you will get a parse error)[/b]
[b]$question1 = "الإسم الحقيقي؟";[/b]
[b]$explain1 = "هنا اكتب اسمك الحقيقي.";[/b]
[b]//QUESTION 2 (do not use quotation marks or you will get a parse error)[/b]
[b]$question2 = "البريد الشخصي؟";[/b]
[b]$explain2 = "هنا اكتب بريدك الشخصي.";[/b]
[b]//QUESTION 3 (do not use quotation marks or you will get a parse error)[/b]
[b]$question3 = "تأكيد البريد الشخصي؟";[/b]
[b]$explain3 = "اعادة كتابة البريد الاليكتروني.";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]//LONG TEXT AREA INPUT: QUESTION 1 (do not use quotation marks or you will get a parse error)[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]$longquestion1 = "اتكلم عن نفسك وعن خبراتك في القسم المحدد؟";[/b]
[b]$longexplain1 = "هنا اتكلم عن نفسك بما ينفعك للحصول على الإشراف والتغييرات التي تتوقع إحداثها على القسم.";[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]////// END OF CUSTOMIZATION ////////////////////////////////////////////////////////////////////[/b]
[b]///// DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!!! ////////////////////////////////[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]////////////////////////////////////////////////////////////////////////////////////////////////////[/b]
[b]// #######################################################################[/b]
[b]// ######################## START MAIN SCRIPT ############################[/b]
[b]// #######################################################################[/b]
[b]$bbuserinfo = $vbulletin->userinfo;[/b]
[b]// start navbar[/b]
[b]$navbits = array();[/b]
[b]$navbits['newthread.php?' . $vbulletin->session->vars['sessionurl'] . "do=$formname"] = $formtitle;[/b]
[b]$navbits = construct_navbits($navbits);[/b]
[b]eval('$navbar = "' . fetch_template('navbar') . '";');[/b]
[b]if ($vbulletin->GPC['action']=="submit")[/b]
[b]{[/b]
[b] if ($answerall == "1")[/b]
[b] {[/b]
[b] if ($normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == '' OR $radioanswer3 == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $longanswer1 == '')[/b]
[b] {[/b]
[b] $errormessage = "$bbuserinfo[username], you need to answer every question!";[/b]
[b] eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');[/b]
[b] exit();[/b]
[b] }[/b]
[b] }[/b]
[b] eval('$formsend = "' . fetch_template("$answertemplate") . '";');[/b]
[b] if ($formforum == "1")[/b]
[b] {[/b]
[b] $foruminfo = verify_id('forum', $formforumid, 0, 1);[/b]
[b] $forumperms = fetch_permissions($foruminfo[forumid]);[/b]
[b] $newpost['message'] =& $formsend;[/b]
[b] $newpost['title'] =& $posttitle;[/b]
[b] $newpost['parseurl'] = '1';[/b]
[b] $newpost['emailupdate'] = '9999';[/b]
[b] if ($vbulletin->userinfo['signature'] != '')[/b]
[b] {[/b]
[b] $newpost['signature'] = '1';[/b]
[b] }[/b]
[b] else[/b]
[b] {[/b]
[b] $newpost['signature'] = '0';[/b]
[b] }[/b]
[b] build_new_post('thread', $foruminfo, array(), array(), $newpost, $errors);[/b]
[b] if ($formpoll == "1")[/b]
[b] {[/b]
[b] $threadinfo = verify_id('thread', $newpost[threadid], 0, 1);[/b]
[b] $polloptions = count($polloption);[/b]
[b] $question = $posttitle;[/b]
[b] $vbulletin->GPC['options'] = $polloption;[/b]
[b] $counter = 0;[/b]
[b] $optioncount = 0;[/b]
[b] $badoption = '';[/b]
[b] while ($counter++ < $polloptions)[/b]
[b] { // 0..Pollnum-1 we want, as arrays start with 0[/b]
[b] if ($vbulletin->options['maxpolllength'] AND vbstrlen($vbulletin->GPC['options']["$counter"]) > $vbulletin->options['maxpolllength'])[/b]
[b] {[/b]
[b] $badoption .= iif($badoption, ', ') . $counter;[/b]
[b] }[/b]
[b] if (!empty($vbulletin->GPC['options']["$counter"]))[/b]
[b] {[/b]
[b] $optioncount++;[/b]
[b] }[/b]
[b] }[/b]
[b] // Add the poll[/b]
[b] $poll =& datamanager_init('Poll', $vbulletin, ERRTYPE_STANDARD);[/b]
[b] $counter = 0;[/b]
[b] while ($counter++ < $polloptions)[/b]
[b] {[/b]
[b] if ($vbulletin->GPC['options']["$counter"] != '')[/b]
[b] {[/b]
[b] $poll->set_option($vbulletin->GPC['options']["$counter"]);[/b]
[b] }[/b]
[b] }[/b]
[b] $poll->set('question', $question);[/b]
[b] $poll->set('dateline', TIMENOW);[/b]
[b] $poll->set('active', '1');[/b]
[b] $pollid = $poll->save();[/b]
[b] //end create new poll[/b]
[b] // update thread[/b]
[b] $threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_STANDARD, 'threadpost');[/b]
[b] $threadman->set_existing($threadinfo);[/b]
[b] $threadman->set('pollid', $pollid);[/b]
[b] $threadman->save();[/b]
[b] }[/b]
[b] }[/b]
[b] if ($formreply == "1")[/b]
[b] {[/b]
[b] $threadinfo = verify_id('thread', $formreplythreadid, 0, 1);[/b]
[b] $forumperms = fetch_permissions($threadinfo[forumid]);[/b]
[b] $newpost['message'] =& $formsend;[/b]
[b] $newpost['title'] =& $posttitle;[/b]
[b] $newpost['parseurl'] = "1";[/b]
[b] $newpost['emailupdate'] = '9999';[/b]
[b] if ($vbulletin->userinfo['signature'] != '')[/b]
[b] {[/b]
[b] $newpost['signature'] = '1';[/b]
[b] }[/b]
[b] else[/b]
[b] {[/b]
[b] $newpost['signature'] = '0';[/b]
[b] }[/b]
[b] [/b]
[b] build_new_post('reply', $foruminfo, $threadinfo, $postinfo, $newpost, $errors);[/b]
[b] }[/b]
[b] if ($formpm == "1")[/b]
[b] {[/b]
[b] $vbulletin->GPC['message'] =& $formsend;[/b]
[b] $vbulletin->GPC['title'] =& $posttitle;[/b]
[b] $vbulletin->GPC['recipients'] =& $formpmname;[/b]
[b] $pm['message'] =& $vbulletin->GPC['message'];[/b]
[b] $pm['title'] =& $vbulletin->GPC['title'];[/b]
[b] $pm['recipients'] =& $vbulletin->GPC['recipients'];[/b]
[b][/b]
[b] // create the DM to do error checking and insert the new PM[/b]
[b] $pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);[/b]
[b] $pmdm->set('fromuserid', $vbulletin->userinfo['userid']);[/b]
[b] $pmdm->set('fromusername', $vbulletin->userinfo['username']);[/b]
[b] $pmdm->setr('title', $pm['title']);[/b]
[b] $pmdm->setr('message', $pm['message']);[/b]
[b] $pmdm->set_recipients($pm['recipients'], $permissions);[/b]
[b] $pmdm->set('dateline', TIMENOW);[/b]
[b] // everything's good![/b]
[b] $pmdm->save();[/b]
[b] }[/b]
[b] if ($formemail == "1")[/b]
[b] {[/b]
[b] vbmail($formemailaddress, $posttitle, $formsend);[/b]
[b] }[/b]
[b] if ($redirectoption == "1")[/b]
[b] {[/b]
[b] $vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]";[/b]
[b] eval(print_standard_redirect('redirect_postthanks'));[/b]
[b] exit();[/b]
[b] }[/b]
[b] if ($redirectoption == "2")[/b]
[b] {[/b]
[b] $vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t=$newpost[threadid]";[/b]
[b] eval(print_standard_redirect('redirect_postthanks'));[/b]
[b] exit();[/b]
[b] }[/b]
[b] if ($redirectoption == "3")[/b]
[b] {[/b]
[b] $vbulletin->url = 'forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f=$foruminfo[forumid]";[/b]
[b] eval(print_standard_redirect('redirect_postthanks'));[/b]
[b] exit();[/b]
[b] }[/b]
[b] if ($redirectoption == "4")[/b]
[b] {[/b]
[b] $vbulletin->url = 'editpost.php?do=editpost&' . $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]";[/b]
[b] eval(print_standard_redirect('redirect_postthanks'));[/b]
[b] exit();[/b]
[b] }[/b]
[b] eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');[/b]
[b] exit();[/b]
[b]}[/b]
[b]eval('print_output("' . fetch_template("$maintemplate") . '");');[/b]
[b]}[/b]