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)

midnz 05-18-2011 11:01 PM

Quote:

Originally Posted by bananalive (Post 2196512)
Perhaps add checkboxes to


AdminCP -> VBulletin Options -> Easy Form Options -> Question Types to Hide in Form Results Table

Although this will affect all your forms

Thanks :). I have added checkboxes so that they're hidden in Form Results Tables.

I wondered if it was possible to have checkbox answers converted to unique numbers and then have all of those unique numbers totaled?

Example:
Question: What colours.....?
Checkbox Answers: 1.Blue 2.Green 4.Yellow 8.White 16.Pink 32.Red 64.Black 128.Purple 256.etc etc etc (the numbers would need to be invisible)

Somebody selecting Yellow, Black and Blue would cause the answer in the Form Results Table to be 69
That would make it easy to know which checkboxes were selected because only 4 + 1 + 64 = 69

Jurg 05-19-2011 04:26 AM

Quote:

Originally Posted by Jurg (Post 2193240)
Please can someone tell me how I could phrase a form hook for the following:

I intend to have 22 identical drop-down fields with 22 answers. I need to validate this before submission to ensure that each answer is selected only once. I.E. each answer will be selected once. Apologies but my PHP knowledge is not good, any help would be appreciated.

Anyone?

whitey92lx 05-19-2011 04:53 PM

awesome!

helwoe 05-24-2011 03:22 AM

Is there a way to tweak this code to make multi-select list?

Code:

$answer .= '<select name="'.$formbit[id].'">';
$answer .= '<option></option>';
$thisanswer = $q_{$formbit[id]};
$members = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "user
WHERE membergroupids LIKE \"%17%\"
ORDER BY username ASC");
    while($row = $db->fetch_array($members)) {
$answer .= '<option value="'.$row[username].'"';
if ($row[username] == $thisanswer) {
$answer .= 'selected="selected"';
}
$answer .= '>'.$row[username].'</option>';
}
$answer .= '</select>';


Kapeket 05-24-2011 04:08 AM

How about a way to have a specific form open from the nav button directly?

Not the list per say.

Thanks!

Tahooma 05-24-2011 05:40 PM

Thank you for your reply bananalive!

Quote:

Yes, select the Form Action as 'Create a New Thread', and then there will be an option to allow attachments
For us it is very important that the data are not visible for other users.
Is there any other way to upload the pics whereby no new threat will be be opend and so the date are not visible vor any other persons?

Regards
Harald

clubvr4 05-25-2011 10:35 AM

Hi,

I'm having some problems with prefix.

I am using the following code in my custom question "choose prefix"

PHP Code:

require_once(DIR '/includes/functions_prefix.php'); 
$thisanswer $q[$formbit[id]]; 
if (!
$form['forumid'])
{
$form['forumid'] = xx;
}
$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>'

Where XX is the destination forum of the form.

under form actions i have selected "no prefix", when i go to my form, i can see the dropdown with all the prefix for the destination forum, but when i submit - no prefix is attached the the thread.

There are no custom hooks etc for this form.

Please advise.

clubvr4 05-25-2011 10:45 AM

I've also tried using the following code, to no avail.

PHP Code:

require_once(DIR '/includes/functions_prefix.php');  
$thisanswer $q[$formbit[id]];  
$forumid $form['forumid'] = XX
$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>'

However,

using the above code, and the no attachments code you kindly provided me before - I find that when i click on attachments i do not have permissions to access to FUM..

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>';


Removing either the no attachment code or the prefix select code allows me to once again open FUM.

Evertonized 05-25-2011 10:47 AM

When I submit the form it says thanks for submitting and looks like it's worked. However the results show no one has submitted a form.

What could be the problem?

clubvr4 05-25-2011 11:53 AM

Quote:

Originally Posted by clubvr4 (Post 2111983)
Or, is there a widget out yet for using Forms with CMS?

Is there any method of CMS being used to display the forms?

clubvr4 05-25-2011 01:58 PM

Quote:

Originally Posted by clubvr4 (Post 2199743)
I've also tried using the following code, to no avail.

PHP Code:

require_once(DIR '/includes/functions_prefix.php');  
$thisanswer $q[$formbit[id]];  
$forumid $form['forumid'] = XX
$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>'

However,

using the above code, and the no attachments code you kindly provided me before - I find that when i click on attachments i do not have permissions to access to FUM..

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>';


Removing either the no attachment code or the prefix select code allows me to once again open FUM.

/facepalm..

found #879

All sorted now...

clubvr4 05-25-2011 06:48 PM

Me again...

Its all working now, so im very happy - But, I am wondering....

I have 5 prefixes configured on the for sale forum, there are 3 forms being used to input threads into this forum. What i would like is that one of these forms, only presents 2 of the 5 prefixes, ensuring that people dont click one of the other 3 by mistake.

Is this possible somehow?

Cheers

helwoe 05-31-2011 01:43 AM

Anyone?

Quote:

Originally Posted by helwoe (Post 2199346)
Is there a way to tweak this code to make multi-select drop down list?

Code:

$answer .= '<select name="'.$formbit[id].'">';
$answer .= '<option></option>';
$thisanswer = $q_{$formbit[id]};
$members = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "user
WHERE membergroupids LIKE \"%17%\"
ORDER BY username ASC");
    while($row = $db->fetch_array($members)) {
$answer .= '<option value="'.$row[username].'"';
if ($row[username] == $thisanswer) {
$answer .= 'selected="selected"';
}
$answer .= '>'.$row[username].'</option>';
}
$answer .= '</select>';



KevinL 06-04-2011 11:50 AM

I have this on a clients site. They have reviews setup in certain forums using this mod.

There is one forum though that the "post new review" button does not work. There is just a '1' after the forum URL. It is set up just like every other form forum.

Is there something I am over looking?

Any help would be great!

Thanks :)

scubasteve3 06-04-2011 06:57 PM

Sorry, I have not been able to read through all 89 pages of this thread. Great mod! I was wondering, is there a way to change the nav link. I want to change the name from the default "Forms". Also, is it possible to make this a button somewhere on the page instead of in the navbar. Thanks!

bananalive 06-05-2011 03:27 PM

Quote:

Originally Posted by scubasteve3 (Post 2203538)
Sorry, I have not been able to read through all 89 pages of this thread. Great mod! I was wondering, is there a way to change the nav link. I want to change the name from the default "Forms". Also, is it possible to make this a button somewhere on the page instead of in the navbar. Thanks!

AdminCP -> Edit Phrase -> forms

There is also a link in navbar under 'Quick Links'

Or post the html link in one of your templates where you want it.

bananalive 06-05-2011 03:29 PM

Quote:

Originally Posted by KevinL (Post 2203380)
I have this on a clients site. They have reviews setup in certain forums using this mod.

There is one forum though that the "post new review" button does not work. There is just a '1' after the forum URL. It is set up just like every other form forum.

Is there something I am over looking?

Any help would be great!

Thanks :)

I'm not sure how you've setup it, but check the html or plugin which edits the url.

bananalive 06-05-2011 03:39 PM

Quote:

Originally Posted by helwoe (Post 2199346)
Is there a way to tweak this code to make multi-select list?

Code:

$answer .= '<select name="'.$formbit[id].'">';
$answer .= '<option></option>';
$thisanswer = $q_{$formbit[id]};
$members = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "user
WHERE membergroupids LIKE \"%17%\"
ORDER BY username ASC");
    while($row = $db->fetch_array($members)) {
$answer .= '<option value="'.$row[username].'"';
if ($row[username] == $thisanswer) {
$answer .= 'selected="selected"';
}
$answer .= '>'.$row[username].'</option>';
}
$answer .= '</select>';



Quote:

Originally Posted by helwoe (Post 2201916)
Anyone?

PHP Code:

$answer .= '<select name="'.$formbit[id].'[]" multiple="multiple" size="4">';
$answer .= '<option></option>';
$thisanswer explode(',',$qo[$formbit[id]]);
$members $db->query_read("SELECT * FROM " TABLE_PREFIX "user
WHERE membergroupids LIKE \"%17%\"
ORDER BY username ASC"
);
    while(
$row $db->fetch_array($members)) {
$answer .= '<option value="'.$row[username].'"';
if (
in_array($row[username], $thisanswer)) {
$answer .= 'selected="selected"';
}
$answer .= '>'.$row[username].'</option>';
}
$answer .= '</select>'


bananalive 06-05-2011 03:41 PM

Quote:

Originally Posted by clubvr4 (Post 2199914)
Me again...

Its all working now, so im very happy - But, I am wondering....

I have 5 prefixes configured on the for sale forum, there are 3 forms being used to input threads into this forum. What i would like is that one of these forms, only presents 2 of the 5 prefixes, ensuring that people dont click one of the other 3 by mistake.

Is this possible somehow?

Cheers

Yes, but you'll have to use the form hooks.

bananalive 06-05-2011 03:42 PM

Quote:

Originally Posted by Evertonized (Post 2199745)
When I submit the form it says thanks for submitting and looks like it's worked. However the results show no one has submitted a form.

What could be the problem?

Have you selected 'Save to Database' as Form Action?

KevinL 06-05-2011 03:42 PM

Quote:

Originally Posted by bananalive (Post 2203872)
I'm not sure how you've setup it, but check the html or plugin which edits the url.

I'll be honest, I don't know how it was set up. I wasn't the one that installed it.

From what I can see there is nothing in the "forumdisplay" template. Which plugin would it be? The form is created and pointing to the correct forum. Just the new thread (review) button does not work.

Thank you for the help

bananalive 06-05-2011 04:05 PM

Quote:

Originally Posted by KevinL (Post 2203881)
I'll be honest, I don't know how it was set up. I wasn't the one that installed it.

From what I can see there is nothing in the "forumdisplay" template. Which plugin would it be? The form is created and pointing to the correct forum. Just the new thread (review) button does not work.

Thank you for the help

Have a look down the plugin list. It might be called on newreply_form_complete or similar plugin.

Vitaris 06-05-2011 04:20 PM

Firstly just wanted to say that I absolutely love this addon. It's saved me a ton of trouble on my Warcraft guild forums for applications. So BL, thank you tons! It even works flawlessly for me after upgrading to vB 4.1, a move I was hesitant to make for addons like this.

I do have a question, though. Is there a way to pull the forum's internal date and post it in the thread title? I'm looking for something like a M d Y format auto detected from the boards, but I can't find anything relevant in this thread. Sorry if I've missed it! I have a forum that's in dire need of some structure in the title. :)

Thank you for an awesome mod!

bananalive 06-05-2011 04:40 PM

Quote:

Originally Posted by Vitaris (Post 2203891)
Firstly just wanted to say that I absolutely love this addon. It's saved me a ton of trouble on my Warcraft guild forums for applications. So BL, thank you tons! It even works flawlessly for me after upgrading to vB 4.1, a move I was hesitant to make for addons like this.

I do have a question, though. Is there a way to pull the forum's internal date and post it in the thread title? I'm looking for something like a M d Y format auto detected from the boards, but I can't find anything relevant in this thread. Sorry if I've missed it! I have a forum that's in dire need of some structure in the title. :)

Thank you for an awesome mod!

Cheers.

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

$threadtitle .= vbdate(" M d Y"TIMENOW); 


Vitaris 06-05-2011 04:46 PM

Thank you for the fast reply, it works perfectly! :D Best mod ever. :D

ascroft 06-06-2011 03:30 AM

Hi there Dom.

I have the following code in a form question (thanks to you! :-)) but I would like to control the order of the items in the drop down list - only 2 there for now but will have have maybe 30 or so soon. Ideally I would like total control as I want to order geographically which only I know. Is this possible please? I was thinking I could keep the order in some kind of variable?

Many thanks

Mark

$answer = "<select name=\"$formbit[id]\" id=\"q_" . $formbit[id] . "\">";
foreach ($vbulletin->forumcache AS $forumid => $forum)
{
if (!in_array($forumid, array(61,56)))
{
continue;
}
if ($qo['forumid']==$forumid)
{
$forum['selected'] = ' selected="selected"';
}
$answer .= "<option value=\"$forumid\"$forum[selected]>$forum[title]</option>";
}
$answer .= "</select>";

bananalive 06-08-2011 09:02 AM

Quote:

Originally Posted by ascroft (Post 2204136)
Hi there Dom.

I have the following code in a form question (thanks to you! :-)) but I would like to control the order of the items in the drop down list - only 2 there for now but will have have maybe 30 or so soon. Ideally I would like total control as I want to order geographically which only I know. Is this possible please? I was thinking I could keep the order in some kind of variable?

Many thanks

Mark


$answer = "<select name=\"$formbit[id]\" id=\"q_" . $formbit[id] . "\">";
foreach ($vbulletin->forumcache AS $forumid => $forum)
{
if (!in_array($forumid, array(61,56)))
{
continue;
}
if ($qo['forumid']==$forumid)
{
$forum['selected'] = ' selected="selected"';
}
$answer .= "<option value=\"$forumid\"$forum[selected]>$forum[title]</option>";
}
$answer .= "</select>";

Yes, but you'll have to create new array to change order, see below example:

(This would show Forumid 2, Forumid 10, then Forumid 1)

PHP Code:

$newarray = array(
  
=> $vbulletin->forumcache['2'],
  
10 => $vbulletin->forumcache['10'],
  
=> $vbulletin->forumcache['1'],
);
$answer "<select name=\"$formbit[id]\" id=\"q_" $formbit[id]  . "\">";
foreach (
$newarray AS $forumid  => $forum)
{
if (
$qo['forumid']==$forumid)
{
$forum['selected'] = ' selected="selected"';
}
$answer .= "<option value=\"$forumid\"$forum[selected]>$forum[title]</option>";
}
$answer .= "</select>"


ascroft 06-08-2011 09:30 AM

Thanks a lot - works perfectly. Much appreciated.

Mark

clubvr4 06-08-2011 01:00 PM

Quote:

Originally Posted by bananalive (Post 2203878)
Yes, but you'll have to use the form hooks.

Cheers for responding.

Would you be able to advise, my hook skills are limited to zero.

Thanks

Fuji1004 06-10-2011 05:25 PM

Nice mod, thanks for that.
But one question: I want to translate the following phrase, but I can't find it by searching all phrases:

"Error, you have exceeded limit for number of times this form can be submitted."

Where can I find this phrase?

Thanks for help

steven s 06-12-2011 02:23 PM

I use the address field.

When I view results, the address is there.
When I go to edit a filled form, there may be a single number or letter in address, city and state.

If I save, that information is also saved. ????

bananalive 06-12-2011 03:01 PM

1 Attachment(s)
Quote:

Originally Posted by steven s (Post 2206657)
I use the address field.

When I view results, the address is there.
When I go to edit a filled form, there may be a single number or letter in address, city and state.

If I save, that information is also saved. ????

Try attached file...

bananalive 06-12-2011 03:03 PM

Quote:

Originally Posted by Fuji1004 (Post 2205916)
Nice mod, thanks for that.
But one question: I want to translate the following phrase, but I can't find it by searching all phrases:

"Error, you have exceeded limit for number of times this form can be submitted."

Where can I find this phrase?

Thanks for help

Edit Phrase: form_error_limit_exceeded

steven s 06-12-2011 03:15 PM

Quote:

Originally Posted by bananalive (Post 2206668)
Try attached file...

That did it. :)
Thanks!
Excellent mod. :up:

I spoke too soon.
Zip Code is now State
State is now City
City is now Address line 2

bananalive 06-12-2011 03:55 PM

1 Attachment(s)
Quote:

Originally Posted by steven s (Post 2206675)
That did it. :)
Thanks!
Excellent mod. :up:

I spoke too soon.
Zip Code is now State
State is now City
City is now Address line 2

Ah, yes forgot line 2 could be optional. Should be fixed in attached file.

steven s 06-12-2011 04:34 PM

Quote:

Originally Posted by bananalive (Post 2206700)
Ah, yes forgot line 2 could be optional. Should be fixed in attached file.

Marvelous!
Looks good now.
This mod is a life saver. I used to use form mail but bots were relentless.
Now I can limit who can view and submit the form.
Thanks again!

Rabby 06-13-2011 10:27 PM

Is it possible to display a form before purchasing a paid subscription? Like you select a paid subscription, and just before you're redirected to the payment site, you'll get a form displayed which must be accepted/filled with information.

Hendrik83 06-14-2011 08:07 AM

The editor is not working anymore with the vb 4.1.4 update.

gr8whtd0pe 06-14-2011 10:24 PM

Quote:

Originally Posted by Hendrik83 (Post 2207483)
The editor is not working anymore with the vb 4.1.4 update.

I had to change mine to a multi-line text box. :(

Shadow09 06-15-2011 07:33 AM

Quote:

Originally Posted by Hendrik83 (Post 2207483)
The editor is not working anymore with the vb 4.1.4 update.

Same here... Disabled til fix.


All times are GMT. The time now is 11:01 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.03780 seconds
  • Memory Usage 1,907KB
  • 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
  • (8)bbcode_php_printable
  • (24)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
  • (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