diff options
| -rw-r--r-- | LibertyContent.php | 4 | ||||
| -rwxr-xr-x | LibertySystem.php | 11 | ||||
| -rw-r--r-- | admin/comments.php | 12 | ||||
| -rw-r--r-- | admin/upgrade_inc.php | 2 | ||||
| -rw-r--r-- | comments_inc.php | 6 | ||||
| -rw-r--r-- | plugins/data.maketoc.php | 57 | ||||
| -rw-r--r-- | plugins/storage.bitfile.php | 4 | ||||
| -rw-r--r-- | templates/comments.tpl | 2 |
8 files changed, 54 insertions, 44 deletions
diff --git a/LibertyContent.php b/LibertyContent.php index 912a319..9d7fa8f 100644 --- a/LibertyContent.php +++ b/LibertyContent.php @@ -3,7 +3,7 @@ * Management of Liberty content * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.18 2006/01/17 13:11:35 squareing Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.19 2006/01/20 11:08:50 squareing Exp $ * @author spider <spider@steelsun.com> */ @@ -690,7 +690,7 @@ class LibertyContent extends LibertyBase { if( empty( $title ) && !empty( $pMixed['title'] ) ) { $title = $pMixed['title']; } - $ret = '<a href="'.BIT_ROOT_URL.'index.php?content_id='.$pMixed['content_id'].'">'.$title.'</a>'; + $ret = '<a title="'.htmlspecialchars( $title ).'" href="'.BIT_ROOT_URL.'index.php?content_id='.$pMixed['content_id'].'">'.htmlspecialchars( $title ).'</a>'; } return $ret; } diff --git a/LibertySystem.php b/LibertySystem.php index 7199634..0b02a1f 100755 --- a/LibertySystem.php +++ b/LibertySystem.php @@ -3,7 +3,7 @@ * System class for handling the liberty package * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.10 2005/12/18 22:30:22 squareing Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.11 2006/01/20 11:08:50 squareing Exp $ * @author spider <spider@steelsun.com> */ @@ -215,7 +215,7 @@ class LibertySystem extends LibertyBase { } // Get the URL to the icon for the mime type passed in. This should probably check for files of multiple image types instead of just jpg - function getMimeThumbnailURL($pMimeType) { + function getMimeThumbnailURL($pMimeType, $pExt=NULL) { $ret = NULL; $parts = split('/',$pMimeType); if (count($parts) > 1) { @@ -231,8 +231,11 @@ class LibertySystem extends LibertyBase { 'url' => 'only', ); if( !$ret = smarty_function_biticon( $biticon,$gBitSmarty ) ) { - $biticon['iname'] = 'generic'; - $ret = smarty_function_biticon( $biticon,$gBitSmarty ); + $biticon['iname'] = $pExt; + if( !$ret = smarty_function_biticon( $biticon,$gBitSmarty ) ) { + $biticon['iname'] = 'generic'; + $ret = smarty_function_biticon( $biticon,$gBitSmarty ); + } } } return $ret; diff --git a/admin/comments.php b/admin/comments.php index 678a70a..59a97f2 100644 --- a/admin/comments.php +++ b/admin/comments.php @@ -5,6 +5,12 @@ include_once( KERNEL_PKG_PATH.'simple_form_functions_lib.php' ); $gBitSystem->verifyPermission( 'bit_p_admin' ); $commentSettings = array( + // when this is enabled, we need to add a spam prevention method + "comments_auto_show_form" => array( + 'label' => 'Always show comment form', + 'note' => 'Check this if you want to show the comment form automatically instead of the <em>Add Comment</em> button first.', + 'page' => '', + ), "comments_reorganise_page_layout" => array( 'label' => 'Position Comments at top of page', 'note' => 'When posting a comment, comments are moved to the top of the page. This can be very disorienting and is only recommended when your site uses comments extensively.', @@ -24,8 +30,6 @@ $commentSettings = array( $gBitSmarty->assign( 'commentSettings', $commentSettings ); if( !empty( $_REQUEST['change_prefs'] ) ) { - - foreach( array_keys( $commentSettings ) as $item ) { simple_set_toggle( $item ); } @@ -34,9 +38,7 @@ if( !empty( $_REQUEST['change_prefs'] ) ) { foreach( $formValues as $item ) { simple_set_value( $item ); } - - } -$gBitSystem->display( 'bitpackage:liberty/admin_comments.tpl'); +$gBitSystem->display( 'bitpackage:liberty/admin_comments.tpl', tra( 'Comment Settings' ) ); ?> diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php index 400fae7..f720bae 100644 --- a/admin/upgrade_inc.php +++ b/admin/upgrade_inc.php @@ -5,7 +5,7 @@ global $gBitSystem, $gUpgradeFrom, $gUpgradeTo; $upgrades = array( 'BONNIE' => array( - 'CLYDE' => array( + 'BWR1' => array( // Step 0 array( 'QUERY' => diff --git a/comments_inc.php b/comments_inc.php index 1336fd7..244d3c1 100644 --- a/comments_inc.php +++ b/comments_inc.php @@ -3,12 +3,12 @@ * comment_inc * * @author spider <spider@steelsun.com> - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ * @package liberty * @subpackage functions */ -// $Header: /cvsroot/bitweaver/_bit_liberty/comments_inc.php,v 1.7 2005/12/26 12:25:03 squareing Exp $ +// $Header: /cvsroot/bitweaver/_bit_liberty/comments_inc.php,v 1.8 2006/01/20 11:08:50 squareing Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. @@ -78,7 +78,7 @@ if (!empty($_REQUEST['post_comment_submit']) && $gBitUser->hasPermission( 'bit_p } // $post_comment_request is a flag indicating whether or not to display the comment input form -if (empty($_REQUEST['post_comment_request'])) { +if( empty( $_REQUEST['post_comment_request'] ) && !$gBitSystem->isFeatureActive( 'comments_auto_show_form' ) ) { $post_comment_request = NULL; } elseif( $gBitUser->hasPermission( 'bit_p_post_comments' ) ) { $post_comment_request = TRUE; diff --git a/plugins/data.maketoc.php b/plugins/data.maketoc.php index 35f35fd..61390e4 100644 --- a/plugins/data.maketoc.php +++ b/plugins/data.maketoc.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ * @package liberty * @subpackage plugins_data */ @@ -15,7 +15,7 @@ // +----------------------------------------------------------------------+ // | Author: xing <xing@synapse.plus.com> // +----------------------------------------------------------------------+ -// $Id: data.maketoc.php,v 1.6 2005/12/05 23:53:17 squareing Exp $ +// $Id: data.maketoc.php,v 1.7 2006/01/20 11:08:50 squareing Exp $ /** * definitions @@ -41,29 +41,34 @@ $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAMAKETOC // Help Function function data_maketoc_help() { $help = - '<table class="data help">' - .'<tr>' - .'<th>' . tra( "Key" ) . '</th>' - .'<th>' . tra( "Type" ) . '</th>' - .'<th>' . tra( "Comments" ) . '</th>' - .'</tr>' - .'<tr class="odd">' - .'<td>maxdepth</td>' - .'<td>' . tra( "numeric") . '<br />' . tra("(optional)") . '</td>' - .'<td>' . tra( 'if you specify 3 here, MakeTOC will only parse headings to the h3 level.' ) . '</td>' - .'</tr>' - .'<tr class="even">' - .'<td>include</td>' - .'<td>' . tra( "value") . '<br />' . tra("(optional)") . '</td>' - .'<td>' . tra( 'if you include <strong>' ).'all'.( '</strong>, it will print a list of the full list of contents, regardless of where in the page {maketoc} is.' ) . '</td>' - .'</tr>' - .'<tr class="odd">' - .'<td>backtotop</td>' - .'<td>' . tra( "boolean") . '<br />' . tra("(optional)") . '</td>' - .'<td>' . tra( 'if you set backtotop <strong>' ).'true'.( '</strong>, it will insert a "back to the top" link.' ) . '</td>' - .'</tr>' - .'</table>' - . tra("Example: ") . '{MAKETOC maxdepth=3 include=all backtotop=true}'; + '<table class="data help"> + <tr> + <th>'.tra( "Key" ).'</th> + <th>'.tra( "Type" ).'</th> + <th>'.tra( "Comments" ).'</th> + </tr> + <tr class="odd"> + <td>maxdepth</td> + <td>'.tra( "numeric").'<br />('.tra("optional").')</td> + <td>'.tra( 'If you specify 3 here, MakeTOC will only parse headings to the h3 level.' ).'</td> + </tr> + <tr class="even"> + <td>include</td> + <td>'.tra( "string").'<br />('.tra("optional").')</td> + <td>'.tra( 'If you include <strong>all</strong>, it will print a list of the full list of contents, regardless of where in the page {maketoc} is.' ).'</td> + </tr> + <tr class="odd"> + <td>backtotop</td> + <td>'.tra( "boolean").'<br />('.tra("optional").')</td> + <td>'.tra( 'If you set backtotop <strong>' ).'true'.( '</strong>, it will insert a "back to the top" link.' ).'</td> + </tr> + <tr class="even"> + <td>class</td> + <td>'.tra( "string").'<br />('.tra("optional").')</td> + <td>'.tra( 'Override the class of the maketoc div.' ).'</td> + </tr> + </table>'. + tra("Example: ").'{MAKETOC maxdepth=3 include=all backtotop=true}'; return $help; } @@ -204,7 +209,7 @@ function maketoc_create_list( $pTocHash, $pParams ) { $toplink = ''; } - $list = '<div class="maketoc"><h3>'.( !empty( $pParams['title'] ) ? $pParams['title'] : tra( 'Page Contents' ) ).'</h3>'.$list.$toplink.'</div>'; + $list = '<div class="'.( !empty( $pParams['class'] ) ? $pParams['class'] : "maketoc" ).'"><h3>'.( !empty( $pParams['title'] ) ? $pParams['title'] : tra( 'Page Contents' ) ).'</h3>'.$list.$toplink.'</div>'; return $list; } diff --git a/plugins/storage.bitfile.php b/plugins/storage.bitfile.php index 595608e..30dc276 100644 --- a/plugins/storage.bitfile.php +++ b/plugins/storage.bitfile.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ * @package liberty * @subpackage plugins_storage */ @@ -81,7 +81,7 @@ function bit_files_load( $pRow ) { $ret['thumbnail_url']['medium'] = LIBERTY_PKG_URL.'icons/generating_thumbnails.png'; $ret['thumbnail_url']['large'] = LIBERTY_PKG_URL.'icons/generating_thumbnails.png'; } else { - $mime_thumbnail = $gLibertySystem->getMimeThumbnailURL($ret['mime_type']); + $mime_thumbnail = $gLibertySystem->getMimeThumbnailURL($ret['mime_type'], substr( $ret['storage_path'], strrpos( $ret['storage_path'], '.' ) + 1 ) ); $ret['thumbnail_url']['avatar'] = $mime_thumbnail; $ret['thumbnail_url']['small'] = $mime_thumbnail; $ret['thumbnail_url']['medium'] = $mime_thumbnail; diff --git a/templates/comments.tpl b/templates/comments.tpl index 7a62ff3..026b4eb 100644 --- a/templates/comments.tpl +++ b/templates/comments.tpl @@ -48,7 +48,7 @@ <div class="row"> {formlabel label="Comment" for="commentpost"} {forminput} - <textarea id="commentpost" name="comment_data" rows="10" cols="50">{$postComment.data}</textarea> + <textarea id="commentpost" name="comment_data" rows="6" cols="50">{$postComment.data}</textarea> {formhelp note="Use [http://www.foo.com] or [http://www.foo.com|description] for links.<br />HTML tags are not allowed inside comments."} {/forminput} </div> |
