Súbor: [Platon] / Metafox / admin / inc-db / editorials.inc.php (stiahnutie)
Revízia 1.13, Tue Nov 7 08:43:23 2017 UTC (6 years, 4 months ago) by nepto
Zmeny od 1.12: +1 -1 [lines]
Reuse existing DB handle in $ezin_db_handle variable instead of creating
a new one. Not only this needs more resources, but also newly created
handle does not have proper encoding initialized via SET NAMES query
(for example default UTF-8 vs required LATIN2)
|
<?php
// Authentification
if (@file_exists('inc/auth.inc.php') && @include_once 'inc/auth.inc.php');
else exit;
// General options
$ezin_opts['dbh'] = $ezin_db_handle;
$ezin_opts['tb'] = $ezin_sys['db']['tables']['editorials'];
$ezin_opts['key'] = 'id';
$ezin_opts['key_type'] = 'int';
$ezin_opts['inc'] = 20;
$ezin_opts['options'] = $ezin_user['role_editorials'];
$ezin_opts['multiple'] = '4';
$ezin_opts['navigation'] = $ezin_cfg['admin_navigation'].$ezin_cfg['admin_buttons_pos'];
$ezin_opts['display'] = array('query' => false, 'sort' => false, 'time' => false);
$ezin_opts['url'] = array('images' => 'icons/');
$ezin_opts['sort_field'] = array('-datetime', '-id');
$ezin_opts['language'] = 'EN';
$ezin_opts['encoding'] = $ezin_cfg['encoding'];
$ezin_opts['ext_hsc'] = false;
// Triggers
$ezin_opts['triggers']['insert']['before'][] = 'inc-db/triggers/word-count.trigger';
$ezin_opts['triggers']['update']['before'][] = 'inc-db/triggers/word-count.trigger';
$ezin_opts['triggers']['insert']['before'][] = 'inc-db/triggers/text-flags.trigger';
$ezin_opts['triggers']['update']['before'][] = 'inc-db/triggers/text-flags.trigger';
// Field definitions
$ezin_opts['fdd']['id'] = array(
'name'=>'ID',
'select'=>'T',
'maxlen'=>3,
'sort'=>true,
'default'=>'',
'options'=>'LDVFPCR',
'colattrs|LF'=>'align="center"',
);
$ezin_opts['fdd']['section_id'] = array(
'name'=>'Section',
'select'=>'T',
'sort'=>true,
'required'=>true,
'strip_tags'=>true,
'values'=>array(
'table' => $ezin_sys['db']['tables']['sections'],
'orderby' => 'lang,ord,id',
'column' => 'id',
'description' => array(
'columns' => array('name', 'id', 'lang'),
'divs' => array(' (', ') ','')),
'filters' => 'FIND_IN_SET("editorials", `select`) > 0'),
);
$ezin_opts['fdd']['article_id'] = array(
'name'=>'Article',
'select'=>'T',
'sort'=>true,
'required'=>true,
'strip_tags'=>true,
'values2'=>array(null=>'- no article -'),
'values'=>array(
'table' => $ezin_sys['db']['tables']['articles'],
'orderby' => '-datetime',
'column' => 'id',
#'filters' => 'section_id = ',
'description' => array(
'columns' => array('atitle', 'id'),
'divs' => array(' (', ')'))),
);
$ezin_opts['fdd']['datetime'] = array(
'name'=>Platon::htmlspecialchars2('Date & Time'),
'select'=>'T',
'sort'=>true,
'required'=>true,
'mask'=>'%.10s',
'default'=>date('Y-m-d H:i:s'),
'colattrs|LF'=>'align="center"',
);
$ezin_opts['fdd']['text_wordcount'] = array(
'name'=>Platon::htmlspecialchars2('Text word count'),
'select'=>'T',
'options'=>'HCAP'
);
$ezin_opts['fdd']['text_flags'] = array(
'name'=>Platon::htmlspecialchars2('Text flags'),
'select'=>'T',
'options'=>'HCAP'
);
$ezin_opts['fdd']['title'] = array(
'name'=>'Title',
'select'=>'T',
'maxlen'=>255,
'sort'=>true,
'trimlen|LF'=>35,
'sql|LF'=>'REPLACE(CONCAT(PMEtable0.title, " | ", text), "\\r\\n", " ")'
);
$ezin_opts['fdd']['text'] = array(
'name'=>Platon::htmlspecialchars2('Editorial text'),
'select'=>'T',
'textarea'=>array(
'rows'=>10,
'cols'=>65,
'wrap'=>'virtual'
),
'required'=>true,
'options'=>'ACPVD',
'trimlen|LF' => 35,
'strip_tags|LF' => true
);
include dirname(__FILE__).'/_credentials.inc.php';
// Execution code
if (! ezin_admin_check_list_privileges($ezin_opts['options'])) {
require 'inc-html/permdenied.html';
} else {
require_once 'phpMyEdit/phpMyEdit.class.php';
new phpMyEdit($ezin_opts);
}
?>
Platon Group <platon@platon.sk> http://platon.sk/
|