vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   New Posting Features - Easy Forms v4.x - Create a form or multiple forms without php or html knowledge (https://vborg.vbsupport.ru/showthread.php?t=234385)

SpaceStar 04-16-2011 12:14 AM

Superb. Working.

Just a simple question, maybe it's asked and answered before...

When a user has submitted the form, is there a way of validating the answered and show the result to user?

Thamks

bananalive 04-16-2011 09:08 AM

Quote:

Originally Posted by clubvr4 (Post 2183787)
Hello great hack!

Is it possible to make attachments mandatory?

Edit Form -> Form Hooks -> Form Hook: Before Submit:
PHP Code:

$currentattaches $db->query_first("SELECT COUNT(*) AS countrows FROM " TABLE_PREFIX "attachment WHERE posthash = '" $db->escape_string($posthash) . "' AND userid = " $vbulletin->userinfo['userid'] );
$attachcount $currentattaches['countrows'];
if (!
$attachcount)
{
$complete false;
$customerror .= '<div class="blockrow"><div>Error, No attachments!</div></div>';



bananalive 04-16-2011 09:15 AM

Quote:

Originally Posted by Za4a Tuner (Post 2183815)
Hello,
i have two question to this mod:

1.)
How can i link the "new thread"-button of a forum to a form?
In a forum with the ID = 46 the "new thread" should be replaced by a form with the ID = 4
If someone like to create a new thread, he should use the form nr. 4, wich "Post a new Thread" in the forum.

2.)
The forum above MUST have a prefix, but not always the same prefix => users should be able to use a prefix that fits to the form.
I created a custom question with the following php-code inside:
PHP Code:

require_once(DIR '/includes/functions_prefix.php'); 
$thisanswer $q[$formbit[id]]; 
if (!
$form['forumid'])
{
$form['forumid'] = 46;
}
$prefix_options fetch_prefix_html($form['forumid'], $thisanswertrue); 
$answer '<select name="' $formbit[id] . '" id="q_' $formbit[id] . '" class="bginput">'
$answer .= '<option value="">'.$vbphrase[no_prefix_meta].'</option>'
$answer .= $prefix_options
$answer .= '</select>'

The question will be shown on the form, but there are no prefixes displayed! How can i get it running?



Can anyone give me a help please?

kr Chris

1. Vbulletin AdminCP -> New Plugin
Hook location: newthread_form_start
Php code:
PHP Code:

if (in_array($forumid, array(1,2))) 

header'Location: http://www.youriste.com/forums/misc.php?do=form&fid=8' ) ; 


2. Add the following to the custom php question, do you get the right forumid (46) at the top of the form?
PHP Code:

print_r($form['forumid']); 


bananalive 04-16-2011 09:16 AM

Quote:

Originally Posted by Welshy2008 (Post 2184478)
I am running vB4.0.7 currently and all forms have been taken from my 3.8.6 version.

I have just tried to add a new "e-mail to me" form, but I have several issues.

1. I have a prefilled username question (which doesn't align in the centre, like the others, but instead shows on the left under the question).

2. I enter an E-mail title and it doesn't save -I get diverted to http://www.myforum.com/#main-forums

3. The same thing happens when I select the tickbox for E-mail Form. (as number 2 above). Previously there was a box that appeared where I would enter the e-mail address that I want the form enailed to, this no longer shows.

4. Form Submit Limit Per User: doesn't save either

5. After Form is Submitted - Form submitted Message doesn't save.

Please can you help me with the above (or anyone else)? I desperately need your help in this, as I need to add these as soon as please.


I also have search engine friendly URLs and vBSEO installed.

Many Thanks.

It may be caused by vbseo, can you disable it on page misc.php and see if that has an effect?

bananalive 04-16-2011 09:17 AM

Quote:

Originally Posted by zushiba (Post 2184644)
What would be the easiest way to go about putting a character limit on text and textarea fields?

Edit Question, set maxlength

bananalive 04-16-2011 09:19 AM

Quote:

Originally Posted by kether1 (Post 2184950)
Dom,

Is there a way to group all of a member's threads created when submitting via this forms modification?

For example:

Lets say a form can be submitted multiple times by a member.

When visiting the forum section where the form is published, is it possible to have all of 'Member A's' threads grouped together (like a sub-forum) and all of Member B's responses grouped together?

Like this:
FORUM where form creates a new thread.

Member A
----first submitted response,
----second submitted response,
----Third...

Member B
----First submitted response,

Member C
----first submitted response,
----second submitted response,
SO, when a member clicks on this forum, they see a list of sections titled with the username. And if they click that name, they see all of the threads that person created by submitting the form.

I hope I explained this where it can be understood. :)

Thanks!
Kether

You will need a separate modification for this which alters thread list.

bananalive 04-16-2011 09:20 AM

Quote:

Originally Posted by SpaceStar (Post 2185110)
Superb. Working.

Just a simple question, maybe it's asked and answered before...

When a user has submitted the form, is there a way of validating the answered and show the result to user?

Thamks

By using quiz mode, php hooks or <vb:if condition=""> in custom output.

Za4a Tuner 04-16-2011 01:24 PM

Quote:

Originally Posted by bananalive (Post 2185204)
1. Vbulletin AdminCP -> New Plugin
Hook location: newthread_form_start
Php code:
PHP Code:

if (in_array($forumid, array(1,2))) 

header'Location: http://www.youriste.com/forums/misc.php?do=form&fid=8' ) ; 



This works fine, now the button "New Thread" roots to the form :D

but:
Quote:

Originally Posted by bananalive (Post 2185204)
2. Add the following to the custom php question, do you get the right forumid (46) at the top of the form?
PHP Code:

print_r($form['forumid']); 


This won't work :(
The forum-id is correct (it's from my liveforum)
Can you give me a "step by step" instruction, what i have to do, that a dropdown-field with the prefixes of a specified forum will be shown?

The form should create a new thread in forum-id = 46, and the prefixes of this forum sould be listed in the form, cause they are required for a new thread!


kr Chris

ascroft 04-16-2011 09:29 PM

Hi there.

One thing I noted today, when the thread is moved to the correct forum, is that it doesn't update the 'header' type of information in the forum summary i.e. last post details, no. of threads/posts. The thread itself is there fine. Example is: http://www.shackchat.co.nz/listings/...lington-Region

I am thinking this needs more code to be added to the plugin in possibly?

Many thanks

Mark



Quote:

Originally Posted by bananalive (Post 2182257)
Try this...

AdminCP -> Plugins & Products -> Add New Plugin

Hook Location
Code:

newthread_post_complete
Title
Code:

Move Thread created by easy forms
PHP Code
PHP Code:

if ($fid == 43)
{
$forumid $q['forumid'];
$dataman =& datamanager_init('Thread'$vbulletinERRTYPE_ARRAY'threadpost'); 
$dataman->set_existing($threadinfo);  
$dataman->setr('forumid'$forumid);  
$dataman->pre_save(); 
if (
count($dataman->errors) > 0

    foreach (
$errors as $error)
    {
        
$errorss .= $error"<br />";
    }
    
$errormessage "Form failed to submit. The following error(s) occured: <br /> ".$errorss;
    eval(
standard_error($errormessage));

else 

$dataman->save();  
$foruminfo fetch_foruminfo($forumid);
$threadinfo fetch_threadinfo($newpost['threadid']);
mark_thread_read($threadinfo$foruminfo$vbulletin->userinfo['userid'], TIMENOW);    
}


Plugin is active
Code:

Yes

Change 43 to appropriate form id.


Darksome 04-18-2011 03:19 PM

New to vB but slowly picking things up. I think I will find this mod extremely useful, but I'd like to know how I can add an 'insert image' button to the vbeditor question section, next to the email and insert link buttons for example.

Or indeed, can it be replaced with all the interface options as if posting a new thread such as; post icons and the tag box?

Cheers


All times are GMT. The time now is 03:28 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03006 seconds
  • Memory Usage 1,799KB
  • 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_code_printable
  • (7)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)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