Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Štvrtok, 28. marec 2024

Súbor: [Platon] / Metafox / admin / inc-db / newsletters.inc.php (stiahnutie)

Revízia 1.8, Tue Nov 7 08:43:23 2017 UTC (6 years, 4 months ago) by nepto


Zmeny od 1.7: +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']['nl_emails'];
$ezin_opts['key'] = 'id';
$ezin_opts['key_type'] = 'int';
$ezin_opts['inc'] = -1;
$ezin_opts['options'] = $ezin_user['role_newsletters'];
$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('-dt_added', '-id');
$ezin_opts['language'] = 'EN';
$ezin_opts['encoding'] = $ezin_cfg['encoding'];
$ezin_opts['ext_hsc'] = false;

// Triggers

// Field definitions

$ezin_opts['fdd']['id'] = array(
        'name'=>'ID',
        'select'=>'T',
        'sort'=>true,
        'size'=>5,
        'default'=>'',
        'options'=>'LDVFPCR',
        'mask'=>'%03d',
        'escape' => false,
        'colattrs|LF'=>'align="center"',
        );

$ezin_opts['fdd']['section_id'] = array(
        'name'=>'Section',
        'select'=>'D',
        'sort'=>true,
        'required'=>true,
        'strip_tags'=>true,
        'values'=>array(
            'table' => $ezin_sys['db']['tables']['sections'],
            'column' => 'id',
            'description' => array(
                'columns' => array('name', 'id'),
                'divs'    => array(' (', ')')))
        );
        
$ezin_opts['fdd']['email'] = array(
        'name'=>Platon::htmlspecialchars2('E-mail address'),
        'select'=>'T',
        'maxlen'=>60,
        'sort'=>true,
        'required'=>true,
        'trimlen|LF'=>35,
        'mask' => '<big><b>%s</b></big>',
        'escape' => false,
        'colattrs|LF' => 'align="center"'
        );

$ezin_opts['fdd']['phone'] = array(
        'name'=>Platon::htmlspecialchars2('Phone'),
        'select'=>'T',
        'maxlen'=>60,
        'sort'=>true,
        'required'=>true,
        'trimlen|LF'=>35,
        'mask' => '<big><b>%s</b></big>',
        'escape' => false,
        'colattrs|LF' => 'align="center"'
        );

$ezin_opts['fdd']['dt_added'] = array(
        'name'=>Platon::htmlspecialchars2('Date Added'),
        'select'=>'T',
        'sort'=>true,
        'required'=>true,
        'mask'=>'%.10s',
        'default'=>date('Y-m-d'),
        'colattrs|LF' => 'align="center"'
        );

$ezin_opts['fdd']['dt_removed'] = array(
        'name'=>Platon::htmlspecialchars2('Date Removed'),
        'select'=>'T',
        'sort'=>true,
        'required'=>true,
        'mask'=>'%.10s',
        'colattrs|LF' => 'align="center"'
        );

$ezin_opts['fdd']['ip'] = array(
        'name'=>Platon::htmlspecialchars2('IP address'),
        'select'=>'T',
        'sort'=>true,
        'required'=>true,
        'trimlen|LF'=>35,
        );

$ezin_opts['fdd']['user_agent'] = array(
        'name'=>Platon::htmlspecialchars2('User Agent'),
        'select'=>'T',
        'sort'=>true,
        'required'=>true,
        'trimlen|LF'=>35,
        );

// 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/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok