vb.org Archive

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

bananalive 07-03-2009 02:53 PM

Quote:

Originally Posted by tldagent (Post 1842038)
Thanks a bunch for your prompt reply.

Imported and overwrote the current form and it still does the same thing. So I created a new form and the description seems to attach itself on a new form just fine but once I go into edit that form and check the selection boxes and hit save, it goes directly to:
Code:

http://www.philosophyforum.com/forum/#lounge
so I'm thinking it may need some re-write rules for vbseo. For some reason hitting submit opens that anchor link to the lounge.

Does anyone else using this form have vbseo with similar problems?

You could look on vbseo website for hints.

pmflav1 07-03-2009 04:42 PM

I have made a little script for our site and thought I would share how I did it with everyone.

This will give you a directory dropdown list in your form, which we are using to choose pictures within a Directory.

Get rid of the space in the opening IMG tags, had to put a space in them to show up in here.

Create a Custom field in your form.
In the phpcode field add the following:
Code:

$answer = '<select id=" name="'.$formbit[id].'">';
$answer .= '<option>--Select Map--</option>';
$thisanswer = $q_{$formbit[id]};

$dirPath = dir('/path/to/image');
$imgArray = array();
while (($file = $dirPath->read()) !== false)
{
  $imgArray[ ] = trim($file);
}
$dirPath->close();
sort($imgArray);
$c = count($imgArray);
for($i=0; $i<$c; $i++)
{
$answer .= '<option value="'.$imgArray[$i].'">'.$imgArray[$i].'';
}

$answer .= '</select>';

Change the following to suite the dir your images are in:
$dirPath = dir('/path/to/image');

Find in plugin Easy forms Part 1
Code:

/*($hook = vBulletinHook::fetch_hook('newthread_post_complete')) ? eval($hook) : false;*/
Replace with:
Code:

($hook = vBulletinHook::fetch_hook('newthread_post_complete')) ? eval($hook) : false;
To get the image to show up once the form is submited, enter the following in to the Custom Form Output, change the domain and directory to suit where the image is located:
Code:

[IMG ]http://www.yourdomain.com/images/maps/$q[39][/IMG]
There is probably an easier way of doing this, but hey it works.

Also if you wish to change the size of your images using the IMG tag then visit
http://tech.mikelopez.info/2006/03/0...resize-script/, and download their script.

This is how I used it: Custom Form Output
Code:

[IMG ]http://www.yourdomain.com/images/imgsize.php?w=250&h=250&constrain=1&img=/path/to/images/maps/$q[39][/IMG]
Replace $q[39] with your field number.

Again changing the domain and paths to suit. The paths are absolute, not relative.

pmflav1 07-04-2009 04:45 AM

Another little hand snipped.
This will give you a dropdown list of times, in 15 min incriments. ie. 12:15pm etc....

Create a Custom field:
Enter the following into your PHP Code Filed.

Code:

$start = strtotime('1:00am');
$end = strtotime('11:59pm');
$answer = '<select name="'.$formbit[id].'">';
$answer .= '<option></option>';
$thisanswer = $q_{$formbit[id]};

for ($i = $start; $i <= $end; $i += 900)
{
$answer .= '<option value="'.date('g:i a', $i).'">'.date('g:i a', $i).'';
}
$answer .'</select>';

Enjoy.

The next code I will be working on is a java based countdown timer for the frontpage of our site which will let people know how much time is left before the time is reached, compared with the time set in the VB CP.
However if anyone has any ideas on this then please do share, saves re-inventing the wheel.

Cheers

MoveOver.cc 07-04-2009 08:28 AM

"Can't you add it to the main page like any other module?"

No, I can make it a module but it is not visible on the "homepage"

bananalive 07-04-2009 11:18 AM

Quote:

Originally Posted by MoveOver.cc (Post 1842555)
"Can't you add it to the main page like any other module?"

No, I can make it a module but it is not visible on the "homepage"

vBa CMPS -> Edit Modules -> {module}

Select 'Add/Remove From Pages' from dropdown

Then you can choose which pages it is displayed on.

MaR? 07-04-2009 05:34 PM

Hi Banana!!!

I made a MAIL form... all is just right... but the "sender" mail is mine... I want the sender to be the user who´s sending the form... is that possible?... am I clear? lol

bananalive 07-04-2009 07:13 PM

Quote:

Originally Posted by MaR? (Post 1842789)
Hi Banana!!!

I made a MAIL form... all is just right... but the "sender" mail is mine... I want the sender to be the user who?s sending the form... is that possible?... am I clear? lol

Form Plugin: Before Submit
PHP Code:

$from $vbulletin->userinfo[email]; 


MaR? 07-04-2009 07:25 PM

Thank you so much banana!!! workin great.... your mod is EXCELENT!!!!

Quantnet 07-04-2009 09:47 PM

This has a lot of potential. I plan to modify this mod to obtain something TOTALLY DIFFERENT.

example: http://www.trackitt.com/usa-immigrat...kers/i130-i485

Question

1) Can we sort by column headers?
2) Can users go back and complete/update partial filled forms?
3) Is there anywhere the user can control the number of cases they filled?

Thanks

jacko_162 07-04-2009 10:29 PM

i was wondering if i have a question where someone has to put there postcode in, can i have the answer link to a URL to a map showing the postcode?

its for my classified section.

other than that excellent script. clicked install.. :)

also is it possible to highlight answers to 2x questions red and BOLD? (for example both answers should be a price!)

thank you.

hqlman 07-05-2009 01:08 AM

I found a small bug, when writing a description i used inverted commas like: "Introduce Yourself" , on my form the output is as such: &quot;Introduce Yourself&quot;

Im not sure how this bug can be corrected, anyone?

pmflav1 07-05-2009 01:40 AM

Quote:

i was wondering if i have a question where someone has to put there postcode in, can i have the answer link to a URL to a map showing the postcode?

its for my classified section.

other than that excellent script. clicked install..

also is it possible to highlight answers to 2x questions red and BOLD? (for example both answers should be a price!)

thank you.
You can use the Custom Form Output for both of these if I am reading the question right

A1.
Code:

[HTML]http://www.yourmap.com/{q_*}[/HTML ]
Replacing * with your field number.
Or to have text linking:
Code:

[URL="http://www.yourmap.com/{q_*}"]Click here for map[/URL ]
Remove spaces out of closing [/URL ]

A2.
To have your answers in bold, use Custom Form Output:
Code:

[B][COLOR="Red"]{q_*}[/COLOR ][/B ]
Again, replacing * with your field number. Remove spaces out of closing [/B ] and [/COLOR ]

pmflav1 07-05-2009 01:47 AM

Quote:

I found a small bug, when writing a description i used inverted commas like: "Introduce Yourself" , on my form the output is as such: &quot;Introduce Yourself&quot;

Im not sure how this bug can be corrected, anyone?
Strange. Tried to replicate this, and the output is "Introduce Yourself"

Are you using a custom field?

Quantnet 07-05-2009 02:44 AM

I have added a question with date type and it's not compulsory i.e I don't have to choose any date. However, the default format for that date field is already have Jan chosen and if I don't pick any date, it will display the error and prevent me from go to other questions.

Quantnet 07-05-2009 02:57 AM

Quote:

Originally Posted by Vitaly (Post 1764244)
And date format is hardcoded. It's better to use format string from VB options (not from language preferences).

8. I'd show asterisks (*) for compulsory question with red color.

Can do so with template edit, but think, that would be useful for all as general template.
.

1) The date output is right now as 3\30\2006, how do I change it to 3/30/2006
2) Which template I need to edit to show the * in red.

steve71 07-06-2009 12:00 AM

I've had no luck with the thumbnails but thanks for the effort and continued support. Is it possible to have the "insert image" icon added to the "field using vb editor"?

Quantnet 07-06-2009 01:49 AM

Is there any plan in the future to store the form data as fields in the database. It will allow the sort by column in the result table.
I've seen a couple of people asking this so it would be awesome if you can add this feature.

Second, can you add a features for members to come back later to edit/update/finish their answers in the form?
This will have to do with a tracking of how many forms each member submit.

ConfusedCartman 07-06-2009 09:30 AM

First of all, thanks for the great mod!

I'm having a bit of an issue, though, and since I'm not too well versed in PHP, I may need your help. I'm trying to work around the fact that there's no easy way to offer the user a choice of a prefix (though if there is, let me know - I tried the code you offered earlier on, but it didn't work). Anyway, I'm adding a radio selection in which the top option will include a preset prefix, and the bottom option will not include any prefix. I'm trying to use an if-else combined with a str_replace in order to add the right "prefix" (actually, it's just extra text) when the option is selected.

In Form Hook: Before Submit:
PHP Code:

if ($q[6] == 1)
{
    
$formoutput str_replace("{f4f}""[f4f]F4F:[/f4f]"$formoutput);
} else {
    
$formoutput str_replace("{f4f}"""$formoutput);


{f4f} is the placeholder that I'm using in order to place the text in the right place. I have the {f4f} placeholder in the Thread/ PM/ Email Title field, but it doesn't get replaced when I submit the form - it just remains in the title. I'm not saying it's your fault - if anything, it's probably a product of poor coding on my part. I'm not very familiar with PHP, so I just know enough to get by. Any chance you can help? It would be greatly appreciated. :)

bananalive 07-06-2009 02:32 PM

Quote:

Originally Posted by Quantnet.org (Post 1842885)
This has a lot of potential. I plan to modify this mod to obtain something TOTALLY DIFFERENT.

example: http://www.trackitt.com/usa-immigrat...kers/i130-i485

Question

1) Can we sort by column headers?
2) Can users go back and complete/update partial filled forms?
3) Is there anywhere the user can control the number of cases they filled?

Thanks

1. In the latest version you can sort form data stored to database by headers via javascript (view results as table)
2. No.
3. You can limit how many times a user can submit the form by editing a form.

bananalive 07-06-2009 02:36 PM

Quote:

Originally Posted by jacko_162 (Post 1842908)
i was wondering if i have a question where someone has to put there postcode in, can i have the answer link to a URL to a map showing the postcode?

its for my classified section.

other than that excellent script. clicked install.. :)

also is it possible to highlight answers to 2x questions red and BOLD? (for example both answers should be a price!)

thank you.

You use try creating a custom output, some-else has replied with specifics a few posts up.

bananalive 07-06-2009 02:37 PM

1 Attachment(s)
Quote:

Originally Posted by hqlman (Post 1842982)
I found a small bug, when writing a description i used inverted commas like: "Introduce Yourself" , on my form the output is as such: &quot;Introduce Yourself&quot;

Im not sure how this bug can be corrected, anyone?

I can remember fixing this.

TRy attached file

bananalive 07-06-2009 03:06 PM

1 Attachment(s)
Quote:

Originally Posted by Quantnet.org (Post 1843010)
I have added a question with date type and it's not compulsory i.e I don't have to choose any date. However, the default format for that date field is already have Jan chosen and if I don't pick any date, it will display the error and prevent me from go to other questions.

Try attached file

bananalive 07-06-2009 03:07 PM

Quote:

Originally Posted by Quantnet.org (Post 1843011)
1) The date output is right now as 3\30\2006, how do I change it to 3/30/2006
2) Which template I need to edit to show the * in red.

1. Edit question and change the date spacer.

2. Findin plugin Easy Forms Part 1:
PHP Code:

$formbit['question'] = $formbit['question'] . "*"

Replace:
PHP Code:

$formbit['question'] = $formbit['question'] . "[color=red]*[/color]"


bananalive 07-06-2009 03:11 PM

Quote:

Originally Posted by steve71 (Post 1843512)
Is it possible to have the "insert image" icon added to the "field using vb editor"?

vBulletin Options -> BB Code Settings -> Allow [IMG] Code in Non Forum Specific Areas -> Yes

bananalive 07-06-2009 03:15 PM

Quote:

Originally Posted by Quantnet.org (Post 1843540)
Is there any plan in the future to store the form data as fields in the database. It will allow the sort by column in the result table.
I've seen a couple of people asking this so it would be awesome if you can add this feature.

Second, can you add a features for members to come back later to edit/update/finish their answers in the form?
This will have to do with a tracking of how many forms each member submit.

Yes that is included in v3.7

The number of times a user submits each form is recorded with v3.7 but not ability to update answers already submitted

bananalive 07-06-2009 03:18 PM

Quote:

Originally Posted by ConfusedCartman (Post 1843665)
First of all, thanks for the great mod!

I'm having a bit of an issue, though, and since I'm not too well versed in PHP, I may need your help. I'm trying to work around the fact that there's no easy way to offer the user a choice of a prefix (though if there is, let me know - I tried the code you offered earlier on, but it didn't work). Anyway, I'm adding a radio selection in which the top option will include a preset prefix, and the bottom option will not include any prefix. I'm trying to use an if-else combined with a str_replace in order to add the right "prefix" (actually, it's just extra text) when the option is selected.

In Form Hook: Before Submit:
PHP Code:

if ($q[6] == 1)
{
    
$formoutput str_replace("{f4f}""[f4f]F4F:[/f4f]"$formoutput);
} else {
    
$formoutput str_replace("{f4f}"""$formoutput);


{f4f} is the placeholder that I'm using in order to place the text in the right place. I have the {f4f} placeholder in the Thread/ PM/ Email Title field, but it doesn't get replaced when I submit the form - it just remains in the title. I'm not saying it's your fault - if anything, it's probably a product of poor coding on my part. I'm not very familiar with PHP, so I just know enough to get by. Any chance you can help? It would be greatly appreciated. :)

The prefix is a seperate field in thread database table not part of the post. $formoutput is what gets stored as the post and does not contain prefix data.

Quantnet 07-06-2009 04:31 PM

Quote:

Originally Posted by bananalive (Post 1843835)
1. Edit question and change the date spacer.

2. Findin plugin Easy Forms Part 1:
PHP Code:

$formbit['question'] = $formbit['question'] . "*"

Replace:
PHP Code:

$formbit['question'] = $formbit['question'] . "[color=red]*[/color]"


1) One thing I notice is that for the question of date type which is not required, if you don't choose any date, the result will display as //. Can you make it blank if we don't pick any date?
2) I did as told and the question now show like this
PHP Code:

Program:[color=red]*[/color

Example http://www.quantnet.org/forum/misc.php?do=form&fid=1

bananalive 07-06-2009 05:14 PM

1 Attachment(s)
Quote:

Originally Posted by Quantnet.org (Post 1843899)
1) One thing I notice is that for the question of date type which is not required, if you don't choose any date, the result will display as //. Can you make it blank if we don't pick any date?
2) I did as told and the question now show like this
PHP Code:

Program:[color=red]*[/color

Example http://www.quantnet.org/forum/misc.php?do=form&fid=1

1. Import attached file.

2. Woops, should have been html code

Find in plugin Easy Forms Part 1:

PHP Code:

$formbit['question'] = $formbit['question'] . "*"

Replace:

PHP Code:

$formbit['question'] = $formbit['question'] . "<font color=red>*</font>"


Quantnet 07-06-2009 05:26 PM

bananalive,
Thanks, it works.
1) It would be nice to edit this phrase as well to show the red color.
Quote:

Please Note: Questions proceeded by an asterisk (*) are compulsory.
2) Which template do I edit to rearrange the form result table? I like to remove/add another column, for example
3) The sort by column header still does not work. You mentioned about using javascript in 3.7. Is it implemented yet?

Thanks for all your hard work. This is a heck of a mod.

Quantnet 07-06-2009 05:35 PM

Quote:

Originally Posted by bananalive (Post 1843803)
2. No.
3. You can limit how many times a user can submit the form by editing a form.

You answered to No to the question of whether a member can go back and edit/update their partially filled form.

How about give the user the option to delete their forms and enter a new one with updated info. Would it be able to have a Delete/Add button next to the form result table so the user can click to remove one of their form, and replace it with another.

Can AJAX feature be implemented in the future?

You know i'm trying to mold this into the trackitt.com feature so hope you can understand :)

Quantnet 07-06-2009 06:07 PM

Which permission I need to give unregistered members to be able to view form and form result table but not submit form

Quantnet 07-06-2009 06:10 PM

Suggestion:
In the form edit,
Userids:
Comma seperated list of userids who have submitted the form

Can we replace userid by username? That would be more useful.

ConfusedCartman 07-06-2009 07:30 PM

Quote:

Originally Posted by bananalive (Post 1843844)
The prefix is a seperate field in thread database table not part of the post. $formoutput is what gets stored as the post and does not contain prefix data.

Ah, I see I've confused you. I'm taking a different route, so I'll ask a different question:

Is there any way to use PHP to append "&prefixid=f4f" onto the end of the url that is submitted? This may allow me to use an if-else statement and, if it returns true, add the actual prefix to the thread.

By the way, if there is any way you can allow users to select their own prefix, that would be a much better solution than the above. Like I said, I tried the code you offered earlier, but it didn't work. Is there any way you can add this functionality?

bananalive 07-07-2009 03:19 PM

Quote:

Originally Posted by Quantnet.org (Post 1843940)
bananalive,
Thanks, it works.
1) It would be nice to edit this phrase as well to show the red color.

2) Which template do I edit to rearrange the form result table? I like to remove/add another column, for example
3) The sort by column header still does not work. You mentioned about using javascript in 3.7. Is it implemented yet?

Thanks for all your hard work. This is a heck of a mod.

1. i might move that into phrase for next version.

2. it's hard coded atm.

3. you'll be missing two javascript files, which are needed for javascript sort table

bananalive 07-07-2009 03:23 PM

Quote:

Originally Posted by Quantnet.org (Post 1843947)
You answered to No to the question of whether a member can go back and edit/update their partially filled form.

How about give the user the option to delete their forms and enter a new one with updated info. Would it be able to have a Delete/Add button next to the form result table so the user can click to remove one of their form, and replace it with another.

Can AJAX feature be implemented in the future?

You know i'm trying to mold this into the trackitt.com feature so hope you can understand :)

form results table is currently only viewable to those who can edit forms. it is much easier to implement than updating it.

What part did you want to use ajax?

bananalive 07-07-2009 03:24 PM

Quote:

Originally Posted by Quantnet.org (Post 1843971)
Which permission I need to give unregistered members to be able to view form and form result table but not submit form

Currently it is not possible for those who cannot edit forms to view form results table. This is something i am working on for v3.7.

bananalive 07-07-2009 03:26 PM

Quote:

Originally Posted by Quantnet.org (Post 1843973)
Suggestion:
In the form edit,
Userids:
Comma seperated list of userids who have submitted the form

Can we replace userid by username? That would be more useful.

User-names would make the list very long and unmanageable. Although not ideal, user-ids are much shorter and practical to use.

bananalive 07-07-2009 03:31 PM

Quote:

Originally Posted by ConfusedCartman (Post 1844016)
Ah, I see I've confused you. I'm taking a different route, so I'll ask a different question:

Is there any way to use PHP to append "&prefixid=f4f" onto the end of the url that is submitted? This may allow me to use an if-else statement and, if it returns true, add the actual prefix to the thread.

By the way, if there is any way you can allow users to select their own prefix, that would be a much better solution than the above. Like I said, I tried the code you offered earlier, but it didn't work. Is there any way you can add this functionality?

The forms use POST actions i.e. the data is not sent via a long url containing all the data and hence is more secure.

If you open template form_view

find:
HTML Code:

<input type="hidden" name="hiddenfield3" value="$hiddenfield3" />
Add after:
HTML Code:

<input type="hidden" name="prefixid" value="f4f" />

The data is then available through $_POST[prefix] after the form is submitted.

I'll have another look at my code posted earlier and find out why it didnt work for you.

chet 07-07-2009 06:18 PM

Can this been used as a forum application form, I run a closed forum but would like users to be able to apply to join.

Thanks

WickedWeb 07-08-2009 05:29 AM

Im posting this with the disclaimer of many others. I have tried searching this thread but its huge and I've had no luck at the moment so my apology if its been answered.

If it helps any I've Installed* Rated 5 Stars and Nominated as its well deserved for all 3 in my opinion. I can do anything with this.

My problem is this. In the vb form options you can set it for the button to show up in your navbar which I have done. I use a custom template so what I need to do is assign the button a defined height and width along with a class for it to blend nicely with my layout. I have looked in the header and other locations that I can think of looking for anyway to add my desired values but I never see any reference of the button along side the other navbar buttons. Where do I need to be to achieve this?

My sincere thanks


All times are GMT. The time now is 07:59 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.02558 seconds
  • Memory Usage 1,896KB
  • 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
  • (10)bbcode_code_printable
  • (2)bbcode_html_printable
  • (11)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