Ignore:
Timestamp:
Apr 1, 2011, 10:56:28 PM (13 years ago)
Author:
mistic100
Message:

[extentions] Smilies Support

  • uses markItUp!
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/SmiliesSupport/admin.php

    r9789 r9966  
    1010{
    1111        // the smilies.txt file is not saved if the directory is changed
    12         if (isset($_POST['text1']) AND $_POST['text1'] != $conf_smiliessupport[0]) {
     12        if (isset($_POST['text1']) AND $_POST['text1'] != $conf_smiliessupport[0])
     13        {
    1314                $not_save_file = true;
    1415        }
    1516       
     17        // new configuration
    1618        $conf_smiliessupport = array(
    1719                isset($_POST['text1']) ? $_POST['text1'] : 'plugins/SmiliesSupport/smilies_1',
     
    1921                isset($_POST['text3']) ? $_POST['text3'] : 'smile.png',
    2022        );
    21        
    2223        if (empty($_POST['text'])) $_POST['text'] = ':)         smile.png';
    2324               
    24     $new_value_smiliessupport = implode (",", $conf_smiliessupport);
    25     $query = 'UPDATE ' . CONFIG_TABLE . '
    26                 SET value="' . $new_value_smiliessupport . '"
    27                 WHERE param="smiliessupport"';
     25    $new_value_smiliessupport = implode(",", $conf_smiliessupport);
     26    $query = "UPDATE " . CONFIG_TABLE . "
     27                SET value='" . $new_value_smiliessupport . "'
     28                WHERE param='smiliessupport'";
    2829    pwg_query($query);
    29    
    30         if (!isset($not_save_file)) {
     30       
     31        // new definitions file
     32        if (!isset($not_save_file))
     33        {
    3134                $smilies_file = PHPWG_ROOT_PATH.$conf_smiliessupport[0].'/smilies.txt';     
    3235
     
    3841                        $page['infos'][] = l10n('Information data registered in database');
    3942                } else {
    40                         $page['errors'][] = l10n('File/directory read error').'   '.$smilies_file;
     43                        $page['errors'][] = l10n('File/directory read error').' : '.$smilies_file;
    4144                }
    4245        }
     46}
     47
     48// check if the representant exists
     49if (!file_exists(PHPWG_ROOT_PATH.$conf_smiliessupport[0].'/'.$conf_smiliessupport[2])) {
     50        $page['errors'][] = l10n('File/directory read error').' : '.$conf_smiliessupport[0].'/'.$conf_smiliessupport[2];
    4351}
    4452
     
    4957));
    5058
     59// build the table of smilies
    5160include_once(SMILIES_PATH . '/smiliessupport.inc.php');
    52 $template->assign('SMILIESSUPPORT_PAGE', SmiliesTable($conf_smiliessupport));
     61$template->assign('smiliesfiles', get_smilies($conf_smiliessupport));
    5362
     63// get the content of definitions file
    5464$smilies_file = PHPWG_ROOT_PATH.$conf_smiliessupport[0].'/smilies.txt';
    55 
    5665if (file_exists($smilies_file)) {
    5766        $content_file = file_get_contents($smilies_file);
Note: See TracChangeset for help on using the changeset viewer.