WordPress.org

Ready to get started?Download WordPress

Forums

Subscribe2
[resolved] [Reqest] - Maximum char number in $message as variable (3 posts)

  1. orion42
    Member
    Posted 1 year ago #

    I've notice the maximum number of character in the message is fixed at 80 chars. I prefer to have a little more text so i've changed in 140. I propose to set this number as a variable that can be set in admin page.

    In class-s2-core.php - row 302:

    //$message = wordwrap(strip_tags($message), 80, "\n");
    $message = wordwrap(strip_tags($message), $message_chars, "\n"); //42 - Maximum number of char 80 => $message_chars

    http://wordpress.org/extend/plugins/subscribe2/

  2. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @orion42,

    This seems reasonable but I'd rather avoid adding a variable to be set in the admin pages. I've added it as a variable in the class-s2-core.php file with a default value of 80, this can then easily be edited if desired.

  3. orion42
    Member
    Posted 1 year ago #

    Could be useful if you create a custom - variable - value script for some local variable settings. In another open-project (Timthumb) where sometimes I partecipate in small development and bug fix all the variable are smart: if there are alredy declared in the custom file the it uses this value, otherwise use the standard ones:

    //Load a config file if it exists. Otherwise, use the values below
    if( file_exists(dirname(__FILE__) . '/timthumb-config.php'))	require_once('timthumb-config.php');
    if(! defined('DEBUG_ON') )					define ('DEBUG_ON', false);

    e.g. and then write in the config file :
    define ('DEBUG_ON', true);

    In this way with a little piece of code everybody can personalize the values just editing one single user-created-files and don't edit the new files at each release just to set up a couple of numerical values.

    Mine is just a proposal, but it's an interesting way of dealing with custom variable (or also functions...)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic