vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Forms Hack (https://vborg.vbsupport.ru/showthread.php?t=93970)

forum-il 12-30-2005 01:03 PM

how do i do that the form will be sent to my e-mail addres?

bluesteel 12-30-2005 05:45 PM

Quote:

Originally Posted by Abe1
Yes, it's possable.

Thanks Abe1!
Any hints?
Pretty please :)

steven s 12-31-2005 12:19 AM

Quote:

Originally Posted by forum-il
how do i do that the form will be sent to my e-mail addres?

//EMAIL ADDRESS TO EMAIL TO
$formemailaddress = "email@yourdomain.com";

steven s 12-31-2005 12:20 AM

Quote:

Originally Posted by Bacon Butty
Can anyone tell me how on earth I can edit the questions on the default form?

"edit the main hook"... ok, i got that bit... shame i dont know were the "hook" is??

Edit your form template. It is nothing more than html.

Bluestrike2 12-31-2005 06:21 PM

Cool Hack - but I have a problem - I get this parse error :(

Code:

Parse error: parse error, unexpected T_STRING in /hsphere/local/home/bluestri/mlgpwncast.com/newthread.php(68) : eval()'d code on line 133
Here is my code:
Code:

// To add more then one form, copy this whole text, and creat a new plug-in with the hook location 'newthread_start'.
// After, change the form name. You can't have 2 forms with the same name.

// Name of this form
$formname = "form";

if ($_REQUEST['do'] == $formname)
{

// #######################################################################
// ######################## CUSTOMIZE VARIABLES ##########################
// #######################################################################

////////////////////////////////////////////////////////////////////////////////////////////////////
////// BEGIN CUSTOMIZATION BELOW////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//VARIABLES
//Study how variables are add here to add or remove any. If you add a variable to your form, you must add it to part one and part two.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'normalanswer1' => TYPE_STR,
'radioanswer1' => TYPE_STR,
'radioanswer2' => TYPE_STR,
'radioanswer3' => TYPE_STR,
'radioanswer3other' => TYPE_STR,
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'longanswer1' => TYPE_STR
));

// Part 2
$normalanswer1 = $vbulletin->GPC['normalanswer1'];
$radioanswer1 = $vbulletin->GPC['radioanswer1'];
$radioanswer2 = $vbulletin->GPC['radioanswer2'];
$radioanswer3 = $vbulletin->GPC['radioanswer3'];
$radioanswer3other = $vbulletin->GPC['radioanswer3other'];
$answer1 = $vbulletin->GPC['answer1'];
$answer2 = $vbulletin->GPC['answer2'];
$answer3 = $vbulletin->GPC['answer3'];
$dropdownanswer1 = $vbulletin->GPC['dropdownanswer1'];
$longanswer1 = $vbulletin->GPC['longanswer1'];

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array.
//To enable this feature, remove the '//' before the 'if'.
////////////////////////////////////////////////////////////////////////////////////////////////////

// if (!in_array($vbulletin->userinfo['usergroupid'], array(2,5,6,7))) print_no_permission();

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS AND WANT TO USE A DIFFERENT LOOKING TEMPLATE
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of the main template
$maintemplate = "form";
// Name of the answer template
$answertemplate = "formanswers";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//CHOOSE WHETHER YOU WANT FORM TO BE POSTED IN A NEW THREAD, NEW POLL, REPLY TO EXISITING THREAD, PMed OR EMAILED
///////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE POSTED - 1 = yes, 0 = no
$formforum = "1";

//FORUM TO POST NEW THREAD IN
//You CAN make this number a variable. You can have a drop down menu or in the link like do=form&f=1. Make sure you add it the variables list.
$formforumid = "15";

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "0";
$polloption[1] = "Yes";
$polloption[2] = "No";
$polloption[3] = "Maybe";

//Make poll public - 1 = yes, 0 = no
$pollpublic = "0";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO REPLY TO EXISTING THREAD - 1 = yes, 0 = no
$formreply = "0";

//EXISTING THREAD ID FOR FORM TO REPLY IN
$formreplythreadid = "12345";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE PMED (guests CANNOT use this option) - 1 = yes, 0 = no
$formpm = "0";

//USERNAME TO PM TO
$formpmname = "Abe";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE EMAILED - 1 = yes, 0 = no
$formemail = "0";

//EMAIL ADDRESS TO EMAIL TO
$formemailaddress = "youremail@yourforums.com";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//REDIRECT OPTIONS:
// 0 - thank you message (thread, reply, pm, or email)
// 1 - redirect to post (thread or reply)
// 2 - redirect to thread (thread only)
// 3 - redirect to forum (thread only)
// 4 - redirect to editpost to upload attachments (thread or reply)
//
// Feel free to change the thank you message if you choose option 0
////////////////////////////////////////////////////////////////////////////////////////////////////

$redirectoption = "0";

$Thank you for submiting your video to the MLG PwnCast Hosting Review System, or PHRS.  Because of the immense number of requests the PHRS receives daily we are unable to give you a proper timeframe as to when you will be notified
(via PM) as to whether or not your video was approved (and subsequently chosen by one of our hosting network partners).  Please keep in mind that if you contact the PHRS, or any of its reviewers, during the process that your video
will take longer.  Thank you!"; //This is the thank you message

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
//If you added or deleted variables, you must edit what it checked for. Search for "$answerall ==" and edit 2 lines under it.
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "0";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle = "Request - PwnCast Hosting Review System";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF THREAD/POST/PM/EMAIL (do not use quotation marks in the title or you will get a parse error)
//You may use variables from the form for this.
////////////////////////////////////////////////////////////////////////////////////////////////////

$posttitle = "$bbuserinfo[username] - PHRS Submission";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "The purpose of this form is to allow you to submit a form, and this form will be made into a thread in a particular forum, or be PMed to a moderator or be emailed to a moderator.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion1 = "Video Title";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion1 = "Have you received previous critiques on your video?";

// The following choices must NOT have quotation marks
$radiochoice1a = "Yes";
$radiochoice1b = "No";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion2 = "Is the audio of high quality?";

// The following choices must NOT have quotation marks
$radiochoice2a = "Yes";
$radiochoice2b = "No";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion3 = "Is the video of high quality?";

// The following choices must NOT have quotation marks
$radiochoice3a = "Yes";
$radiochoice3b = "No";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//QUESTION 1 (do not use quotation marks or you will get a parse error)
$question1 = "What is your name?";
$explain1 = "Please enter your real name here.";

//QUESTION 2 (do not use quotation marks or you will get a parse error)
$question2 = "What is your email?";
$explain2 = "Please enter your real email here.";

//QUESTION 3 (do not use quotation marks or you will get a parse error)
$question3 = "What is the temporary URL to your video??";
$explain3 = "We recommend using YouHostIt.com";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//DROP DOWN CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$dropdownquestion1 = "What kind of video is this?";

// The following choices must NOT have quotation marks
$dropdownchoice1a = "Montage";
$dropdownchoice1b = "Gameplay";
$dropdownchoice1c = "Misc./Other";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$longquestion1 = "Video Description";
$longexplain1 = "";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//VB TEXT AREA INPUT: You can only have ONE vb text question. (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$vbtextquestion = "Do you have any other questions/comments/concerns?";
$vbtextexplain = "";

////////////////////////////////////////////////////////////////////////////////////////////////
////// END OF CUSTOMIZATION ////////////////////////////////////////////////////////////////////
/////  DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!!! ////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
if ($_REQUEST['action'] == '')
{
  $_REQUEST['action'] = "form";
}


$bbuserinfo = $vbulletin->userinfo;

// start navbar
$navbits = array();
$navbits['newthread.php?' . $vbulletin->session->vars['sessionurl'] . "do=$formname"] = $formtitle;

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

if ($_REQUEST['action'] == "submit")
{

    if ($answerall == "1")
    {
        if ($normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == '' OR $radioanswer3 == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $longanswer1 == '')
        {
            $errormessage = "$bbuserinfo[username], you need to answer every question!";
            eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
            exit();
        }
    }

        $vbulletin->input->clean_array_gpc('p', array(
                'wysiwyg'                        => TYPE_BOOL,
                'message'                        => TYPE_STR
                ));

        if ($vbulletin->GPC['wysiwyg'])
        {
                require_once(DIR . '/includes/functions_wysiwyg.php');
                $vbtextanswer = convert_wysiwyg_html_to_bbcode($vbulletin->GPC['message'], $foruminfo['allowhtml']);
        }
        else
        {
                $vbtextanswer =& $vbulletin->GPC['message'];
        }

    eval('$formsend = "' . fetch_template("$answertemplate") . '";');

    if ($formforum == "1")
    {
        $foruminfo = verify_id('forum', $formforumid, 0, 1);
        $forumperms = fetch_permissions($foruminfo[forumid]);
        $newpost['username'] =& $vbulletin->userinfo['username'];
        $newpost['message'] =& $formsend;
        $newpost['title'] =& $posttitle;
        $newpost['parseurl'] = '1';
        $newpost['emailupdate'] = '9999';

                if ($vbulletin->userinfo['signature'] != '')
                {
                        $newpost['signature'] = '1';
                }
                else
                {
                        $newpost['signature'] = '0';
                }

            build_new_post('thread', $foruminfo, array(), array(), $newpost, $errors);

        if ($formpoll == "1")
        {
            $threadinfo = verify_id('thread', $newpost[threadid], 0, 1);
            $polloptions = count($polloption);
            $question = $posttitle;
            $vbulletin->GPC['options'] = $polloption;

            $counter = 0;
            $optioncount = 0;
            $badoption = '';
            while ($counter++ < $polloptions)
            { // 0..Pollnum-1 we want, as arrays start with 0
                if ($vbulletin->options['maxpolllength'] AND vbstrlen($vbulletin->GPC['options']["$counter"]) > $vbulletin->options['maxpolllength'])
                {
                    $badoption .= iif($badoption, ', ') . $counter;
                }
                if (!empty($vbulletin->GPC['options']["$counter"]))
                {
                    $optioncount++;
                }
            }

            // Add the poll
            $poll =& datamanager_init('Poll', $vbulletin, ERRTYPE_STANDARD);

            $counter = 0;
            while ($counter++ < $polloptions)
            {
                if ($vbulletin->GPC['options']["$counter"] != '')
                {
                    $poll->set_option($vbulletin->GPC['options']["$counter"]);
                }
            }

            $poll->set('question',        $question);
            $poll->set('dateline',        TIMENOW);
            $poll->set('active',        '1');
            $poll->set('public',        $pollpublic);

            $pollid = $poll->save();
            //end create new poll

            // update thread
            $threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_STANDARD, 'threadpost');
            $threadman->set_existing($threadinfo);
            $threadman->set('pollid', $pollid);
            $threadman->save();

        }
    }

    if ($formreply == "1")
    {
        $threadinfo = verify_id('thread', $formreplythreadid, 0, 1);
        $forumperms = fetch_permissions($threadinfo[forumid]);
        $newpost['username'] =& $vbulletin->userinfo['username'];
        $newpost['message'] =& $formsend;
        $newpost['title'] =& $posttitle;
        $newpost['parseurl'] = "1";
        $newpost['emailupdate'] = '9999';

                if ($vbulletin->userinfo['signature'] != '')
                {
                        $newpost['signature'] = '1';
                }
                else
                {
                        $newpost['signature'] = '0';
                }

        build_new_post('reply', $foruminfo, $threadinfo, $postinfo, $newpost, $errors);
    }

    if ($formpm == "1")
    {
        $vbulletin->GPC['message'] =& $formsend;
        $vbulletin->GPC['title'] =& $posttitle;
        $vbulletin->GPC['recipients'] =& $formpmname;

        $pm['message'] =& $vbulletin->GPC['message'];
        $pm['title'] =& $vbulletin->GPC['title'];
        $pm['recipients'] =& $vbulletin->GPC['recipients'];


        // create the DM to do error checking and insert the new PM
        $pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);

        $pmdm->set('fromuserid', $vbulletin->userinfo['userid']);
        $pmdm->set('fromusername', $vbulletin->userinfo['username']);
        $pmdm->setr('title', $pm['title']);
        $pmdm->setr('message', $pm['message']);
        $pmdm->set_recipients($pm['recipients'], $permissions);
        $pmdm->set('dateline', TIMENOW);

        // everything's good!
        $pmdm->save();
    }

        if ($formemail == "1")
    {
        vbmail($formemailaddress, $posttitle, $formsend);
    }

    if ($redirectoption == "1")
    {
        $vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]";
        eval(print_standard_redirect('redirect_postthanks'));
        exit();
    }
    if ($redirectoption == "2")
    {
        $vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t=$newpost[threadid]";
        eval(print_standard_redirect('redirect_postthanks'));
        exit();
    }
    if ($redirectoption == "3")
    {
        $vbulletin->url = 'forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f=$foruminfo[forumid]";
        eval(print_standard_redirect('redirect_postthanks'));
        exit();
    }
    if ($redirectoption == "4")
    {
        $vbulletin->url = 'editpost.php?do=editpost&' . $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]";
        eval(print_standard_redirect('redirect_postthanks'));
        exit();
    }
    eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
    exit();
}

if ($_REQUEST['action'] == 'form')
{
                          // set message box width to usercp size
                        $stylevar['messagewidth'] = $stylevar['messagewidth_usercp'];
                        $dontusewysiwyg = 1;
                        $editorid = construct_edit_toolbar();

  eval('print_output("' . fetch_template("$maintemplate") . '");');
}
}

I appreciate any help you can give me - more than anything you could imagine :D.

jesse 12-31-2005 09:33 PM

want to be able to manage a file like upload a image or a word file etc.

silly rabbit 12-31-2005 09:40 PM

Quote:

Originally Posted by silurius
So anyone have any idea I might be getting "Sorry! This forum is not accepting new posts." when the forum in question has no posting restrictions whatsoever?

Quote:

Originally Posted by silurius
Sorry to keep bumping this. Still wondering if there is anything else I should look at here.

I am reading this for the 1'st time and as I go I suspect the forum you are posting to doesn't allow 'attachments'!!!!

Rabbit

Abe1 12-31-2005 10:31 PM

Quote:

Originally Posted by Bluestrike2
Cool Hack - but I have a problem - I get this parse error :(

Code:

Parse error: parse error, unexpected T_STRING in /hsphere/local/home/bluestri/mlgpwncast.com/newthread.php(68) : eval()'d code on line 133
Here is my code:
Code:

// To add more then one form, copy this whole text, and creat a new plug-in with the hook location 'newthread_start'.
// After, change the form name. You can't have 2 forms with the same name.

// Name of this form
$formname = "form";

if ($_REQUEST['do'] == $formname)
{

// #######################################################################
// ######################## CUSTOMIZE VARIABLES ##########################
// #######################################################################

////////////////////////////////////////////////////////////////////////////////////////////////////
////// BEGIN CUSTOMIZATION BELOW////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//VARIABLES
//Study how variables are add here to add or remove any. If you add a variable to your form, you must add it to part one and part two.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'normalanswer1' => TYPE_STR,
'radioanswer1' => TYPE_STR,
'radioanswer2' => TYPE_STR,
'radioanswer3' => TYPE_STR,
'radioanswer3other' => TYPE_STR,
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'longanswer1' => TYPE_STR
));

// Part 2
$normalanswer1 = $vbulletin->GPC['normalanswer1'];
$radioanswer1 = $vbulletin->GPC['radioanswer1'];
$radioanswer2 = $vbulletin->GPC['radioanswer2'];
$radioanswer3 = $vbulletin->GPC['radioanswer3'];
$radioanswer3other = $vbulletin->GPC['radioanswer3other'];
$answer1 = $vbulletin->GPC['answer1'];
$answer2 = $vbulletin->GPC['answer2'];
$answer3 = $vbulletin->GPC['answer3'];
$dropdownanswer1 = $vbulletin->GPC['dropdownanswer1'];
$longanswer1 = $vbulletin->GPC['longanswer1'];

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array.
//To enable this feature, remove the '//' before the 'if'.
////////////////////////////////////////////////////////////////////////////////////////////////////

// if (!in_array($vbulletin->userinfo['usergroupid'], array(2,5,6,7))) print_no_permission();

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS AND WANT TO USE A DIFFERENT LOOKING TEMPLATE
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of the main template
$maintemplate = "form";
// Name of the answer template
$answertemplate = "formanswers";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//CHOOSE WHETHER YOU WANT FORM TO BE POSTED IN A NEW THREAD, NEW POLL, REPLY TO EXISITING THREAD, PMed OR EMAILED
///////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE POSTED - 1 = yes, 0 = no
$formforum = "1";

//FORUM TO POST NEW THREAD IN
//You CAN make this number a variable. You can have a drop down menu or in the link like do=form&f=1. Make sure you add it the variables list.
$formforumid = "15";

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "0";
$polloption[1] = "Yes";
$polloption[2] = "No";
$polloption[3] = "Maybe";

//Make poll public - 1 = yes, 0 = no
$pollpublic = "0";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO REPLY TO EXISTING THREAD - 1 = yes, 0 = no
$formreply = "0";

//EXISTING THREAD ID FOR FORM TO REPLY IN
$formreplythreadid = "12345";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE PMED (guests CANNOT use this option) - 1 = yes, 0 = no
$formpm = "0";

//USERNAME TO PM TO
$formpmname = "Abe";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE EMAILED - 1 = yes, 0 = no
$formemail = "0";

//EMAIL ADDRESS TO EMAIL TO
$formemailaddress = "youremail@yourforums.com";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//REDIRECT OPTIONS:
// 0 - thank you message (thread, reply, pm, or email)
// 1 - redirect to post (thread or reply)
// 2 - redirect to thread (thread only)
// 3 - redirect to forum (thread only)
// 4 - redirect to editpost to upload attachments (thread or reply)
//
// Feel free to change the thank you message if you choose option 0
////////////////////////////////////////////////////////////////////////////////////////////////////

$redirectoption = "0";

$Thank you for submiting your video to the MLG PwnCast Hosting Review System, or PHRS.  Because of the immense number of requests the PHRS receives daily we are unable to give you a proper timeframe as to when you will be notified
(via PM) as to whether or not your video was approved (and subsequently chosen by one of our hosting network partners).  Please keep in mind that if you contact the PHRS, or any of its reviewers, during the process that your video
will take longer.  Thank you!"; //This is the thank you message

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
//If you added or deleted variables, you must edit what it checked for. Search for "$answerall ==" and edit 2 lines under it.
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "0";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle = "Request - PwnCast Hosting Review System";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF THREAD/POST/PM/EMAIL (do not use quotation marks in the title or you will get a parse error)
//You may use variables from the form for this.
////////////////////////////////////////////////////////////////////////////////////////////////////

$posttitle = "$bbuserinfo[username] - PHRS Submission";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "The purpose of this form is to allow you to submit a form, and this form will be made into a thread in a particular forum, or be PMed to a moderator or be emailed to a moderator.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion1 = "Video Title";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion1 = "Have you received previous critiques on your video?";

// The following choices must NOT have quotation marks
$radiochoice1a = "Yes";
$radiochoice1b = "No";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion2 = "Is the audio of high quality?";

// The following choices must NOT have quotation marks
$radiochoice2a = "Yes";
$radiochoice2b = "No";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion3 = "Is the video of high quality?";

// The following choices must NOT have quotation marks
$radiochoice3a = "Yes";
$radiochoice3b = "No";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//QUESTION 1 (do not use quotation marks or you will get a parse error)
$question1 = "What is your name?";
$explain1 = "Please enter your real name here.";

//QUESTION 2 (do not use quotation marks or you will get a parse error)
$question2 = "What is your email?";
$explain2 = "Please enter your real email here.";

//QUESTION 3 (do not use quotation marks or you will get a parse error)
$question3 = "What is the temporary URL to your video??";
$explain3 = "We recommend using YouHostIt.com";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//DROP DOWN CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$dropdownquestion1 = "What kind of video is this?";

// The following choices must NOT have quotation marks
$dropdownchoice1a = "Montage";
$dropdownchoice1b = "Gameplay";
$dropdownchoice1c = "Misc./Other";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$longquestion1 = "Video Description";
$longexplain1 = "";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//VB TEXT AREA INPUT: You can only have ONE vb text question. (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$vbtextquestion = "Do you have any other questions/comments/concerns?";
$vbtextexplain = "";

////////////////////////////////////////////////////////////////////////////////////////////////
////// END OF CUSTOMIZATION ////////////////////////////////////////////////////////////////////
/////  DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!!! ////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
if ($_REQUEST['action'] == '')
{
  $_REQUEST['action'] = "form";
}


$bbuserinfo = $vbulletin->userinfo;

// start navbar
$navbits = array();
$navbits['newthread.php?' . $vbulletin->session->vars['sessionurl'] . "do=$formname"] = $formtitle;

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

if ($_REQUEST['action'] == "submit")
{

    if ($answerall == "1")
    {
        if ($normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == '' OR $radioanswer3 == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $longanswer1 == '')
        {
            $errormessage = "$bbuserinfo[username], you need to answer every question!";
            eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
            exit();
        }
    }

        $vbulletin->input->clean_array_gpc('p', array(
                'wysiwyg'                        => TYPE_BOOL,
                'message'                        => TYPE_STR
                ));

        if ($vbulletin->GPC['wysiwyg'])
        {
                require_once(DIR . '/includes/functions_wysiwyg.php');
                $vbtextanswer = convert_wysiwyg_html_to_bbcode($vbulletin->GPC['message'], $foruminfo['allowhtml']);
        }
        else
        {
                $vbtextanswer =& $vbulletin->GPC['message'];
        }

    eval('$formsend = "' . fetch_template("$answertemplate") . '";');

    if ($formforum == "1")
    {
        $foruminfo = verify_id('forum', $formforumid, 0, 1);
        $forumperms = fetch_permissions($foruminfo[forumid]);
        $newpost['username'] =& $vbulletin->userinfo['username'];
        $newpost['message'] =& $formsend;
        $newpost['title'] =& $posttitle;
        $newpost['parseurl'] = '1';
        $newpost['emailupdate'] = '9999';

                if ($vbulletin->userinfo['signature'] != '')
                {
                        $newpost['signature'] = '1';
                }
                else
                {
                        $newpost['signature'] = '0';
                }

            build_new_post('thread', $foruminfo, array(), array(), $newpost, $errors);

        if ($formpoll == "1")
        {
            $threadinfo = verify_id('thread', $newpost[threadid], 0, 1);
            $polloptions = count($polloption);
            $question = $posttitle;
            $vbulletin->GPC['options'] = $polloption;

            $counter = 0;
            $optioncount = 0;
            $badoption = '';
            while ($counter++ < $polloptions)
            { // 0..Pollnum-1 we want, as arrays start with 0
                if ($vbulletin->options['maxpolllength'] AND vbstrlen($vbulletin->GPC['options']["$counter"]) > $vbulletin->options['maxpolllength'])
                {
                    $badoption .= iif($badoption, ', ') . $counter;
                }
                if (!empty($vbulletin->GPC['options']["$counter"]))
                {
                    $optioncount++;
                }
            }

            // Add the poll
            $poll =& datamanager_init('Poll', $vbulletin, ERRTYPE_STANDARD);

            $counter = 0;
            while ($counter++ < $polloptions)
            {
                if ($vbulletin->GPC['options']["$counter"] != '')
                {
                    $poll->set_option($vbulletin->GPC['options']["$counter"]);
                }
            }

            $poll->set('question',        $question);
            $poll->set('dateline',        TIMENOW);
            $poll->set('active',        '1');
            $poll->set('public',        $pollpublic);

            $pollid = $poll->save();
            //end create new poll

            // update thread
            $threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_STANDARD, 'threadpost');
            $threadman->set_existing($threadinfo);
            $threadman->set('pollid', $pollid);
            $threadman->save();

        }
    }

    if ($formreply == "1")
    {
        $threadinfo = verify_id('thread', $formreplythreadid, 0, 1);
        $forumperms = fetch_permissions($threadinfo[forumid]);
        $newpost['username'] =& $vbulletin->userinfo['username'];
        $newpost['message'] =& $formsend;
        $newpost['title'] =& $posttitle;
        $newpost['parseurl'] = "1";
        $newpost['emailupdate'] = '9999';

                if ($vbulletin->userinfo['signature'] != '')
                {
                        $newpost['signature'] = '1';
                }
                else
                {
                        $newpost['signature'] = '0';
                }

        build_new_post('reply', $foruminfo, $threadinfo, $postinfo, $newpost, $errors);
    }

    if ($formpm == "1")
    {
        $vbulletin->GPC['message'] =& $formsend;
        $vbulletin->GPC['title'] =& $posttitle;
        $vbulletin->GPC['recipients'] =& $formpmname;

        $pm['message'] =& $vbulletin->GPC['message'];
        $pm['title'] =& $vbulletin->GPC['title'];
        $pm['recipients'] =& $vbulletin->GPC['recipients'];


        // create the DM to do error checking and insert the new PM
        $pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);

        $pmdm->set('fromuserid', $vbulletin->userinfo['userid']);
        $pmdm->set('fromusername', $vbulletin->userinfo['username']);
        $pmdm->setr('title', $pm['title']);
        $pmdm->setr('message', $pm['message']);
        $pmdm->set_recipients($pm['recipients'], $permissions);
        $pmdm->set('dateline', TIMENOW);

        // everything's good!
        $pmdm->save();
    }

        if ($formemail == "1")
    {
        vbmail($formemailaddress, $posttitle, $formsend);
    }

    if ($redirectoption == "1")
    {
        $vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]";
        eval(print_standard_redirect('redirect_postthanks'));
        exit();
    }
    if ($redirectoption == "2")
    {
        $vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t=$newpost[threadid]";
        eval(print_standard_redirect('redirect_postthanks'));
        exit();
    }
    if ($redirectoption == "3")
    {
        $vbulletin->url = 'forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f=$foruminfo[forumid]";
        eval(print_standard_redirect('redirect_postthanks'));
        exit();
    }
    if ($redirectoption == "4")
    {
        $vbulletin->url = 'editpost.php?do=editpost&' . $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]";
        eval(print_standard_redirect('redirect_postthanks'));
        exit();
    }
    eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
    exit();
}

if ($_REQUEST['action'] == 'form')
{
                          // set message box width to usercp size
                        $stylevar['messagewidth'] = $stylevar['messagewidth_usercp'];
                        $dontusewysiwyg = 1;
                        $editorid = construct_edit_toolbar();

  eval('print_output("' . fetch_template("$maintemplate") . '");');
}
}

I appreciate any help you can give me - more than anything you could imagine :D.

The thank you message is not in quotes.

ChrisBaktis 01-01-2006 12:17 AM

I have a form set to post as a thread - im trying to have the members name (member that is filling out the form) appear in the title of the thread that is posted. However when I put $bbuserinfo[username] in the $posttitle field it doesnt show...any suggestions?

Abe1 01-01-2006 05:25 AM

Quote:

Originally Posted by ChrisBaktis
I have a form set to post as a thread - im trying to have the members name (member that is filling out the form) appear in the title of the thread that is posted. However when I put $bbuserinfo[username] in the $posttitle field it doesnt show...any suggestions?

use $vbulletin->userinfo[username]

ChrisBaktis 01-01-2006 01:45 PM

this is the code I used:

PHP Code:

$vbulletin->userinfo[username] / $normalanswer1 

This is the result

Array[username] / bruins

bruins is the $normalanswer 1 so that works fine.

Abe1 01-01-2006 01:57 PM

Quote:

Originally Posted by ChrisBaktis
this is the code I used:

PHP Code:

$vbulletin->userinfo[username] / $normalanswer1 

This is the result

Array[username] / bruins

bruins is the $normalanswer 1 so that works fine.

add to the line before,
$bbuserinfo = $vbulletin->userifo;
now, you can use $bbuserinfo[usergroup]

ChrisBaktis 01-01-2006 02:39 PM

sorry about being a noob but you have me lost on this...

$bbuserinfo = $vbulletin->userinfo; <<-- is already in the main script area of the form

but in your last post you are now saying use $bbuserinfo[usergroup] and Im not sure why....

This is the code I have tried and the result:

$bbuserinfo <<---- results in a blank post title

$vbulletin->userinfo <<-- results in Array[username]

your post was confusing as what to add and to where.

Abe1 01-01-2006 06:21 PM

Quote:

Originally Posted by ChrisBaktis
sorry about being a noob but you have me lost on this...

$bbuserinfo = $vbulletin->userinfo; <<-- is already in the main script area of the form

but in your last post you are now saying use $bbuserinfo[usergroup] and Im not sure why....

This is the code I have tried and the result:

$bbuserinfo <<---- results in a blank post title

$vbulletin->userinfo <<-- results in Array[username]

your post was confusing as what to add and to where.

Use $bbuserinfo[username] but on the line right above add this: $bbuserinfo = $vbulletin->userinfo;

ChrisBaktis 01-01-2006 09:28 PM

Thank you

futuregizmo 01-01-2006 10:40 PM

noob question, would this work with ver 3.5.0 or would i need to upgrade to 3.5.2 to use this hack?

steven s 01-01-2006 10:51 PM

Quote:

Originally Posted by futuregizmo
noob question, would this work with ver 3.5.0 or would i need to upgrade to 3.5.2 to use this hack?

Redundant question as you should update to 3.5.2 regardless. ;)

Abe1 01-01-2006 11:28 PM

Quote:

Originally Posted by futuregizmo
noob question, would this work with ver 3.5.0 or would i need to upgrade to 3.5.2 to use this hack?

yes, It should work with 3.5.0

futuregizmo 01-02-2006 12:18 AM

Quote:

Originally Posted by 1996 328ti
Redundant question as you should update to 3.5.2 regardless. ;)

naah, not thinking of doing so yet, since some hacks installed in my site are not compatible with 3.5.2 and i can't afford to lose them. ;)

Oreamnos 01-02-2006 12:34 AM

great looking plugin.

one question: is it possible to insert the form submitted by the user into a specific forum DEPENDING on what drop down box option is selected?

Example:
1. I have 3 forums: Canada, America & Mexico

2. The user selects 'America' from the drop down box.

3. The user's post is posted in the 'America' forum.

I hope that make sense.

Is this possible?

Thanks
eric

rip9001 01-02-2006 04:48 AM

hey, installed it works great

1 question: What do i have to do to get this form to come up when sombody tries to create a new thread in a certain section (eg. forumid: 55)

I had a look through both forumdisplay.php and newthread.php but im still kind of a newb at this

Oreamnos 01-02-2006 05:02 AM

You might have to create a new style and then change the link to newthread.php to something like this: forum/newthread.php?do=newthread&f=55&do=form

Nikke 01-02-2006 11:16 AM

How do I create double templates for two different types of forms? I did manage to do the plugin part where you had to copy the plugin, but how will I get two different templates?

ChrisBaktis 01-02-2006 12:47 PM

Quote:

Originally Posted by rip9001
hey, installed it works great

1 question: What do i have to do to get this form to come up when sombody tries to create a new thread in a certain section (eg. forumid: 55)

I had a look through both forumdisplay.php and newthread.php but im still kind of a newb at this

I do this on my site.....you will need to change to locations in the FORUMDISPLAY template....

This appears in two spots....im nost sure on your style but you will see what I have changed and you should be able to find it in your template...

Code:

<td class="smallfont"><if condition="$show['newthreadlink']  and $foruminfo[forumid] <> '36'"><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else /><a href="http://rustysoaptraders.com/forums/newthread.php?do=tradeform"><font size="2">Post A Trade</font></a></if></td>
What this code above does is leave the 'New Thread' link in all the forums except my forum number 36...if it is forum 36 then 'Post A Trade' link shows up and when that is clicked it goes to my form.

Make sure you keep a copy of the original template in case you make an error. Hope this helps.

*** of course I didnt see the Add-On that may do this same thing.

Abe1 01-02-2006 12:48 PM

Quote:

Originally Posted by rip9001
hey, installed it works great

1 question: What do i have to do to get this form to come up when sombody tries to create a new thread in a certain section (eg. forumid: 55)

I had a look through both forumdisplay.php and newthread.php but im still kind of a newb at this

Hack has been made already. Look at the add-ons to this hack.

Abe1 01-02-2006 12:49 PM

Quote:

Originally Posted by Oreamnos
great looking plugin.

one question: is it possible to insert the form submitted by the user into a specific forum DEPENDING on what drop down box option is selected?

Example:
1. I have 3 forums: Canada, America & Mexico

2. The user selects 'America' from the drop down box.

3. The user's post is posted in the 'America' forum.

I hope that make sense.

Is this possible?

Thanks
eric

Yes, it's possable. No, I dont have to time to write it right now. Something to do with the values of a drop down menu.

HaMaDa4eVeR 01-02-2006 04:03 PM

Hello
I got this error message :
Parse error: parse error, unexpected T_STRING in
Quote:

/home/xXx/public_html/vb/newthread.php(68) : eval()'d code on line 3
and when I try to open newthread.php?do=form I will get this error

Quote:

Invalid forum specified. If you followed a valid link, please notify the administrator
althouth everything is right and I changed the formforumid to the my specified forum id ?????

wrang 01-02-2006 04:14 PM

Is it possible to have a attachment in this form hack. if so how do i do

HaMaDa4eVeR 01-02-2006 04:20 PM

Hello
I got this error message when i do new post :

Quote:

Parse error: parse error, unexpected T_STRING in

and when I try to open newthread.php?do=form I will get this error

Quote:

Invalid forum specified. If you followed a valid link, please notify the administrator

althouth everything is right and I changed the formforumid to the my specified forum id ?????

sully02 01-02-2006 05:08 PM

I am getting a similar error, except mine is a T_CONSTANT_ENCAPSED_STRING, and it's on line 29 instead of line 3.
Quote:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/sportsd/public_html/forums/newthread.php(68) : eval()'d code on line 29
I didn't make any PHP code edits, so I'm trying to figure out exactly where I messed up.

steven s 01-02-2006 05:55 PM

Everytime I get that error has been because of my hacking.
Third line?
// Name of this form
$formname = "form"; <-- do you have the semicolon?

Puntoboy 01-02-2006 06:05 PM

am i missing something here??

Edit the main hook - the instructions are all inside the hook itself, in the top half. Follow the instructions carefully!

i went into Edit, then then there isn't much info there. a few blank boxes and thats it.

steven s 01-02-2006 06:14 PM

Quote:

Originally Posted by Puntoboy
am i missing something here??

Edit the main hook - the instructions are all inside the hook itself, in the top half. Follow the instructions carefully!

i went into Edit, then then there isn't much info there. a few blank boxes and thats it.

Hook Location : newthread_start

Puntoboy 01-02-2006 06:16 PM

Quote:

Originally Posted by 1996 328ti
Hook Location : newthread_start

where is that?

steven s 01-02-2006 06:28 PM

Quote:

Originally Posted by Puntoboy
where is that?

ACP->Plugin System->Plugin Manager->Hook Location : newthread_start->Form Hack

Puntoboy 01-02-2006 06:49 PM

thanks, this is quite difficult to edit.

Puntoboy 01-02-2006 06:53 PM

Quote:

Originally Posted by Puntoboy
thanks, this is quite difficult to edit.

i cant get it to edit

http://www.puntosports.co.uk/forums/...do=Application

Puntoboy 01-02-2006 07:00 PM

Quote:

Originally Posted by Puntoboy

it says do not use quotation marks, but there are already quotation marks in every option.

i've added 7 normal questions but only one shows. followed by questions that i deleted from the original template.

rip9001 01-02-2006 07:29 PM

Got it to Work. Great Hack!.

Thanks Abe

Puntoboy 01-02-2006 07:41 PM

can anyone help me?


All times are GMT. The time now is 02:48 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02357 seconds
  • Memory Usage 2,054KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (2)bbcode_php_printable
  • (25)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete