Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ryuui

    (@ryuui)

    EDIT: I found the limit is in the database fields…

    Particularly inside here:

    $sql = "CREATE TABLE ". $table_name ." (
    				id   mediumint(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    				time varchar(200) NOT NULL DEFAULT '',
    				name varchar(200) NOT NULL DEFAULT '',
    				text varchar(200) NOT NULL DEFAULT '',
    				url  varchar(200) NOT NULL DEFAULT '',
    				ip   varchar(200) NOT NULL DEFAULT '',
    				PRIMARY KEY (id)
    			) ". $charset_collate .";";

    Is this intended?
    So a user can not post more than 200 chars inside a message… if so, the user interface and options should be updated, otherwise the database creation SQL should be updated instead.

    • This reply was modified 6 years, 10 months ago by ryuui.
    Thread Starter ryuui

    (@ryuui)

    Awesome,

    thank you for both the quick reply and the very helpful answer.
    I have taken a look at the Gist example and modified it accordingly.
    The end result is exactly what I wanted.

    /**
     * Analytics
     */
    function gadwp_addcode($gadwp) {
      $commands = $gadwp->get(); // Get commands array
    
      $fields = array();
      $fields['trackingId'] = 'UA-XXXXXXXX-XX';
      $fields['cookieDomain'] = 'auto';
      $fields['name'] = 'other';
      $commands[] = $gadwp->prepare( 'create', $fields ); // Add a new line to the commands array
    
      $fields = array();
      $fields['hitType'] = 'pageview';
      $commands[] = $gadwp->prepare( 'other.send', $fields ); // Add a new line to the commands array
    
      $gadwp->set($commands); // Store the new commands array
    }
    add_action( 'gadwp_analytics_commands',  'gadwp_addcode', 10, 1 );
Viewing 2 replies - 1 through 2 (of 2 total)