Changeset 5 for branches/portal_by_daris

Show
Ignore:
Timestamp:
02/07/09 08:33:30 (3 years ago)
Author:
daris
Message:

portal: language files review

Location:
branches/portal_by_daris
Files:
2 added
22 modified

Legend:

Unmodified
Added
Removed
  • branches/portal_by_daris/admin/pages.php

    r4 r5  
    11<?php 
    2 /** 
    3  * Forum management page 
    4  * 
    5  * Allows administrators to add, modify, and remove forums. 
    6  * 
    7  * @copyright Copyright (C) 2008 FluxBB.org, based on code copyright (C) 2002-2008 PunBB.org 
    8  * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher 
    9  * @package FluxBB 
    10  */ 
     2/*********************************************************************** 
     3 
     4        PunBB extension 
     5        Portal 
     6        Daris <daris91@gmail.com> 
     7 
     8************************************************************************/ 
    119 
    1210 
  • branches/portal_by_daris/admin/panels.php

    r2 r5  
    11<?php 
    2 /** 
    3  * Forum management page. 
    4  * 
    5  * Allows administrators to add, modify, and remove forums. 
    6  * 
    7  * @copyright Copyright (C) 2008 PunBB, partially based on code copyright (C) 2008 FluxBB.org 
    8  * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher 
    9  * @package PunBB 
    10  */ 
     2/*********************************************************************** 
     3 
     4        PunBB extension 
     5        Portal 
     6        Daris <daris91@gmail.com> 
     7 
     8************************************************************************/ 
    119 
    1210 
    1311if (!defined('FORUM_ROOT')) 
    14         define('FORUM_ROOT', '../../..//'); 
     12        define('FORUM_ROOT', '../../../'); 
    1513require FORUM_ROOT.'include/common.php'; 
    1614require FORUM_ROOT.'include/common_admin.php'; 
     
    3331require PORTAL_ROOT.'include/functions.php'; 
    3432 
    35 $side_names = array( 
     33$location_names = array( 
    3634        0 => 'Left side', 
    3735        1 => 'Center top', 
     
    4341if (isset($_POST['add_panel'])) 
    4442{ 
    45         $panel_title = forum_trim($_POST['title']); 
    46         $side = intval($_POST['side']); 
     43        $panel_name = forum_trim($_POST['name']); 
     44        $location = intval($_POST['location']); 
    4745        $file = $_POST['file']; 
    4846        $position = intval($_POST['position']); 
     
    5048        ($hook = get_hook('afo_add_forum_form_submitted')) ? eval($hook) : null; 
    5149 
    52         if ($panel_title == '') 
     50        if ($panel_name == '') 
    5351                message($lang_admin_panels['Must enter forum message']); 
    5452 
    5553        $query = array( 
    56                 'INSERT'        => 'title, side, file, position', 
     54                'INSERT'        => 'name, location, file, position', 
    5755                'INTO'          => 'panels', 
    58                 'VALUES'        => '\''.$forum_db->escape($panel_title).'\', '.$side.', \''.$forum_db->escape($file).'\', '.$position 
     56                'VALUES'        => '\''.$forum_db->escape($panel_name).'\', '.$location.', \''.$forum_db->escape($file).'\', '.$position 
    5957        ); 
    6058 
     
    112110        { 
    113111                $query = array( 
    114                         'SELECT'        => 'pn.title', 
     112                        'SELECT'        => 'pn.name', 
    115113                        'FROM'          => 'panels AS pn', 
    116114                        'WHERE'         => 'pn.id='.$panel_to_delete 
     
    122120                        message($lang_common['Bad request']); 
    123121 
    124                 $panel_title = $forum_db->result($result); 
     122                $panel_name = $forum_db->result($result); 
    125123 
    126124 
     
    130128                        array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])), 
    131129                        array($lang_admin_common['Start'], forum_link($forum_url['admin_index'])), 
    132                         array($lang_admin_common['Forums'], forum_link($forum_url['admin_panels'])), 
     130                        array($lang_admin_panels['Panels'], forum_link($forum_url['admin_panels'])), 
    133131                        $lang_admin_panels['Delete panel'] 
    134132                ); 
     
    147145?> 
    148146        <div class="main-subhead"> 
    149                 <h2 class="hn"><span><?php printf($lang_admin_panels['Confirm delete panel'], forum_htmlencode($panel_title)) ?></span></h2> 
     147                <h2 class="hn"><span><?php printf($lang_admin_panels['Confirm delete panel'], forum_htmlencode($panel_name)) ?></span></h2> 
    150148        </div> 
    151149        <div class="main-content main-frm"> 
     
    242240                ($hook = get_hook('xn_portal_by_daris_apn_save_panel_form_submitted')) ? eval($hook) : null; 
    243241 
    244                 $title = trim($_POST['title']); 
     242                $name = trim($_POST['name']); 
    245243                $content = forum_linebreaks(trim($_POST['content'])); 
    246                 $side = intval($_POST['side']); 
     244                $location = intval($_POST['location']); 
    247245                $file = trim($_POST['file']); 
    248246 
     
    253251                $query = array( 
    254252                        'UPDATE'        => 'panels', 
    255                         'SET'           => 'title=\''.$forum_db->escape($title).'\', content=\''.$forum_db->escape($content).'\', file=\''.$forum_db->escape($file).'\', side='.$side, 
     253                        'SET'           => 'name=\''.$forum_db->escape($name).'\', content=\''.$forum_db->escape($content).'\', file=\''.$forum_db->escape($file).'\', location='.$location, 
    256254                        'WHERE'         => 'id='.$panel_id 
    257255                ); 
     
    269267        // Fetch panel info 
    270268        $query = array( 
    271                 'SELECT'        => 'pn.id, pn.title, pn.content, pn.file, pn.side', 
     269                'SELECT'        => 'pn.id, pn.name, pn.content, pn.file, pn.location', 
    272270                'FROM'          => 'panels AS pn', 
    273271                'WHERE'         => 'pn.id='.$panel_id 
     
    306304?> 
    307305        <div class="main-subhead"> 
    308                 <h2 class="hn"><span><?php printf($lang_admin_panels['Edit panel head'], forum_htmlencode($cur_panel['title'])) ?></span></h2> 
     306                <h2 class="hn"><span><?php printf($lang_admin_panels['Edit panel head'], forum_htmlencode($cur_panel['name'])) ?></span></h2> 
    309307        </div> 
    310308        <div class="main-content main-frm"> 
     
    322320                                <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> 
    323321                                        <div class="sf-box text"> 
    324                                                 <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_panels['Panel name'] ?></span></label><br /> 
    325                                                 <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="title" size="35" value="<?php echo forum_htmlencode($cur_panel['title']) ?>" /></span> 
     322                                                <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_panels['Panel name'] ?></span> <small><?php echo $lang_admin_panels['Panel name help'] ?></small></label><br /> 
     323                                                <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="name" size="50" value="<?php echo forum_htmlencode($cur_panel['name']) ?>" /></span> 
    326324                                        </div> 
    327325                                </div> 
     
    338336                                <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> 
    339337                                        <div class="sf-box select"> 
    340                                                 <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_panels['Panel side'] ?></span></label><br /> 
    341                                                 <span class="fld-input"><select id="fld<?php echo $forum_page['fld_count'] ?>" name="side"> 
    342 <?php 
    343         foreach ($side_names as $side => $name) 
    344                 echo '<option value="'.$side.'"'.($cur_panel['side'] == $side ? ' selected="selected"' : '').'>'.$lang_admin_panels[$name].'</option>'; 
     338                                                <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_panels['Panel location'] ?></span></label><br /> 
     339                                                <span class="fld-input"><select id="fld<?php echo $forum_page['fld_count'] ?>" name="location"> 
     340<?php 
     341        foreach ($location_names as $location => $name) 
     342                echo '<option value="'.$location.'"'.($cur_panel['location'] == $location ? ' selected="selected"' : '').'>'.$lang_admin_panels[$name].'</option>'; 
    345343?> 
    346344                                                </select></span> 
     
    382380        array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])), 
    383381        array($lang_admin_common['Start'], forum_link($forum_url['admin_index'])), 
    384         array($lang_admin_common['Forums'], forum_link($forum_url['admin_panels'])) 
     382        array($lang_admin_panels['Panels'], forum_link($forum_url['admin_panels'])) 
    385383); 
    386384 
     
    412410                                        <div class="sf-box text"> 
    413411                                                <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_panels['Panel name'] ?></span></label><br /> 
    414                                                 <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="title" size="35" maxlength="80" /></span> 
     412                                                <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="name" size="50" /></span> 
    415413                                        </div> 
    416414                                </div> 
     
    418416                                <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> 
    419417                                        <div class="sf-box select"> 
    420                                                 <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_panels['Panel side'] ?></span></label><br /> 
    421                                                 <span class="fld-input"><select id="fld<?php echo $forum_page['fld_count'] ?>" name="side"> 
    422 <?php 
    423         foreach ($side_names as $side => $name) 
    424                 echo '<option value="'.$side.'">'.$lang_admin_panels[$name].'</option>'; 
     418                                                <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_panels['Panel location'] ?></span></label><br /> 
     419                                                <span class="fld-input"><select id="fld<?php echo $forum_page['fld_count'] ?>" name="location"> 
     420<?php 
     421        foreach ($location_names as $location => $name) 
     422                echo '<option value="'.$location.'">'.$lang_admin_panels[$name].'</option>'; 
    425423?> 
    426424                                                </select></span> 
     
    449447// Display all the panels 
    450448$query = array( 
    451         'SELECT'        => 'pn.id, pn.title, pn.content, pn.position, pn.side, pn.enable, pn.file', 
     449        'SELECT'        => 'pn.id, pn.name, pn.content, pn.position, pn.location, pn.enable, pn.file', 
    452450        'FROM'          => 'panels AS pn', 
    453         'ORDER BY'      => 'pn.side, pn.position' 
     451        'ORDER BY'      => 'pn.location, pn.position' 
    454452); 
    455453 
     
    481479        { 
    482480 
    483                 if ($cur_panel['side'] != $cur_category)        // A new category since last iteration? 
     481                if ($cur_panel['location'] != $cur_category)    // A new category since last iteration? 
    484482                { 
    485483                        if ($i > 2) echo "\t\t\t".'</div>'."\n"; 
     
    488486?> 
    489487                        <div class="content-head"> 
    490                                 <h3 class="hn"><span><?php printf($lang_admin_panels['Panels for'], $lang_admin_panels[$side_names[$cur_panel['side']]]) ?></span></h3> 
     488                                <h3 class="hn"><span><?php printf($lang_admin_panels['Panels for'], $lang_admin_panels[$location_names[$cur_panel['location']]]) ?></span></h3> 
    491489                        </div> 
    492490                        <div class="frm-group frm-hdgroup group<?php echo ++$forum_page['group_count'] ?>"> 
     
    494492<?php 
    495493 
    496                         $cur_category = $cur_panel['side']; 
     494                        $cur_category = $cur_panel['location']; 
    497495                } 
    498496 
     
    506504                                                <div class="mf-field mf-field1 forum-field"> 
    507505                                                        <span class="aslabel"><?php echo $lang_admin_panels['Panel name'] ?></span> 
    508                                                         <span class="fld-input"><?php echo forum_htmlencode($cur_panel['title']) ?></span> 
     506                                                        <span class="fld-input"><?php echo forum_htmlencode($cur_panel['name']) ?></span> 
    509507                                                </div> 
    510508<?php ($hook = get_hook('afo_pre_edit_cur_forum_position')) ? eval($hook) : null; ?> 
  • branches/portal_by_daris/admin/portal.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
  • branches/portal_by_daris/include/cache.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
     
    2222                'FROM'          => 'panels AS pn', 
    2323                'WHERE'         => 'pn.enable=1', 
    24                 'ORDER BY'      => 'pn.side, pn.position' 
     24                'ORDER BY'      => 'pn.location, pn.position' 
    2525        ); 
    2626 
     
    3131        while ($cur_panel = $forum_db->fetch_assoc($result)) 
    3232        { 
    33                 if (!isset($output[$cur_panel['side']])) 
    34                         $output[$cur_panel['side']] = array(); 
     33                if (!isset($output[$cur_panel['location']])) 
     34                        $output[$cur_panel['location']] = array(); 
    3535                 
    36                 $output[$cur_panel['side']][] = array( 
    37                         'title' => $cur_panel['title'], 
     36                $output[$cur_panel['location']][] = array( 
     37                        'name' => $cur_panel['name'], 
    3838                        'position' => $cur_panel['position'], 
    3939                        'content' => $cur_panel['content'], 
  • branches/portal_by_daris/include/rewrite_rules.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
  • branches/portal_by_daris/include/url/Default.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
  • branches/portal_by_daris/include/url/File_based.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
  • branches/portal_by_daris/include/url/File_based_(fancy).php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
  • branches/portal_by_daris/include/url/Folder_based.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
  • branches/portal_by_daris/include/url/Folder_based_(fancy).php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
  • branches/portal_by_daris/index.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
  • branches/portal_by_daris/install.php

    r4 r5  
    6363                                        'default'       => 0 
    6464                                ), 
    65                                 'title'                 => array( 
     65                                'name'                  => array( 
    6666                                        'datatype'              => 'VARCHAR(255)', 
    6767                                        'allow_null'    => true 
     
    7575                                        'allow_null'    => true 
    7676                                ), 
    77                                 'side'                  => array( 
     77                                'location'                      => array( 
    7878                                        'datatype'              => 'INT(10) UNSIGNED', 
    7979                                        'allow_null'    => true, 
  • branches/portal_by_daris/lang/English/admin_pages.php

    r4 r5  
    88'Edit'                                                  =>      'Edit', 
    99'Delete'                                                =>      'Delete', 
    10 'Page name'                                     =>      'Page name:', 
     10'Page name'                                             =>      'Page name:', 
    1111'Delete page'                                   =>      'Delete page', 
    12 'Delete page warning'                   =>      '<strong>WARNING!</strong> Deleting a page will delete all posts (if any) in that page!', 
    13 'Edit page'                                     =>      'Edit page', 
     12'Delete page warning'                   =>      'Are you sure you want to delete this page?', 
     13'Edit page'                                             =>      'Edit page', 
    1414'Edit page details legend'              =>      'Page details:', 
    15 'Category assignment'                   =>      'Assign to category:', 
    16 'Pages in category'                     =>      'Pages in category: %s', 
    17 'Edit page perms legend'                =>      'Page group permissions (non default permissions are suffixed "(S)":', 
    18 'Position label'                                =>      'Position:', 
    1915'Add to category label'                 =>      'Add to category:', 
    2016'Page content'                                  =>      'Page content:', 
     
    2420'Confirm delete page'                   =>      'You are deleting the page "%s"', 
    2521'Add page'                                              =>      'Add page', 
    26 'Add page head'                         =>      'Add a new page', 
     22'Add page head'                                 =>      'Add a new page', 
    2723'Add page legend'                               =>      'Add page:', 
    2824'Page added'                                    =>      'Page added.', 
    2925'Page deleted'                                  =>      'Page deleted.', 
    30 'Pages updated'                         =>      'Pages updated.', 
    3126'Page updated'                                  =>      'Page updated.', 
    3227'Must enter page message'               =>      'You must enter a page name.', 
  • branches/portal_by_daris/page.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
  • branches/portal_by_daris/panels.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
     
    2525        ); 
    2626 
    27         foreach ($forum_panels as $side => $panels) 
     27        foreach ($forum_panels as $location => $panels) 
    2828        { 
    29                 foreach ($panels as $panel) 
     29                foreach ($panels as $cur_panel) 
    3030                { 
    3131                        ob_start(); 
    3232         
    33                         $content_class = 'panel-content'; 
     33                        // default class for content element, panels can change it 
     34                        $cur_panel['class'] = 'panel-content'; 
    3435         
    35                         $file = FORUM_ROOT.'extensions/'.$panel['file']; 
     36                        $file = FORUM_ROOT.'extensions/'.$cur_panel['file']; 
    3637                         
    3738                        // if panel file exists require it 
    38                         if ($panel['file'] != '' && file_exists($file) && is_file($file)) 
     39                        if ($cur_panel['file'] != '' && file_exists($file) && is_file($file)) 
    3940                                require_once $file; 
    4041         
    4142                        // else evaluate panel content 
    4243                        else 
    43                                 eval('?>'.$panel['content']); 
     44                                eval('?>'.$cur_panel['content']); 
    4445         
    4546         
    46                         $content = ob_get_contents(); 
     47                        $cur_panel['content'] = ob_get_contents(); 
    4748                        ob_end_clean(); 
    4849                         
    49                         if ($content == '') 
     50                        if (!$cur_panel['content']) 
    5051                                continue; 
    5152                 
     
    5455 
    5556                <div class="main-head"> 
    56                         <h2 class="hn"><span><?php echo $panel['title'] ?></span></h2> 
     57                        <h2 class="hn"><span><?php echo $cur_panel['name'] ?></span></h2> 
    5758                </div> 
    5859 
    59                 <div class="main-content <?php echo $content_class ?>"> 
    60 <?php echo $content ?> 
     60                <div class="main-content <?php echo $cur_panel['class'] ?>"> 
     61<?php echo $cur_panel['content'] ?> 
    6162 
    6263                </div> 
     
    6667 
    6768                        // insert panel html to specified side 
    68                         $panels_output[$side][] = ob_get_contents(); 
     69                        $panels_output[$location][] = ob_get_contents(); 
    6970         
    7071                        ob_end_clean(); 
  • branches/portal_by_daris/panels/active_topics.php

    r2 r5  
    11<?php 
    2 /** 
    3  * Lists the topics in the specified forum. 
    4  * 
    5  * @copyright Copyright (C) 2008 PunBB, partially based on code copyright (C) 2008 FluxBB.org 
    6  * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher 
    7  * @package PunBB 
    8  */ 
     2/*********************************************************************** 
     3 
     4        PunBB extension 
     5        Portal 
     6        Daris <daris91@gmail.com> 
     7 
     8************************************************************************/ 
    99 
    1010 
     
    1414 
    1515$count = 5; // active topics count 
    16 $content_class = 'forum'; 
     16$cur_panel['class'] = 'forum'; 
    1717 
    1818// Load the viewforum.php language file 
  • branches/portal_by_daris/panels/example.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
     
    1313        exit; 
    1414 
    15 $panel['title'] = 'Example panel'; // title for panel (if it isn't set, will be used panel name 
     15$cur_panel['title'] = 'Example panel'; // title for panel (if it isn't set, will be used panel name) 
    1616 
    1717echo 'This is an example panel'; 
  • branches/portal_by_daris/panels/menu.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
  • branches/portal_by_daris/panels/pages.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
  • branches/portal_by_daris/panels/recent_posts.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
  • branches/portal_by_daris/panels/top_posters.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
  • branches/portal_by_daris/panels/who_is_online.php

    r2 r5  
    22/*********************************************************************** 
    33 
    4         FluxBB extension 
     4        PunBB extension 
    55        Portal 
    66        Daris <daris91@gmail.com> 
     
    104104else 
    105105{ 
    106         $panel['title'] = $lang_common['Login']; 
     106        $cur_panel['title'] = $lang_common['Login']; 
    107107 
    108108        require_once FORUM_ROOT.'lang/'.$forum_user['language'].'/login.php';