Skip to content
This repository has been archived by the owner on Aug 25, 2019. It is now read-only.

Commit

Permalink
Added topic review feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
dietrichm committed Mar 31, 2005
1 parent 01c5347 commit e4dd1fa
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.txt
Expand Up @@ -3,6 +3,7 @@ $Header$
UseBB 0.5 Changelog
------------------------------

- Added topic review feature.
- Make edit post location bar contain full path.
- Fixed bad smiley parsing code.

Expand Down
1 change: 1 addition & 0 deletions config.php
Expand Up @@ -101,6 +101,7 @@
$conf['target_blank'] = 0;
$conf['template'] = 'default';
$conf['timezone'] = 0;
$conf['topicreview_posts'] = 5;
$conf['topics_per_page'] = 25;
$conf['username_max_length'] = 255;
$conf['users_must_activate'] = 1;
Expand Down
2 changes: 2 additions & 0 deletions languages/lang_English.php
Expand Up @@ -392,3 +392,5 @@
$lang['Administrators'] = 'Administrators';
$lang['Moderators'] = 'Moderators';
$lang['SortBy'] = 'Sort by: %s';
$lang['TopicReview'] = 'Topic review';
$lang['ViewMorePosts'] = 'View more posts';
2 changes: 2 additions & 0 deletions languages/lang_Nederlands.php
Expand Up @@ -392,6 +392,8 @@
$lang['Administrators'] = 'Administrators';
$lang['Moderators'] = 'Moderators';
$lang['SortBy'] = 'Sorteren op: %s';
$lang['TopicReview'] = 'Onderwerp herbekijken';
$lang['ViewMorePosts'] = 'Meer berichten weergeven';

//
// Date translations
Expand Down
25 changes: 25 additions & 0 deletions sources/post_reply.php
Expand Up @@ -261,6 +261,31 @@
'form_end' => '</form>'
));

//
// Topic review feature
//
if ( !($result = $db->query("SELECT p.poster_id, u.name, p.poster_guest, p.post_time, p.content, p.enable_bbcode, p.enable_smilies, p.enable_sig, p.enable_html FROM ( usebb_posts p LEFT JOIN usebb_members u ON p.poster_id = u.id ), usebb_topics t WHERE t.id = ".$_GET['topic']." AND p.topic_id = t.id ORDER BY p.post_time DESC LIMIT ".$functions->get_config('topicreview_posts'))) )
$functions->usebb_die('SQL', 'Unable to get reviewed posts!', __FILE__, __LINE__);

$template->parse('topicreview_header', 'topicreview');

while ( $postsdata = $db->fetch_result($result) ) {

$colornum = ( !isset($colornum) || $colornum !== 1 ) ? 1 : 2;

$template->parse('topicreview_post', 'topicreview', array(
'poster_name' => ( !empty($postsdata['poster_id']) ) ? unhtml(stripslashes($postsdata['name'])) : unhtml(stripslashes($postsdata['poster_guest'])),
'post_date' => $functions->make_date($postsdata['post_time']),
'post_content' => $functions->markup(stripslashes($postsdata['content']), $postsdata['enable_bbcode'], $postsdata['enable_smilies'], $postsdata['enable_html']),
'colornum' => $colornum
));

}

$template->parse('topicreview_footer', 'topicreview', array(
'view_more_posts' => '<a href="'.$functions->make_url('topic.php', array('id' => $_GET['topic'])).'" target="topicreview">'.$lang['ViewMorePosts'].'</a>'
));

}

} else {
Expand Down
2 changes: 2 additions & 0 deletions templates/default/global.tpl.php
Expand Up @@ -490,6 +490,8 @@
text-align: center;
font-size: 10pt;
font-weight: bold;
width: 135px;
height: 1%;
}
table.maintable td.postername .posternamecontainer {
overflow: hidden;
Expand Down
72 changes: 72 additions & 0 deletions templates/default/topicreview.tpl.php
@@ -0,0 +1,72 @@
<?php

/*
Copyright (C) 2003-2005 UseBB Team
http://www.usebb.net
$Header$
This file is part of UseBB.
UseBB is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
UseBB is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with UseBB; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

//
// Die when called directly in browser
//
if ( !defined('INCLUDED') )
exit();

//
// Topic review templates
//

$templates['topicreview_header'] = '
<table class="maintable">
<tr>
<td colspan="2" class="forumcat">&raquo; {l_TopicReview}</td>
</tr>
<tr>
<th>{l_Author}</th>
<th>{l_Post}</th>
</tr>
';

$templates['topicreview_post'] = '
<tr class="tr{colornum}">
<td class="postername">
<div class="posternamecontainer">{poster_name}</div>
</td>
<td class="postcontent" rowspan="2">
<div class="post">{post_content}</div>
</td>
</tr>
<tr class="tr{colornum}">
<td class="posterinfo">
<div class="field">{post_date}</div>
</td>
</tr>
';

$templates['topicreview_footer'] = '
<tr>
<td class="formcontrols" colspan="2">
{view_more_posts}
</td>
</tr>
</table>
';

?>

0 comments on commit e4dd1fa

Please sign in to comment.