Changeset 843 in ExiteCMS


Ignore:
Timestamp:
09/27/07 19:34:07 (4 years ago)
Author:
hverton
Message:

Moved all CMS templates from the theme to the include directory. They are theme independent
Added a Smarty resource to load templates from strings
Some XHTML fixes

Location:
trunk
Files:
81 added
80 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/forum/viewthread.php

    r834 r843  
    117117    define("iMOD", false);  
    118118} 
     119 
     120// check if this user is allowed to blacklist 
     121$variables['user_can_blacklist'] = checkrights("B"); 
    119122 
    120123// get information about the current thread 
  • trunk/includes/Smarty-2.6.18/Smarty.class.php

    r841 r843  
    7373     * @var string 
    7474     */ 
    75     var $template_dir    =  'templates'; 
     75    var $template_dir    =  array('templates'); 
    7676 
    7777    /** 
  • trunk/includes/Smarty-2.6.18/custom-plugins/function.buttonlink.php

    r838 r843  
    5757    } 
    5858     
    59     return "<input type='button' class='button' value='$name' ".($title?"title='$title' ":"")."onClick='".($script ? ($link."'") : ($new ? "window.open(\"$link\");'" : "window.location=\"$link\";'"))." />"; 
     59    return "<input type='button' class='button' value='$name' ".($title?"title='$title' ":"")."onclick='".($script ? ($link."'") : ($new ? "window.open(\"$link\");'" : "window.location=\"$link\";'"))." />"; 
    6060} 
    6161 
  • trunk/includes/core_functions.php

    r834 r843  
    498498     
    499499    $text = preg_replace('#\[flash width=([0-9]*?) height=([0-9]*?)\]([^\s\'\";:\+]*?)(\.swf)\[/flash\]#si', '<object classid=\'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\' codebase=\'http://active.macromedia.com/flash6/cabs/swflash.cab#version=6,0,0,0\' id=\'\3\4\' width=\'\1\' height=\'\2\'><param name=movie value=\'\3\4\'><param name=\'quality\' value=\'high\'><param name=\'bgcolor\' value=\'#ffffff\'><embed src=\'\3\4\' quality=\'high\' bgcolor=\'#ffffff\' width=\'\1\' height=\'\2\' type=\'application/x-shockwave-flash\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\'></embed></object>', $text); 
    500     $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)(.*?)(\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\[/img\]#sie","'<img src=\'\\1'.str_replace(array('.php','?','&','='),'','\\3').'\\4\' style=\'border:0px\' />'",$text); 
     500    $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)(.*?)(\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\[/img\]#sie","'<img src=\'\\1'.str_replace(array('.php','?','&','='),'','\\3').'\\4\' style=\'border:0px\' alt=\'\' />'",$text); 
    501501 
    502502    $text = preg_replace('#\[quote=([\r\n]*)(.*?)\]#si', '<b>\2 '.$locale['199'].':</b><br />[quote]', $text); 
     
    711711    global $settings; 
    712712     
     713    // ask the user for authentication 
    713714    header('WWW-Authenticate: Basic realm="'.$settings['sitename'].'"'); 
    714715    header('HTTP/1.0 401 Unauthorized'); 
    715     echo "Pressed cancel. Need to replace this with something useful"; 
     716    // if the user cancels, redirect to the homepage 
     717    echo "<script type='text/javascript'>document.location.href='".BASEDIR."index.php'</script>\n"; 
    716718    exit; 
    717719} 
     
    735737        } 
    736738        if ($data['user_status'] == 0) {     
    737             // HV - set the 'remember me' status value into a cookie 
    738739            if (isset($_POST['remember_me'])) { 
    739740                setcookie("remember_me", "yes", time() + 31536000, "/", "", "0"); 
     
    743744                $cookie_exp = time() + 60*30; 
    744745            } 
    745             // HV - end of code change 
    746746            header("P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'"); 
    747747            setcookie("userinfo", $cookie_value, $cookie_exp, "/", "", "0"); 
  • trunk/includes/theme_functions.php

    r841 r843  
    2727$template->compile_check = true; 
    2828 
     29// set the compile ID for this website 
     30$template->compile_id = $_SERVER['SERVER_NAME']; 
     31 
    2932// caching required? 
    3033$template->caching = 0; 
     
    4447// and finaly, use the default Smarty plugins 
    4548$plugins_dir[] = 'smarty-plugins'; 
     49 
    4650$template->plugins_dir = $plugins_dir; 
     51 
     52// templates, where to find them? 
     53$template_dir = array(); 
     54// first check if there's one defined in the current theme 
     55if (is_dir(PATH_THEME."templates/source")) $template_dir[] = PATH_THEME."templates/source"; 
     56// next, check the CMS template directory 
     57$template_dir[] = PATH_INCLUDES.'templates'; 
     58 
     59$template->template_dir = $template_dir; 
    4760 
    4861// PHP in Templates? Don't think so! 
     
    158171            } 
    159172 
    160             // if this is a module template... 
     173            //if this is a module template... 
    161174            $tpl_parts = explode(".", $panel['template']); 
    162175            if ($tpl_parts[0] == "modules") { 
    163                 // check if there is a customized version for the current theme 
    164                 if (!file_exists($template->template_dir."/".$panel['template'])) { 
    165                     // if not, add the module template to smarty's source list, so the default template can be found 
    166                     $template->template_dir = array(PATH_MODULES.$tpl_parts[1].'/templates', $template->template_dir); 
    167                 } 
    168             } 
     176                // store the current template directories, we need to restore them later 
     177                $td = $template->template_dir; 
     178                $template->template_dir = array_merge(array(PATH_MODULES.$tpl_parts[1].'/templates'), $template->template_dir); 
     179            } else { 
     180                // we shouldn't get here 
     181            } 
     182         
    169183            // if a template is defined, load the template,  
    170184            if (isset($panel['template'])) $template->display($panel['template']); 
    171  
    172             // restore the template directory if needed 
    173             $template->template_dir = PATH_THEME.'templates/source'; 
     185             
     186            // restore the template direcory if needed 
     187            if (isset($td) && is_array($td)) $template->template_dir = $td; 
    174188        } 
    175189    } 
  • trunk/locale/English/admin/settings.php

    r814 r843  
    9393$locale['661'] = "Leave empty for immediate upload/download of backups."; 
    9494$locale['662'] = "Use TinyMCE HTML editor?"; 
    95 $locale['663'] = "For article and news admin only."; 
    96 $locale['664'] = "SMTP Host"; 
     95$locale['663'] = "Leave blank if your SMTP host does not require authentication"; 
     96$locale['664'] = "SMTP Host:"; 
    9797$locale['665'] = "Leave empty if sendmail is enabled."; 
    98 $locale['666'] = "SMTP Username"; 
    99 $locale['667'] = "SMTP Password"; 
     98$locale['666'] = "SMTP Username and Password:"; 
     99$locale['667'] = "In seconds.Only one post per interval is allowed."; 
    100100$locale['668'] = "Use external download statistics:"; 
    101101$locale['669'] = "Maintenance mode background color:"; 
     102$locale['670'] = "If yes, an external program has to update the download counters."; 
    102103// Private Message Settings 
    103104$locale['700'] = "Private Messages"; 
  • trunk/locale/English/forum/main.php

    r835 r843  
    7878$locale['569'] = "Quote"; 
    7979$locale['570'] = "IP Address"; 
     80$locale['570a'] = ". Click to blacklist this ".$locale['570']; 
    8081$locale['571'] = "pm"; 
    8182$locale['571a'] = "Send Private Message"; 
  • trunk/locale/English/global.php

    r814 r843  
    130130$locale['110'] = "View"; 
    131131$locale['111'] = "View Poll"; 
     132$locale['112'] = "(Poll)"; 
    132133// Shoutbox 
    133134$locale['120'] = "Shoutbox"; 
  • trunk/news_cats.php

    r834 r843  
    1616require_once PATH_ROOT."/includes/theme_functions.php"; 
    1717 
    18 define('NC_OVERVIEW_LIMIT', 10); 
     18define('NC_OVERVIEW_LIMIT', 5); 
    1919 
    2020// load this module's locales 
  • trunk/profile.php

    r834 r843  
    136136        } 
    137137        $data['cc_flag'] = $cc_flag; 
    138         $data['user_level'] = getuserlevel($data['user_level']); 
    139138        $members[] = $data; 
    140139    } 
  • trunk/themes/PLiTheme/templates/source/_header.tpl

    r841 r843  
    197197            <a href='.' onclick='fontGroter(-0.1); return false' title='Decrease font-size'><img src='{$smarty.const.THEME}images/minus.gif' alt='' border='0' /></a><a href='.' onclick='fontReset(0.7); return false' title='Restore default font-sizes'><img src='{$smarty.const.THEME}images/reset.gif' hspace='2' alt='' border='0' /></a><a href='.' onclick='fontGroter(0.1); return false' title='Increase font-size'><img src='{$smarty.const.THEME}images/plus.gif' alt='' border='0' /></a> 
    198198            {section name=index loop=$headermenu} 
    199                 {if !$smarty.section.index.first} &middot;{/if} <a href='{$headermenu[index].link_url}' {if $headermenu[index].link_window == 1}target='_blank' {/if}alt=''><span class='small'>{$headermenu[index].link_name}</span></a> 
     199                {if !$smarty.section.index.first} &middot;{/if} <a href='{$headermenu[index].link_url}' {if $headermenu[index].link_window == 1}target='_blank' {/if}><span class='small'>{$headermenu[index].link_name}</span></a> 
    200200            {/section} 
    201201        </td> 
  • trunk/themes/PLiTheme/templates/source/_message_side_panel.simple.tpl

    r747 r843  
    11{***************************************************************************} 
    22{*                                                                         *} 
    3 {* PLi-Fusion CMS template: _message_side_panel.simple.tpl                 *} 
     3{* ExiteCMS template: _message_side_panel.simple.tpl                       *} 
    44{*                                                                         *} 
    55{***************************************************************************} 
  • trunk/themes/PLiTheme/templates/source/_message_side_panel.tpl

    r735 r843  
    11{***************************************************************************} 
    22{*                                                                         *} 
    3 {* PLi-Fusion CMS template: _message_side_panel.tpl                        *} 
     3{* ExiteCMS template: _message_side_panel.tpl                              *} 
    44{*                                                                         *} 
    55{***************************************************************************} 
  • trunk/themes/PLiTheme/templates/source/_message_table_panel.simple.tpl

    r743 r843  
    11{***************************************************************************} 
    22{*                                                                         *} 
    3 {* PLi-Fusion CMS template: _message_table_panel.simple.tpl                *} 
     3{* ExiteCMS template: _message_table_panel.simple.tpl                      *} 
    44{*                                                                         *} 
    55{***************************************************************************} 
  • trunk/themes/PLiTheme/templates/source/_message_table_panel.tpl

    r735 r843  
    11{***************************************************************************} 
    22{*                                                                         *} 
    3 {* PLi-Fusion CMS template: _message_table_panel.tpl                       *} 
     3{* ExiteCMS template: _message_table_panel.tpl                             *} 
    44{*                                                                         *} 
    55{***************************************************************************} 
  • trunk/themes/PLiTheme/templates/source/_openside.tpl

    r735 r843  
    11{***************************************************************************} 
    22{*                                                                         *} 
    3 {* PLi-Fusion CMS include template: _openside.tpl                          *} 
     3{* ExiteCMS include template: _openside.tpl                                *} 
    44{*                                                                         *} 
    55{***************************************************************************} 
  • trunk/themes/PLiTheme/templates/source/_openside_x.tpl

    r735 r843  
    11{***************************************************************************} 
    22{*                                                                         *} 
    3 {* PLi-Fusion CMS include template: _openside_x.tpl                        *} 
     3{* ExiteCMS include template: _openside_x.tpl                              *} 
    44{*                                                                         *} 
    55{***************************************************************************} 
  • trunk/themes/PLiTheme/templates/source/_opentable.tpl

    r735 r843  
    11{***************************************************************************} 
    22{*                                                                         *} 
    3 {* PLi-Fusion CMS include template: _opentable.tpl                         *} 
     3{* ExiteCMS include template: _opentable.tpl                               *} 
    44{*                                                                         *} 
    55{***************************************************************************} 
  • trunk/themes/PLiTheme/templates/source/_query_debug.tpl

    r778 r843  
    11{***************************************************************************} 
    22{*                                                                         *} 
    3 {* PLi-Fusion CMS template: _query_debug.tpl                               *} 
     3{* ExiteCMS template: _query_debug.tpl                                     *} 
    44{*                                                                         *} 
    55{***************************************************************************} 
Note: See TracChangeset for help on using the changeset viewer.