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)

Trevor Hannant 10-06-2016 11:39 AM

Quote:

Originally Posted by Trevor Hannant (Post 2575383)
At some point, a site I now do some work on has had their forms stop working although no-one seems to know when! Site is running vB4.2.2 and have tried the latest forms.php and 4.4.0 update but still get following error when trying to open a form:

PHP Fatal error: Cannot use object of type mysqli_result as array in /var/www/vhosts/DOMAIN/httpdocs/forum/forms.php on line 1242, referer: http://DOMAIN/forum/forms.php?do=editform&fid=1&pg=7

Server running:

PHP 5.3.10-1ubuntu3.24
MySQL Version 5.5.50-0ubuntu0.12.04.1


Runs on another server I have OK - probably been looking at it too long and missing something obvious...

To add, doesn't matter whether 'mysql' or 'mysqli' is used in the config file...

Budget101 12-23-2016 02:25 PM

I would like to add a Referer hook to the form output- basically I want to know what page they were on when they accessed the form and sent it to me.

$_SERVER['HTTP_REFERER']

Example: form is hosted on this page:

anysite.com/content.php/1950-friendly-url

when the form is submitted I want to have a field that shows:

Referer: anysite.com/content.php/1950-friendly-url

Instead all I can see is:

Referer: anysite.com/forms.php?do=form&fid=47

Any ideas on the correct syntax to add it to the Form Hook before submission?

I've tried:
PHP Code:

$formoutput .= $form[preq] . "Referer:" $_SERVER['HTTP_REFERER']; 

PHP Code:

$formoutput .= $form[preq] . "Referer:" $_GET['auth'] . $form[psta]; 

PHP Code:

$formoutput .= $form[preq] . "Referer:" $_SERVER['REQUEST_URI']; 

PHP Code:

$formoutput .= $form[preq] . "Referer:" $_SERVER['HTTP_REFERER']; 

PHP Code:

$formoutput .= $form[preq] . "Referer:" $_SERVER['PHP_SELF']; 

PHP Code:

$formoutput .= $form[preq] . "Referer:" $_SERVER['QUERY_STRING']; 

PHP Code:

$formoutput .= $form[preq] . "Referer:" $_SERVER['PATH_INFO']; 

PHP Code:

$formoutput .= $form[preq] . "Referer:" $_SESSION['loc']=$_SERVER['PHP_SELF'] . $form[psta]; 

PHP Code:

$formoutput .= $form[preq] . "Referer:" $_SERVER['REQUEST_URI'] .
$form[psta]; 

I basically want to know if people are accessing the form directly by sharing the link or whether they are accessing the form from the specific page I am embedding it within.

audzilla 02-15-2017 07:57 PM

Any php folks who could help me with some custom stuff? I don't even know if this is possible:

I've got a question with a five item dropdown, and I'm hoping I can use a custom question to populate the form output with a bunch of other information depending on which of the five items a user picks.
e.g. They pick their city of residence from a dropdown, and the output of the submitted form lists a few things relevant only to that city. Picking a different city gives different output. The bits of info themselves are not super long and won't be changing.

EGNDRAGON 03-07-2017 06:39 PM

Need help i cant seem to figure out where to creat the forum or what not

MdSWolfy 03-10-2017 08:06 AM

I am unable to create new form questions. The submit button after creating a new question doesn't seem to do anything at all.

Here is the button that is not doing anything when clicked:

Code:

<input class="button" name="cancel" type="button" id="cancel" value="Cancel" onclick="window.location.href='forms.php?do=editform&amp;fid=1'">

kobrualet 05-25-2017 08:59 AM

Hello!

How can I install it to Vb5? Is it possible? Or can someone help me with it?

Thank you.

Trevor Hannant 05-25-2017 09:11 AM

Quote:

Originally Posted by kobrualet (Post 2586927)
Hello!

How can I install it to Vb5? Is it possible? Or can someone help me with it?

Thank you.

If you rewrite it you can install it to vB5....

grey_goose 05-28-2017 01:20 PM

Really love this mod, so first off -- big thanks.

Following this line of questions with ascroft, I wanted to add a subscription to the newly posted thread for the user.

Hook Location: newthread_post_complete

Code:

if ($fid == 32)
{
        $addthreadinfo = fetch_threadinfo($newpost['threadid']);
        $adduserinfo = $vbulletin->userinfo['userid'];
       
        $db->query_write("INSERT INTO subscribethread 
            (userid,threadid,emailupdate,folderid,canview)
        VALUES
            ('$adduserinfo','addthreadinfo','1','0','1');
    ");
}

I even replaced the variables with static info which also did nothing so it looks like the IF $fid isn't working. Did I miss something or is there a better way to go about adding a user thread subscription for the newly created thread?

grey_goose 05-28-2017 09:12 PM

nvm, I just added into the 'Easy Forms Part 1' plugin:

~ line 807 just before 'mark_thread_read'

PHP Code:

        // Add Subscription        
        
$fid $vbulletin->input->clean_gpc('p''fid'TYPE_UINT);
        if (
in_array($fid, array('10''25''27''14'))) 
            {
                
$subscribethisuser $vbulletin->userinfo['userid'];            
                
$db->query_write("INSERT INTO subscribethread  
                        (userid,threadid,emailupdate,folderid,canview) 
                    VALUES 
                        ('
$subscribethisuser','$threadinfo[threadid]','1','0','1'); 
                "
);            
            } 

It doesn't check for user specific settings for subscriptions, but I want them subscribed regardless of their personal prefs. Seems to be working.

wolfey 06-02-2017 11:42 AM

Hello

Recently my emails are delayed for 12 hours only when sent from forms?

Further...just updated to 4.25, and form gets stuck now when trying to submit

Thank you


All times are GMT. The time now is 08:14 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.03023 seconds
  • Memory Usage 1,772KB
  • 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
  • (2)bbcode_code_printable
  • (10)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)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