Jump to content
Дизайн и модификация IPS Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Lesovsky

Код шаблона Front Page (Blog Format)

Recommended Posts

Приветствую!

Перед редактированием не сделал бекап шаблона Front Page (Blog Format), передайте код шаблона, у кого есть возможность.

Share this post


Link to post
Share on other sites

Из дома

<div class='type-1x1x1'>
<php>
	// Category or global?
	if( isset( $data['category']['category_id'] ) ){
		$rss = array( 
			'enabled' => ( substr( $data['category']['category_rss'], 0, 1 ) == 1 && $data['category']['category_show_records'] ) ? 1 : 0,
			'type' => 'category',
			'id' => $data['database']['database_id'].'c'.$data['category']['category_id'],
			'name' => $data['category']['category_name']
		);
		$title = $data['category']['category_name'];
		$this->settings['_active_cat'] = $data['category']['category_id'];
	} else {
		$rss = array( 
			'enabled' => ( substr( $data['database']['database_rss'], 0, 1 ) == 1 ),
			'type' => 'global',
			'id' => $data['database']['database_id'],
			'name' => $data['database']['database_name']
		);
		$title = $this->lang->words['fpdt_latestnews'];
	}
</php>
<div class='utilities right'>
	<if test="$data['category']['category_id']">
		<a href='{$data['category']['category_link']}?view=archive' title='{$this->lang->words['fpdt_viewarchives']}'><img src='{$this->settings['img_url']}/archive.png' alt='' /></a>
	</if>
	   
	<if test="$rss['enabled']"><a href='{parse url="app=core&module=global&section=rss&type=ccs&id={$rss['id']}" seotitle="{$rss['name']}" template="section=rss2" base="public"}' class='right'><img src='{$this->settings['img_url']}/feed.png' alt='' /></a></if>
</div>
<h2 class='section_title'>
	{$title}
	<if test="$data['database']['_can_add']">
		<a href='{$data['database']['base_link']}do=add&category={$this->request['category']}' title='{$this->lang->words['add_record_button']}' accesskey='s' class='add_link'>{$this->lang->words['add_record_button']}</a>
	</if>
	<if test="$this->memberData['member_id'] AND $this->request['category']">
		<if test="$this->settings['cpu_watch_update'] AND ( is_array( $this->memberData['_cache'] ) AND is_array( $this->memberData['_cache']['watchedContentCats'] ) AND in_array( $this->request['category'], $this->memberData['_cache']['watchedContentCats'] ) )">
			<a href='{$data['database']['base_link']}do=unwatch&category={$this->request['category']}' title='{$this->lang->words['watch_category_stop']}' class='add_link'>{$this->lang->words['watch_category_stop']}</a>
		<else />
			<a href='{$data['database']['base_link']}do=watch&category={$this->request['category']}' title='{$this->lang->words['watch_category']}' class='add_link'>{$this->lang->words['watch_category']}</a>
		</if>
	</if>
</h2>

<if test="count( $data['records'] )">
	<!-- START ARTICLE POSITION 1 -->
	<foreach loop="$data['records'] as $record">
		<div class='article block block-1<if test="!$record['record_approved']"> moderated</if><if test="$record[ $data['special']['date'] ] > time()"> unpublished</if>'>
                               <h2><a href='{$record['record_link']}'>{$record['article_title']}</a></h2>
			<div class='overview'>
			    <if test="$record['article_image']">
				<img src='{$record['article_image']}' class='photo' {parse resize_image="$record['article_image']" maxwidth="150"} alt='' />
			    </if>
				<span class='desc posted_info'>{$record['article_date']} | <a href='{parse url="showuser={$record['member_id']}" base="public" template="showuser" seotitle="{$record['members_seo_name']}"}'>{$record['members_display_name']}</a> {$this->lang->words['fpdt_in']} <a href='{$record['category_link']}'>{$record['category_name']}</a></span>

				<div class='excerpt'>
					{$record['article_body']}
					<br class='clear' />
					<span class='links'>
						<a href='{$record['record_link']}' class='read_more'>{$this->lang->words['fpdt_readstory']}</a>
						  
						<a href='{$record['record_link']}#comments' class='comments'>{$record['record_comments']} {$this->lang->words['fpdt_comments']}</a>
						  
						<if test="$data['database']['database_rate']">
							<if test="$record['rating_real'] >= 1">{parse replacement="rate_on"}<else />{parse replacement="rate_off"}</if><if test="$record['rating_real'] >= 2">{parse replacement="rate_on"}<else />{parse replacement="rate_off"}</if><if test="$record['rating_real'] >= 3">{parse replacement="rate_on"}<else />{parse replacement="rate_off"}</if><if test="$record['rating_real'] >= 4">{parse replacement="rate_on"}<else />{parse replacement="rate_off"}</if><if test="$record['rating_real'] >= 5">{parse replacement="rate_on"}<else />{parse replacement="rate_off"}</if>
						</if>
					</span>
				</div>
			</div>
		</div>
	</foreach>
<else />
	<div class='no_messages'>
		{$this->lang->words['fpdt_noarticles']}
		<if test="$data['database']['_can_add']">
			<a href='{$data['database']['base_link']}do=add&category={$this->request['category']}' title='{$this->lang->words['add_record_button']}'><strong>{$this->lang->words['fpdt_addone']}</strong></a>
		</if>
	</div>
</if>

<if test="$this->caches['ccs_frontpage']['paginate']">
<div class='pagelinks'>
	<if test="$this->request['p'] AND $this->request['p'] > 1">
		<div class='left'>
			<a href='<if test="$data['category']['category_id']">{$data['category']['category_link']}?p=1<else />{$data['database']['base_link']}p=1</if>'>{$this->lang->words['frontpage_previouspage']}</a>
		</div>
	</if>

	<php>
		$_ttlPgs	= $data['database']['_fp_count'] ? ceil( $data['database']['_fp_count'] / $this->caches['ccs_frontpage']['limit'] ) : 0;
		$_curPg		= $this->request['p'] ? $this->request['p'] : 1;
		$_nextPg	= $_curPg + 1;
	</php>
	<if test="$_ttlPgs AND $_curPg < $_ttlPgs">
		<div class='right'>
			<a href='<if test="$data['category']['category_id']">{$data['category']['category_link']}?p={$_nextPg}<else />{$data['database']['base_link']}p={$_nextPg}</if>'>{$this->lang->words['frontpage_nextpage']}</a>
		</div>
	</if>
</div>
</if>
</div>
<br class='clear' />

  • Upvote 1

Share this post


Link to post
Share on other sites

Спасибо! Меня интересовала в нём строчка:

 

                                                {$record['article_body']}

 

А то я ограничил кол-во символов на главной вот так:

 

						{IPSText::truncate( strip_tags($record['article_body']), 600 )}

 

Но к сожалению обработка BB кодов перестала работать, как можно сделать, чтобы и обработка была и уменьшить количество символов?

Share this post


Link to post
Share on other sites

К сожалению, не знаю.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...