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)

Erwin 07-02-2004 06:26 AM

Quote:

Originally Posted by ragintajin
Okay, its official...Steve Machol says I'm showing up as licensed...could you kindly address my questions in post #64?

Was that at vBulletin.com? Because over here, you're still showing up as unlicensed. vBulletin.org uses a separate database to check if a member is licensed.

Praxin 07-02-2004 02:12 PM

I'm trying to pre-populate a drop down box with usernames from a specific usergroup - I know how to do it if it was all in the PHP file (cant quote it off the top of my head, got it all at home though), but I am not sure how to then translate this into the form using the actual template.

Its the templates that really bamboozle me - I'm thinking that I need to create separate variables for each returned row to then pass into the template. Anything easier?

Steve Machol 07-02-2004 04:15 PM

Quote:

Originally Posted by Erwin
Was that at vBulletin.com? Because over here, you're still showing up as unlicensed. vBulletin.org uses a separate database to check if a member is licensed.

Erwin, he's showing up as licensed for me on these forums and was yesterday when I checked. He also shows as licensed in the Admin CP here, and was yesterday when I checked.

Creative210 07-02-2004 08:03 PM

Excellent I will be installing this. :)

WAR 07-03-2004 10:25 AM

Quote:

Originally Posted by Praxin
I'm trying to pre-populate a drop down box with usernames from a specific usergroup - I know how to do it if it was all in the PHP file (cant quote it off the top of my head, got it all at home though), but I am not sure how to then translate this into the form using the actual template.

Its the templates that really bamboozle me - I'm thinking that I need to create separate variables for each returned row to then pass into the template. Anything easier?

I am trying to do similiar things, populating drop down menus with results from a query.

If anyone figures out an easy way to do this please share.

trainer 07-03-2004 05:48 PM

how can i setup different layouts for different forms? do i have to add a template for each layout? if so how do i call the new template so the .php file knows what template to use?

GamerzWorld 07-03-2004 08:30 PM

Anyone got a premade form.php i can edit for mod application

GamerzWorld 07-03-2004 09:01 PM

Nvm, all done :) great hack

[high]* GamerzWorld installs[/high]

blkmgc 07-04-2004 05:19 PM

*clicks install*

got a quick question though, ok i installed it on my site (www.jo-joint.com/forums/form.php) and it only lets the user submit a form one time, is there a way to change that?

Jolten 07-09-2004 09:46 PM

Wonderful hack!

After some modifying I'm getting a query for an uncached template. All I pretty much did was delete some radio buttons and the check for them and changed the two template names to two new custom templates. I'm having a real hard time finding what other template the script may be using other than STANDARD_ERROR.

Either way.. freakin' great hack Erwin. Thanks.

Erwin 07-09-2004 09:50 PM

Quote:

Originally Posted by Jolten
Wonderful hack!

After some modifying I'm getting a query for an uncached template. All I pretty much did was delete some radio buttons and the check for them and changed the two template names to two new custom templates. I'm having a real hard time finding what other template the script may be using other than STANDARD_ERROR.

Either way.. freakin' great hack Erwin. Thanks.

This file only uses the standard_error template.

Jolten 07-09-2004 09:56 PM

that's what I thought. hmmm.. Thanks Erwin.

Jolten 07-09-2004 10:18 PM

Okay help please... I've changed the three template names. The form works wonderfully.. but there's a query for an uncashed template.

PHP Code:

if ($action=="submit") {

if (
$answerall == "1") {
    if (
$answer1 == '' OR $answer2 == '' OR $longanswer1 == '')
    {
    
$errormessage "You need to answer every question, $bbuserinfo[username]!";
    eval(
'print_output("' fetch_template('flag_error') . '");');
    exit();
    }
}

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

    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,
                                " 
iif($type == 'thread''threadcount = threadcount + 1,') . "
                                lastpost = " 
TIMENOW ",
                                lastposter = '" 
addslashes($bbuserinfo['username']) . "',
                                lastthread = '"
.addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle',
                                lastthreadid = 
$thread[threadid]
                                WHERE forumid = 
$formforumid
                        "
);

    }


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

    
$errormessage "The image has been flagged.";
    eval(
'print_output("' fetch_template('flag_error') . '");');
   exit();
}

eval(
'print_output("' fetch_template('flag') . '");');
?> 


mtha 07-10-2004 03:55 AM

Quote:

Originally Posted by Erwin
2. Posted as a reply in an existing thread of your choice

When reply to an existing thread, should thread counter and last poster be updated?


Look for
PHP Code:

    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) . "','$allowsmilie','$signature','$ipaddress','$iconid','1')"); 

Add after

PHP Code:

        $DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " TIMENOW ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid"); 


Erwin 07-10-2004 07:10 AM

Thanks mtha - forgot to add that.

Update Version 1.2

Thread count and lastposter information now updated if form is sent to existing thread.

Zip file is updated.

To upgrade, just apply the changes in the post above.

Merjawy 07-10-2004 08:05 AM

Great hack Erwin.. will install soon I get my issues out of the way and upgrade

mtha 07-10-2004 06:20 PM

Quote:

Originally Posted by Erwin
Thanks mtha - forgot to add that.

Update Version 1.2

Thread count and lastposter information now updated if form is sent to existing thread.

Zip file is updated.

To upgrade, just apply the changes in the post above.

:)

this one is not important, but if you want, you can fix.

when sending a PM to user, and that user has option to display a pop-up for new PM, the pop-up isnt displayed.

T2DMan 07-13-2004 12:25 PM

Cool - this is going to be fun

Objective - each thread is a restaurant, users submit review, and review gets posted into that thread, with the data stored. Each thread shows survey to date, new survey form, and submitted reviews.

I'll report back when its all working.

Erwin 07-13-2004 12:32 PM

Quote:

Originally Posted by mtha
:)

this one is not important, but if you want, you can fix.

when sending a PM to user, and that user has option to display a pop-up for new PM, the pop-up isnt displayed.

Really? It does for me.

WAR 07-14-2004 07:44 PM

Quote:

Originally Posted by Erwin
Really? It does for me.

It doesn't pop the window up for me either but i wasn't worried about it.

Thanks again for this hack erwin, it has been invaluable for me as I've been building the site I am working on.

Fibe 07-14-2004 09:37 PM

Best mod ever ! I needed this so bad.

One question how would i be able to add a drop down menu like for example:

What's your favourite color ? and then they can chose from red/blue/black/etc

I am a complete newbie so the more details you can give me the better !

Thanks !

Fibe 07-16-2004 01:09 AM

Figured everything out.

However, is there a way to allow other usergroups to see it without them being able to submit it?

And if so, how would it be possible to make it so that when they do enter info and submit they see a message saying something like "you're not allowed to apply" ?

Thanks and sorry i am asking for so much.

romanticyao 07-20-2004 07:38 AM

I have one question, is it possible to add dropdown box with all my fourm & subforum listed so when my user apply for mod they don't need to type the fourm name in a box? if it's possilbe please show me how its done~Thank you and again, this is a great hack.

D|ver 07-20-2004 04:08 PM

a really great hack !!!! :D

but will there be a version in the future which allow attachment uploading, if the output is going to be submitted as a thread?
that would be great :)

Holidazed 07-20-2004 09:28 PM

Erwin, this is awesome. However, I am having a problem.

I modified the form.php and added a bunch of questions. I also removed the radio buttons as they were not needed.

However, my form now looks like this.

http://www.dungeonkeepersdomain.com/...st_a_forum.php

It has radion buttons at the top and does not have all my questions.

What did I do wrong?

Erwin 07-20-2004 10:21 PM

Quote:

Originally Posted by bitg
Erwin, this is awesome. However, I am having a problem.

I modified the form.php and added a bunch of questions. I also removed the radio buttons as they were not needed.

However, my form now looks like this.

http://www.dungeonkeepersdomain.com/...st_a_forum.php

It has radion buttons at the top and does not have all my questions.

What did I do wrong?

Edit the form template and remove the radio buttons in it. I can't see the page as you've made the form for registered members only.

Holidazed 07-20-2004 10:27 PM

Well, if the template needs modifying for this, does this mean I need to modify the template for each and every different form I make? Do I make new templates? What do I call them? How do I tell hte form to look to these templates instead of the old ones?

Erwin 07-20-2004 11:30 PM

Quote:

Originally Posted by bitg
Well, if the template needs modifying for this, does this mean I need to modify the template for each and every different form I make? Do I make new templates? What do I call them? How do I tell hte form to look to these templates instead of the old ones?

If you don't modify the number of questions, you can use the same templates.

If you want to start changing the type and number of questions, you need to copy and rename the template, and change the template name in form.php - keep doing that for new forms, only if you modify those things.

It's not hard too work out - I've made this hack to be customizable - go forth and change it however you like.

irishfreakout 07-21-2004 04:58 PM

Just an idea for future versions (something i would fiind really useful!)

Add the ability to post to a text file for either all or part of the form.

For example, ithis would be used for collecting demographic information that is dumped into a text file then imported to Excel for analysis.

Holidazed 07-21-2004 07:27 PM

Quote:

Originally Posted by Erwin
If you don't modify the number of questions, you can use the same templates.

If you want to start changing the type and number of questions, you need to copy and rename the template, and change the template name in form.php - keep doing that for new forms, only if you modify those things.

It's not hard too work out - I've made this hack to be customizable - go forth and change it however you like.

OK, I got that resolved. I currently have the form at http://www.dungeonkeepersdomain.com/...st_a_forum.php set so anybody can use it. It is ustilizing the the "form_request_a_forum" template and "formanswers_request_a_forum" answers template. When I fill out the form, it still says "you need to answer every question!".

I DID ANSWER EVERY QUESTION.

My "form_request_a_forum" template looks like this.

Code:

$stylevar[htmldoctype]
<html id="form" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle] - $formtitle</title>
$headinclude
</head>
<body>
$header
$navbar
<br>
<form enctype="multipart/form-data" method="post" action="$phpfilename">
<input type="hidden" value="$userid" name="userid">
<input type="hidden" value="submit" name="action">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
  <tr>
        <td class="tcat" colspan="3">
          $vboptions[bbtitle] - $formtitle
        </td>
  </tr>
  <tr>
        <td class="panelsurround" align="center" colspan="3">
          <table class="panel" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
                <tr>
                  <td align="$stylevar[left]">
                        <fieldset class="fieldset" style="margin:0px">
                          <table bgcolor="#FFFFFF" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
                                <tr>
                                  <td>
                                        <font color="#000000">$formpurpose</font>
                                  </td>
                                </tr>
                          </table>
                          </fieldset>
                        </td>
                  </tr>
                </table>
          </td>
        </tr>
        <tr>
          <td class="alt2" valign="middle" width="60%">
                <b>Your Username</b>:</td>
          <td class="alt2" valign="middle" colspan="2" width="40%">
                <b>$bbuserinfo[username]</b>
          </td>
        </tr>
        <tr>
          <td class="alt2" valign="middle" width="60%">
                <b>$normalquestion1</b><br>
                <font face="verdana" size="1">$explain1</font>
          </td>
          <td class="alt2" valign="middle" colspan="2" width="40%">
                <input type="text" size="30" name="normalanswer1">
          </td>
        </tr>
        <tr>
          <td class="alt2" valign="middle" width="60%">
                <b>$normalquestion2</b><br>
                <font face="verdana" size="1">$explain2</font>
          </td>
          <td class="alt2" valign="middle" colspan="2" width="40%">
                <input type="text" size="30" name="normalanswer2">
          </td>
        </tr>
        <tr>
          <td class="alt2" valign="middle" width="60%">
                <b>$normalquestion3</b><br>
                <font face="verdana" size="1">$explain3</font>
          </td>
          <td class="alt2" valign="middle" colspan="2" width="40%">
                <input type="text" size="30" name="normalanswer3">
          </td>
        </tr>
        <tr>
          <td class="alt2" valign="middle" width="60%">
                <b>$normalquestion4</b><br>
                <font face="verdana" size="1">$explain4</font>
          </td>
          <td class="alt2" valign="middle" colspan="2" width="40%">
                <input type="text" size="30" name="normalanswer4">
          </td>
        </tr>
        <tr>
          <td class="alt2" valign="middle" width="60%">
                <b>$normalquestion5</b><br>
                <font face="verdana" size="1">$explain5</font>
          </td>
          <td class="alt2" valign="middle" colspan="2" width="40%">
                <input type="text" size="30" name="normalanswer5">
          </td>
        </tr>
        <tr>
          <td colspan="3" class="alt2" valign="middle">
                <b>$longquestion6</b><br>
                <font face="verdana" size="1">$longexplain6</font><br>
                <textarea rows="5" cols="60" name="longanswer6" wrap="VIRTUAL" maxlength="225"></textarea>
          </td>
        </tr>
        <tr>
          <td colspan="3" class="alt2" valign="middle">
                <b>$longquestion7</b><br>
                <font face="verdana" size="1">$longexplain7</font><br>
                <textarea rows="5" cols="60" name="longanswer7" wrap="VIRTUAL" maxlength="225"></textarea>
          </td>
        </tr>
<tr>
<td valign="top">
<p align="center">
<input type="submit" value="Submit" name="submit" style="font-family: Verdana; font-size: 10pt" class="button">
<input type="reset" value="Reset" name="reset" style="font-family: Verdana; font-size: 10pt" class="button">
</p></td></tr>
</table>
</td>
</tr>
</table>
</form>
$footer
</body>
</html>

And my "formanswers_request_a_forum" template looks like this.
Code:

$formtitle
$bbuserinfo[username]
-----------------------------------------------------
$normalquestion1
$normalanswer1
-----------------------------------------------------
$normalquestion2
$normalanswer2
-----------------------------------------------------
$normalquestion3
$normalanswer3
-----------------------------------------------------
$normalquestion4
$normalanswer4
-----------------------------------------------------
$normalquestion5
$normalanswer5
-----------------------------------------------------
$longquestion6
$longanswer6
------------------------------------------------------
$longquestion7
$longanswer7
------------------------------------------------------

It works perfectly if I do not force all the questions to be answerws.
What am I doing wrong?

WAR 07-21-2004 09:55 PM

you need to change the conditional in the PHP file where it checks to see if all questions have been answered to match your new format.

I don't have the files where i can look at them right now, but the line you are looking for is marked with a comment, it is a long string of if ($variable1 == "" OR $variable2 == "" OR etc...

You need to change all of the previously used variable names into the variable names you are using now:

$normalanswer1
$normalanswer2
$normalanswer3
$normalanswer4
$normalanswer5
$longanswer6
$longanswer7

If that isn't clear enough, I will post the specific line you need to change later when I get back home

Holidazed 07-21-2004 10:04 PM

Quote:

Originally Posted by WAR
you need to change the conditional in the PHP file where it checks to see if all questions have been answered to match your new format.

I don't have the files where i can look at them right now, but the line you are looking for is marked with a comment, it is a long string of if ($variable1 == "" OR $variable2 == "" OR etc...

You need to change all of the previously used variable names into the variable names you are using now:

$normalanswer1
$normalanswer2
$normalanswer3
$normalanswer4
$normalanswer5
$longanswer6
$longanswer7

If that isn't clear enough, I will post the specific line you need to change later when I get back home

OK, it looks like this.

Code:

globalize($_POST, array(
'normalanswer1' => STR,
'normalanswer2' => STR,
'normalanswer3' => STR,
'normalanswer4' => STR,
'normalanswer5' => STR,
'longanswer6' => STR,
'longanswer7' => STR,
'action' => STR
));

Still does not work

Erwin 07-21-2004 10:50 PM

No, not that part, that's the wrong section.

You need to modify the bit of code that checks that all questions are answered which is further down the file. The one that checks that if a variable is empty, then the person needs to answer it.

Holidazed 07-22-2004 02:02 AM

Quote:

Originally Posted by Erwin
No, not that part, that's the wrong section.

You need to modify the bit of code that checks that all questions are answered which is further down the file. The one that checks that if a variable is empty, then the person needs to answer it.

Erwin, can you give me the classic "Look for" kind of help? Also, I answered all the questions I had on the form. I left NOTHING blank.

Erwin 07-22-2004 02:25 AM

Remove the variables you don't need in this line:

PHP Code:

if ($answerall == "1") {
    if (
$normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == '' OR $radioanswer3 == '' OR $radioanswer3other == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $longanswer1 == ''


Holidazed 07-22-2004 12:09 PM

thanks

Aurous 07-26-2004 08:54 PM

no spam control :(

:dead:

pjdaley 07-27-2004 01:01 AM

Quote:

Originally Posted by pjdaley
not really a coder though :ermm:

can someone show me what to change in the php file, so i can change the title of the thread thats created into one of the answers? please?

Holidazed 07-27-2004 02:41 PM

Quote:

Originally Posted by pjdaley
can someone show me what to change in the php file, so i can change the title of the thread thats created into one of the answers? please?

That is pretty self explanitory

Open up the form.php (or whatever you named it) file
Look for:
Code:

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$formtitle = "Generic Form";

Replace:
Code:

$formtitle = "Generic Form";
With:

Code:

$formtitle = "thread title goes here";

LoOnEyToOnZ 07-27-2004 03:49 PM

Dont mind if its a silly question, but the 2 templates being mentioned that has to be added, where are they ?


All times are GMT. The time now is 04:15 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.01973 seconds
  • Memory Usage 1,923KB
  • 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
  • (6)bbcode_code_printable
  • (4)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (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