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)

Spinball 11-20-2004 10:04 AM

*installed*
Very nice hack - does, with a bit of tweaking, just what I need.
I'm using it to ensure people enter all the required information in classified adverts. I'll be trying to change the target address of the 'New thread' button in certain forums to call this script.
Many thanks Mr Erwin, Sir!

Question/request for you.
How would I implement the $messagearea and $posticons variables so that the user interface for one of the fields is identical to a normal new thread?

Spinball 11-20-2004 10:27 PM

I hope you don't mind but I'd like to share how I got this working to use a form to submit the first post in new threads.
It's for our classifieds forums (3 of them) where people often dive in and break several trading rules.
I wanted to make sure they were given plenty of opportunities to read the rules before submitting their adverts.
See the attached screen grab.
Our 3 forums have forum ids of 51,62 and 99.

Firstly I used a temporary forum invisible to the public to test this out.
I followed Erwin's instructions to edit the form and formanswers templates and form.php.
The only things I needed to change in the form.txt template was to add a variable 'f' to store the forumid rather than hard code it.

HTML Code:

  <input type="hidden" value="$userid" name="userid">
  <input type="hidden" value="$f" name="f">
  <input type="hidden" value="submit" name="action">

and the tickbox code looked like this.
HTML Code:

      <tr>
        <td class="alt1" valign="top"><b>$ad_agreequestion</b></td>
        <td class="alt1" valign="top" colspan="2"><input name="ad_agree" type="checkbox" value="Confirmed"> <font class="smallfont">$ad_agreeexplain</font></td>
      </tr>

(I used the smallfont class to reduce the size of the explanation text).

Then most of the work goes in the form.php. Aside from changing it to put in my own variables etc., I had to make a few additional tweaks.

At the top I globalised the variables used in the form plus the forum id 'f'

HTML Code:

globalize($_POST, array(
'ad_title' => STR,
'ad_description' => STR,
'ad_location' => STR,
'ad_agree' => STR,
'action' => STR,
'f' => STR
));

and set the forumid to the passed variable $f instead of hard coding it.

PHP Code:

//FORUM TO POST NEW THREAD IN
$formforumid $f

and changed the form validation to insist that the checkbox be checked:

PHP Code:

if ($answerall == "1") {
    if (
$ad_title == '' OR $ad_description == '' OR $ad_location == '' 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();
    }


The last thing I did was to edit the FORUMDISPLAY template to make the 'New Thread' buttons call the form. In both places (there are 2 buttons):

PHP Code:

<!-- -------------- new thread button logic for classifieds form -----  -->
<if 
condition="$show['newthreadlink']">
<if 
condition="$foruminfo[forumid] == 51 OR $foruminfo[forumid] == 62 OR $foruminfo[forumid] == 99">
<
a href="form.php?$session[sessionurl]&amp;f=$foruminfo[forumid]">
<else />
<
a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]">
</if>
<!-- ------------ / new 
thread button logic for classifieds form -----  --> 

Note that it calls the form.php with the f= to the forumid.
And it works perfectly.

The next enhancement might be to install a separate hack which creates an [admin] bb code which hides text within it from all users except admin. And then get people to enter a phone number for security purposes which only admin can see in the posts.

Maybe Erwin will want to add my suggestions into his standard hack.

blue_chi 11-21-2004 07:47 PM

THIS IS GOOD.

Going to install it soon! ;)

defi 11-23-2004 08:16 PM

I was wondering;

1.) Is there a way to change it so the user can enter a name for the thread rather then a pre-defined one being made?

2.) Have attachments been added to the capability of this form?

neofootball 11-23-2004 08:34 PM

Nice hack! Is there a way to pm & email more than one person?

glenvw 11-26-2004 09:04 AM

I am looking for a registration process where a person:

First has to fill out a separate front-end registration process I already have. The applicant fills out name, address, phone, birthdate, etc (common demographic information) . He is presented with opt-in co-reg offers etc.

He is then automatically sent to the VBBS registration page where he/she enters a user name and password. It would be nice if the user name, birthdate, etc could be passed from the first form (not on a VBBS page) and inserted in the VBBS registration. This would make it look uniform. It is not necessary though.

My goal is first to monetize the registration process.

Restrict access to all forums unless they were registered.

However, if a person is not registered now, they are sent directly to the VBBS registration page. This process would require that they be sent to the new front end registration page.

After a member is regsitered, I would like it if they were made to log in only on the front end page where they could just log in if already registered.

I have no idea if this could be done but I am looking for a programmer that knows his stuff and can make this happen. I am posting it here because Erwin's hack was as close as I have seen.

Thank in advance.

The Markus 11-27-2004 10:36 PM

Quote:

Originally Posted by BarHopper
This sia stupid question, but where are the two templates?

If that was stupid then my question is ridiculous... :nervous:

Where do you upload these to?? I am somewhat PHP inept at the moment, but I am learning.. I can feel my brain swelling :ninja:

ChrisBaktis 12-12-2004 06:43 PM

Need some Mod Help....

I run a site that mambers trade on - I want to use this form to post a thread of what is being traded....This is what I would like to do...

Instead of the username and form title to show up as the 'Thread Title' I would like to use $normalanswer1 / $normalanswer2

For Example..I would like the title show up as 'member#1 / member#2' This way when our mods are going through the posts the title of each post is the two members names that are making the trade with an '/' in between.

Can this be done? if so how?

Also is it possible to use Bold and underline in the output when this is posted to a thread? I know I cannot use HTML because I dont allow HTML in the thread but is there any other way?

Chris

Erwin 12-12-2004 08:35 PM

Quote:

Originally Posted by ChrisBaktis
Need some Mod Help....

I run a site that mambers trade on - I want to use this form to post a thread of what is being traded....This is what I would like to do...

Instead of the username and form title to show up as the 'Thread Title' I would like to use $normalanswer1 / $normalanswer2

For Example..I would like the title show up as 'member#1 / member#2' This way when our mods are going through the posts the title of each post is the two members names that are making the trade with an '/' in between.

Can this be done? if so how?

Also is it possible to use Bold and underline in the output when this is posted to a thread? I know I cannot use HTML because I dont allow HTML in the thread but is there any other way?

Chris

1. You can change the thread title within the code - look at the code and you can work it out.

2. You can modify the form template with bbcode tags to add bold.

ChrisBaktis 12-12-2004 08:47 PM

problem is i have no idea where to change it in the form.php file....$formtitle shows up all over the place and i dont know which to replace and how I would put 2 variables with an "/" between them.


All times are GMT. The time now is 09:14 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.01445 seconds
  • Memory Usage 1,772KB
  • 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
  • (3)bbcode_html_printable
  • (3)bbcode_php_printable
  • (2)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