summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2005-08-25 11:24:22 +0000
committerMax Kremmel <xing@synapse.plus.com>2005-08-25 11:24:22 +0000
commit1f9adbef6d6e80413f294431328e20cacd0cea7b (patch)
tree2c616f4a06c6b545414484b97a6ff28f88b706d4 /index.php
parent37cbd1f6295888cf43aea9d277f8aecaa46d583f (diff)
downloadarticles-1f9adbef6d6e80413f294431328e20cacd0cea7b.tar.gz
articles-1f9adbef6d6e80413f294431328e20cacd0cea7b.tar.bz2
articles-1f9adbef6d6e80413f294431328e20cacd0cea7b.zip
make "read more" links conditional, depending on whether there is more to read or not.
Diffstat (limited to 'index.php')
-rw-r--r--index.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/index.php b/index.php
index db8fe3e..c5b70d3 100644
--- a/index.php
+++ b/index.php
@@ -1,6 +1,6 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_articles/index.php,v 1.2 2005/08/13 22:03:39 squareing Exp $
-// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
+// $Header: /cvsroot/bitweaver/_bit_articles/index.php,v 1.3 2005/08/25 11:24:22 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.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
@@ -13,15 +13,20 @@ $gBitSystem->verifyPackage( 'articles' );
// Now check permissions to access this page
$gBitSystem->verifyPermission( 'bit_p_read_article' );
-if (!empty($_REQUEST['article_id'])) {
- header("location: ".ARTICLES_PKG_URL."read.php?article_id=".((int)$_REQUEST['article_id']));
+if( !empty( $_REQUEST['article_id'] ) ) {
+ header( "location: ".ARTICLES_PKG_URL."read.php?article_id=".( ( int )$_REQUEST['article_id'] ) );
}
require_once( ARTICLES_PKG_PATH.'lookup_article_inc.php' );
-$articles = $gContent->getList($_REQUEST);
-$smarty->assign_by_ref('articles', $articles['data']);
+$articles = $gContent->getList( $_REQUEST );
+foreach( $articles['data'] as $key => $article ) {
+ if( strlen( $article['parsed_description'] ) != strlen( $article['parsed_data'] ) ) {
+ $articles['data'][$key]['read_more'] = TRUE;
+ }
+}
+$smarty->assign_by_ref( 'articles', $articles['data'] );
// Display the template
-$gBitSystem->display( 'bitpackage:articles/center_list_articles.tpl', tra('Articles') );
+$gBitSystem->display( 'bitpackage:articles/center_list_articles.tpl', tra( 'Articles' ) );
?>