vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Need help with a Mysqi problem using a mod (https://vborg.vbsupport.ru/showthread.php?t=315024)

HM666 11-05-2014 05:12 PM

Ok there are several if/else statements & variables that contain $_POST['do'].

Code:

if ($_POST['do'] == 'updateformresult')

$_POST['do'] = 'postform';

if ($_POST['do'] == 'postform')

if ($_POST['do'] == 'insertform')

if ($_POST['do'] == 'updateform')

if ($_POST['do'] == 'insertq')

if ($_POST['do'] == 'updateq')

if ($_POST['do'] == 'formresults_export')

if ($_POST['do'] == 'updateqorder')

if ($_POST['do'] == 'importform')

if ($_POST['do'] == 'addq')

But it seems that the 'postform' may have the most to do with this, but I'm not a PHP coder so I'm not entirely sure. Here is the code that looks about like it has to do with viewing the form:

Code:

        if (($caneditformresult && !is_member_of($vbulletin->userinfo, $caneditformresult)) AND (!$canmanageownformresults OR !$vbulletin->userinfo['userid']))
        {
                print_no_permission();
        }
        $show['edit_id'] = $id = $vbulletin->input->clean_gpc('p', 'id', TYPE_UINT);
        $fid = $vbulletin->input->clean_gpc('p', 'fid', TYPE_UINT);
        $_POST['do'] = 'postform';
        $show['editing'] = true;
        $where = "";
        if ($canmanageownformresults && !is_member_of($vbulletin->userinfo, $caneditformresult))
        {
                $where = " AND userid = '" . $vbulletin->userinfo['userid'] . "'";
        }
        $formresult = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "formresults WHERE fid = '$fid' AND id = '$id' $where");
        if (!$formresult)
        {
                $errormessage = $vbphrase[form_error_data_not_exist];
              eval(standard_error($errormessage));
        }
}
if ($_POST['do'] == 'postform')
{
        $POST_FORM = true;
        $canviewform = unserialize($vbulletin->options['canviewform']);
        if (!$canviewform OR !is_member_of($vbulletin->userinfo, $canviewform))
        {
                print_no_permission();
        }
        $fid = $vbulletin->input->clean_gpc('p', 'fid', TYPE_UINT);
        if (empty($fid))
        {
                $errormessage = $vbphrase[form_error_not_existing_form];
              eval(standard_error($errormessage));
        }
        $posthash = $vbulletin->input->clean_gpc('p', 'posthash', TYPE_NOHTML);
        $poststarttime = $vbulletin->input->clean_gpc('p', 'poststarttime', TYPE_NOHTML);
        $hiddenfield1 = $vbulletin->input->clean_gpc('p', 'hiddenfield1', TYPE_NOHTML);
        $hiddenfield2 = $vbulletin->input->clean_gpc('p', 'hiddenfield2', TYPE_NOHTML);
        $hiddenfield3 = $vbulletin->input->clean_gpc('p', 'hiddenfield3', TYPE_NOHTML);
        $complete = true;
        $incompleteqs = array();
        $iqs = array();
        $form = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "forms WHERE fid = '$fid'");
        if (!$form)
        {
                $errormessage = $vbphrase[form_error_not_existing_form];
              eval(standard_error($errormessage));
        }
        ($hook = vBulletinHook::fetch_hook('easy_forms_post_form_start')) ? eval($hook) : false;
        if ($form[submitlimitperuser] >= 1 && !$show['editing'])
        {


kh99 11-05-2014 06:28 PM

Well, you'd have to know the actual value of $_POST['do'] when the error happens. You say that this happens when you click on a button that you created? Then if that button isn't submitting a form, $_POST['do'] won't have a value. That could be the problem - maybe it's not meant to be used that way. Maybe you'd have to submit a form with some data for it to work.

But really this has gotten in to helping with a mod, and that shouldn't be done in this forum (my fault, I should have said that before). We could just continue in the mod thread, if anyone else has anything to post.

bridge2heyday 11-05-2014 07:41 PM

Did you put any plugins at hook location easy_forms_view_question_start ?

ozzy47 11-05-2014 07:46 PM

Please continue this in the mods thread, this is not the proper place for discussing the mod. :)

HM666 11-06-2014 02:29 AM

This has been solved thanks all for your help.

squidsk 11-06-2014 02:02 PM

What was the solution so that if others run into the problem they can solve it?

ozzy47 11-06-2014 03:03 PM

Quote:

Originally Posted by squidsk (Post 2521638)
What was the solution so that if others run into the problem they can solve it?

Check in the modifications thread for the solution. :)

HM666 11-06-2014 03:44 PM

Quote:

Originally Posted by ozzy47 (Post 2521640)
Check in the modifications thread for the solution. :)

Yeah what he said....lol


All times are GMT. The time now is 07:19 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.01096 seconds
  • Memory Usage 1,738KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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