vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   FORM to THREAD/ FORUM/ POLL/ PM/ EMAIL - CUSTOMIZABLE FORMS - Mod Apps, Orders, News. (https://vborg.vbsupport.ru/showthread.php?t=66082)

the Sandman 01-06-2005 03:29 AM

Quote:

Originally Posted by PKRWUD
Quote:

Originally Posted by Erwin
Replace:

'$formtitle'

in the query with:

'" . addslashes($formtitle) . "'

I'm not terribly bright when it comes to this stuff, and didn't realize that I had to make that change in 3 queries in order for it to work, but I figured it out in a couple minutes. Thanks for taking the time to help! You ROCK!

Thanks again!

Take care,
~Chris

I'm just not getting this. :( Can you tell me exactly what to replace where...

Abe1 01-06-2005 02:33 PM

Quote:

Originally Posted by Erwin
Version 1.6 minor update - added the option to redirect to editpost to upload attachments. Good simple solution provided by alkatraz - saves me from figuring out a way to hack it. ;)

Maybe I should get some credit for it also. I was the one who came up with idea and have been using it since you came up with this hack. alkatraz, just posted the code for it.

Don't worry I don't need the credit. I just wanted to correct you.

Erwin 01-06-2005 08:54 PM

Quote:

Originally Posted by Abe1
Maybe I should get some credit for it also. I was the one who came up with idea and have been using it since you came up with this hack. alkatraz, just posted the code for it.

Don't worry I don't need the credit. I just wanted to correct you.

Oops - I assumed it was alkatraz's idea. I'll fix it.

Abe1 01-06-2005 08:57 PM

Quote:

Originally Posted by Erwin
Oops - I assumed it was alkatraz's idea. I'll fix it.

If you look at his post, he quotes me.

dina 01-06-2005 10:39 PM

I installed this mod tonight, and it worked fine until I wanted to translate the "If yes, please elaborate" on $radioquestion3. First no matter how many times I changed the text it still showed up the same. Then I tried removing the whole "please elaborate" text, but it was still there.

After that I started wondering if it was a browser problem (normally use Opera), so I opened the site in IE, but the page came out blank (did log in and have added it to all templates and permissions are correct). Same thing in Firefox.

Is something cached somewhere or have I completely gone insane?

Here is the link to the form (guest can view it, but it's not in English):

www.akasha.no/modform.php

Here is the modform.php:

Code:

<?php

/*======================================================================*\
|| #################################################################### ||
|| # FORM TO THREAD/ FORUM/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS    # ||
|| # Version 1.6 for vBulletin 3.x.x by Dr Erwin Loh                  # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000–2004 Dr Erwin Loh. All Rights Reserved.          # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| #################################################################### ||
\*======================================================================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

$globaltemplates = array(
        'modform',
        'modformanswers'
);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

globalize($_POST, array(
'normalanswer1' => STR,
'radioanswer1' => STR,
'radioanswer2' => STR,
'radioanswer3' => STR,
'radioanswer3other' => STR,
'answer1' => STR,
'answer2' => STR,
'answer3' => STR,
'longanswer1' => STR,
'action' => STR
));

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array
////////////////////////////////////////////////////////////////////////////////////////////////////

if (!in_array($bbuserinfo['usergroupid'], array(6,7,2,5,1,3,18,11,14,9,10,12,13,16))) print_no_permission();

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF THIS PHP FILE AND TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS!
//You can easily make more forms by just copying this file, renaming it, and modifying the variable in
//this file. You can keep the same templates for different forms. For more customization, you can
//use different templates, by renaming and modifying the templates.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of this file
$phpfilename = "modform.php";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "0";

//FORUM TO POST NEW THREAD IN
$formforumid = "143";

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "0";
$formoption1 = "Yes";
$formoption2 = "No";

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

//ENABLE FORM TO REPLY TO EXISTING THREAD
$formreply = "0";

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

//FORUM ID WHERE THE EXISTING THREAD IS IN
$formreplyforumid = "456";

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

//ENABLE FORM TO BE PMED - 1 = yes, 0 = no
$formpm = "1";

//USERID TO PM TO
$formpmid = "2";

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

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

//EMAIL ADDRESS TO EMAIL TO
$formemailaddress = "admin@akasha.no";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//REDIRECT OPTIONS:
// 0 - thank you message
// 1 - redirect to post
// 2 - redirect to thread
// 3 - redirect to forum
// 4 - redirect to editpost to upload attachments
//
// Feel free to change the thank you message if you choose option 0
////////////////////////////////////////////////////////////////////////////////////////////////////

$redirectoption = "0";

$errormessage = "Takk for at du tok deg tid til ? fylle ut dette skjemaet. Vi vil svare deg s? fort som mulig!"; //This is the thank you message

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "1";

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

$formtitle = "Moderators?knad";

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

$formpurpose = "Her kan du fylle inn din moderators?knad for Akasha Diskusjonsforum. Vennligst fyll inn alle felter nedenfor. Din s?knad vil bli sendt til Mari og vurdert av hele ledelsen.";

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

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

$normalquestion1 = "Fortell oss litt om deg selv";
$normalanswer1 = "";

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

$question1 = "Hvorfor ?nsker du ? bli moderator?";
$answer1 = "";

$question2 = "Hva ?nsker du ? bidra med?";
$answer2 = "";

$question3 = "Hvordan tror du forumet kan forbedres dersom du blir moderator?";
$answer3 = "";

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

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

$radioquestion1 = "Kan du jobbe under stress og kunne ta et valg selv om valget m?ter kritikk?";

// The following choices must NOT have quotation marks
$radiochoice1a = "ja";
$radiochoice1b = "nei";

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

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

$radioquestion2 = "Er du lojal og kan samarbeide med andre, dele ideer og v?re tilgjengelig for m?ter";

// The following choices must NOT have quotation marks
$radiochoice2a = "ja";
$radiochoice2b = "nei";
$radiochoice2c = "delvis";

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

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

$radioquestion3 = "Er du moderator/administrator for andre norske religi?se/alternative forum?";

// The following choices must NOT have quotation marks
$radiochoice3a = "ja";
$radiochoice3b = "nei";

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

$longquestion1 = "Fortell oss litt om deg selv og hvorfor du mener du passer som moderator.";
$longexplain1 = "For eksempel, tidligere erfaring o.l.";

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

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################


// start navbar
$navbits = array(
        "$phpfilename?$session[sessionurl]" => $formtitle
);

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

if ($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();
        }
}

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

    if ($formforum == "1") {
                        $DB_site->query("
                                INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,
                                postusername, postuserid, lastposter, dateline, iconid, visible, attach)
                                VALUES
                                        ('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle', " . TIMENOW . ", $formforumid,
                                        1, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
                                        '" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1,
                                        0)
                        ");
                $thread['threadid'] = $DB_site->insert_id();
                                $DB_site->query("
                        INSERT INTO " . TABLE_PREFIX . "post
                                (threadid, title, username, userid, dateline, pagetext, allowsmilie,
                                showsignature, iconid, visible)
                        VALUES
                                ($thread[threadid], '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
                                '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " . TIMENOW . ",
                                '" . addslashes($formsend) . "', 1, 1,
                                0, 1)
                ");
                $post['postid'] = $DB_site->insert_id();
                $DB_site->query("
                                UPDATE " . TABLE_PREFIX . "thread
                                SET firstpostid = $post[postid]
                                WHERE threadid = $thread[threadid]
                        ");
                $DB_site->query("
                                UPDATE " . TABLE_PREFIX . "forum
                                SET replycount = replycount +  1,
                                threadcount = threadcount + 1,
                                lastpost = " . TIMENOW . ",
                                lastposter = '" . addslashes($bbuserinfo['username']) . "',
                                lastthread = '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
                                lastthreadid = $thread[threadid]
                                WHERE forumid = $formforumid
                        ");
$forum[forumid] = $formforumid;
        }

        if ($formpoll == "1") {
                          $DB_site->query("INSERT INTO " . TABLE_PREFIX . "poll (question,dateline,options,votes,active,numberoptions,timeout,multiple,public) VALUES ('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle'," . TIMENOW . ",'$formoption1|||$formoption2','" . addslashes("0|||0") . "',1,2,0,0,0)");
                        $pollid = $DB_site->insert_id();
                        $DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET pollid = '".$pollid."' WHERE threadid = '".$thread[threadid]."'");
}

    if ($formreply == "1") {
      $DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$formreplythreadid','".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','" . addslashes($formsend) . "','1','1','0','0','1')");
          $DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " . TIMENOW . ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid");
                          $DB_site->query("
                                UPDATE " . TABLE_PREFIX . "forum
                                SET replycount = replycount +  1,
                                lastpost = " . TIMENOW . ",
                                lastposter = '".addslashes(htmlspecialchars($bbuserinfo[username]))."',
                                lastthread = '" . addslashes($bbuserinfo['username']) . " $formtitle',
                                lastthreadid = $formreplythreadid
                                WHERE forumid = $formreplyforumid
                        ");
$forum[forumid] = $formreplyforumid;
    }

if ($formpm == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature)\nVALUES\n\t($bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', '".addslashes(htmlspecialchars($formtitle))."', '".addslashes(htmlspecialchars($formsend))."', '" . addslashes(serialize($tostring)) . "', 0, " . TIMENOW . ", 1)");
$pmtextid = $DB_site->insert_id();
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid, messageread) VALUES ($pmtextid, $formpmid, 0)");
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1 WHERE userid = $formpmid");
    }

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

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

I haven't altered the templates at all.

Any ideas?

Erwin 01-07-2005 12:10 AM

You changed the name of the template but forgot to change this line in form.php:

PHP Code:

eval('print_output("' fetch_template('form') . '");'); 

Hence the blank page.

As for the changing of the variable - it's because the page is blank so your browser cached the old page.

dina 01-07-2005 12:20 AM

Ahhh.. thanks :)

Mythotical 01-11-2005 02:41 AM

Ok too many pages to read but here is my problem, I got radio buttons going across the screen, I need 3 to a line, how can I add a line break and it actually read it with no error?

http://www.malvaria.com/character.php is where its located.

Thanks in advance.
Myth

alkatraz 01-11-2005 02:52 AM

^^^ boo to being lazy

edit the template "form"

HTML Code:

<tr>
<td class="alt2" colspan="3">
<b>$radioquestion2</b>
</td></tr><tr>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2a"> $radiochoice2a </td>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2b"> $radiochoice2b </td>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2c"> $radiochoice2c </td>
</tr>

change it to
HTML Code:

<tr>
<td class="alt2" colspan="3">
<b>$radioquestion2</b>
</td></tr><tr>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2a"> $radiochoice2a </td>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2b"> $radiochoice2b </td>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2c"> $radiochoice2c </td>
</tr>

<tr>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2d"> $radiochoice2d </td>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2e"> $radiochoice2e </td>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2f"> $radiochoice2f </td>
</tr>


It's basic html, just add a new table row instead of trying to squeeze everything into one row.

Mythotical 01-11-2005 03:16 AM

Yeah a friend and me got it figured out. We proud of ourselves for that. hehe


All times are GMT. The time now is 05: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.01649 seconds
  • Memory Usage 1,863KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)bbcode_php_printable
  • (5)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
  • (10)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