Changeset 601 for trunk/bin


Ignore:
Timestamp:
Apr 27, 2017 4:43:35 PM (7 years ago)
Author:
anonymous
Message:

Updated every instance of 'zero' date 0000-00-00 to use 1000-01-01 if mysql version >= 5.7.4

Location:
trunk/bin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/init_codebase_tables.cli.php

    r573 r601  
    146146            // Lock!
    147147            require_once CODEBASE_PATH . '/lib/Lock.inc.php';
     148            require_once CODEBASE_PATH . '/lib/Auth_SQL.inc.php';
    148149            $lock =& Lock::getInstance(new Auth_SQL('codebase'));
    149150            $lock->setParam(array('create_table' => true));
     
    162163            // Version!
    163164            require_once CODEBASE_PATH . '/lib/Version.inc.php';
     165            require_once CODEBASE_PATH . '/lib/Auth_SQL.inc.php';
    164166            $version = Version::getInstance(new Auth_SQL('codebase'));
    165167            $version->setParam(array('create_table' => true));
  • trunk/bin/module_maker/list_template.cli.php

    r533 r601  
    119119            $listrows[] = "<\x3fphp echo mb_strlen(\$list[\$i]['$field'])<50 \x3f oTxt(\$list[\$i]['$field'], true) : oTxt(trim(mb_substr(\$list[\$i]['$field'], 0, 50)) . '...'); \x3f>";
    120120        } else if (preg_match('/.*(begin|start).*date.*/i', $field)) {
    121             $listrows[] = "<\x3fphp echo '0000-00-00' == \$list[\$i]['$field'] ? '' : date(\$app->getParam('date_format'), strtotime(\$list[\$i]['$field'])); \x3f>";
     121            $listrows[] = "<\x3fphp echo \$db->getParam('zero_date') == \$list[\$i]['$field'] ? '' : date(\$app->getParam('date_format'), strtotime(\$list[\$i]['$field'])); \x3f>";
    122122        } else if (preg_match('/.*(end|expire).*date.*/i', $field)) {
    123123            $listrows[] = "<\x3fphp echo '9999-12-31' == \$list[\$i]['$field'] ? '' : date(\$app->getParam('date_format'), strtotime(\$list[\$i]['$field'])); \x3f>";
  • trunk/bin/module_maker/skel/public.php

    r468 r601  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    6060        WHERE %PRIMARY_KEY% = '" . $db->escapeString(getFormData('%PRIMARY_KEY%')) . "'
    6161        AND publish = 'true'
    62         __///__AND (publish_date <= CURDATE() OR publish_date = '0000-00-00')
    63         __///__AND (expire_date > CURDATE() OR expire_date = '0000-00-00')
     62        __///__AND (publish_date <= CURDATE() OR publish_date = '" . $db->escapeString($db->getParam('zero_date')) . "')
     63        __///__AND (expire_date > CURDATE() OR expire_date = '" . $db->escapeString($db->getParam('zero_date')) . "')
    6464    ");
    6565    if (!$item = mysql_fetch_assoc($qid)) {
Note: See TracChangeset for help on using the changeset viewer.