Forum Replies Created

Viewing 1 replies (of 1 total)
  • fillrobs

    (@fillrobs)

    I spent an hour or 2 battling with this – turns out that the Javascript needs a tweak – edit the smack-vtlc-scripts.js file (line 37)

    change

    if(response == “Success”)

    to

    if(jQuery.trim(response) == “Success”)

    works then – I also created a WP plugin to prove it works

    <?php
    /*
    Plugin Name: Test VTiger Connection
    Description: Test VTiger Conn
    Version: 1.0
    Author: probins
    Author URI: https://www.futurestorage.co.uk/
    */

    add_action( ‘admin_menu’, ‘test_vtiger_connection’ );

    function test_vtiger_connection() {
    add_options_page( ‘test vtiger connection’, ‘vtiger connection’, ‘manage_options’, ‘my-unique-identifier2’, ‘vtiger_connection’ );
    }

    function vtiger_connection(){
    //global $wpdb;
    echo “<h1> Testing Vtiger Connection </h1>”;
    //require_once(getcwd().’/../../../wp-load.php’);

    define(‘MY_HOST’, ‘<Your IP>’);
    define(‘MY_USER’, ‘<Your Username>’);
    define(‘MY_PASSWORD’, ‘<Your Password>’);
    define(‘MY_DBNAME’, ‘<Your DB Name>’);

    require_once( $_SERVER[‘DOCUMENT_ROOT’] . ‘/wp-load.php’ );

    $mydb = new wpdb(MY_USER,MY_PASSWORD,MY_DBNAME,MY_HOST);

    $mydb->show_errors();
    $rows = $mydb->get_results(“select * from vtiger_users”); // This vtiger’s user table used only for test purpose

    if(isset($rows))
    echo “Success”;
    else
    echo “Failed”;

    }

Viewing 1 replies (of 1 total)