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 02-28-2009 10:07 AM

Quote:

Originally Posted by frogster (Post 1755698)
Hello,

I installed and can submit a form with and without a picture attachment. However, when I attach a picture and click preview I get this:

Fatal error: Call to undefined function construct_attachment_add_js() in /home/content/g/a/l/galvanm/html/app/webroot/forum/misc.php(100) : eval()'d code on line 807

What vbulletin version are you using? Are you using any modifications which alter the attachment system?

bananalive 02-28-2009 10:16 AM

Quote:

Originally Posted by Michigan Morels (Post 1755504)
Questions on number and dollar formating.

Problem 1. In a single line text field I put this
PHP Code:

/(d+)/ 

in the Regular Expression:

However when I try to submit a form I get the invalid format error.
See attach. Attachment 95542

I'm using vB 3.7.4 and Easy Forms 3.1


Question 2. Is it possible to force number in text field so that both (5) and (5.00) would show as 5.00 (with decimal) and not 5 (without decimal), on submitted post? or make them both a dollar number ($5.00)
I can live without the dollar format if too difficult, but would like the other options.

Use
Code:

/(\d+)/
Use php code at Form hook: Form Start:
PHP Code:

$q[8] = $vbulletin->input->clean_gpc('p'8TYPE_NUM);
$q[8] = vb_number_format($q[8], 2);
$_POST['8'] = $q[8]; 

replace 8 with appropriate question hash

bananalive 02-28-2009 10:17 AM

Quote:

Originally Posted by alkank (Post 1755378)
hey there. great application. but i have a same problem that is like in the past posts. i use 3.1 and when i disallow registered users to edit forms they can not see the forms. i want them to see. use thr forms but not to edit or delete. thenk you so much..

vbulletin ver. : 3.81
www.amatorbalikcilar.net

Change their permissions to view forms in vbulletin options

Gizmo999 02-28-2009 01:18 PM

Is it possible to edit a completed form if its saved to database? currently admins can view the results, delete the results but not edit the results

dknelson 02-28-2009 02:32 PM

Quote:

Originally Posted by bananalive (Post 1755287)
I'll have to have think about this. There is probably a way to use the hooks so that you only have to have one form.

WOW...I sure hope so. I thought I would go ahead and just create 60 something forms but they have custom output so I just realized that I can't just cut and past the custom output because the question numbers are different for each one, even though they are the same questions. :(

frogster 02-28-2009 03:26 PM

Quote:

Originally Posted by bananalive (Post 1756773)
What vbulletin version are you using? Are you using any modifications which alter the attachment system?


I am using vB 3.8. I have the VB blog installed, and the FB Connect mod installed besides yours. I installed the update and now I get this when trying to preview...pretty much the same.

Fatal error: Call to undefined function construct_attachment_add_js() in /home/content/g/a/l/galvanm/html/app/webroot/forum/misc.php(100) : eval()'d code on line 1704

Also, when a user submits a form to a new thread, it goes into moderation. I already made sure the newpost visable is set to 1 and checked all my forum options and everything seems to be set right. Not sure what the problem is. Hopefully I can get this fixed as this is a great mod that I would love to use.

bananalive 02-28-2009 03:35 PM

Quote:

Originally Posted by Gizmo999 (Post 1756892)
Is it possible to edit a completed form if its saved to database? currently admins can view the results, delete the results but not edit the results

Nope

bananalive 02-28-2009 03:43 PM

Quote:

Originally Posted by dknelson (Post 1756927)
WOW...I sure hope so. I thought I would go ahead and just create 60 something forms but they have custom output so I just realized that I can't just cut and past the custom output because the question numbers are different for each one, even though they are the same questions. :(

  1. Create custom question
  2. php code:
    PHP Code:

    $answer '<select name="'.$formbit[id].'">';
    $answer .= '<option></option>';
    $thisanswer $q[$formbit[id]];
    $threads $db->query_read("SELECT * FROM " TABLE_PREFIX "thread
    WHERE forumid = '10' 
    ORDER BY title ASC"
    );
        while(
    $row $db->fetch_array($threads)) {
    $answer .= '<option value="'.$row[threadid].'"';
    if (
    $row[threadid] == $thisanswer) {
    $answer .= 'selected="selected"';
    }
    $answer .= '>'.htmlspecialchars($row[title]).'</option>';
    }
    $answer .= '</select>'

  3. Replace 10 with appropriate forumid
  4. Edit Form Hook: Before Submit
    PHP Code:

    $form['threadid'] = $q[1]; 

  5. Replace 1 with appropriate question hash

Andyrew 02-28-2009 04:26 PM

Is it possible to make a form that will add the output into an existing bbcode table in a thread, :)
even if the form can be only used by me, it would make it a lot easier than keep editing a bbcode table.

DontWannaName 02-28-2009 10:13 PM

Quote:

Originally Posted by bananalive (Post 1756768)
Edit plugin: Easy Forms Part 1

Find:
PHP Code:

/*$newpost['prefixid'] =& '';*/ 

Replace:
PHP Code:

$newpost['prefixid'] =& 1''

Replace 1 with the appropriate prefixid

I get this error:

Parse error: syntax error, unexpected T_LNUMBER, expecting T_NEW or T_STRING or T_VARIABLE or '$' in /home/topnotch/public_html/forums/misc.php(100) : eval()'d code on line 438

Michigan Morels 03-01-2009 05:21 AM

First of all... Thank you bananalive, for your quick help and responses to everyone in thread. I also see you have actually updated your help file yesterday too!

Hats off to you my friend, for being so diligent and helpful.

Of course you knew there was gonna be a question or two along with this. HA!

1. I changed the code to make a single line field into a number only field
Code:

From this /(d+)/  to this:  /(\d+)/
and that did get rid of the error even when a number was correctly entered.
But... now, when a non-compulsory number only question, is left empty, it is showing the same error and not letting the form being submited.

2. I've noticed that when I use a dropdown box field, and it is Not Compulsory, that when posted, it will print the 1st option in the post. Even though not selected by user. (I haven't tried the radios or check boxes yet, but I suspect they may do the same.)

How can I make a blank/empty space at top of dropdown list, so that this doesn't happen?

3. What exactly is the Section option for and what does it do?
(I've read the help file, but still haven't a clue.)

bananalive 03-01-2009 11:21 AM

Quote:

Originally Posted by DontWannaName (Post 1757216)
I get this error:

Parse error: syntax error, unexpected T_LNUMBER, expecting T_NEW or T_STRING or T_VARIABLE or '$' in /home/topnotch/public_html/forums/misc.php(100) : eval()'d code on line 438

Sorry, my fault the 1 should be inside the ''


Edit plugin: Easy Forms Part 1

Find:
PHP Code:

/*$newpost['prefixid'] =& '';*/ 

Replace:
PHP Code:

$newpost['prefixid'] =& '1'

Replace 1 with the appropriate prefixid

dknelson 03-01-2009 12:00 PM

OK...I've pretty much got this working the way I like it to. I still wish there was a way to use one form instead of the 60 something that I had to create to post basically the same output but to different threads. It's done though and I can change it later if a solution is found.

I do have a question about URL links though. I have one question where a user can enter a URL. It posts fine the the URL is posted just as text and not as an actual link. Can I change something so that it posts as an actual link?

bananalive 03-01-2009 12:13 PM

1 Attachment(s)
Quote:

Originally Posted by Michigan Morels (Post 1757378)
First of all... Thank you bananalive, for your quick help and responses to everyone in thread. I also see you have actually updated your help file yesterday too!

Hats off to you my friend, for being so diligent and helpful.

Of course you knew there was gonna be a question or two along with this. HA!

1. I changed the code to make a single line field into a number only field
Code:

From this /(d+)/  to this:  /(\d+)/
and that did get rid of the error even when a number was correctly entered.
But... now, when a non-compulsory number only question, is left empty, it is showing the same error and not letting the form being submited.

2. I've noticed that when I use a dropdown box field, and it is Not Compulsory, that when posted, it will print the 1st option in the post. Even though not selected by user. (I haven't tried the radios or check boxes yet, but I suspect they may do the same.)

How can I make a blank/empty space at top of dropdown list, so that this doesn't happen?

3. What exactly is the Section option for and what does it do?
(I've read the help file, but still haven't a clue.)

Fixed issues in attached file

The Section is not a question but more like a heading.

bananalive 03-01-2009 12:16 PM

Quote:

Originally Posted by dknelson (Post 1757517)
OK...I've pretty much got this working the way I like it to. I still wish there was a way to use one form instead of the 60 something that I had to create to post basically the same output but to different threads. It's done though and I can change it later if a solution is found.

I do have a question about URL links though. I have one question where a user can enter a URL. It posts fine the the URL is posted just as text and not as an actual link. Can I change something so that it posts as an actual link?

I told you how to do it in this post

You could use conditional statement in custom output:

HTML Code:

<if condition"$q[8]">[url]$q[8][/url]</if>

dknelson 03-01-2009 12:29 PM

OK...sorry I didn't see it. I did search the thread for an answer before posting the question but missed it somehow. My apologies.

dknelson 03-01-2009 12:43 PM

OK...here is the issue. Maybe I'm trying to use this in a way that it was really not intended for and just need to find another solution.

My members wanted a place to post their favorite restaurants. I have members all across the USA and Canada plus some other countries.

I created a new forum area called Restaurant Reviews. Within that forum, I created threads for all the states, provinces and "other countries".

I created 60 something forms so that they click a form for their state/province and the review goes to the appropriate thread.

To make the URL clickable, I would have to create custom outputs for all of those 60 something forms. Any change I make I would have to do this also. That's why it would be great if one form could be used and then the drop down question that lists all the states and provinces would direct it to the proper thread.

If that can't be done though, is there another way to make URLs clickable without having to create custom outputs for all the forms?

Michigan Morels 03-01-2009 06:49 PM

Quote:

Originally Posted by bananalive (Post 1757521)
Fixed issues in attached file

The Section is not a question but more like a heading.

Thank you. That updated file worked.

Here's another question for you.
I'm sure there's an easy way to do this, but I don't understand php. I'm strictly a copy and paste guy.

Questions that depend on another question.
Question 4 [your item for sale] is not compulsory - but...

Question 5 [how many of item one?]
relates to question 4 and must be filled in, if 4 is used

Question 6 {your price for item?]
relates to question 4 and must be filled in, if 4 is used
________________

if question 4 if filled in then both questions 5 and 6 must be filled in as well. If question 4 is left blank, then 5 and 6 must be left blank as well.

I hope I've explained it well enough.

Thank you for your help. So far I really like this Mod and can see a lot of uses for it.

Chet T16 03-01-2009 07:52 PM

I'm having issues with all posts (from non admin/mods) from the forms being put in the moderation queue.

I searched this thread and checked
PHP Code:

$newpost['visible'] = '1'

The people posting always had permission to post in these forums but are now being redirected to the forms as directed in this post

Any ideas?

DontWannaName 03-01-2009 08:07 PM

Quote:

Originally Posted by bananalive (Post 1757505)
Sorry, my fault the 1 should be inside the ''


Edit plugin: Easy Forms Part 1

Find:
PHP Code:

/*$newpost['prefixid'] =& '';*/ 

Replace:
PHP Code:

$newpost['prefixid'] =& '1'

Replace 1 with the appropriate prefixid

I did exactly that and I get
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_NEW or T_STRING or T_VARIABLE or '$' in /home/topnotch/public_html/forums/misc.php(100) : eval()'d code on line 438

It takes me to a page with all of my smilies.

frogster 03-02-2009 12:14 AM

Quote:

Originally Posted by Chet T16 (Post 1757843)
I'm having issues with all posts (from non admin/mods) from the forms being put in the moderation queue.

I searched this thread and checked
PHP Code:

$newpost['visible'] = '1'

The people posting always had permission to post in these forums but are now being redirected to the forms as directed in this post

Any ideas?


I am still having the same issue as well and I already changed it to 1. I am also still having an error when I click preview as well. Anyone have any ideas on how to fix these 2 issues?

Thanks,
Maria

ssslippy 03-02-2009 12:11 PM

Moderation is an issue for me also.

bananalive 03-02-2009 02:35 PM

Quote:

Originally Posted by DontWannaName (Post 1757863)
I did exactly that and I get
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_NEW or T_STRING or T_VARIABLE or '$' in /home/topnotch/public_html/forums/misc.php(100) : eval()'d code on line 438

It takes me to a page with all of my smilies.

Are you replacing 1 with the appropriate prefixid?

bananalive 03-02-2009 02:40 PM

Quote:

Originally Posted by Michigan Morels (Post 1757789)
Thank you. That updated file worked.

Here's another question for you.
I'm sure there's an easy way to do this, but I don't understand php. I'm strictly a copy and paste guy.

Questions that depend on another question.
Question 4 [your item for sale] is not compulsory - but...

Question 5 [how many of item one?]
relates to question 4 and must be filled in, if 4 is used

Question 6 {your price for item?]
relates to question 4 and must be filled in, if 4 is used
________________

if question 4 if filled in then both questions 5 and 6 must be filled in as well. If question 4 is left blank, then 5 and 6 must be left blank as well.

I hope I've explained it well enough.

Thank you for your help. So far I really like this Mod and can see a lot of uses for it.

php for hook before form submit

PHP Code:

if ($q[4] && (empty($q[5]) || empty($q[6])))
        {
            
$complete false;
            if (empty(
$q[5])) $iqs[] = 5;
            if (empty(
$q[6])) $iqs[] = 6;
        } 


bananalive 03-02-2009 02:58 PM

Quote:

RE: Moderation issues
Have you checked their permissions to follow forum moderation rules?

frogster 03-02-2009 03:06 PM

Quote:

Originally Posted by bananalive (Post 1758560)
Have you checked their permissions to follow forum moderation rules?

Yes I've tried it with and without and neither work.

Michigan Morels 03-02-2009 05:50 PM

Quote:

Originally Posted by bananalive (Post 1758548)
php for hook before form submit

PHP Code:

if ($q[4] && (empty($q[5]) || empty($q[6])))
        {
            
$complete false;
            if (empty(
$q[5])) $iqs[] = 5;
            if (empty(
$q[6])) $iqs[] = 6;
        } 


Thank you again bananalive, it worked exactly as I asked. You Da Man!

However, I didn't think it through all the way.
What I really needed was if 'any' of the three question were used, then the other two would have to be filled in too.

So I just repeated the code and changed the q#'s around like this
Code:

if ($q[4] && (empty($q[5]) || empty($q[6])))
        {
            $complete = false;
            if (empty($q[5])) $iqs[] = 5;
            if (empty($q[6])) $iqs[] = 6;
        } 
if ($q[5] && (empty($q[4]) || empty($q[6])))
        {
            $complete = false;
            if (empty($q[4])) $iqs[] = 4;
            if (empty($q[6])) $iqs[] = 6;
        } 
if ($q[6] && (empty($q[4]) || empty($q[5])))
        {
            $complete = false;
            if (empty($q[4])) $iqs[] = 4;
            if (empty($q[5])) $iqs[] = 5;
        }

and it works ok.

But I'm wondering if this is the proper way to do it for each set of questions, or if it should be written a different way.

Thanks again for your help. *nominated for Mod of Month*

hobbybox 03-02-2009 06:15 PM

Everything works great except that if I change to a custom layout and questions I have that have a drop down box or check box will no longer display the correct answer.

Example - Is this a trade or sale (dropdown is Trade,Sale)

In the custom output I Put 'This is a: {q_2}

With the the answer will be 'This is a : Array'

It replaces the correct answer with 'Array'

If I dont change the custom output it shows the correct answer...is there something else I need to do?

Also with a custom layout none of the BBCode applies - everything is normal text

UPDATE - with a drop down box no information is put into the output - checkbox shows ARRAY

bananalive 03-02-2009 06:46 PM

Quote:

Originally Posted by hobbybox (Post 1758700)
Everything works great except that if I change to a custom layout and questions I have that have a drop down box or check box will no longer display the correct answer.

Example - Is this a trade or sale (dropdown is Trade,Sale)

In the custom output I Put 'This is a: {q_2}

With the the answer will be 'This is a : Array'

It replaces the correct answer with 'Array'

If I dont change the custom output it shows the correct answer...is there something else I need to do?

Also with a custom layout none of the BBCode applies - everything is normal text

UPDATE - with a drop down box no information is put into the output - checkbox shows ARRAY

Use
Code:

This is a: $qo[2]

bananalive 03-02-2009 06:49 PM

Quote:

Originally Posted by Michigan Morels (Post 1758680)
Thank you again bananalive, it worked exactly as I asked. You Da Man!

However, I didn't think it through all the way.
What I really needed was if 'any' of the three question were used, then the other two would have to be filled in too.

So I just repeated the code and changed the q#'s around like this
and it works ok.

But I'm wondering if this is the proper way to do it for each set of questions, or if it should be written a different way.

Thanks again for your help. *nominated for Mod of Month*

PHP Code:

if ($q[4] || $q[5] || $q[6]) 
        { 
            if (empty(
$q[5]))
            {
                  
$iqs[] = 5
                  
$complete false
            }
            if (empty(
$q[6]))
            {
                  
$iqs[] = 6
                  
$complete false
            }
            if (empty(
$q[4]))
            {
                  
$iqs[] = 4
                  
$complete false
            }
        } 


ssslippy 03-02-2009 06:57 PM

The moderation issue only happens to users and not to admins. I login as a user account and it goes into moderation que.

Also note preview button does not work with attachment.

hobbybox 03-02-2009 06:57 PM

Quote:

Originally Posted by bananalive (Post 1758721)
Use
Code:

This is a: $qo[2]


This results in the following:

This is a: Array{2}

hobbybox 03-02-2009 07:08 PM

Another question...

One of my questions requires inputting another members name...

Is there anyway to make it so the form would check to make sure that the name being type in matches a members username?

bananalive 03-02-2009 07:14 PM

Quote:

Originally Posted by hobbybox (Post 1758743)
Another question...

One of my questions requires inputting another members name...

Is there anyway to make it so the form would check to make sure that the name being type in matches a members username?

Use hook before submit. run a simple query and if it returns empty set $complete = false;

bananalive 03-02-2009 07:17 PM

1 Attachment(s)
Quote:

Originally Posted by hobbybox (Post 1758736)
This results in the following:

This is a: Array{2}

Just tested this it works for me. Are you using the question hash and not the question number?

frogster 03-02-2009 08:17 PM

How many people is this happening to?

I have VB 3.8.1 installed and the following mods:

FB Connect
VB Classifieds
Open Inviter
VBblog

I am willing to pay someone to fix this for me.

1. All new threads submitted through easy forms go into moderation when logged in as a user (not when logged in as admin). I'm pretty sure I have everything set up right but I may need a set of second eyes.

2. Preview button. I get an error.

Please help.

Andyrew 03-02-2009 09:26 PM

I have had the odd error when previewing a form, but it was because i had put some incorrect code in when setting up the form. plus i have 33 other mods installed and it works fine. :D

hobbybox 03-02-2009 10:43 PM

That was the problem - thank you...

As for the form checking the members name im not great with hooks and queries. Can you elaborate more on how to check for a real member username before the form is submitted.

xcesivvs 03-03-2009 12:19 AM

Great modifications.

I have a slight question

I have my form being used in 1 section of my forum where i want to set forced Prefix's

Is there a way to have it auto default the prefix to the first prefix on the list or something.

I dont want to have the form user to choose the prefix, I want it that i decide the prefix level

Thanks

Warren

Michigan Morels 03-03-2009 05:48 AM

Thank you Dom. Once again you made it easier! ( this post)

I sure do appreciate all your effort and time spent, explaining to us non-coders how to do things.
:up: Your support of this mod is excellent!


All times are GMT. The time now is 03:57 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.02863 seconds
  • Memory Usage 1,912KB
  • 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
  • (6)bbcode_code_printable
  • (1)bbcode_html_printable
  • (15)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