- Timestamp:
- Jan 22, 2014, 6:12:46 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 11 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Forum/Forum.php
r750 r760 20 20 'Title' => T('Forum'), 'Channel' => 'forum', 'Callback' => array('PageForum', 'ShowRSS'), 21 21 'Permission' => LICENCE_ANONYMOUS)); 22 $this->System->RegisterMenuItem(array( 22 23 if(array_key_exists('Search', $this->System->ModuleManager->Modules)) 24 $this->System->ModuleManager->Modules['Search']->RegisterSearch('forum', 25 T('Forum'), array('UserName', 'Text'), '`ForumText`', $this->System->Link('/forum/?search=')); 26 if(array_key_exists('Search', $this->System->ModuleManager->Modules)) 27 $this->System->ModuleManager->Modules['Search']->RegisterSearch('forumthread', 28 'Název vlákna fóra', array('UserName', 'Text'), '`ForumThread`', $this->System->Link('/forum/?search=')); 29 30 $this->System->RegisterMenuItem(array( 23 31 'Title' => T('Forum'), 24 32 'Hint' => 'Forum na debatování ohledně překladu wow', … … 39 47 else if(array_key_exists('a', $_GET)) $Action = $_GET['a']; 40 48 else $Action = ''; 49 if (array_key_exists('search', $_GET)) 50 $Output .= $this->ShowSearchForum(); 51 else 41 52 if (array_key_exists('Thread', $_GET)) { 42 53 $Output .= '<h3>'.T('Forum - Thread').'</h3>'; … … 62 73 } 63 74 75 function ShowSearchForum() 76 { 77 $parser = new HTML_BBCodeParser2(array('filters' => array('Basic','Extended','Images','Links','Lists','Email'))); 78 $Count = 20; 79 $Output = ''; 80 81 $Output .= '<div class="shoutbox">'; 82 $where = '`ForumText`.`Text` LIKE "%'.($_GET['search'] ).'%" OR '. 83 ' `ForumThread`.`Text` LIKE "%'.($_GET['search'] ).'%" OR `ForumThread`.`UserName` LIKE "%'.($_GET['search'] ).'%" OR '. 84 ' `ForumText`.`UserName` LIKE "%'.($_GET['search'] ).'%"'; 85 $join = ' JOIN `ForumThread` ON `ForumThread`.`ID` = `ForumText`.`Thread`'; 86 87 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `ForumText` '.$join.' WHERE '.$where); 88 $DbRow = $DbResult->fetch_row(); 89 $PageList = GetPageList($DbRow[0]); 90 91 $Output .= $PageList['Output']; 92 93 $DbResult = $this->System->Database->query('SELECT `ForumText`.`Text`, `ForumText`.`Date`, `ForumText`.`UserName`,'. 94 '`ForumThread`.`Text` as `ThreadName`,`ForumText`.`Thread` FROM `ForumText` '.$join.' WHERE '.$where.' ORDER BY `ForumText`.`Date` DESC '.$PageList['SQLLimit']); 95 while($Line = $DbResult->fetch_assoc()) 96 $Output .= '<div><a href="'.$this->System->Link('/forum/?Thread='.$Line['Thread']).'">'.$Line['ThreadName'].'</a><br /><strong>'.$Line['UserName'].'</strong> ('.HumanDate($Line['Date']).'): '.$parser->qparse($Line['Text']).'</div> '; 97 $Output .= '</div>'.$PageList['Output']; 98 return($Output); 99 100 return($Output); 101 } 102 64 103 function ShowListThread() 65 104 { … … 74 113 $DbResult = $this->System->Database->query('SELECT * FROM `ForumThread` WHERE 1 ORDER BY `ID` DESC '.$PageList['SQLLimit']); 75 114 while($Line = $DbResult->fetch_assoc()) 76 $Output .= '<div><a href="?Thread='.$Line['ID'].'">'. MakeActiveLinks(str_replace("\n", '',$Line['Text'])).'</a> (<strong>'.$Line['UserName'].'</strong>) - '.HumanDate($Line['Date']).'</div>';115 $Output .= '<div><a href="?Thread='.$Line['ID'].'">'.str_replace("\n", '',$Line['Text']).'</a> (<strong>'.$Line['UserName'].'</strong>) - '.HumanDate($Line['Date']).'</div>'; 77 116 $Output .= '</div>'.$PageList['Output']; 78 117 return($Output); … … 82 121 { 83 122 $Output = ''; 123 124 $parser = new HTML_BBCodeParser2(array('filters' => array('Basic','Extended','Images','Links','Lists','Email'))); 125 // echo $parser->qparse('[youtube]http://www.youtube.com/watch?v=hwgO6p2Jh-A[/youtube][img]http://www.bbcode.org/images/lubeck_small.jpg[/img]normal [i][b]bold[/b][/i] [img]http://imageshack.com/a/img203/7462/6ctg.jpg[/img] and normal again'); 126 84 127 if(array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search']; 85 128 else if(!array_key_exists('search', $_SESSION)) $_SESSION['search'] = ''; … … 103 146 $DbResult = $this->System->Database->query('SELECT * FROM `ForumText` WHERE `Thread` = '.$_GET['Thread'].' '.$SearchQuery.' ORDER BY `ID` DESC '.$PageList['SQLLimit']); 104 147 while($Line = $DbResult->fetch_assoc()) 105 $Output .= '<div><strong>'.$Line['UserName'].'</strong> ('.HumanDate($Line['Date']).'): '. MakeActiveLinks($Line['Text']).'</div> ';148 $Output .= '<div><strong>'.$Line['UserName'].'</strong> ('.HumanDate($Line['Date']).'): '.$parser->qparse($Line['Text']).'</div> '; 106 149 $Output .= '</div>'.$PageList['Output']; 107 150 return($Output); … … 118 161 if($this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />'; 119 162 else $Output .= '<input type="text" name="user" /><br />'; 120 $Output .= 'Text zprávy: <br/>'.121 '<textarea onkeydown="ResizeTextArea(this)" name="text" cols=" 40"></textarea> <br/>'.163 $Output .= 'Text zprávy: (Můžete využít <a href="http://www.bbcode.org/reference.php">BB kód</a>)<br/>'. 164 '<textarea onkeydown="ResizeTextArea(this)" name="text" cols="80"></textarea> <br/>'. 122 165 '<input type="hidden" name="a" value="add2"/>'. 123 166 '<input type="submit" value="Odeslat" /><br /></fieldset>'. -
trunk/Modules/Search/Search.php
r636 r760 43 43 else if(array_key_exists('text', $_POST)) $Search = $_POST['text']; 44 44 else $Search = ''; 45 $SearchHTML = htmlentities($Search);45 $SearchHTML = urlencode($Search); 46 46 47 47 $Output = '<table class="BaseTable"><tr><th>'.T('Section').'</th><th>'.T('Found count').'</th></tr>'; … … 52 52 { 53 53 $ColumnQuery[] = '(`'.$Column.'` LIKE "%'.$Search.'%")'; 54 } 54 } 55 55 $ColumnQuery = implode(' OR ', $ColumnQuery); 56 56 if($SearchItem['Query'] != '') 57 { 57 { 58 58 $DbResult = $this->Database->query('SELECT COUNT(*) FROM '.$SearchItem['Query'].' WHERE '.$ColumnQuery); 59 59 $Line = $DbResult->fetch_row(); 60 60 $Line = $Line[0]; 61 61 } else $Line = ''; 62 $Output .= '<tr><td><a href="'.$SearchItem['Link'].$SearchHTML.'">'.$SearchItem['Name'].'</a></td><td>'.$Line.'</td></tr>'; 62 if ($Line <> 0) 63 $Output .= '<tr><td><a href="'.$SearchItem['Link'].$SearchHTML.'">'.$SearchItem['Name'].'</a></td><td>'.$Line.'</td></tr>'; 63 64 } 64 65 -
trunk/Modules/User/Profile.php
r728 r760 116 116 return($Output); 117 117 } 118 119 function ShowLastForum() 120 { 121 $parser = new HTML_BBCodeParser2(array('filters' => array('Basic','Extended','Images','Links','Lists','Email'))); 122 $Count = 20; 123 $Output = '<strong>Poslední příspěvky ve fóru:</strong>'; 124 125 $Output .= '<div class="shoutbox">'; 126 $DbResult = $this->System->Database->query('SELECT `ForumText`.`Text`, `ForumText`.`Date`, `ForumText`.`UserName`,`ForumThread`.`Text` as `ThreadName`,`ForumText`.`Thread` FROM `ForumText` JOIN `ForumThread` ON `ForumThread`.`ID` = `ForumText`.`Thread` WHERE `ForumText`.`User` = '.($_GET['user'] * 1).' ORDER BY `ForumText`.`Date` DESC LIMIT '.$Count); 127 while($Line = $DbResult->fetch_assoc()) 128 $Output .= '<div><a href="'.$this->System->Link('/forum/?Thread='.$Line['Thread']).'">'.$Line['ThreadName'].'</a><br /><strong>'.$Line['UserName'].'</strong> ('.HumanDate($Line['Date']).'): '.$parser->qparse($Line['Text']).'</div> '; 129 $Output .= '</div>'; 130 return($Output); 131 132 return($Output); 133 } 118 134 119 135 function ShowProfile() … … 149 165 '<td>'.$this->ExportList().'</td>'. 150 166 '</tr></table>'; 151 167 $Output .= '<br />'.$this->ShowLastForum().'<br />'; 152 168 if($this->System->User->Licence(LICENCE_MODERATOR)) 153 169 { -
trunk/includes/Version.php
r759 r760 6 6 // and system will need database update. 7 7 8 $Revision = 7 59; // Subversion revision8 $Revision = 760; // Subversion revision 9 9 $DatabaseRevision = 748; // Database structure revision 10 $ReleaseTime = '2014-01-2 0';10 $ReleaseTime = '2014-01-22'; -
trunk/includes/global.php
r758 r760 33 33 include_once(dirname(__FILE__).'/../Modules/Download/Download.php'); 34 34 include_once(dirname(__FILE__).'/../Modules/Forum/Forum.php'); 35 require_once(dirname(__FILE__).'/../HTML/BBCodeParser2.php'); 35 36 36 37
Note:
See TracChangeset
for help on using the changeset viewer.