Changeset 2089 in ExiteCMS


Ignore:
Timestamp:
12/03/08 17:29:31 (3 years ago)
Author:
WanWizard
Message:

added bbcode editor and bbcode parsing for download and download category descriptions
fixed a few relative link issues in the news main module

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/administration/download_cats.php

    r2033 r2089  
    7070    $cat_name = stripinput($_POST['cat_name']); 
    7171    $cat_locale = isset($_POST['cat_locale']) ? $_POST['cat_locale'] : ""; 
    72     $cat_description = stripinput($_POST['cat_description']); 
     72    $cat_description = trim(stripinput($_POST['cat_description'])); 
    7373    $cat_access = isNum($_POST['cat_access']) ? $_POST['cat_access'] : "0"; 
    7474    $cat_image = stripinput($_POST['cat_image']); 
     
    237237} 
    238238 
     239// load the hoteditor if needed 
     240if ($settings['hoteditor_enabled'] && (!iMEMBER || $userdata['user_hoteditor'])) { 
     241    define('LOAD_HOTEDITOR', true); 
     242} 
     243 
    239244// panel definitions 
    240245$template_panels[] = array('type' => 'body', 'name' => 'admin.download_cats', 'title' => $title, 'template' => 'admin.download_cats.tpl', 'locale' => "admin.downloads"); 
  • trunk/administration/downloads.php

    r2033 r2089  
    133133if (isset($_POST['save_download'])) { 
    134134    $download_title = stripinput($_POST['download_title']); 
    135     $download_description = addslash($_POST['download_description']); 
     135    $download_description = trim(stripinput($_POST['download_description'])); 
    136136    $download_url = stripinput($_POST['download_url']); 
    137137    $download_external = (isset($_POST['download_external']) && isNum($_POST['download_external'])) ? $_POST['download_external'] : 0; 
     
    153153    $data = dbarray($result); 
    154154    $download_title = $data['download_title']; 
    155     $download_description = stripslashes($data['download_description']); 
     155    $download_description = $data['download_description']; 
    156156    $download_url = $data['download_url']; 
    157157    $download_license = $data['download_license']; 
     
    260260$variables['download_external'] = $download_external; 
    261261 
     262// load the hoteditor if needed 
     263if ($settings['hoteditor_enabled'] && (!iMEMBER || $userdata['user_hoteditor'])) { 
     264    define('LOAD_HOTEDITOR', true); 
     265} 
     266 
    262267// panel definitions 
    263268$template_panels[] = array('type' => 'body', 'name' => 'admin.downloads', 'title' => $title, 'template' => 'admin.downloads.tpl', 'locale' => "admin.downloads"); 
  • trunk/downloads.php

    r2030 r2089  
    2626// load this module's locales 
    2727locale_load("main.downloads"); 
     28 
     29// shared forum functions include 
     30require_once PATH_INCLUDES."forum_functions_include.php"; 
    2831 
    2932function countdownloads($cat_id) { 
     
    136139    while ($data = dbarray($result)) { 
    137140        $data['download_count'] = countdownloads($data['download_cat_id']); 
     141        $data['download_cat_description'] = parsemessage(array(), $data['download_cat_description'], true, true); 
    138142        $variables['download_cats'][] = $data; 
    139143    } 
     
    148152        while ($data = dbarray($result)) { 
    149153            $data['now'] = showdate("", time()); 
    150             $data['download_description'] = nl2br(stripslashes($data['download_description'])); 
     154            $data['download_description'] = parsemessage(array(), $data['download_description'], true, true); 
    151155            $variables['downloads'][] = $data; 
    152156        } 
  • trunk/files/locales/nl.main.global.php

    r2033 r2089  
    11<?php 
    22// ---------------------------------------------------------- 
    3 // locale       : English 
     3// locale       : Nederlands 
    44// locale name  : main.global 
    5 // generated on : Sat Nov 15 2008, 16:19:19 CET 
     5// generated on : Wed Dec 3 2008, 16:48:23 CET 
    66// translators  : ExiteCMS team,WanWizard 
    77// ---------------------------------------------------------- 
  • trunk/includes/templates/admin.download_cats.tpl

    r2035 r2089  
    4343        {/if} 
    4444        <tr> 
    45             <td width='1%' class='tbl' style='white-space:nowrap'> 
     45            <td width='1%' class='tbl' style='vertical-align:top;white-space:nowrap'> 
    4646                {$locale.431} 
    4747            </td> 
    4848            <td class='tbl'> 
    49                 <input type='text' name='cat_description' value='{$cat_description}' class='textbox' style='width:250px;' /> 
     49                {if $settings.hoteditor_enabled == 0 || $userdata.user_hoteditor == 0} 
     50                    <textarea name='cat_description' rows='5' cols='80' class='textbox' style='width:350px'>{$cat_description}</textarea><br /> 
     51                    <input type='button' value='b' class='button' style='font-weight:bold;width:25px;' onclick="addText('cat_description', '[b]', '[/b]');" /> 
     52                    <input type='button' value='i' class='button' style='font-style:italic;width:25px;' onclick="addText('cat_description', '[i]', '[/i]');" /> 
     53                    <input type='button' value='u' class='button' style='text-decoration:underline;width:25px;' onclick="addText('cat_description', '[u]', '[/u]');" /> 
     54                    <input type='button' value='url' class='button' style='width:30px;' onclick="addText('cat_description', '[url]', '[/url]');" /> 
     55                    <input type='button' value='mail' class='button' style='width:35px;' onclick="addText('cat_description', '[mail]', '[/mail]');" /> 
     56                    <input type='button' value='img' class='button' style='width:30px;' onclick="addText('cat_description', '[img]', '[/img]');" /> 
     57                    <input type='button' value='center' class='button' style='width:45px;' onclick="addText('cat_description', '[center]', '[/center]');" /> 
     58                    <input type='button' value='small' class='button' style='width:40px;' onclick="addText('cat_description', '[small]', '[/small]');" /> 
     59                {else} 
     60                    <script language="javascript" type="text/javascript"> 
     61                        // non-standard toolbars for this editor instance 
     62                        var toolbar1 ="SPACE,btFont_Name,btFont_Size,btFont_Color,btHighlight"; 
     63                        var toolbar2 ="SPACE,btRemove_Format,SPACE,btBold,btItalic,btUnderline,SPACE,btAlign_Left,btCenter,btAlign_Right,SPACE,btStrikethrough,btSubscript,btSuperscript,btHorizontal"; 
     64                        var toolbar3 ="SPACE,btHyperlink,btHyperlink_Email,btInsert_Image,btEmotions"; 
     65 
     66                        var textarea_toolbar1 ="SPACE,btFont_Name,btFont_Size,btFont_Color,btHighlight"; 
     67                        var textarea_toolbar2 ="SPACE,btRemove_Format,SPACE,btBold,btItalic,btUnderline,SPACE,btAlign_Left,btCenter,btAlign_Right,SPACE,btStrikethrough,btSubscript,btSuperscript,btHorizontal"; 
     68                        var textarea_toolbar3 ="SPACE,btHyperlink,btHyperlink_Email,btInsert_Image,btEmotions"; 
     69                    </script> 
     70                    {include file="_bbcode_editor.tpl" name="cat_description" id="cat_description" author="" message=$cat_description width="350px" height="200px"} 
     71                {/if} 
    5072            </td> 
    5173        </tr> 
     
    134156        <tr> 
    135157            <td align='center' colspan='2' class='tbl'> 
    136                 <input type='submit' name='save_cat' value='{$locale.432}' class='button' /> 
     158                {if $settings.hoteditor_enabled == 0 || $userdata.user_hoteditor == 0} 
     159                    <input type='submit' name='save_cat' value='{$locale.432}' class='button' /> 
     160                {else} 
     161                    <input type='submit' name='save_cat' value='{$locale.432}' class='button' onclick='javascript:get_hoteditor_data("cat_description");' /> 
     162                {/if} 
    137163            </td> 
    138164        </tr> 
  • trunk/includes/templates/admin.downloads.tpl

    r2035 r2089  
    3535                    </td> 
    3636                    <td class='tbl'> 
    37                         <textarea name='download_description' rows='5' cols='80' class='textbox' style='width:400px;'>{$download_description}</textarea> 
    38                     </td> 
    39                 </tr> 
    40                 <tr> 
    41                     <td width='1%' class='tbl' style='white-space:nowrap'> 
    42                     </td> 
    43                     <td class='tbl'> 
    44                         <input type='button' value='b' class='button' style='font-weight:bold;width:25px;' onclick="addText('download_description', '<b>', '</b>');" /> 
    45                         <input type='button' value='i' class='button' style='font-style:italic;width:25px;' onclick="addText('download_description', '<i>', '</i>');" /> 
    46                         <input type='button' value='u' class='button' style='text-decoration:underline;width:25px;' onclick="addText('download_description', '<u>', '</u>');" /> 
    47                         <input type='button' value='ul' class='button' style='width:25px;' onclick="addText('download_description', '<ul>', '</ul>');" /> 
    48                         <input type='button' value='li' class='button' style='width:25px;' onclick="addText('download_description', '<li>', '</li>');" /> 
    49                         <input type='button' value='link' class='button' style='width:35px' onclick="addText('download_description', '<a href=\'', '\' target=\'_blank\'>Link</a>');" /> 
    50                         <input type='button' value='img' class='button' style='width:35px' onclick="addText('download_description', '<img src=\'', '\' style=\'margin:5px\' align=\'left\'>');" /> 
    51                         <input type='button' value='center' class='button' style='width:45px' onclick="addText('download_description', '<center>', '</center>');" /> 
    52                         <input type='button' value='small' class='button' style='width:40px' onclick="addText('download_description', '<span class=\'small\'>', '</span>');" /> 
    53                         <input type='button' value='small2' class='button' style='width:45px' onclick="addText('download_description', '<span class=\'small2\'>', '</span>');" /> 
    54                         <input type='button' value='alt' class='button' style='width:25px' onclick="addText('download_description', '<span class=\'alt\'>', '</span>');" /> 
    55                         <br /> 
     37                        {if $settings.hoteditor_enabled == 0 || $userdata.user_hoteditor == 0} 
     38                            <textarea name='download_description' rows='5' cols='80' class='textbox' style='width:400px'>{$download_description}</textarea><br /> 
     39                            <input type='button' value='b' class='button' style='font-weight:bold;width:25px;' onclick="addText('download_description', '[b]', '[/b]');" /> 
     40                            <input type='button' value='i' class='button' style='font-style:italic;width:25px;' onclick="addText('download_description', '[i]', '[/i]');" /> 
     41                            <input type='button' value='u' class='button' style='text-decoration:underline;width:25px;' onclick="addText('download_description', '[u]', '[/u]');" /> 
     42                            <input type='button' value='url' class='button' style='width:30px;' onclick="addText('download_description', '[url]', '[/url]');" /> 
     43                            <input type='button' value='mail' class='button' style='width:35px;' onclick="addText('download_description', '[mail]', '[/mail]');" /> 
     44                            <input type='button' value='img' class='button' style='width:30px;' onclick="addText('download_description', '[img]', '[/img]');" /> 
     45                            <input type='button' value='center' class='button' style='width:45px;' onclick="addText('download_description', '[center]', '[/center]');" /> 
     46                            <input type='button' value='small' class='button' style='width:40px;' onclick="addText('download_description', '[small]', '[/small]');" /> 
     47                            <br /> 
     48                        {else} 
     49                            <script language="javascript" type="text/javascript"> 
     50                                // non-standard toolbars for this editor instance 
     51                                var toolbar1 ="SPACE,btFont_Name,btFont_Size,btFont_Color,btHighlight"; 
     52                                var toolbar2 ="SPACE,btRemove_Format,SPACE,btBold,btItalic,btUnderline,SPACE,btAlign_Left,btCenter,btAlign_Right,SPACE,btStrikethrough,btSubscript,btSuperscript,btHorizontal"; 
     53                                var toolbar3 ="SPACE,btHyperlink,btHyperlink_Email,btInsert_Image,btEmotions"; 
     54 
     55                                var textarea_toolbar1 ="SPACE,btFont_Name,btFont_Size,btFont_Color,btHighlight"; 
     56                                var textarea_toolbar2 ="SPACE,btRemove_Format,SPACE,btBold,btItalic,btUnderline,SPACE,btAlign_Left,btCenter,btAlign_Right,SPACE,btStrikethrough,btSubscript,btSuperscript,btHorizontal"; 
     57                                var textarea_toolbar3 ="SPACE,btHyperlink,btHyperlink_Email,btInsert_Image,btEmotions"; 
     58                            </script> 
     59                            {include file="_bbcode_editor.tpl" name="download_description" id="download_description" author="" message=$download_description width="400px" height="200px"} 
     60                        {/if} 
    5661                    </td> 
    5762                </tr> 
     
    143148                            <br /><br /> 
    144149                        {/if} 
    145                         <input type='submit' name='save_download' value='{$locale.488}' class='button' /> 
     150                        {if $settings.hoteditor_enabled == 0 || $userdata.user_hoteditor == 0} 
     151                            <input type='submit' name='save_download' value='{$locale.488}' class='button' /> 
     152                        {else} 
     153                            <input type='submit' name='save_download' value='{$locale.488}' class='button' onclick='javascript:get_hoteditor_data("download_description");' /> 
     154                        {/if} 
    146155                    </td> 
    147156                </tr> 
  • trunk/includes/templates/main.news.tpl

    r2088 r2089  
    4141            <tr> 
    4242                <td style='width:100%;vertical-align:top;'> 
    43                     <a href='news_cats.php?cat_id={$news[column][item].news_cat_id}'> 
     43                    <a href='{$smarty.const.BASEDIR}news_cats.php?cat_id={$news[column][item].news_cat_id}'> 
    4444                    <img src='{$smarty.const.IMAGES_NC}{$news[column][item].news_cat_image}' alt='{$news[column][item].news_cat_name}' align='left' style='border:0px;margin-top:3px;margin-right:5px' /></a> 
    4545                    {$news[column][item].news_news|escape:"amp"}<br /> 
     
    4747            </tr> 
    4848        </table> 
    49         {if $allow_edit}<form name='editnews{$news[column][item].news_id}' method='post' action='/administration/news.php{$aidlink}&amp;news_id={$news[column][item].news_id}'>{/if} 
     49        {if $allow_edit}<form name='editnews{$news[column][item].news_id}' method='post' action='{$smarty.const.BASEDIR}administration/news.php{$aidlink}&amp;news_id={$news[column][item].news_id}'>{/if} 
    5050            <table width='100%' cellspacing='0' cellpadding='0'> 
    5151                <tr> 
    5252                    <td align='center' class='infobar'> 
    5353                        <img src='{$smarty.const.THEME}images/bullet.gif' alt='' /> {$locale.040} 
    54                         {if $smarty.const.iMEMBER}<a href='profile.php?lookup={$news[column][item].user_id}'>{/if} 
     54                        {if $smarty.const.iMEMBER}<a href='{$smarty.const.BASEDIR}profile.php?lookup={$news[column][item].user_id}'>{/if} 
    5555                        {$news[column][item].user_name}{if $smarty.const.iMEMBER}</a>{/if} 
    5656                        {if $_maxcols == 3} 
     
    6565                            &middot; 
    6666                        {/if} 
    67                         {if $news[column][item].news_extended}<a href='news.php?readmore={$news[column][item].news_id}'>{$locale.042}</a> &middot;{/if} 
     67                        {if $news[column][item].news_extended}<a href='{$smarty.const.BASEDIR}news.php?readmore={$news[column][item].news_id}'>{$locale.042}</a> &middot;{/if} 
    6868                        {if $news[column][item].allow_comments} 
    69                             <a href='news.php?readmore={$news[column][item].news_id}#comments'>{$news[column][item].news_comments} {$locale.043}</a> &middot; 
     69                            <a href='{$smarty.const.BASEDIR}news.php?readmore={$news[column][item].news_id}#comments'>{$news[column][item].news_comments} {$locale.043}</a> &middot; 
    7070                            {if $_maxcols == 3} 
    7171                                <img src='{$smarty.const.THEME}images/bulletb.gif' alt='' /><br /> 
Note: See TracChangeset for help on using the changeset viewer.