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)

midnightz 06-20-2005 09:14 PM

Hello

I also believe in theory it would be easy to add a browse feature and then it could upload a file (lets say banner) into a directory in forums (ie forums/banners/)

Thank you - this is the last tweak I need for this to be perfect!

jeepinaround 06-20-2005 11:07 PM

Yeah I triple checked everything and no luck so I had to take it off. I didn't really want to as when it was working it was exactly what I needed. To me it seems as though it quit working when I upgraded to 3.0.7. No way to prove it and I am moderate at coding php. I can get around it and see things that I wouldn't have just 1 year ago but still no luck with this mod. Still if anyone has any suggestions please post them as I would love for this to work again. I just needed to make the forum so people could at least post in it.

MrTchMan 06-21-2005 01:15 PM

Quote:

Originally Posted by MrTchMan
I am having a problem. I have set up the form to require all information to be filled in. I was testing it out and if I complete the form it would give me a error message. When I hot the back button the error message stays up and I have to refresh the form before it will come back up and I loose all the information. Any Ideas???

Thanks


Anyone have any ideas?

midnightz 06-21-2005 01:42 PM

Quote:

Originally Posted by MrTchMan
Anyone have any ideas?

On line 137


PHP Code:

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

$answerall "0"

Change 0 to variable 1.

and make sure you have all created fields (lets say answer 9) in form / form answers / and inside the php file and bottom code on line 234 to 235

where it says:

PHP Code:

if ($answerall == "1") {
    if (
$normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == 

etc....

MrTchMan 06-21-2005 02:00 PM

Quote:

Originally Posted by midnightz
On line 137


PHP Code:

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

$answerall "0"

Change 0 to variable 1.

and make sure you have all created fields (lets say answer 9) in form / form answers / and inside the php file and bottom code on line 234 to 235

where it says:

PHP Code:

if ($answerall == "1") {
    if (
$normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == 

etc....

Here is my form.php I have that option checked. It does requre me to fill out all info but when a user doesn't it gives them the error message and when they hit back it doesn't go back. Maybe I am over looking something. THanks in advance

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(
    
'form',
    
'formanswers'
);

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

globalize($_POST, array(
'normalanswer1' => STR,
'answer1' => STR,
'answer2' => STR,
'answer3' => STR,
'answer4' => STR,
'answer5' => STR,
'answer6' => STR,
'answer7' => STR,
'answer8' => STR,
'answer9' => STR,
'answer10' => STR,
'answer11' => 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(2,5,6,7,9,10))) 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 "form.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 "1";

//FORUM TO POST NEW THREAD IN
$formforumid "24";

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

//USERID TO PM TO
$formpmid "1";

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

//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
// 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 "4";

$errormessage "Thank you for submitting this form!"//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 "Trading Post Form";

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

$formpurpose "The purpose of this form is to create a standard way of entering items for sale in the flea market. If you item is not a cell phone please put a N/A in all fields that don't apply to you, and then post all your details in the additional details section";

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

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

$normalquestion1 "What is the title of your thread?";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//QUESTION 1 (do not use quotation marks or you will get a parse error)
$question1 "What is your asking price?";
$explain1 "Please enter a asking price. If it is a trade specify what you are looking for";

//QUESTION 2 (do not use quotation marks or you will get a parse error)
$question2 "What color is the item";
$explain2 "Please enter the color of the item.";

//QUESTION 3 (do not use quotation marks or you will get a parse error)
$question3 "What is included?";
$explain3 "Please let people know what is included with your item";

//QUESTION 4 (do not use quotation marks or you will get a parse error)
$question4 "What Service Provider?";
$explain4 "List the networks this phone has been used or tested on.";

//QUESTION 5 (do not use quotation marks or you will get a parse error)
$question5 "What is the life timer?";
$explain5 "Please enter your life time here. For sprint phones press ##786#";

//QUESTION 6 (do not use quotation marks or you will get a parse error)
$question6 "What is the condition of the item?";
$explain6 "Item Condition.";

//QUESTION 7 (do not use quotation marks or you will get a parse error)
$question7 "Do you have pictures?";
$explain7 "If you have pictures post them in additional details box via the [img] code or click submit and add an attachment";

//QUESTION 8 (do not use quotation marks or you will get a parse error)
$question8 "What is the location you are shipping from?";
$explain8 "Please enter a location.";

//QUESTION 9 (do not use quotation marks or you will get a parse error)
$question9 "What is your shipping method";
$explain9 "Shipping terms and how will you ship. Please inlcude Price.";

//QUESTION 10 (do not use quotation marks or you will get a parse error)
$question10 "What Payment methods do you accept?";
$explain10 "Please list preferred payment methods";

//QUESTION 11 (do not use quotation marks or you will get a parse error)
$question11 "How can users contact you?";
$explain11 "Contact Information";

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

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

$longquestion1 "What are your additional details?.";
$longexplain1 "Please use this area to enter more details. (i.e. Why you are selling) You can also use this space to put in any information that you could not in the above questions. Like items other than cell phones.";

////////////////////////////////////////////////////////////////////////////////////////////////
////// 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 $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $answer4 == '' OR $answer5 == '' OR $answer6 == '' OR $answer7 == '' OR $answer8 == '' OR $answer9 == '' OR $answer10 == '' OR $answer11 == '' OR $longanswer1 == '' OR $ad_agree <> 'Confirmed')
    {
    
$errormessage "Please complete all the information on the classified submission form and agree that you have read and abide by the trading rules.<br>Press the Back button to return to the form."
    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
                                        ('normalanswer1', " 
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], '$normalanswer1',
                                 '" 
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 = '
$normalanswer1',
                                lastthreadid = 
$thread[threadid]
                                WHERE forumid = 
$formforumid
                        "
);
                
$DB_site->query(
                                UPDATE " 
TABLE_PREFIX "user 
                                SET posts = posts + 1 
                                WHERE userid = 
$bbuserinfo[userid] 
                        "
); 
$forum[forumid] = $formforumid;
    }

    if (
$formpoll == "1") {
              
$DB_site->query("INSERT INTO " TABLE_PREFIX "poll (question,dateline,options,votes,active,numberoptions,timeout,multiple,public) VALUES ('$normalanswer1'," 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','$normalanswer1','".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
                        "
);
      
$DB_site->query(
                                UPDATE " 
TABLE_PREFIX "user 
                                SET posts = posts + 1 
                                WHERE userid = 
$bbuserinfo[userid] 
                        "
); 
$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') . '");');
?>


paul41598 06-21-2005 03:15 PM

Here is a documentation I wrote up for anyone who wants dropdowns as well, in their forms. ;)


Good luck, and enjoy!

bluesteel 06-22-2005 09:39 PM

Hi Erwin,

Great hack! Very flexible and just what I was looking for. Thanks!

I have a question for either your good self, or anyone else who might like to reply.

Is there a line of code or something that I can add to the form.php file that puts the new thread in the ACP Thread Moderation queue? I have the specific forum that the new thread is created in set for new Threads to be Moderated, but the form.php ignores this and posts.
If you know what I mean! :squareeyed:

Thanks in advance for any help that may be forthcoming guys.

Alan

jaredvolkl 06-24-2005 09:06 PM

Quote:

Originally Posted by bluesteel
Hi Erwin,

Great hack! Very flexible and just what I was looking for. Thanks!

I have a question for either your good self, or anyone else who might like to reply.

Is there a line of code or something that I can add to the form.php file that puts the new thread in the ACP Thread Moderation queue? I have the specific forum that the new thread is created in set for new Threads to be Moderated, but the form.php ignores this and posts.
If you know what I mean! :squareeyed:

Thanks in advance for any help that may be forthcoming guys.

Alan

This is exactly what I need to do. I have a forum that I'd like new threads posted to go into moderation when they are posted through this form. I've tried setting the visible value to 0 which gets pushed to both post and thread, but that was no help.

Marcus Lau 06-27-2005 12:57 PM

Erwin ... nin bei dan sibei gu liao! Thanks Erwin and God Bless You Richly!

MrTchMan 06-27-2005 11:59 PM

Anyone? Please?


Quote:

Originally Posted by MrTchMan
Here is my form.php I have that option checked. It does requre me to fill out all info but when a user doesn't it gives them the error message and when they hit back it doesn't go back. Maybe I am over looking something. THanks in advance

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(
    
'form',
    
'formanswers'
);

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

globalize($_POST, array(
'normalanswer1' => STR,
'answer1' => STR,
'answer2' => STR,
'answer3' => STR,
'answer4' => STR,
'answer5' => STR,
'answer6' => STR,
'answer7' => STR,
'answer8' => STR,
'answer9' => STR,
'answer10' => STR,
'answer11' => 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(2,5,6,7,9,10))) 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 "form.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 "1";

//FORUM TO POST NEW THREAD IN
$formforumid "24";

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

//USERID TO PM TO
$formpmid "1";

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

//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
// 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 "4";

$errormessage "Thank you for submitting this form!"//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 "Trading Post Form";

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

$formpurpose "The purpose of this form is to create a standard way of entering items for sale in the flea market. If you item is not a cell phone please put a N/A in all fields that don't apply to you, and then post all your details in the additional details section";

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

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

$normalquestion1 "What is the title of your thread?";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//QUESTION 1 (do not use quotation marks or you will get a parse error)
$question1 "What is your asking price?";
$explain1 "Please enter a asking price. If it is a trade specify what you are looking for";

//QUESTION 2 (do not use quotation marks or you will get a parse error)
$question2 "What color is the item";
$explain2 "Please enter the color of the item.";

//QUESTION 3 (do not use quotation marks or you will get a parse error)
$question3 "What is included?";
$explain3 "Please let people know what is included with your item";

//QUESTION 4 (do not use quotation marks or you will get a parse error)
$question4 "What Service Provider?";
$explain4 "List the networks this phone has been used or tested on.";

//QUESTION 5 (do not use quotation marks or you will get a parse error)
$question5 "What is the life timer?";
$explain5 "Please enter your life time here. For sprint phones press ##786#";

//QUESTION 6 (do not use quotation marks or you will get a parse error)
$question6 "What is the condition of the item?";
$explain6 "Item Condition.";

//QUESTION 7 (do not use quotation marks or you will get a parse error)
$question7 "Do you have pictures?";
$explain7 "If you have pictures post them in additional details box via the [img] code or click submit and add an attachment";

//QUESTION 8 (do not use quotation marks or you will get a parse error)
$question8 "What is the location you are shipping from?";
$explain8 "Please enter a location.";

//QUESTION 9 (do not use quotation marks or you will get a parse error)
$question9 "What is your shipping method";
$explain9 "Shipping terms and how will you ship. Please inlcude Price.";

//QUESTION 10 (do not use quotation marks or you will get a parse error)
$question10 "What Payment methods do you accept?";
$explain10 "Please list preferred payment methods";

//QUESTION 11 (do not use quotation marks or you will get a parse error)
$question11 "How can users contact you?";
$explain11 "Contact Information";

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

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

$longquestion1 "What are your additional details?.";
$longexplain1 "Please use this area to enter more details. (i.e. Why you are selling) You can also use this space to put in any information that you could not in the above questions. Like items other than cell phones.";

////////////////////////////////////////////////////////////////////////////////////////////////
////// 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 $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $answer4 == '' OR $answer5 == '' OR $answer6 == '' OR $answer7 == '' OR $answer8 == '' OR $answer9 == '' OR $answer10 == '' OR $answer11 == '' OR $longanswer1 == '' OR $ad_agree <> 'Confirmed')
    {
    
$errormessage "Please complete all the information on the classified submission form and agree that you have read and abide by the trading rules.<br>Press the Back button to return to the form."
    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
                                        ('normalanswer1', " 
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], '$normalanswer1',
                                 '" 
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 = '
$normalanswer1',
                                lastthreadid = 
$thread[threadid]
                                WHERE forumid = 
$formforumid
                        "
);
                
$DB_site->query(
                                UPDATE " 
TABLE_PREFIX "user 
                                SET posts = posts + 1 
                                WHERE userid = 
$bbuserinfo[userid] 
                        "
); 
$forum[forumid] = $formforumid;
    }

    if (
$formpoll == "1") {
              
$DB_site->query("INSERT INTO " TABLE_PREFIX "poll (question,dateline,options,votes,active,numberoptions,timeout,multiple,public) VALUES ('$normalanswer1'," 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','$normalanswer1','".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
                        "
);
      
$DB_site->query(
                                UPDATE " 
TABLE_PREFIX "user 
                                SET posts = posts + 1 
                                WHERE userid = 
$bbuserinfo[userid] 
                        "
); 
$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') . '");');
?>



aggiefan 07-02-2005 11:43 PM

Here's a link to my form. It's being used for a contest I'm doing (win 2 Big XII Championship Tickets for football). It's a pick 'em contest where the user predicts the winner and fills out a tiebreaker guess. I have it set up to where it will PM me. The games entered are just testing...

http://aggiefans.com/forums/week1.php

Listed are the things I want this form to do:
  • I want it to PM me and the submitting user.
  • Also, is there a way to get this form to actually input the answers into a table which can be stored in a database and displayed by user (link to each person's picks)?
  • Only allow a user to submit it once

I'd be willing to pay for help with the database/table thing. The other two requests have been posted before, but I've searched all 31 pages and haven't found an answer. Take a look and let me know what you think and if you can help.

aggiefan 07-03-2005 12:02 AM

Ok, I found the answer to #1 and a lot of other user's questions. Here's what I did to get the 2 PM's to work. (it may be redundant or the roundabout way, but given my lack of programming skill, it works and wasn't hard).

In your form.php find:
Code:

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

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

Make this change:
Code:

//USERID TO PM TO
$formpmid = "whateveridyouhavehere";
$formpmid2 = "$bbuserinfo[userid]"

That's if you want it PM'd to the submitter. If not, put whoever's userid you want it to go to. Repeat as many times as necessary (next one would be pmid3, etc).

Then scroll down and find in the bottom area:
Code:

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");
    }

What I did is copy this entire section of code, repaste it below where it is and change the 2 bolded area:
Code:

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, $formpmid2, 0)");
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1 WHERE userid = $formpmid2");

It worked for me and sent a PM of the answers to me and the person who submitted it. Hope this helps.

Stachel 07-03-2005 11:01 AM

Quote:

Originally Posted by Erwin
Ever wanted an online form that a user can fill out, which when submitted gets:

1. Posted into a new thread in a forum of your choice
3. Posted as a reply in an existing thread of your choice
5. Emailed to an email address you specify

Oh my GOD just last week I was wondering if this was possible !!!

Dr. Loh you are a genius!

Stachel

Michael2 07-07-2005 08:27 AM

Any plans to make this work with 3.5? I was using it before and really miss it. :(

jsteinitz 07-07-2005 08:46 PM

Hi,

Downloaded, installed and made some field modifications--working well. Excellent hack; I had been trying to figure out a way to standardize input from users but had given up. Thanks very much to you, Dr. Loh.

One problem-- the threads that are posted via the form don't seem to be appearing in searches; if I post a thread directly to the forum (bypassing the form), searching works correctly on this one thread only.

Any ideas why my form-generated posts aren't being included in searches?

jsteinitz 07-07-2005 09:03 PM

Thanks anyway; found the answer in the forum.

ZGeek 07-13-2005 02:04 AM

Is there anyway to change the reply to email address to the member who filled out the form?

jschlosser 07-13-2005 03:58 AM

hi dude's,

first of all thanks for this nice script. its very impotant for me to have it.
the second one is my bad english. sorry for:)
i have changed the script for my needs, but one thing is also important for me.

THE TITLE::: can only changed in the script. form.php

but i need a textform wherer i can write my own TITLE of the new thread.
is it possible to change ???

would be wonderful.

you can see my form on this site.

http://www.pickup-portal.com
on the left side go to "Fahruzeuge eingeben" then you 'll see the form.php

when you click on "Frachten eingeben" you 'll see the the fom1.php

login: test
pass: test

many thankx in advance

greets sascha

ps. when i make a new thread with this script and i want search a word from the new thread, i cannot find something in the search. ???

SirJonathan 07-14-2005 12:01 AM

Quote:

Originally Posted by SirJonathan
Yes :). I added all the variables and for most people it works great. There are just some who have filled it all out, post, and it never shows up in the forum.

I've worked on the permissions and I'm pretty sure its not that.. You are required to register before you access the form. Can you think of any reasons why it would work for most people and then not for some?

-Jonathan

Any ideas on this one?

I'm using the form to recieve membership applications from my members and its very frustrating when even a few of the applications posted don't actually go through. Has anyone else had trouble with the form not posting for some of their users?

-Jonathan

Sovereign 07-19-2005 10:38 PM

Uhh, the install says that this is compliant with vB version 3.x.x, but I get

Code:

Fatal error: Call to undefined function: globalize() in /home/alliance/public_html/vb/hostingrequest.php on line 24
when attempting to use the test form....(I'm on 3.5)

Marco van Herwaarden 07-20-2005 06:35 AM

Quote:

Originally Posted by Sovereign
Uhh, the install says that this is compliant with vB version 3.x.x, but I get

Code:

Fatal error: Call to undefined function: globalize() in /home/alliance/public_html/vb/hostingrequest.php on line 24
when attempting to use the test form....(I'm on 3.5)

I am afraid that this thread was posted before anybody had knowledge of the upcoming vB3.5.

I guess it should read that this hack will work on any vB3.0.x version.

csidlernet 07-20-2005 07:55 AM

preety cool. *installs*

Sovereign 07-20-2005 01:30 PM

I saw the same error in Erwin's POP3/IMAP hack, something with "globalize" being undefined....

Abe1 07-20-2005 01:43 PM

Quote:

Originally Posted by Sovereign
I saw the same error in Erwin's POP3/IMAP hack, something with "globalize" being undefined....

Because you installed this hack on a vb3.5 forum. This hack only works on a vb3.0 forum

Sovereign 07-20-2005 04:56 PM

Is there a way around that? And besides, the hack readme says for vB 3.x.x! (I know now that this was before any info on the actual 3.5 became availible, but I thought I'd give it a shot.)

Abe1 07-20-2005 07:03 PM

Quote:

Originally Posted by Sovereign
Is there a way around that? And besides, the hack readme says for vB 3.x.x! (I know now that this was before any info on the actual 3.5 became availible, but I thought I'd give it a shot.)

The only way around it wait for an update. I contacted the developer if he minds if I come out with an update for this but I didn't here back from him yet.

ZGeek 07-21-2005 03:55 AM

I have a weird problem I wonder if anyone can help. I converted my mail system so the form answers are emailed in HTML format. Unfortunately I sometimes get strange "!" marks appearing in the code. They are random and only appear in emails. The forms post perfectly in the forums.

Any ideas?

PKRWUD 07-21-2005 12:04 PM

I'm sorry if it's been covered, but I can't afford the time to read all 32 pages. I am trying to use this form for all replies to a specific thread. It's thread #18579 in forum #40. How do I set things up so that when someone hits the reply button in that thread, they are taken to the form?

Santhalas 07-23-2005 05:41 PM

Is this hack compatible with 3.0.7? I tried installing it exactly as it says in the instructions, but all I'm getting is a blank page...

Edit: Solved the problem on my own, actually. Thanks!

kvnband 07-25-2005 01:54 AM

For all those wanting moderation, I've got it for ya! The following code places the THREAD into moderation que. It appears to work flawlessly.

in form.php, find

Code:

                $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
                        ");

and delete it. Then find

Code:

                $post['postid'] = $DB_site->insert_id();
                $DB_site->query("
                                UPDATE " . TABLE_PREFIX . "thread
                                SET firstpostid = $post[postid]
                                WHERE threadid = $thread[threadid]
                        ");

AFTER, ADD

Code:

//Added By Kevin
//Add Thread To Moderation Que

                                $DB_site->query("
                        INSERT INTO " . TABLE_PREFIX . "moderation(threadid, postid, type)
                        VALUES
                                ($thread[threadid], $post[postid], 'thread')
                ");
               
//End Added By Kevin


Now, if the thread is in moderation que, you don't want it to show up as visible in your forums, do you? So, in

Code:

$DB_site->query("
                        INSERT INTO " . TABLE_PREFIX . "post
                                (threadid, title, username, userid, dateline, pagetext, allowsmilie,
                                showsignature, iconid, visible)
                        VALUES......addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " . TIMENOW . ",
                                '" . addslashes($formsend) . "', 1, 1,
                                0, 1)
                ");

at the end there, instead of it being 1, 1, 0, 1, make it 1, 1, 0, 0. Then, right above there, change the numbers at the end of

Code:

$DB_site->query("
                                INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,
                                postusername, postuserid, lastposter, dateline, iconid, visible, attach)
                                VALUES
                                        (.... " . TIMENOW . ", $formforumid,
                                        0, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
                                        '" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1, 0)
                        ");

to 0, 0, 0.

I'm sorry if this is confusing...It probably is. But Just wanted to give everyone else a chance to add threads to the moderation que.

Kevin

PKRWUD 07-25-2005 09:48 AM

That's killer! I don't suppose you know how to set it up the way I was asking, do you (scroll up two posts)?

kvnband 07-25-2005 01:05 PM

Quote:

Originally Posted by PKRWUD
That's killer! I don't suppose you know how to set it up the way I was asking, do you (scroll up two posts)?

I can try. In your Showthread template, go down about 20 lines.

FIND
Code:

<if condition="$show['largereplybutton']">
AFTER, ADD
Code:

<if condition="$thread[threadid] == 18579">
<td class="smallfont"><a href="form.php"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /></a>
<else />

FIND
Code:

</if>
AFTER, ADD
Code:

</if>
FIND
Code:

<if condition="$show['largereplybutton']">
It is down many lines.

You'll see that this section is identical to the one you just changed. So change this one just like you changed the other one.
Please note that I haven't tested it and honestly have no idea if it works :-)
Kevin

DougM 07-27-2005 01:10 AM

EDIT :: I was making this too complicated. All I had to do was add the $bbuserinfo[field9] to the formanswers template. Fantastic.

I think this will do exactly what I need but I'm having some difficulty pulling custom profile fields into a new thread from the form. I can get the member's custom field to show up in the form by using this:

In the Form template:
Code:

<tr>
<td class="alt2" valign="middle">
<b>Phone</b>:<br>
Your Phone Number.</td>
<td class="alt2" valign="middle" colspan="2">
<b>$bbuserinfo[field9]</b></td>
</tr>

In form.php
Code:

I can't figure it out
I'm looking at form.php and trying to see how the username $bbuserinfo[username] is processed but I guess it's beyond me or I'm missing the obvious.

Can anyone help me to get a custom profile field into a new thread? Much appreciated if so.

Thanks

Antivirus 07-27-2005 09:37 PM

This is a great hack, which is extremely useful for us. I was wondering though, while turning on the ENABLE FORM TO BE EMAILED feature within the form.php file... would it be possible for the REPLYTO email address in the email which is sent, to match the email address in the profile of the member whom had submitted the form?

jschlosser 07-29-2005 07:26 AM

hi dude's,

first of all thanks for this nice script. its very impotant for me to have it.
the second one is my bad english. sorry for
i have changed the script for my needs, but one thing is also important for me.

THE TITLE::: can only changed in the script. form.php

but i need a textform wherer i can write my own TITLE of the new thread.
is it possible to change ???

would be wonderful.

you can see my form on this site.

http://www.pickup-portal.com
on the left side go to "Fahruzeuge eingeben" then you 'll see the form.php

when you click on "Frachten eingeben" you 'll see the the fom1.php

login: test
pass: test



ps. when i make a new thread with this script and i want search a word from the new thread, i cannot find something in the search. ???

the search function isn#t working with this script. can any1 fix this bug ?

I use the Version vbulletin 3.07
many thankx in advance

greets sascha

Marco van Herwaarden 07-29-2005 07:38 AM

Please provide a test login if you want us to see something.

Thanks.

DougM 07-29-2005 10:51 AM

I'm trying to create a different header for my form by using a conditional statement and it's not working. Can anyone tell what I may be doing wrong? This is what I'm trying to use:
Code:

<if condition="THIS_SCRIPT == 'form'">
Nothing shows up on the form page with this.

kvnband 07-29-2005 01:08 PM

Quote:

Originally Posted by jschlosser
hi dude's,

first of all thanks for this nice script. its very impotant for me to have it.
the second one is my bad english. sorry for
i have changed the script for my needs, but one thing is also important for me.

THE TITLE::: can only changed in the script. form.php

but i need a textform wherer i can write my own TITLE of the new thread.
is it possible to change ???

would be wonderful.

you can see my form on this site.

http://www.pickup-portal.com
on the left side go to "Fahruzeuge eingeben" then you 'll see the form.php

when you click on "Frachten eingeben" you 'll see the the fom1.php

login: test
pass: test



ps. when i make a new thread with this script and i want search a word from the new thread, i cannot find something in the search. ???

the search function isn#t working with this script. can any1 fix this bug ?

I use the Version vbulletin 3.07
many thankx in advance

greets sascha

First off, search this thread for the search problem. I'm not sure if it's ever been fixed or not.

Secondly, to change the subject, in form.php, go down to

Code:

INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,....
2 lines down is
Code:

('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle', " . TIMENOW . ", $formforumid,
change
Code:

'".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle'
to
Code:

'Your THREAD TITLE HERE'
then go down about 10 lines to

Code:

VALUES
                                ($thread[threadid], '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
                                '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " . TIMENOW . ",
                                '" . addslashes($formsend) . "', 1, 1,
                                0, 1)

and change
Code:

"'.addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle'
to
Code:

'YOUR THREAD TITLE'
You'll want to put some sort of variable in those changes though. a variable from the form so that not every thread will have the same exact title. You can see what I'm doing at
http://www.birdboard.com/forum/bird-...assifieds.html

Every new thread there has the same format, but not exactly the same title.
Kevin

leroub 07-31-2005 12:21 PM

thx for this hack....

how to put bbcode in the template of the answer....

thanks in advance...

leroub 07-31-2005 12:43 PM

it's ok... i forget to put a space between my text and bbcode... ;)


All times are GMT. The time now is 09:53 PM.

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.02773 seconds
  • Memory Usage 2,285KB
  • 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
  • (26)bbcode_code_printable
  • (6)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)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