Go Back   vb.org Archive > vBulletin Modifications > vBulletin 5.x Modifications > vBulletin 5.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Basic Form that submits to a new Thread Details »»
Basic Form that submits to a new Thread
Version: 0, by rustyshack rustyshack is offline
Developer Last Online: Jan 2021 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 5.5.5 Rating:
Released: 04-20-2020 Last Update: 04-26-2020 Installs: 2
Template Edits
Is in Beta Stage  
No support by the author.

After upgrading my forums to VB5 i was in need of a Review form for my board which I had on VB4. Unfortunately the Easy Forms plugin was disabled for VB5 so I worked to create my own form. As I have seen many saying they would like some type of form like this also, which is why I am posting this here. Also I want to help with the viability of the VB5 platorm.

Installation Instructions:
  1. Open the text file and change the ChannelID in two places in the file to the Channel you want the thread to go in. One spot is a <DIV> at the top of the form. The other is a hidden field at the end of the forum. You can search for '23' which is the current Channel value.
  2. Create a custom template in Style Manager.
  3. Paste the entire attached txt file into that template.
  4. Save the template and record the name of the template for later use.
  5. Go to Site Builder at the top of the forum and choose "New Page.
  6. This will create a new page and you can choose the "Display Template Module".
  7. Drag the Display Template Module into the first slot on your new page.
  8. Click the pencil icon to configure the module.
  9. Enter the Page name and the name of the template, then save the module.
  10. Save and exit out of the page builder.
  11. Go to your new page and see the form. It should work with no other changes.

The form can be tailored to your needs you can add fields or change fields, all you need is some html and Javascript knowledge but it is very easy to change.
There is also a validation function you can extend to put more or different validation on fields. Currently it only checks for required fields.

This uses the CreateContent API which has required fields of "title" and "text".
The 'string_yy() function takes all the field values, format them with BBcode and strings it all into text form field. The form once submitted creates a post in the Channel you specify in the script.

This is an independent template that does not interfere with any other functions outside that page. It should work on all versions of VB5 although I have only tested in on 5.5.4 and 5.5.5

There is probably other and better ways to do this or improve this script.
There is no flood control or captcha, so best only make this available to registered members unless you can implement some protections against multiple submissions.

Update suggestion or modifications welcome.
The intention is that this is a template that you change to fit your needs.
So i can only support what i have created, you would be reponsible for changing the form and working out any bugs that arise from your changes.

It does not work without including the Jquery js from a CDN.
It doesn't seem to work with the native forum jquery but this also does not appear to conflict with anything.

The standard function is that it creates a new thread then redirects you to the new thread.
This could be change to take some other action.

I now works great on 2 of my VB5 forums with no changes in a basic new page.

Download Now

File Type: txt VB5_form_example.txt (7.4 KB, 73 views)

Screenshots

File Type: jpg busform.jpg (29.3 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
redragon29, varum

Comments
  #2  
Old 04-21-2020, 08:50 PM
rustyshack rustyshack is offline
 
Join Date: Jun 2009
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry.
Reply With Quote
  #3  
Old 04-22-2020, 06:31 AM
delicjous's Avatar
delicjous delicjous is offline
 
Join Date: Nov 2014
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice idea. In my tests I ends up on mydomain/undefined ... You should use the inbuild jQuery instead of load a new one... just put the script-part to the hook footer_before_body_end ... you could use the api to create a new post instead of loading the new thread page.
Reply With Quote
  #4  
Old 04-22-2020, 07:40 AM
rustyshack rustyshack is offline
 
Join Date: Jun 2009
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by delicjous View Post
Nice idea. In my tests I ends up on mydomain/undefined ... You should use the inbuild jQuery instead of load a new one... just put the script-part to the hook footer_before_body_end ... you could use the api to create a new post instead of loading the new thread page.
I'm not clear at all why it wouldn't work for you on a fresh template page in the site builder.
Did you change the channel Ids in the file? Perhaps 23 doesn't exist on your board.

The functionality I wanted was to go to the thread after submission.
In my case it is always a new thread.
I will try the jquery change you mentioned. It isn't the greatest script but there was no other examples or help I could find to build one.

It could be tweaked or changed in many ways. The main point of it is that is strings the many fields into the one text field and formats it for submission. I tried to do this with a second PHP page in the sitebuilder but I didn't get that to work, but there is many options.

There is nothing that specifically connects this script to Vbulletin functionality.
Which makes it not subject to most changes in VB.
My current issue is that the forms i use now will not move from VB4 to VB5.
I shouldn't have that issue next time.
Reply With Quote
  #5  
Old 04-22-2020, 09:01 AM
delicjous's Avatar
delicjous delicjous is offline
 
Join Date: Nov 2014
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried on my testpage with a lot of custom-stuff implemented and I changed the channelid 23 to a 3. So it could work on a fresh installed vB. Its Ok if it is working for you... but I thought I mention because I saw you marked it as supported.
Reply With Quote
  #6  
Old 04-22-2020, 05:51 PM
rustyshack rustyshack is offline
 
Join Date: Jun 2009
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by delicjous View Post
I tried on my testpage with a lot of custom-stuff implemented and I changed the channelid 23 to a 3. So it could work on a fresh installed vB. Its Ok if it is working for you... but I thought I mention because I saw you marked it as supported.
Right but is there more information to go by? So are you saying your install is far from standard?
Did you change the channel Id in 2 places?
Did you actually create a post? Is it the redirect to the new thread that is failing only? What part is not working for you?
All of it, some of it? I don't think you are giving me a fair shake to even support it.
Is there any sort of error you can point me too?
Not much for me to go by. But it sounds like you know way more than me anyways.

I can mark it as unsupported and will because on my 6 year old forum it works fine on a new page. Is there any console errors in the script or anything like that? I specifically say i am supporting the basic function and structure of the basic form. In all my testing it works fine on a stand alone standard html page placed in the VB5 main folder. Or when creating it in a new page in the site builder.

My whole intention is to provide an example others could build on.
I will just delete the stupid thing, sorry for trying to help.
Reply With Quote
  #7  
Old 04-22-2020, 06:33 PM
delicjous's Avatar
delicjous delicjous is offline
 
Join Date: Nov 2014
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Like I wrote. The idea is good and you should leave it here for others.
Reply With Quote
  #8  
Old 04-22-2020, 06:48 PM
rustyshack rustyshack is offline
 
Join Date: Jun 2009
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But why won't you give me information that i can help you make it work.
You didn't answer any of my questions and just made my mod seem like crap.
thanks for that!
Way to encourage developers for the platform.
On most other support requests users actually provide error and feedback.
You should just delete the comments about it not working unless you are prepared to work through it.
Plus you don't seem like anyone who is actually interested in implementing it anyways.
Reply With Quote
  #9  
Old 04-22-2020, 08:06 PM
rustyshack rustyshack is offline
 
Join Date: Jun 2009
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What browser are you using, what platform are you using?
Are there any errors in the JS console or otherwise.
Did it create a new thread or not?
Did you change the channel id in two places.
Is there anything in your page that is custom that would affect it?
If there is no jquery errors or conflicts, what error is there?
Reply With Quote
  #10  
Old 04-23-2020, 05:43 AM
delicjous's Avatar
delicjous delicjous is offline
 
Join Date: Nov 2014
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by rustyshack View Post
What browser are you using, what platform are you using?
Are there any errors in the JS console or otherwise.
Did it create a new thread or not?
Did you change the channel id in two places.
Is there anything in your page that is custom that would affect it?
If there is no jquery errors or conflicts, what error is there?
Like I said the url will become mydomain/undefined and it not creating a thread. You are right I will not using it, but I also tried/try to help you. There is no comment I mention your mod is crap!

My vB-Version is 5.6.1 Alpha 4

It is not give me any error (not in the console or php-errors).
Most users here are to lazy to install a mod to try if it works in new versions, so I want to tell you to go a secure way and do not support a mod which works for you but perhaps not for others.
I looked a little deeper because I will not named a jerk which is not helping!

The form-action attribute you set is "create-content/text" and the ajaxForm url is "this.href" which override the form-action attribute "create-content/text". This is not correct in both cases, because you need to set the ajax-baseurl!!!

Change your js-script url to url: vBulletin.getAjaxBaseurl() + '/create-content/text',

console-answer:
Object { retUrl: "https://mydomain.de/forum/main-forum/782-this-is-a-test-review", nodeId: 782 }

Thats it... content is created and you will be redirected to it.

You have to much places code have to be changed and it is a little unstructured but I did not say crap!

Wonder that it is working for you, but could be the js-changes in version 5.6.0 and 5.6.1 ...

Glad I could help!
Reply With Quote
Благодарность от:
megabink
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:24 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06662 seconds
  • Memory Usage 2,335KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (3)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete