Changeset 850 for trunk/Modules


Ignore:
Timestamp:
Jan 17, 2016, 8:15:03 PM (8 years ago)
Author:
chronos
Message:
  • Added: List of latest forum posts on front page.
Location:
trunk/Modules
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Dictionary/Dictionary.php

    r846 r850  
    274274    $TableColumns = array(
    275275      array('Name' => 'Original', 'Title' => T('English')),
    276       array('Name' => 'Translated', 'Title' => $LanguageName),
     276      array('Name' => 'Translated', 'Title' => T($LanguageName)),
    277277    );
    278278    if(!is_numeric($_SESSION['language'])) $TableColumns[] = array('Name' => 'LangName', 'Title' => T('Language'));
  • trunk/Modules/Download/Download.php

    r843 r850  
    1919    $this->System->RegisterMenuItem(array(
    2020      'Title' => T('Download'),
    21       'Hint' => T('List of czech to download'),
     21      'Hint' => T('List of files for download'),
    2222      'Link' => $this->System->Link('/download/'),
    2323      'Permission' => LICENCE_ANONYMOUS,
     
    7979  function ShowDownload()
    8080  {
    81     $Output = '<h3>'.T('Download czech').'</h3><br />';
     81    $Output = '<h3>'.T('Download files').'</h3><br />';
    8282
    8383    $Output .= T('Additional files: modified wow.exe, fonts to game, translated interface aowow and more can be found on page').
  • trunk/Modules/Forum/Forum.php

    r846 r850  
    3535      'Icon' => '',
    3636    ), 17);
     37  }
     38
     39  function ShowBox()
     40  {
     41    $Parser = new HTML_BBCodeParser2(array('filters' => array('Basic', 'Extended',
     42      'Images', 'Links', 'Lists', 'Email')));
     43    $Count = 20;
     44    $Output = '<strong><a href="'.$this->System->Link('/forum/').'">'.T('Last forum posts').':</a></strong>';
     45
     46    $Query = 'SELECT `ForumText`.`Text`, `ForumText`.`Date`, `User`.`Name` AS `UserName`, '.
     47      '`User`.`Id` AS `UserId`, `ForumText`.`Thread` '.
     48      'FROM `ForumText` '.
     49      'JOIN `User` ON `User`.`Id` = `ForumText`.`User` '.
     50      'ORDER BY `Date` DESC LIMIT '.$Count;
     51    $DbResult = $this->Database->query($Query);
     52    $Output .= '<table class="MiniTable"><tr><th>'.T('Date').'</th><th>'.T('User').'</th><th>'.T('Post').'</th></tr>';
     53    while($DbRow = $DbResult->fetch_assoc())
     54    {
     55      $Output .= '<tr>'.
     56        '<td><a href="'.$this->System->Link('/forum/?Thread='.$DbRow['Thread']).'">'.HumanDate($DbRow['Date']).'</a></td>'.
     57        '<td><a href="'.$this->System->Link('/user/?user='.$DbRow['UserId']).'">'.$DbRow['UserName'].'</a></td>'.
     58        '<td>'.$Parser->qparse($DbRow['Text']).'</td>'.
     59        '</tr>';
     60    }
     61    $Output .= '</table>';
     62    return($Output);
    3763  }
    3864}
     
    7399  {
    74100    $Output = '';
    75 
    76101    $Text = $_POST['text'];
    77 
    78102    $DbResult = $this->System->Database->query('UPDATE `ForumText` SET `Text`="'.$_POST['text'].'" WHERE `User` = '.$this->System->User->Id.' AND `ID` = '.$_GET['Edit']);
    79 
    80103    $Output .= ShowMessage(T('Text edited.'));
    81 
    82 
    83104    return ($Output);
    84105  }
     
    178199    $Output .= $PageList['Output'];
    179200    $Output .= '<div class="shoutbox">';
    180     $DbResult = $this->System->Database->query('SELECT * FROM `ForumText`  WHERE `Thread` = '.
     201    $DbResult = $this->System->Database->query('SELECT * FROM `ForumText` WHERE `Thread` = '.
    181202      ($_GET['Thread']*1).' '.$SearchQuery.' ORDER BY `ID` DESC '.$PageList['SQLLimit']);
    182203    while($Line = $DbResult->fetch_assoc()) {
    183204      if ($this->System->User->Id == $Line['User'])
    184         $edit = '<a href="?Edit='.$Line['ID'].'">editovat</a>';
     205        $edit = '<a href="?Edit='.$Line['ID'].'">'.T('edit').'</a>';
    185206      else $edit = '';
    186207      $Output .= '<div><span style="float:right;">'.$edit.' ('.HumanDate($Line['Date']).
     
    197218    if($this->System->User->Licence(LICENCE_USER))
    198219    {
    199         $Output .= '<form action="?Thread='.$_GET['Thread'].'" method="post">'.
    200             '<fieldset><legend>'.T('New Forum Message').'</legend>'.
    201             T('User').': ';
    202         if($this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />';
     220      $Output .= '<form action="?Thread='.$_GET['Thread'].'" method="post">'.
     221        '<fieldset><legend>'.T('New Forum Message').'</legend>'.
     222        T('User').': ';
     223      if($this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />';
    203224        else $Output .= '<input type="text" name="user" /><br />';
    204         $Output .= T('Message text').': ('.T('You can use').' <a href="http://www.bbcode.org/reference.php">'.T('BB code').'</a>)<br/>'.
    205       '<textarea onkeydown="ResizeTextArea(this)" name="text" cols="80"></textarea> <br/>'.
    206       '<input type="hidden" name="a" value="add2"/>'.
    207       '<input type="submit" value="'.T('Send').'" /><br /></fieldset>'.
    208       '</form>';
     225      $Output .= T('Message text').': ('.T('You can use').' <a href="http://www.bbcode.org/reference.php">'.T('BB code').'</a>)<br/>'.
     226        '<textarea onkeydown="ResizeTextArea(this)" name="text" cols="80"></textarea> <br/>'.
     227        '<input type="hidden" name="a" value="add2"/>'.
     228        '<input type="submit" value="'.T('Send').'" /><br /></fieldset>'.
     229        '</form>';
    209230    } else $Output .= ShowMessage(T('You have to be registered for adding message.'), MESSAGE_CRITICAL);
    210231    return($Output);
  • trunk/Modules/FrontPage/FrontPage.php

    r848 r850  
    1111    $this->License = 'GNU/GPL';
    1212    $this->Description = 'Main welcome page';
    13     $this->Dependencies = array('News', 'User', 'ShoutBox', 'Translation');
     13    $this->Dependencies = array('News', 'User', 'ShoutBox', 'Translation', 'Log',
     14      'Forum');
    1415  }
    1516
     
    7980    if(isset($Message)) $Output .= ShowMessage($Message, $MessageType);
    8081
    81     $Output .= '<br />'.
    82       '<table class="Home"><tr><td colspan="3">'.$this->ShowWelcome().
     82    $Output .= ''.
     83      '<table class="Home"><tr><td colspan="2">'.$this->ShowWelcome().
    8384      '</td></tr>';
    84     $Output .= '<tr><td colspan="3"><h3><a href="'.$this->System->Link('/download/').'">'.T('Download Czech File').'</a></h3></td></tr>';
     85    $Output .= '<tr><td colspan="3"><h3><a href="'.$this->System->Link('/download/').'">'.T('Download files').'</a></h3></td></tr>';
    8586
    86     $Output .= '<tr><td class="SideBox">'.$this->ShowLastTranslated().'</td>'.
    87         '<td class="news-box">'.$this->System->ModuleManager->Modules['News']->ShowBox().'</td>'.
    88         '<td class="SideBox">'.$this->System->ModuleManager->Modules['ShoutBox']->ShowBox().'</td>'.
    89         '</tr></table>';
     87    $Output .= '<tr>'.
     88      '<td class="news-box">'.$this->System->ModuleManager->Modules['News']->ShowBox().'</td>'.
     89      '<td class="SideBox">'.$this->System->ModuleManager->Modules['ShoutBox']->ShowBox().'</td>'.
     90      '</tr></table>'.
     91      '<table class="Home"><tr>'.
     92      '<td class="news-box">'.$this->System->ModuleManager->Modules['Forum']->ShowBox().'</td>'.
     93      '<td class="SideBox">'.$this->System->ModuleManager->Modules['Translation']->ShowBox().'</td>'.
     94      '</tr></table>';
    9095     return($Output);
    91   }
    92 
    93   function ShowLastTranslated()
    94   {
    95     $Count = 40;
    96     $Output = '<strong>'.T('Last translated').':</strong>';
    97 
    98     $GroupListQuery = 'SELECT `Group`.* FROM `Group`';
    99     $Query = '';
    100     $UnionItems = array();
    101     $DbResult = $this->Database->query($GroupListQuery);
    102     if($DbResult->num_rows > 0)
    103     {
    104       while($DbRow = $DbResult->fetch_assoc())
    105       {
    106         $UnionItems[] = 'SELECT `T`.`ID`, `T`.`Take`, `T`.`User`, `T`.`ModifyTime`, `T`.`Group`, `T`.`GroupName` '.
    107             'FROM (SELECT `T`.`User`, `T`.`ID`, `T`.`ModifyTime`, '.
    108             $DbRow['Id'].' AS `Group`, "'.addslashes($DbRow['Name']).'" AS `GroupName`, `T`.`Take` FROM `'.
    109             $DbRow['TablePrefix'].'` AS `T`'.
    110             ' WHERE (`T`.`Complete` = 1) AND (`T`.`Language` != '.$this->System->Config['OriginalLanguage'].') ORDER BY `T`.`ModifyTime` DESC LIMIT '.
    111             $Count.') AS `T`';
    112       }
    113       $Query = 'SELECT `TT`.*, `User`.`Name` AS `UserName`, `User`.`Id` AS `UserId` '.
    114           ' FROM ('.implode(' UNION ', $UnionItems).') AS `TT`'.
    115           ' JOIN `User` ON `User`.`Id` = `TT`.`User`'.
    116           ' ORDER BY `ModifyTime` DESC LIMIT '.$Count;
    117       $DbResult = $this->Database->query($Query);
    118       $Output .= '<table class="MiniTable"><tr><th>'.T('Date').'</th><th>'.T('Who').'</th><th>'.T('New').'</th><th>'.T('Source').'</th><th>'.T('Group').'</th></tr>';
    119       while($DbRow = $DbResult->fetch_assoc())
    120       {
    121         $Output .= '<tr><td>'.HumanDate($DbRow['ModifyTime']).'</td>'.
    122             '<td><a href="'.$this->System->Link('/user/?user='.$DbRow['UserId']).'">'.$DbRow['UserName'].'</a></td>'.
    123             '<td><a href="'.$this->System->Link('/form.php?group='.$DbRow['Group'].'&amp;ID='.$DbRow['ID']).'">'.$DbRow['ID'].'</a></td>'.
    124             '<td><a href="'.$this->System->Link('/form.php?group='.$DbRow['Group'].'&amp;ID='.$DbRow['Take']).'">'.$DbRow['Take'].'</a></td>'.
    125             '<td><a href="'.$this->System->Link('/TranslationList.php?group='.$DbRow['Group'].'&amp;action=filter').'">'.T($DbRow['GroupName']).'</a></td></tr>';
    126       }
    127       $Output .= '</table>';
    128     }
    129     return($Output);
    13096  }
    13197
     
    160126    // Echo text even if it is hidden because of caching by external searching engines
    161127    return('<div style="'.$HideWelcome.'">'.
    162         '<div id="bannertitle">'.$this->System->Config['Web']['Title'].'</div>'.
    163         T('Open web system for translation texts from game World of Warcraft (WoW).<br/>'.
    164         '<ul>'.
    165         '<li>The project is operated as open and professes princips of freedom and openness. That is why texts are free to download.</li>'.
    166         '<li>The project serve for team translation. Anybody can contribute by translating texts and made link public e.g. banner at own web.</li>'.
    167         '<li>The project is not focused only to one server but allows collectively translation to people from various servers. Translators can translate in teams by name of own server and export texts only from selected translators.</li>'.
    168         '<li>Translated texts can be freely downloaded in various forms like XML, SQL, Addon and Lua. So translated texts can be simply imported to own free server or used in other projects.</li>'.
    169         '<li>Aim of the project is to translate all game texts. Not just texts of quests.</li>'.
    170         '<li>Thanks for sophisticated system of selectable exports you can download any part of translation, even just quests. And so exclude translation of items, creatures and others.</li>'.
    171         '<li>Texts can be translated to multiple languages, e.g. Czech and Slovak.</li>'.
    172         '</ul>').'</div>'.$Action);
     128      '<div id="bannertitle">'.$this->System->Config['Web']['Title'].'</div>'.
     129      T('Open web system for translation texts from game World of Warcraft (WoW).<br/>'.
     130      '<ul>'.
     131      '<li>The project is operated as open and professes princips of freedom and openness. That is why texts are free to download.</li>'.
     132      '<li>The project serve for team translation. Anybody can contribute by translating texts and made link public e.g. banner at own web.</li>'.
     133      '<li>The project is not focused only to one server but allows collectively translation to people from various servers. Translators can translate in teams by name of own server and export texts only from selected translators.</li>'.
     134      '<li>Translated texts can be freely downloaded in various forms like XML, SQL, Addon and Lua. So translated texts can be simply imported to own free server or used in other projects.</li>'.
     135      '<li>Aim of the project is to translate all game texts. Not just texts of quests.</li>'.
     136      '<li>Thanks for sophisticated system of selectable exports you can download any part of translation, even just quests. And so exclude translation of items, creatures and others.</li>'.
     137      '<li>Texts can be translated to multiple languages, e.g. Czech and Slovak.</li>'.
     138      '</ul>').'</div>'.$Action);
    173139  }
    174140}
  • trunk/Modules/News/News.php

    r839 r850  
    2929  function ShowBox()
    3030  {
    31     $Output = '<strong><a href="'.$this->System->Link('/news/').'">'.T('News').':</a></strong><div class="NewsBox">';
     31    $Count = 6;
     32    $Output = '<strong><a href="'.$this->System->Link('/news/').'">'.T('News').':</a></strong>'.
     33    '<div class="NewsBox">';
    3234    $DbResult = $this->Database->query('SELECT `News`.`Time`, `User`.`Name`, `News`.`Text`,`News`.`Title`, `News`.`Id` '.
    33       ' FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10');
     35      ' FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT '.$Count);
    3436    while($DbRow = $DbResult->fetch_assoc())
    3537    {
  • trunk/Modules/Translation/Translation.php

    r846 r850  
    4949      'Icon' => '',
    5050    ));
    51     /*
    5251    if(array_key_exists('Search', $this->System->ModuleManager->Modules))
    5352    {
     
    6867      }
    6968    }
    70     */
    7169  }
    7270
     
    9694    return($Output);
    9795  }
     96
     97  function ShowBox()
     98  {
     99    $Count = 40;
     100    $Output = '<strong>'.T('Last translated').':</strong>';
     101
     102    $GroupListQuery = 'SELECT `Group`.* FROM `Group`';
     103    $Query = '';
     104    $UnionItems = array();
     105    $DbResult = $this->Database->query($GroupListQuery);
     106    if($DbResult->num_rows > 0)
     107    {
     108      while($DbRow = $DbResult->fetch_assoc())
     109      {
     110        $UnionItems[] = 'SELECT `T`.`ID`, `T`.`Take`, `T`.`User`, `T`.`ModifyTime`, `T`.`Group`, `T`.`GroupName` '.
     111            'FROM (SELECT `T`.`User`, `T`.`ID`, `T`.`ModifyTime`, '.
     112            $DbRow['Id'].' AS `Group`, "'.addslashes($DbRow['Name']).'" AS `GroupName`, `T`.`Take` FROM `'.
     113            $DbRow['TablePrefix'].'` AS `T`'.
     114            ' WHERE (`T`.`Complete` = 1) AND (`T`.`Language` != '.$this->System->Config['OriginalLanguage'].') ORDER BY `T`.`ModifyTime` DESC LIMIT '.
     115            $Count.') AS `T`';
     116      }
     117      $Query = 'SELECT `TT`.*, `User`.`Name` AS `UserName`, `User`.`Id` AS `UserId` '.
     118          ' FROM ('.implode(' UNION ', $UnionItems).') AS `TT`'.
     119          ' JOIN `User` ON `User`.`Id` = `TT`.`User`'.
     120          ' ORDER BY `ModifyTime` DESC LIMIT '.$Count;
     121      $DbResult = $this->Database->query($Query);
     122      $Output .= '<table class="MiniTable"><tr><th>'.T('Date').'</th><th>'.T('Who').'</th><th>'.T('New').'</th><th>'.T('Source').'</th><th>'.T('Group').'</th></tr>';
     123      while($DbRow = $DbResult->fetch_assoc())
     124      {
     125        $Output .= '<tr><td>'.HumanDate($DbRow['ModifyTime']).'</td>'.
     126            '<td><a href="'.$this->System->Link('/user/?user='.$DbRow['UserId']).'">'.$DbRow['UserName'].'</a></td>'.
     127            '<td><a href="'.$this->System->Link('/form.php?group='.$DbRow['Group'].'&amp;ID='.$DbRow['ID']).'">'.$DbRow['ID'].'</a></td>'.
     128            '<td><a href="'.$this->System->Link('/form.php?group='.$DbRow['Group'].'&amp;ID='.$DbRow['Take']).'">'.$DbRow['Take'].'</a></td>'.
     129            '<td><a href="'.$this->System->Link('/TranslationList.php?group='.$DbRow['Group'].'&amp;action=filter').'">'.T($DbRow['GroupName']).'</a></td></tr>';
     130      }
     131      $Output .= '</table>';
     132    }
     133    return($Output);
     134  }
    98135}
  • trunk/Modules/User/Profile.php

    r846 r850  
    122122    $parser = new HTML_BBCodeParser2(array('filters' => array('Basic','Extended','Images','Links','Lists','Email')));
    123123    $Count = 20;
    124     $Output = '<strong>'.T('Lastest forum posts:').'</strong>';
     124    $Output = '<strong>'.T('Latest forum posts:').'</strong>';
    125125
    126126    $Output .= '<div class="shoutbox">';
Note: See TracChangeset for help on using the changeset viewer.