summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2016-02-07 16:48:55 +0000
committerlsces <lester@lsces.co.uk>2016-02-07 16:48:55 +0000
commit4ca3b5d485889ff7ed9ecb7de8e85ae5e947c246 (patch)
tree07a089fae0cee14a14c0e4cb6b6fc4eea49f22cc
parent56b66c1c1e6645e7574eea55bc4ff0ff65ae931f (diff)
downloadarticles-4ca3b5d485889ff7ed9ecb7de8e85ae5e947c246.tar.gz
articles-4ca3b5d485889ff7ed9ecb7de8e85ae5e947c246.tar.bz2
articles-4ca3b5d485889ff7ed9ecb7de8e85ae5e947c246.zip
Aditional style sheet for Article list
-rw-r--r--templates/center_display_articles.php53
-rw-r--r--templates/center_display_articles.tpl70
2 files changed, 123 insertions, 0 deletions
diff --git a/templates/center_display_articles.php b/templates/center_display_articles.php
new file mode 100644
index 0000000..cb68b87
--- /dev/null
+++ b/templates/center_display_articles.php
@@ -0,0 +1,53 @@
+<?php
+// $Header$
+global $gBitSmarty, $gBitSystem, $gQueryUserId, $moduleParams;
+if ( !empty( $moduleParams ) ) {
+ extract( $moduleParams );
+}
+
+include_once( ARTICLES_PKG_PATH.'BitArticle.php' );
+include_once( ARTICLES_PKG_PATH."lookup_article_inc.php" );
+include_once( ARTICLES_PKG_PATH.'article_filter_inc.php' );
+
+$listHash = array();
+
+if ( $gBitUser->hasPermission( 'p_articles_admin' ) ) {
+ $_REQUEST['status_id'] = !empty( $_REQUEST['status_id'] ) ? $_REQUEST['status_id'] : ARTICLE_STATUS_APPROVED;
+ $_REQUEST['max_records'] = !empty( $_REQUEST['max_records'] ) ? $_REQUEST['max_records'] : $gBitSystem->getConfig( 'articles_max_list' );
+ $_REQUEST['topic_id'] = !empty( $_REQUEST['topic_id'] ) ? $_REQUEST['topic_id'] : NULL;
+ $_REQUEST['type_id'] = !empty( $_REQUEST['type_id'] ) ? $_REQUEST['type_id'] : NULL;
+
+ $_template->tpl_vars['futures'] = new Smarty_variable( $gContent->getFutureList( $listHash ) );
+} else {
+ $_REQUEST['status_id'] = ARTICLE_STATUS_APPROVED;
+ $_REQUEST['max_records'] = $gBitSystem->getConfig( 'articles_max_list' );
+}
+if ( !empty( $_REQUEST['topic'] ) ) {
+ $_template->tpl_vars['topic'] = new Smarty_variable( $_REQUEST['topic'] );
+}
+
+if ( !empty( $moduleParams )) {
+ $listHash = array_merge( $_REQUEST, $moduleParams['module_params'] );
+ $listHash['max_records'] = $module_rows;
+ //$listHash['parse_data'] = TRUE;
+ //$listHash['load_comments'] = TRUE;
+} else {
+ $listHash = $_REQUEST;
+}
+
+BitUser::userCollection( $_REQUEST, $listHash );
+
+$articles = $gContent->getList( $listHash );
+$_template->tpl_vars['gContent'] = new Smarty_variable( $gContent );
+$_template->tpl_vars['articles'] = new Smarty_variable( $articles );
+$_template->tpl_vars['listInfo'] = new Smarty_variable( $listHash['listInfo'] );
+
+// show only descriptions on listing page
+$_template->tpl_vars['showDescriptionsOnly'] = new Smarty_variable( TRUE );
+
+// display submissions if we have the perm to approve them
+if ( $gBitUser->hasPermission( 'p_articles_approve_submission' ) || ( $gBitSystem->isFeatureActive( 'articles_auto_approve' ) && $gBitUser->isRegistered() )) {
+ $listHash = array( 'status_id' => ARTICLE_STATUS_PENDING );
+ $submissions = $gContent->getList( $listHash );
+ $_template->tpl_vars['submissions'] = new Smarty_variable( $submissions );
+}
diff --git a/templates/center_display_articles.tpl b/templates/center_display_articles.tpl
new file mode 100644
index 0000000..795b27f
--- /dev/null
+++ b/templates/center_display_articles.tpl
@@ -0,0 +1,70 @@
+<div class="display articles reverse">
+ {foreach from=$articles item=article}
+ {if $article@index == 0}
+ <div class="col-md-6 col-sm-8 col-xs-12">
+ <h1>{$article.title|escape}</h1>
+ {$article.parsed_description}
+ {if $article.has_more}
+ {if $spacer}&nbsp; &bull; &nbsp;{/if}
+ {assign var=spacer value=TRUE}
+ <br /><a class="more" href="{$article.display_url}">{tr}Read More&hellip;{/tr}</a>
+ {/if}
+ </div>
+ {/if}
+ {if $article@index == 1}
+ <div class="col-md-3 col-sm-4 hidden-xs news-border">
+ {$article.parsed_description}
+ {if $article.has_more}
+ {if $spacer}&nbsp; &bull; &nbsp;{/if}
+ {assign var=spacer value=TRUE}
+ <br /><a class="more" href="{$article.display_url}">{tr}Read More&hellip;{/tr}</a>
+ {/if}
+ <h1>{$article.title|escape}</h1>
+ </div>
+ <div class="visible-xs col-xs-12">
+ <h1>{$article.title|escape}</h1>
+ {$article.parsed_description}
+ {if $article.has_more}
+ {if $spacer}&nbsp; &bull; &nbsp;{/if}
+ {assign var=spacer value=TRUE}
+ <br /><a class="more" href="{$article.display_url}">{tr}Read More&hellip;{/tr}</a>
+ {/if}
+ </div>
+ <div class="visible-xs clear"></div>
+ {/if}
+ {if $article@index == 2}
+ <div class="col-md-3 hidden-sm hidden-xs reverse news-border">
+ <h1>{$article.title|escape}</h1>
+ {$article.parsed_description}
+ {if $article.has_more}
+ {if $spacer}&nbsp; &bull; &nbsp;{/if}
+ {assign var=spacer value=TRUE}
+ <br /><a class="more" href="{$article.display_url}">{tr}Read More&hellip;{/tr}</a>
+ {/if}
+ </div>
+ <div class="col-sm-12 visible-sm visible-xs reverse">
+ <h1>{$article.title|escape}</h1>
+ {$article.parsed_description}
+ {if $article.has_more}
+ {if $spacer}&nbsp; &bull; &nbsp;{/if}
+ {assign var=spacer value=TRUE}
+ <br /><a class="more" href="{$article.display_url}">{tr}Read More&hellip;{/tr}</a>
+ {/if}
+ </div>
+ <div class="clear"></div>
+ {/if}
+ {if $article@index == 3}
+ </div>
+ <div class="display articles">
+ {/if}
+ {if $article@index > 2}
+ <h1>{$article.title|escape}</h1>
+ {$article.parsed_description}
+ {if $article.has_more}
+ {if $spacer}&nbsp; &bull; &nbsp;{/if}
+ {assign var=spacer value=TRUE}
+ <br /><a class="more" href="{$article.display_url}">{tr}Read More&hellip;{/tr}</a>
+ {/if}
+ {/if}
+ {/foreach}
+</div>