summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHash9 <hash9@users.sourceforge.net>2006-07-27 23:00:41 +0000
committerHash9 <hash9@users.sourceforge.net>2006-07-27 23:00:41 +0000
commita8b681c00bec7fdfc25382087c6c50cd149926aa (patch)
tree525fa0a9a9dee81548bfe407792e6e990106b2e2
parente4a219b620c013a2a0d9edfc8e1a142a53d74ec3 (diff)
downloadboards-a8b681c00bec7fdfc25382087c6c50cd149926aa.tar.gz
boards-a8b681c00bec7fdfc25382087c6c50cd149926aa.tar.bz2
boards-a8b681c00bec7fdfc25382087c6c50cd149926aa.zip
Fix unregistered post count column, Add column baised layout, and allow posts to be replied to using the new reply with quote feature of comments, Improve moderation, move to board if rejecting a new topic, premit topic to be moderated from the topic list for the board
-rw-r--r--BitBoard.php42
-rw-r--r--BitBoardForum.php13
-rw-r--r--BitBoardTopic.php19
-rw-r--r--bit_setup_inc.php21
-rw-r--r--post.php10
-rw-r--r--styles/bitboards.css23
-rw-r--r--templates/board.tpl40
-rw-r--r--templates/post.tpl8
-rw-r--r--templates/post_display.tpl7
-rw-r--r--templates/topic.tpl77
-rw-r--r--topic.php23
11 files changed, 212 insertions, 71 deletions
diff --git a/BitBoard.php b/BitBoard.php
index 8a56535..15a7e56 100644
--- a/BitBoard.php
+++ b/BitBoard.php
@@ -1,7 +1,7 @@
<?php
/**
-* $Header: /cvsroot/bitweaver/_bit_boards/BitBoard.php,v 1.5 2006/07/26 22:45:29 hash9 Exp $
-* $Id: BitBoard.php,v 1.5 2006/07/26 22:45:29 hash9 Exp $
+* $Header: /cvsroot/bitweaver/_bit_boards/BitBoard.php,v 1.6 2006/07/27 23:00:39 hash9 Exp $
+* $Id: BitBoard.php,v 1.6 2006/07/27 23:00:39 hash9 Exp $
*/
/**
@@ -10,7 +10,7 @@
*
* @date created 2004/8/15
* @author spider <spider@steelsun.com>
-* @version $Revision: 1.5 $ $Date: 2006/07/26 22:45:29 $ $Author: hash9 $
+* @version $Revision: 1.6 $ $Date: 2006/07/27 23:00:39 $ $Author: hash9 $
* @class BitBoard
*/
@@ -387,9 +387,9 @@ class BitBoard extends LibertyAttachable {
}
if ($gBitSystem->isFeatureActive('bitboards_post_anon_moderation') && !($gBitUser->hasPermission('p_bitboards_edit') || $gBitUser->hasPermission('p_bitboards_post_edit'))) {
- $whereSql .= " AND ((post.`approved` = 1) OR (lc.`user_id` >= 0))";
+
}
- if ($gBitSystem->isFeatureActive('bitboards_post_anon_moderation') || $gBitUser->hasPermission('p_bitboards_edit') || $gBitUser->hasPermission('p_bitboards_post_edit')) {
+ if ($gBitSystem->isFeatureActive('bitboards_post_anon_moderation') && ($gBitUser->hasPermission('p_bitboards_edit') || $gBitUser->hasPermission('p_bitboards_post_edit'))) {
$selectSql .= ", ( SELECT COUNT(*)
FROM `".BIT_DB_PREFIX."forum_map` AS map
INNER JOIN `".BIT_DB_PREFIX."liberty_comments` s_lcom ON (map.`topic_content_id` = s_lcom.`root_id`)
@@ -402,11 +402,13 @@ WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`a
$selectSql .= ", 0 AS unreg";
}
- $query = "SELECT ts.*, lc.`content_id`, lc.`title`, lc.`data`,
+ $query = "SELECT ts.*, lc.`content_id`, lc.`title`, lc.`data`, lc.`format_guid`,
( SELECT count(*)
FROM `".BIT_DB_PREFIX."forum_map` AS map
INNER JOIN `".BIT_DB_PREFIX."liberty_comments` lcom ON (map.`topic_content_id` = lcom.`root_id`)
- WHERE lcom.`root_id`=lcom.`parent_id` AND map.`board_content_id`=lc.`content_id`
+ INNER JOIN `".BIT_DB_PREFIX."liberty_content` AS slc ON( slc.`content_id` = lcom.`content_id` )
+ LEFT JOIN `".BIT_DB_PREFIX."forum_post` AS fp ON (fp.`comment_id` = lcom.`comment_id`)
+ WHERE lcom.`root_id`=lcom.`parent_id` AND map.`board_content_id`=lc.`content_id` AND ((fp.`approved` = 1) OR (slc.`user_id` >= 0))
) AS post_count
$selectSql
FROM `".BIT_DB_PREFIX."forum_board` ts INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON( lc.`content_id` = ts.`content_id` ) $joinSql
@@ -432,6 +434,8 @@ WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`a
$res['track']['on'] = false;
}
unset($res['track_count']);
+ $res['parsed_data']=$this->parseData($res);
+ $res['last'] = $this->getLastTopic($res);
}
$ret[] = $res;
}
@@ -442,6 +446,30 @@ WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`a
return $ret;
}
+ function getLastTopic($data) {
+ global $gBitSystem;
+ $BIT_DB_PREFIX = BIT_DB_PREFIX;
+ $query="SELECT
+ slc.`last_modified`, slc.`user_id`, lcom.`anon_name` AS l_anon_name, f_lc.`title`, SUBSTRING(f_lcom.`thread_forward_sequence`,1,9) AS thread_id
+ FROM `".BIT_DB_PREFIX."forum_map` AS map
+ INNER JOIN `".BIT_DB_PREFIX."liberty_comments` lcom ON (map.`topic_content_id` = lcom.`root_id`)
+ INNER JOIN `".BIT_DB_PREFIX."liberty_content` AS slc ON( slc.`content_id` = lcom.`content_id` )
+ LEFT JOIN `".BIT_DB_PREFIX."forum_post` AS fp ON (fp.`comment_id` = lcom.`comment_id`)
+ INNER JOIN `".BIT_DB_PREFIX."liberty_comments` f_lcom ON (SUBSTRING(lcom.`thread_forward_sequence`,1,10) = SUBSTRING(f_lcom.`thread_forward_sequence`,1,10) AND f_lcom.`root_id`=f_lcom.`parent_id`)
+ INNER JOIN `".BIT_DB_PREFIX."liberty_content` AS f_lc ON( f_lc.`content_id` = f_lcom.`content_id` )
+ WHERE lcom.`root_id`=lcom.`parent_id` AND ".$data['content_id']."=map.`board_content_id` AND ((fp.`approved` = 1) OR (slc.`user_id` >= 0))
+ ORDER BY slc.`last_modified` DESC
+ ";
+ $result = $this->mDb->getRow( $query);
+ if (!empty($result['thread_id'])) {
+ if (empty($result['l_anon_name'])) $result['l_anon_name'] = "Anonymous";
+ $result['thread_id']=intval($result['thread_id']);
+ $t = new BitBoardTopic($result['thread_id']);
+ $result['url']=$t->getDisplayUrl();
+ }
+ return $result;
+ }
+
/**
* Generates the URL to the bitforum page
* @param pExistsHash the hash that was returned by LibertyContent::pageExists
diff --git a/BitBoardForum.php b/BitBoardForum.php
index d9424db..0194407 100644
--- a/BitBoardForum.php
+++ b/BitBoardForum.php
@@ -1,7 +1,7 @@
<?php
/**
-* $Header: /cvsroot/bitweaver/_bit_boards/Attic/BitBoardForum.php,v 1.2 2006/07/26 22:45:29 hash9 Exp $
-* $Id: BitBoardForum.php,v 1.2 2006/07/26 22:45:29 hash9 Exp $
+* $Header: /cvsroot/bitweaver/_bit_boards/Attic/BitBoardForum.php,v 1.3 2006/07/27 23:00:39 hash9 Exp $
+* $Id: BitBoardForum.php,v 1.3 2006/07/27 23:00:39 hash9 Exp $
*/
/**
@@ -10,7 +10,7 @@
*
* @date created 2004/8/15
* @author spider <spider@steelsun.com>
-* @version $Revision: 1.2 $ $Date: 2006/07/26 22:45:29 $ $Author: hash9 $
+* @version $Revision: 1.3 $ $Date: 2006/07/27 23:00:39 $ $Author: hash9 $
* @class BitBoardBoard
*/
@@ -138,12 +138,7 @@ class BitBoardForum extends LibertyAttachable {
INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON( lc.`content_id` = b.`content_id` )
ORDER BY lc.`title` ASC";
- $result = $gBitDb->getAll( $query);
- $ret = array();
- while( $res = $result->fetchRow() ) {
- $ret[] = $res;
- }
- return $ret;
+ return $gBitDb->getAll( $query);
}
/**
diff --git a/BitBoardTopic.php b/BitBoardTopic.php
index 3515600..d61604d 100644
--- a/BitBoardTopic.php
+++ b/BitBoardTopic.php
@@ -1,7 +1,7 @@
<?php
/**
-* $Header: /cvsroot/bitweaver/_bit_boards/BitBoardTopic.php,v 1.7 2006/07/26 22:45:29 hash9 Exp $
-* $Id: BitBoardTopic.php,v 1.7 2006/07/26 22:45:29 hash9 Exp $
+* $Header: /cvsroot/bitweaver/_bit_boards/BitBoardTopic.php,v 1.8 2006/07/27 23:00:40 hash9 Exp $
+* $Id: BitBoardTopic.php,v 1.8 2006/07/27 23:00:40 hash9 Exp $
*/
/**
@@ -10,7 +10,7 @@
*
* @date created 2004/8/15
* @author spider <spider@steelsun.com>
-* @version $Revision: 1.7 $ $Date: 2006/07/26 22:45:29 $ $Author: hash9 $
+* @version $Revision: 1.8 $ $Date: 2006/07/27 23:00:40 $ $Author: hash9 $
* @class BitBoardTopic
*/
@@ -68,6 +68,7 @@ SELECT
lc.`content_id` AS flc_content_id,
COALESCE(post.`approved`,0) AS first_approved,
+ lcom.`anon_name`,
th.`parent_id` AS th_first_id,
COALESCE(th.`locked`,0) AS th_locked,
@@ -101,6 +102,7 @@ WHERE
$this->mRootId = $result->fields['th_thread_id'];
BitBoardTopic::track($this->mInfo);
$this->mInfo['display_url'] = $this->getDisplayUrl();
+ if (empty($this->mInfo['anon_name'])) $this->mInfo['anon_name'] = "Anonymous";
LibertyAttachable::load();
}
@@ -251,7 +253,7 @@ WHERE
if ($gBitSystem->isFeatureActive('bitboards_post_anon_moderation') && !($gBitUser->hasPermission('p_bitboards_edit') || $gBitUser->hasPermission('p_bitboards_post_edit'))) {
$whereSql .= " AND ((post.`approved` = 1) OR (lc.`user_id` >= 0))";
}
- if ($gBitSystem->isFeatureActive('bitboards_post_anon_moderation') || $gBitUser->hasPermission('p_bitboards_edit') || $gBitUser->hasPermission('p_bitboards_post_edit')) {
+ if ($gBitSystem->isFeatureActive('bitboards_post_anon_moderation') && ($gBitUser->hasPermission('p_bitboards_edit') || $gBitUser->hasPermission('p_bitboards_post_edit'))) {
$selectSql .= ", ( SELECT COUNT(*)
FROM `${BIT_DB_PREFIX}liberty_comments` AS s_lcom
INNER JOIN `".BIT_DB_PREFIX."liberty_content` s_lc ON (s_lcom.`content_id` = s_lc.`content_id`)
@@ -273,6 +275,7 @@ WHERE SUBSTRING(s_lcom.`thread_forward_sequence`,1,10) LIKE SUBSTRING(lcom.`thre
lc.`content_id` AS flc_content_id,
COALESCE(post.`approved`,0) AS first_approved,
+ lcom.`anon_name`,
th.`parent_id` AS th_first_id,
COALESCE(th.`locked`,0) AS th_locked,
@@ -318,6 +321,7 @@ WHERE
$result = $this->mDb->query( $query, $bindVars, $max_records, $offset );
$ret = array();
while( $res = $result->fetchRow() ) {
+ if (empty($res['anon_name'])) $res['anon_name'] = "Anonymous";
if ($res['th_moved']>0) {
$res['url']=BITBOARDS_PKG_URL."index.php?t=".$res['th_moved'];
} else {
@@ -340,11 +344,12 @@ WHERE
function getLastPost($data) {
global $gBitSystem;
+ $whereSql = '';
if ($gBitSystem->isFeatureActive('bitboards_post_anon_moderation')) {
$whereSql = " AND ((post.`approved` = 1) OR (lc.`user_id` >= 0))";
}
$BIT_DB_PREFIX = BIT_DB_PREFIX;
- $query="SELECT lc.`last_modified` AS llc_last_modified, lc.`user_id` AS llc_user_id, lc.`content_id` AS llc_content_id, lcom.`anon_name` AS llc_anon_name
+ $query="SELECT lc.`last_modified` AS llc_last_modified, lc.`user_id` AS llc_user_id, lc.`content_id` AS llc_content_id, lcom.`anon_name` AS l_anon_name
FROM `".BIT_DB_PREFIX."liberty_comments` lcom
INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON (lcom.`content_id` = lc.`content_id`)
LEFT JOIN `${BIT_DB_PREFIX}forum_post` AS post ON (post.`comment_id` = lcom.`comment_id`)
@@ -352,6 +357,7 @@ WHERE
ORDER BY lc.`last_modified` DESC
";
$result = $this->mDb->getRow( $query);
+ if (empty($result['l_anon_name'])) $result['l_anon_name'] = "Anonymous";
return $result;
}
@@ -609,6 +615,9 @@ If you no longer wish to watch this topic you can either click the \"Stop watchi
if($gBitUser->isRegistered() && $gBitSystem->isFeatureActive('bitboards_thread_track') && $res['th_moved']<=0) {
$res['track']['on'] = true;
$res['track']['date'] = $res['track_date'];
+ if (empty($res['llc_last_modified'])) {
+ $res['llc_last_modified']=0;
+ }
if ($res['llc_last_modified']>$res['track_date']) {
$res['track']['mod'] = true;
} else {
diff --git a/bit_setup_inc.php b/bit_setup_inc.php
index e01d614..5e84b85 100644
--- a/bit_setup_inc.php
+++ b/bit_setup_inc.php
@@ -11,12 +11,13 @@ if( $gBitSystem->isPackageActive( 'bitboards' ) ) {
$gBitSystem->registerAppMenu( BITBOARDS_PKG_NAME, ucfirst( BITBOARDS_PKG_DIR ), BITBOARDS_PKG_URL.'index.php', 'bitpackage:bitboards/menu_bitboards.tpl', BITBOARDS_PKG_NAME );
}
if (!function_exists('reltime')) {
- function reltime($time) {
+ function reltime($time,$mode='long') {
$m = 60;
$h = 3600;
$d = $h * 24;
$w = $d * 7;
$M = $w * 4;
+ $L = $M * 2;
if (! is_numeric($time)) return $time;
$delta = (time() - $time);
@@ -49,12 +50,26 @@ if (!function_exists('reltime')) {
if ($delta<($d*1.7)) {
return "Yesterday " .date('h:i:s A',$time);
} else {
+ if ($mode='short') {
+ return date('D H:i:s',$time);
+ }
return date('l h:i:s A',$time);
}
} elseif ($delta<($M)) {
- return date('l dS \a\t h:i:s A',$time);
+ if ($mode='short') {
+ return date('D d, H:i',$time);
+ }
+ return date('l dS \a\t h:i A',$time);
+ } elseif ($delta<($L)) {
+ if ($mode='short') {
+ return date('M d, H:i',$time);
+ }
+ return date('l dS \of F h:i A',$time);
} else {
- return date('l dS \of F Y h:i:s A',$time);
+ if ($mode='short') {
+ return date('M d, Y H:i',$time);
+ }
+ return date('l dS \of F Y h:i A',$time);
}
}
}
diff --git a/post.php b/post.php
index 313e5a6..21a35fb 100644
--- a/post.php
+++ b/post.php
@@ -40,7 +40,13 @@ $gBitSmarty->assign( 'loadAjax', TRUE );
$thread = new BitBoardTopic($_REQUEST['t']);
$thread->load();
if (empty($thread->mInfo['th_root_id'])) {
- $gBitSystem->fatalError(tra( "Invalid thread selection." ) );
+ if ($_REQUEST['action']==3) {
+ //Invalid as a result of rejecting the post, redirect to the board
+ $tb = new BitBoard(null,$thread->mInfo['board_content_id']);
+ header("Location: ".$tb->getDisplayUrl());
+ } else {
+ $gBitSystem->fatalError(tra( "Invalid thread selection." ) );
+ }
}
$thread->readTopic();
@@ -59,6 +65,8 @@ $gBitSmarty->assign('comment_template','bitpackage:bitboards/post_display.tpl');
require_once (LIBERTY_PKG_PATH.'comments_inc.php');
$postComment['registration_date']=$gBitUser->mInfo['registration_date'];
+$postComment['user_avatar_url']=$gBitUser->mInfo['avatar_url'];
+$postComment['user_url'] = $gBitUser->getDisplayUrl();
$warnings = array();
if (!empty($_REQUEST['warning'])) {
diff --git a/styles/bitboards.css b/styles/bitboards.css
index c232163..447ce5b 100644
--- a/styles/bitboards.css
+++ b/styles/bitboards.css
@@ -26,15 +26,6 @@
background-color: #d9fcdb;
}
-.mb-table {
- border:1px solid #339933;
-}
-
-.mb-table tr {
- padding:3px 2px;
- border:1px solid #339933;
-}
-
.mb-warned {
text-align:center;
}
@@ -84,4 +75,18 @@
padding-top: 4px;
margin-top: 1em;
white-space: nowrap;
+}
+
+.quote .quote-title {
+ font-size: 90%;
+ font-weight: bold;
+ font-style: italic;
+}
+
+.quote blockquote {
+ margin: 1.3em;
+ margin-top: 4px;
+ margin-left: 1.3em;
+ border: 1px #aaa solid;
+ background: #f7f7f7;
} \ No newline at end of file
diff --git a/templates/board.tpl b/templates/board.tpl
index c0161c7..ea7c254 100644
--- a/templates/board.tpl
+++ b/templates/board.tpl
@@ -1,4 +1,4 @@
-{* $Header: /cvsroot/bitweaver/_bit_boards/templates/Attic/board.tpl,v 1.5 2006/07/26 22:45:30 hash9 Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_boards/templates/Attic/board.tpl,v 1.6 2006/07/27 23:00:40 hash9 Exp $ *}
{strip}
<div class="floaticon">{bithelp}</div>
@@ -14,7 +14,17 @@
<input type="hidden" name="sort_mode" value="{$control.sort_mode|escape}" />
<table class="mb-table">
-
+ {if !$gBitSystem->isFeatureActive('bitboards_thread_verbrose')}
+ <th width="1">{if $boardsList.0.track.on}<small>UBSI</small>{/if}</td>
+ <th style="text-align:left;white-space: nowrap;">Title</td><br />
+ {if $gBitUser->hasPermission('p_bitboards_edit') || $gBitUser->hasPermission('p_bitboards_post_edit')}
+ <th style="text-align: center;">Anon</td>
+ {/if}
+ <th style="text-align: center;">Topics</td>
+ <th style="text-align: center;">Last Topic</td>
+ <th style="text-align: center;">Poster</td>
+ <th style="text-align: right;">Updated</td>
+ {/if}
{foreach item=board from=$boardsList}
{if $board.title}
{assign var=board_title value=$board.title|escape}
@@ -31,11 +41,27 @@
{biticon ipackage=bitboard iname="track_old_l" iexplain="No New Posts"}
{/if}
</td>
- <td><a href="{$board.url}" title="{$board_title}">{$board_title}</a></td>
-
- {if $gBitUser->hasPermission('p_bitboards_edit') || $gBitUser->hasPermission('p_bitboards_post_edit')}
- <td style="text-align:right;">{if $board.unreg > 0}<a style="color: blue;" href="{$board.url}" title="{$board.title|escape}">{$board.unreg}&nbsp;Unregistered&nbsp;Posts</a>{/if}</td>{/if}
- <td style="text-align:right; color: blue;">{if $board.post_count > 0}{$board.post_count}&nbsp;Threads</a>{/if}</td>
+ <td><a href="{$board.url}" title="{$board_title}">{$board_title}</a><div style="margin-left:2em;" class="small">{$board.parsed_data}</blockquote></td>
+ {if $gBitSystem->isFeatureActive('bitboards_thread_verbrose')}
+ {if $gBitUser->hasPermission('p_bitboards_edit') || $gBitUser->hasPermission('p_bitboards_post_edit')}
+ <td style="text-align:right;">{if $board.unreg > 0}<a style="color: blue;" href="{$board.url}" title="{$board.title|escape}">{$board.unreg}&nbsp;Unregistered&nbsp;Posts</a>{/if}</td>
+ {/if}
+ <td style="text-align:right; color: blue;">{if $board.post_count > 0}{$board.post_count}&nbsp;Threads</a>{/if}</td>
+ {else}
+ {if $gBitUser->hasPermission('p_bitboards_edit') || $gBitUser->hasPermission('p_bitboards_post_edit')}
+ <td style="text-align:center;">{if $board.unreg > 0}<a style="color: blue;" href="{$board.url}" title="{$board.title|escape}">{$board.unreg}</a>{/if}</td>
+ {/if}
+ <td style="text-align:center;">{if $board.post_count > 0}{$board.post_count}</a>{/if}</td>
+ {if !empty($board.last)}
+ <td style="text-align:center;"><a href="{$board.last.url}">{$board.last.title}</td>
+ <td style="text-align:center;">{if $board.last.user_id < 0}{$board.last.l_anon_name|escape}{else}{displayname user_id=$board.last.user_id}{/if}</td>
+ <td style="text-align:right;">{if $board.last.last_modified > 0}{$board.last.last_modified|reltime}</a>{/if}</td>
+ {else}
+ <td></td>
+ <td></td>
+ <td></td>
+ {/if}
+ {/if}
</tr>
{foreachelse}
<tr class="norecords"><td colspan="16">
diff --git a/templates/post.tpl b/templates/post.tpl
index 519e3e7..8cfb594 100644
--- a/templates/post.tpl
+++ b/templates/post.tpl
@@ -1,14 +1,10 @@
-{* $Header: /cvsroot/bitweaver/_bit_boards/templates/Attic/post.tpl,v 1.7 2006/07/26 22:45:30 hash9 Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_boards/templates/Attic/post.tpl,v 1.8 2006/07/27 23:00:40 hash9 Exp $ *}
{strip}
<div class="floaticon">
{assign var=flip value=$thread->getFlipFlop()}
{foreach from=$flip item=flip_s key=flip_name}
{include file="bitpackage:bitboards/flipswitch.tpl"}
{/foreach}
-{*{assign var=flip_name value="locked"}
-{include file="bitpackage:bitboards/flipswitch.tpl"}
-{assign var=flip_name value="sticky"}
-{include file="bitpackage:bitboards/flipswitch.tpl"}*}
{if !$topic_locked}<a title="{tr}Post on this thread{/tr}" href="{$comments_return_url}&post_comment_reply_id={$thread->mInfo.flc_content_id}&post_comment_request=1#editcomments"> {biticon ipackage=bitboard iname="mail_new" iexplain="Post on this thread"}</a>{/if}
{bithelp}</div>
@@ -40,7 +36,9 @@
<tr><td colspan="10"><h2 style="text-align:center; padding:.5em">{tr}{$post_title} Preview{/tr}</h2></td></tr>
<tr>
<div class="preview">
+ {assign var=post_is_preview value=1}
{displaycomment comment=$postComment template=$comment_template}
+ {assign var=post_is_preview value=0}
</div><!-- end .preview -->
</tr>
<tr><td colspan="10">&nbsp;</td></tr>
diff --git a/templates/post_display.tpl b/templates/post_display.tpl
index 57876ea..bf69165 100644
--- a/templates/post_display.tpl
+++ b/templates/post_display.tpl
@@ -39,7 +39,7 @@
<td valign="top" width="0" class="mb-avatar">
{if $gBitUser->getPreference('boards_show_avatars','y')==y}
<strong>{if $comment.user_id < 0}{$comment.anon_name|escape}{else}{displayname hash=$comment}{/if}</strong><br />
- {if $comment.user_id >= 0}
+ {if $comment.user_id >= 0 && !empty($comment.user_avatar_url)}
<a href="{$comment.user_url}"><img src="{$comment.user_avatar_url}" class="thumb" title="{tr}Avatar{/tr}" alt="{tr}Avatar{/tr}" /></a><br />
<small>{tr}Joined: {/tr}{$comment.registration_date|bit_short_date}</small><br />
{else}
@@ -54,6 +54,7 @@
{/if}
<a name="{$comment.comment_id|escape}" id="{$comment.comment_id|escape}">
<div class="display bitboard">
+ {if !$post_is_preview}
<div class="floaticon">
{if $print_page ne 'y' && $comment.deleted==0 }
{if $gBitUser->hasPermission( 'p_bitboards_edit' ) && (($comment.user_id<0 && $comment.approved==0)||$comment.user_id>=0) && !$comment.warned}
@@ -94,6 +95,9 @@
{if !$topic_locked && $gBitUser->hasPermission( 'p_liberty_post_comments' )}
<a href="{$comments_return_url}&amp;post_comment_reply_id={$comment.content_id}&amp;post_comment_request=1#editcomments" rel="nofollow">{biticon ipackage="liberty" iname="reply" iexplain="Reply to this Post"}</a>
{/if}
+ {if !$topic_locked && $gBitUser->hasPermission( 'p_liberty_post_comments' )}
+ <a href="{$comments_return_url}&amp;post_comment_reply_id={$comment.content_id}&amp;post_comment_request=1&amp;quote=y#editcomments" rel="nofollow">{biticon ipackage="liberty" iname="reply_quote" iexplain="Reply with Quote to this Post"}</a>
+ {/if}
{if $comment.editable}
<a href="{$comments_return_url}&amp;post_comment_id={$comment.comment_id}&amp;post_comment_request=1#editcomments" rel="nofollow">{biticon ipackage="liberty" iname="edit" iexplain="Edit"}</a>
{/if}
@@ -102,6 +106,7 @@
{/if}
{/if}<!-- end print_page -->
</div><!-- end .floaticon -->
+ {/if}
<div class="header">
{if $comment.title neq ""}<h3>{$comment.title|escape}</h3>{/if}
diff --git a/templates/topic.tpl b/templates/topic.tpl
index bd11074..4ee7367 100644
--- a/templates/topic.tpl
+++ b/templates/topic.tpl
@@ -1,4 +1,4 @@
-{* $Header: /cvsroot/bitweaver/_bit_boards/templates/Attic/topic.tpl,v 1.6 2006/07/26 22:45:30 hash9 Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_boards/templates/Attic/topic.tpl,v 1.7 2006/07/27 23:00:41 hash9 Exp $ *}
{strip}
<div class="listing bitboard">
<div class="floaticon">
@@ -14,21 +14,16 @@
<div class="header">
<h1>{$board->mInfo.title|escape|default:"Forum Topic"} <a id='content_1' href="{$comments_return_url}&show={if empty($smarty.request.show)}1{else}0{/if}" onclick="{literal}if (this.innerHTML=='-') { document.getElementById('content_div').style.display='none'; this.innerHTML='+'; } else { document.getElementById('content_div').style.display='block'; this.innerHTML='-'; } return false;{/literal}">{if empty($smarty.request.show)}+{else}-{/if}</a></h1>
<div class="date">
- {tr}Created by{/tr}: {displayname user=$board->mInfo.creator_user user_id=$board->mInfo.creator_user_id real_name=$board->mInfo.creator_real_name} on {$board->getField('created')|bit_short_datetime}
-
- {if $board->getField('last_modified') != $board->getField('created')}
- &nbsp; {tr}Edited by{/tr}: {displayname user=$board->mInfo.modifier_user user_id=$board->mInfo.modifier_user_id real_name=$board->mInfo.modifier_real_name}, {$board->getField('last_modified')|bit_short_datetime}
- {/if}
+ <div id="content_div" class="content" style="text-align: right; {if empty($smarty.request.show)}display: none;{/if}">
+ {$board->mInfo.parsed_data}
+ </div><!-- end .content -->
</div>
Back to <a href="{$cat_url}">{$board->mInfo.content_type.content_description}s</a>
</div>
<div class="body">
- <div id="content_div" class="content" style="text-align: right; {if empty($smarty.request.show)}display: none;{/if}">
- {$board->mInfo.parsed_data}
- </div><!-- end .content -->
- <p style="text-align: right; margin: 0px; padding: 0px;"><a title="{tr}Start a new thread{/tr}" href="{$comments_return_url}&amp;post_comment_request=1#editcomments">{tr}Start a new thread{/tr} {biticon ipackage=bitboard iname="mail_new" iexplain="Start a new thread"}</a></p>
+ <p style="text-align: right; margin: 0px; padding: 0px;"><a title="{tr}Start a new thread{/tr}" href="{$comments_return_url}&amp;post_comment_request=1#editcomments">{tr}Start a new topic{/tr} {biticon ipackage=bitboard iname="mail_new" iexplain="Start a new topic"}</a></p>
{minifind sort_mode=$sort_mode board_id=$smarty.request.board_id}
{form id="checkform"}
<input type="hidden" name="board_id" value="{$smarty.request.board_id}" />
@@ -36,33 +31,70 @@
<input type="hidden" name="sort_mode" value="{$control.sort_mode|escape}" />
<table class="mb-table">
+ {if ! $gBitSystem->isFeatureActive('bitboards_thread_verbrose')}
+ <th width="1" colspan="{$threadList.0.flip|@count}"><small>{if $gBitUser->isRegistered()}U{/if}TSI</small></td>
+ <th style="text-align:left;white-space: nowrap;">Title</td>
+ <th style="text-align: center;">Topic Starter</td>
+ <th style="text-align: left;">Started</td>
+ <th width="1" style="text-align: center;">Replies</td>
+ {if $gBitUser->hasPermission('p_bitboards_edit') || $gBitUser->hasPermission('p_bitboards_post_edit')}
+ <th style="text-align: center;">Anon</td>
+ {/if}
+ <th style="text-align: center;">Last Poster</td>
+ <th style="text-align: right;">Updated</td>
+ {if $gBitUser->hasPermission('p_bitboards_edit')}
+ <th colspan="4" style="text-align: center;">Actions</td>
+ {/if}
+ {/if}
{foreach item=thread from=$threadList}
{cycle values="even,odd" print=false assign=cycle_var}
<tr class="
- {$cycle_var} {if $thread.unreg > 0} mb-{$cycle_var}-unapproved
+ {$cycle_var} {if $gBitSystem->isFeatureActive('bitboards_post_anon_moderation') && $thread.unreg > 0} mb-{$cycle_var}-unapproved
{elseif $thread.th_moved>0} mb-{$cycle_var}-moved
{/if}
{if $thread.th_sticky==1} mb-sticky{/if}">
- <td class="actionicon">{* thread status icons *}
- {if $thread.th_moved>0}
+ {if $thread.th_moved>0}
+ <td class="actionicon" width="1" colspan="{$thread.flip|@count}">{* thread status icons *}
{biticon ipackage=bitboard iname="move" iexplain="Moved Thread"}
- {/if}
</td>
+ {else}
{assign var=flip value=$thread.flip}
{foreach from=$flip item=flip_s key=flip_name}
- <td class="actionicon">{* thread status icons *}
- {if $thread.th_moved<=0}
+ <td class="actionicon" width="1">{* thread status icons *}
{include file="bitpackage:bitboards/flipswitch.tpl"}
- {/if}
</td>
{/foreach}
+ {/if}
+ {if $gBitSystem->isFeatureActive('bitboards_thread_verbrose')}
<td>
- <a href="{$thread.url}" title="{$thread.title|escape}">{$thread.title|escape}</a>, started by {if $thread.flc_user_id < 0}{$thread.first_unreg_uname|escape}{else}{displayname user_id=$thread.flc_user_id}{/if} {$thread.flc_created|reltime|escape}{if $thread.post_count > 1}, with {$thread.post_count|escape} posts,
- last update by {if $thread.llc_user_id < 0}{$thread.llc_anon_name|escape}{else}{displayname user_id=$thread.llc_user_id}{/if} {$thread.llc_last_modified|reltime|escape}{/if}
+ <a href="{$thread.url}" title="{$thread.title|escape}">{$thread.title|escape}</a>, started by {if $thread.flc_user_id < 0}{$thread.anon_name|escape}{else}{displayname user_id=$thread.flc_user_id}{/if} {$thread.flc_created|reltime|escape}{if $thread.post_count > 1}, with {$thread.post_count|escape} posts,
+ last update by {if $thread.llc_user_id < 0}{$thread.l_anon_name|escape}{else}{displayname user_id=$thread.llc_user_id}{/if} {$thread.llc_last_modified|reltime|escape}{/if}
</td>
{if $gBitUser->hasPermission('p_bitboards_edit') || $gBitUser->hasPermission('p_bitboards_post_edit')}
- <td style="text-align:right;">{if $thread.unreg > 0}<a style="color: blue;" href="{$thread.url}" title="{$thread.title}">{$thread.unreg}&nbsp;Unregistered&nbsp;Posts</a>{/if}</td>
- {if ($gBitUser->hasPermission( 'p_bitboards_edit' )||$gBitUser->hasPermission( 'p_bitboards_remove' ))}
+ <td style="text-align:right;">{if $thread.unreg > 0}<a style="color: blue;" href="{$thread.url}" title="{$thread.title}">{$thread.unreg}&nbsp;Unregistered&nbsp;Posts</a>{/if}</td>
+ {/if}
+ {else}
+ <td style="white-space: nowrap;"><a href="{$thread.url}" title="{$thread.title|escape}">{$thread.title|escape}</a></td>
+ <td style="text-align: center;">{if $thread.flc_user_id < 0}{$thread.anon_name|escape}{else}{displayname user_id=$thread.flc_user_id}{/if}</td>
+ <td>{$thread.flc_created|reltime:short|escape}</td>
+ <td width="1" style="text-align: center;">{$thread.post_count-1|escape}</td>
+ {if $gBitUser->hasPermission('p_bitboards_edit') || $gBitUser->hasPermission('p_bitboards_post_edit')}
+ <td style="text-align:center;">{if $thread.unreg > 0}<a style="color: blue;" href="{$thread.url}" title="{$thread.title}">{$thread.unreg}</a>{/if}</td>
+ {/if}
+ <td style="text-align: center;">{if $thread.post_count > 1}{if $thread.llc_user_id < 0}{$thread.l_anon_name|escape}{else}{displayname user_id=$thread.llc_user_id}{/if}{else}{/if}</td>
+ <td style="text-align: right;">{if $thread.post_count > 1}{$thread.llc_last_modified|reltime:short|escape}{else}{/if}</td>
+ {/if}
+ {if $gBitUser->hasPermission('p_bitboards_edit') || $gBitUser->hasPermission('p_bitboards_post_edit')}
+ <td class="actionicon">
+ {if $thread.flc_user_id<0 && $thread.first_approved==0}
+ <a title="{tr}Approve First Post{/tr}" href="{$smarty.const.BITBOARDS_PKG_URL}topic.php?b={$board->mInfo.board_id}&action=1&comment_id={$thread.th_thread_id}">
+ {biticon ipackage=bitboard iname="edit_add" iexplain="Approve First Post"}
+ </a>
+ <a title="{tr}Reject First Post{/tr}" href="{$smarty.const.BITBOARDS_PKG_URL}topic.php?b={$board->mInfo.board_id}&action=2&comment_id={$thread.th_thread_id}">
+ {biticon ipackage=bitboard iname="edit_remove" iexplain="Reject First Post"}
+ </a>
+ {/if}
+ </td>
<td class="actionicon">
{if $thread.th_moved==0}
{if $gBitUser->hasPermission( 'p_bitboards_edit' )}
@@ -105,7 +137,6 @@
{/if}
</td>
{/if}
- {/if}
</tr>
{foreachelse}
<tr class="norecords"><td colspan="16">
@@ -114,7 +145,7 @@
{/foreach}
</table>
- <p style="text-align: right;"><a title="{tr}Start a new thread{/tr}" href="{$comments_return_url}&amp;post_comment_request=1#editcomments">{tr}Start a new thread{/tr} {biticon ipackage=bitboard iname="mail_new" iexplain="Start a new thread"}</a></p>
+ <p style="text-align: right;"><a title="{tr}Start a new thread{/tr}" href="{$comments_return_url}&amp;post_comment_request=1#editcomments">{tr}Start a new topic{/tr} {biticon ipackage=bitboard iname="mail_new" iexplain="Start a new topic"}</a></p>
{if $gBitUser->hasPermission( 'p_bitboards_remove' )}
<div style="text-align:right;">
<script type="text/javascript">/* <![CDATA[ check / uncheck all */
diff --git a/topic.php b/topic.php
index 17a33b0..08467a7 100644
--- a/topic.php
+++ b/topic.php
@@ -1,5 +1,5 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_boards/Attic/topic.php,v 1.5 2006/07/21 23:58:44 hash9 Exp $
+// $Header: /cvsroot/bitweaver/_bit_boards/Attic/topic.php,v 1.6 2006/07/27 23:00:40 hash9 Exp $
// Copyright (c) 2004 bitweaver Messageboards
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
@@ -49,6 +49,27 @@ if (isset($_REQUEST["new"])) {
trigger_error(var_export($gContent->mErrors,true ));
}
die();
+} elseif (!empty($_REQUEST['action'])) {
+ // Now check permissions to access this page
+ $gBitSystem->verifyPermission( 'p_bitboards_edit' );
+
+ $comment = new BitBoardPost($_REQUEST['comment_id']);
+ $comment->loadComment();
+ if (!$comment->isValid()) {
+ $gBitSystem->fatalError("Invalid Comment Id");
+ }
+ switch ($_REQUEST['action']) {
+ case 1:
+ // Aprove
+ $comment->mod_approve();
+ break;
+ case 2:
+ // Reject
+ $comment->mod_reject();
+ break;
+ default:
+ break;
+ }
} elseif (empty($_REQUEST['b'])) {
$gBitSystem->fatalError("board id not given");
}