Announcement

Collapse
No announcement yet.

Helping for compatible a mod in vb4 to vb6

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Helping for compatible a mod in vb4 to vb6

    Hello
    i have a mod in vb4 and it is a payment method for our country
    it is important for us and no body want upgrade to vb6 without this.

    can u help us?

    we have error when uploading xml file

    Code:
    An unexpected error was returned: 'Call to a member function hide_errors() on null'
    
    Exception trace:
    
    ## /forum/core/includes/adminfunctions_product.php(952) : eval()'d code(35) Exception Thrown
    #0 /forum/core/includes/adminfunctions_product.php(952): eval()
    #1 /forum/core/admincp/product.php(1213): install_product()
    #2 /forum/includes/api/interface/collapsed.php(149): require_once('/home/bydgofzg/...')
    #3 /forum/includes/vb5/frontend/controller/relay.php(33): Api_Interface_Collapsed->relay()
    #4 /forum/index.php(65): vB5_Frontend_Controller_Relay->admincp()
    #5 {main}​
    it is here:
    Contribute to ZarinPal-Lab/vBulletinModule development by creating an account on GitHub.



    #2
    Try replacing all instances of $db with $vbulletin->db

    Some are already using it but most are not.

    I don't know how those worked correctly in vB4 because the $db variable is not defined and thus has a null value. Maybe there was $db = $vbulletin->db; declaration before but it was deleted?
    Buy me a coffeePayPal QR Code
    My Amazon Affiliate Link
    Fast vBulletin VPS Host:
    This site is hosted by IONOS

    Comment


      #3
      i replaced all

      but still error

      Code:
      An unexpected error was returned: 'Call to a member function hide_errors() on null'
      
      Exception trace:
      
      ## /forum/core/includes/adminfunctions_product.php(952) : eval()'d code(35) Exception Thrown
      #0 /forum/core/includes/adminfunctions_product.php(952): eval()
      #1 /forum/core/admincp/product.php(1213): install_product()
      #2 /forum/includes/api/interface/collapsed.php(149): require_once('/home/bydgofzg/...')
      #3 /forum/includes/vb5/frontend/controller/relay.php(33): Api_Interface_Collapsed->relay()
      #4 /forum/index.php(65): vB5_Frontend_Controller_Relay->admincp()
      #5 {main}​​

      Comment


        #4
        I tried installing it on my local vB6 and doing the changes I suggested and it got past that error and got a new error.

        Code:
        An unexpected error was returned: 'Call to undefined function fetch_query_sql()'
        Make sure you are correctly replacing $db with $vbulletin->db. Take note of where the $ sign is.

        To fix the new error, replace fetch_query_sql with fetchQuerySql.

        You may still get new errors after that.

        Btw, since this mod was made for vB4, it may not completely work with vB6 without further tweaks.
        Buy me a coffeePayPal QR Code
        My Amazon Affiliate Link
        Fast vBulletin VPS Host:
        This site is hosted by IONOS

        Comment


          #5
          yes new error is arrived
          Code:
          An unexpected error was returned: 'mysqli_query(): Argument #2 ($query) must be of type string, array given'
          i think is is related to query of db

          Comment


            #6
            for example this code is right?
            Code:
            if ($check = $vbulletin->db->query_first("

            Comment


              #7
              Technically it's correct. It shouldn't cause any issue. Although storing the output in the $check variable is unnecessary as the variable is not used thereafter. The variable is supposed to contain an array of all the columns in the resulting query but no column is used. It's basically only concerned if the query returns any records or rows and doesn't care about the records itself.
              Buy me a coffeePayPal QR Code
              My Amazon Affiliate Link
              Fast vBulletin VPS Host:
              This site is hosted by IONOS

              Comment


                #8
                there are not many codes, pls if u have time pls see this and find out what is the problem.

                Comment


                  #9
                  ​i fond what is the problem
                  Code:
                  $db->query_write(fetch_query_sql($api, 'paymentapi'));
                  change to
                  Code:
                  $db->query_write("INSERT INTO " . TABLE_PREFIX . "paymentapi (title, active, classname, currency, recurring, settings) values ('zarinpalwg', 1, 'zarinpalwg', 'usd', 0, '" . serialize($apisettings) . "')");
                  but "subsettings" field in phpmyadmin is empty


                  Comment


                    #10
                    i fixed it.

                    Comment


                      #11
                      Glad you figured it out.

                      If you're comfortable sharing the solution, it could be really helpful for others facing the same issue.
                      Buy me a coffeePayPal QR Code
                      My Amazon Affiliate Link
                      Fast vBulletin VPS Host:
                      This site is hosted by IONOS

                      Comment


                        #12
                        im using
                        Code:
                        global $vbulletin;
                        $db = $vbulletin->db;
                        $settings = array("gpid" => array("type" => "text", "value" => "", "validate" => "string"), "d2t" => array("type" => "text", "value" => "", "validate" => "string"));
                        $subsettings = array('show' => array('type' => 'yesno', 'type' => 'yesno', 'type' => 'yesno'));
                        $db->query_write("INSERT INTO " . TABLE_PREFIX . "paymentapi (title, active, classname, currency, recurring, settings, subsettings) values ('gooyapay', 1, 'gooyapay', 'usd', 0, '" . serialize($settings) . "', '" . serialize($subsettings) . "')");
                        in xml

                        my xml completely is:
                        Attached Files

                        Comment


                        • glennrocksvb
                          commented
                          Editing a comment
                          Thanks for sharing.

                      Latest Posts

                      Collapse

                      Working...
                      X
                      Searching...Please wait.
                      An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

                      Please push the back button and reload the previous window.'
                      An unexpected error was returned: 'Your submission could not be processed because the token has expired.

                      Please push the back button and reload the previous window.'
                      An internal error has occurred and the module cannot be displayed.
                      There are no results that meet this criteria.
                      Search Result for "|||"