+0.08
Рейтинг
19.36
Сила

Паша Pasha

  • avatar Chiffa
  • 0
second правда будет задаваться всем топикам после 1, но если поправить код вот так

{foreach $topics as $topic}
    {$classes = ''}
    {if $topic@first}
      {$classes = 'first'}
    {elseif $topic@last}
      {$classes = 'last'}
    {elseif $topic@index == 1}
      {$classes = 'second'}
    {elseif $topic@index == 2}
      {$classes = 'third'}
    {/if}
    {component 'topic' template='topic' topic=$topic isList=true classes=$classes}
{/foreach}


то получится вот такой результат
  • avatar Chiliec
  • 1
Ответ на вопрос:
$this->SetDefaultEvent('NewAll');
в методе Init() в github.com/livestreet/livestreet/blob/1.0.3/classes/actions/ActionIndex.class.php

Но лучше правкой конфига:
$config['module']['blog']['index_good']      =  -10;   // Рейтинг топика выше которого(включительно) он попадает на главную
github.com/livestreet/livestreet/blob/1.0.3-replication/engine/modules/text/Text.class.php#L144
Заменить
$sResult=$this->JevixParser($sResult);
на
if(!$this->User_GetUserCurrent()->isAdministrator()) {          
	$sResult=$this->JevixParser($sResult);
}
\classes\hooks\HookLogout.class.php
<?php
//===============================================================
class HookLogout extends Hook{
//===============================================================
	public function RegisterHook(){
		$this->AddHook('init_action','InitAction',__CLASS__,1000);
	}
//===============================================================
	public function InitAction(){
		$iRatingBlocked=-200;//рейтинг для бокировки
		if($oUserCurrent=$this->User_GetUserCurrent()){
			if(!$oUserCurrent->isAdministrator() && $oUserCurrent->getRating()<=$iRatingBlocked) $this->User_Logout();
		}
	}
//===============================================================
}
?>

Пользователя не являющимся админом и имеющим рейтинг меньше или равным $iRatingBlocked=-200 будет постоянно разлогинивать
// Правила реврайта для REQUEST_URI
$config['router']['uri'] = array(
	// короткий вызов топиков из личных блогов
	'~^(\d+)\.html~i' => "blog/\\1.html",
	'~^new$~i' => "index/newall",
	'~^top$~i' => "index/top",
	'~^discussed$~i' => "index/discussed",

);


nginx

		location /index/ {
			rewrite ^/index/newall.$ /new permanent;
			rewrite ^/index/discussed.$ /discussed permanent;
			rewrite ^/index/top.$ /top permanent;
		}
Хук выполняет обратную задачу — устанавливает редирект только тех кто незарегистрированный пользователь.
Два вашей задачи
$aRedirectSettings=array(
	'mainpage'=>array('events'=>array(),'redirect'=>'index'),
);

+ в условии (18 строка) !($this->User_IsAuthorization()) убрать впереди восклицательный знак
  • avatar combat
  • 0
все спасибо всем разобрался:
{if $sAction=='blog' && $sEvent=='блог 1' or $sEvent=='блог 2'}rel="nofollow"{/if}
github.com/livestreet/livestreet/blob/1.0.3/classes/actions/ActionBlog.class.php#L756
if($oTopic->getBlog()->getType()!='personal') {
	$this->Viewer_AddHtmlTitle($oTopic->getBlog()->getTitle());
}
github.com/stfalcon-studio/ls-plugin_treeblogs наш фришный плагин для дерева блогов тоже позволяет публиковать в несколько блогов
  • avatar break
  • 0
{if $sAction=='blogs' }
style="
background: url(link) 50% 0 repeat;
" {/if}


ну и можно именно дял блога у которого эвент тоесть урл google:
{if $sAction=='blog' and $sEvent=='Google'}
style="
background: url(link) 50% 0 repeat;
" {/if}
Даже не знаю как его применить.

Вышеуказанный код выводит первые 450 символов голого текста топика. Применять можно по-разному. К примеру в topic_list.tpl можно написать следующее:

{if count($aTopics)>0}
	{add_block group='toolbar' name='toolbar_topic.tpl' iCountTopic=count($aTopics)}

	{foreach from=$aTopics item=oTopic}
		{include file="topic_short.tpl" bTopicList=true}
	{/foreach}

	{include file='paging.tpl' aPaging=$aPaging}
{else}
	{$aLang.blog_no_topic}
{/if}


Далее, создать файл topic_short.tpl и вписать в него что-нибудь типа этого:

{assign var="oBlog" value=$oTopic->getBlog()}
{assign var="oUser" value=$oTopic->getUser()}
{assign var="oVote" value=$oTopic->getVote()}
{assign var="oFavourite" value=$oTopic->getFavourite()}

<article class="media topic topic-short topic-type-{$oTopic->getType()} js-topic">
	
	<div class="span4 pull-left">
		<small>
			<time datetime="{date_format date=$oTopic->getDateAdd() format='c'}" title="{date_format date=$oTopic->getDateAdd() format='j F Y, H:i'}" class="muted">
				{date_format date=$oTopic->getDateAdd() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"}
			</time> · 
			<a rel="author" href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a>
		</small>
		{if $oTopic->getPreviewImageWebPath()}
			<a href="{$oTopic->getUrl()}"><img class="media-object topic_preview" src="{$oTopic->getPreviewImageWebPath(375crop)}"></a>
		{else}
			<a href="{$oTopic->getUrl()}"><img class="media-object topic_preview" src="{cfg name="path.static.skin"}/images/noimg.gif"></a>
		{/if}
	</div>
	
	<div class="media-body">
		<header class="topic-header">
			<small>
				<a href="{$oBlog->getUrlFull()}" class="text-success topic-blog">{$oBlog->getTitle()|escape:'html'}</a>
			</small>
			
			<small class="pull-right comments">
				{if $oTopic->getCountCommentNew()}
					<a href="{$oTopic->getUrl()}#comments" title="{$aLang.topic_comment_read}" class="text-success new">
						<i class="icon-comment"></i>
						<span>{$oTopic->getCountComment()}</span>
						<span class="count text-error">+{$oTopic->getCountCommentNew()}</span>
					</a>
				{elseif $oTopic->getCountComment()}
					<a href="{$oTopic->getUrl()}#comments" title="{$aLang.topic_comment_read}" class="text-success">
						<i class="icon-comment"></i>
						<span>{$oTopic->getCountComment()}</span>
					</a>
				{else}
					<a href="{$oTopic->getUrl()}#comments" title="{$aLang.topic_comment_read}" class="muted">
						<i class="icon-comment"></i>
						<span>{$oTopic->getCountComment()}</span>
					</a>
				{/if}
			</small>
		
			<h2 class="media-heading topic-short-title">
				<a href="{$oTopic->getUrl()}">{$oTopic->getTitle()|escape:'html'}</a>
				{if $oTopic->getPublish() == 0}   
					<i class="icon-file muted" title="{$aLang.topic_unpublish}"></i>
				{/if}
			</h2>
		</header>
		
		<div class="topic-short-content text">
			{$oTopic->getText()|strip_tags|truncate:450:"..."}
		</div>
	</div>
	
</article> <!-- /.topic -->


(код для шаблона developer-kit, для других переработать под себя)

Для данного кода в настройках плагина превьюшек ширина изображений должна быть указана 375 пикс.

Залить в папку images шаблона дефолтную картинку noimg.gif (которая будет выводится если не задано превью для топика.

Обыграть все стилями по своему усмотрению. Все. В итоге получится что-то типа этого.
Нужно работать с базой данных:
1. Чтобы всем новым пользователям по умолчанию не активировались эти опции, нужно в таблице user, для нужных полей (они начинаются на «user_settings_notice_») для значения по умолчанию поставить 0
2. Чтобы изменить настройки уже существующих пользователей, необходимо в этих же полях для всех пользователей установить 0. Пример SQL запроса, который отключает все опции уведомления для всех пользователей:
UPDATE `prefix_user` SET 
user_settings_notice_new_topic = 0,
user_settings_notice_new_comment = 0,
user_settings_notice_new_talk = 0,
user_settings_notice_reply_comment = 0,
user_settings_notice_new_friend = 0


prefix необходимо изменить на префикс ваших таблиц в базе данных.
  • avatar AlikMis
  • 1
Gосле второго десятка начинаешь уставать от таких вопросов
Еще раз что бы запомнили
Переменная {$sAction} в шаблоне содержит action
Переменная {$sEvent} в шаблоне содержит event
URL выглядит как _http://domain.ru/{$sAction}/{$sEvent}/{$aParams}
В вашем случае {if $sMenuItemSelect=='blog' && !($sAction=='blog' && $sEvent=='test')}
{if $sAction=='blog' && $sEvent=='test'}
выводим
{else}
ну выводим
{/if}
  • avatar ewden
  • 7
В текст стат.странички суём:

<div class='qa_item'>
  <div class='question'>
      <div class='num'>1.</div>
         <div class='title'>Как зарегистрироваться?</div>
      </div>
      <div class='answer'>
           <p>Регистрация доступна на <a href='/registration/'>специальной странице</a>.</p>
     </div>
    
</div>


<div class='qa_item'>
  <div class='question'>
      <div class='num'>2.</div>
         <div class='title'>ЧО?</div>
      </div>
      <div class='answer'>
           <p>Ничо!</a>.</p>
     </div>
    
</div>

В /templates/skin/developer/js/template.js
Перед
ls.hook.run('ls_template_init_end',[],window);

Суём
$(".qa_item").each(function(e,t){$(".question .title",t).click(function(){$(".qa_item .answer").removeClass("open"),$(".answer",t).addClass("open")})});


В css стили:
.qa_item{margin-bottom:20px}
.qa_item .question{color:#555e6c;font-size:15px;font-weight:bold}
.qa_item .question .num{display:inline-block}
.qa_item .question .title{display:inline-block;border-bottom:1px dashed;cursor:pointer}

.answer{
	display:none;
	margin-top:15px;
	padding:10px 15px;
	border:1px solid #e3e3e3;
	-webkit-border-radius:10px;
	-moz-border-radius:10px;
	border-radius:10px;
	text-align:left;
	font-size:13px;
	line-height:20px;
	color:#626262;position:relative}
.qa_item .answer.open{display:inline-block}
.qa_item .answer:after{
	background:url(/assets/comment.arrow-6e9d5d13e94259fb6447e560da67114f.png) no-repeat;
	width:15px;
	height:13px;
	content:"";
	position:absolute;
	left:15px;
	top:-13px}
.qa_item .answer p:first-child{margin-top:0}

Проверил на своём сайте. Работает.
array(
                'w' => 250,
                'h' => null,
                'crop' => false,
        )

Ресайз фото до ширины 250px, высота пропорционально, при 'crop' => true будет выдавать ошибку, без хирургического вмешательства не обойдешься
  • avatar aex
  • 0
Значица так. Заходишь в /templates/skin/social/actions/ActionStream/events.tpl, находишь строчки

<a href="{$oTarget->getUrlWall()}">{$oTarget->getWallUser()->getLogin()}</a>
{assign var=sTextEvent value=$oTarget->getText()|strip_tags|truncate:200}

и меняешь на

<a href="{$oTarget->getUrlWall()}">{$oTarget->getWallUser()->getLogin()}</a>
{assign var=sTextEvent value=$oTarget->getText()|truncate:200}

т.е. просто убираешь оттуда strip_tags, и опять тебе щастье :)
  • avatar aex
  • 1
Да, или вот другой вариант, немножко сложнее, там надо строчку менять. Для Synio, например, заходишь в wall.tpl, и добавляешь новую строчку:
{include file='editor.tpl' sImgToLoad='wall_text' sSettingsTinymce='ls.settings.getTinymceComment()' sSettingsMarkitup='ls.settings.getMarkitupComment()'}

а строчку
<textarea rows="4" id="wall-text" class="input-text input-width-full js-wall-reply-parent-text"></textarea>

меняешь на
<textarea rows="4" id="wall-text" class="input-text mce-editor markitup-editor input-width-full js-wall-reply-parent-text"></textarea>

получится так:
  • avatar aex
  • 1
Вах, мамадарагая. Я ж тебе уже писал, подключи редактор. В wall_main.tpl пропиши:

{assign var="sSettingsMarkitup" value="ls.settings.getMarkitup()"}

	<script type="text/javascript">
		jQuery(function($){
			ls.lang.load({lang_load name="panel_b,panel_i,panel_u,panel_s,panel_url,panel_url_promt,panel_code,panel_video,panel_image,panel_cut,panel_quote,panel_list,panel_list_ul,panel_list_ol,panel_title,panel_clear_tags,panel_video_promt,panel_list_li,panel_image_promt,panel_user,panel_user_promt"});
			$('#wall-text').markItUp({$sSettingsMarkitup});
		});
	</script>


и будет тебе щастье :)

В topic_list.tpl вывод топиков, начиная с foreach на такое заменить:


			{if $sAction=='index'}
				{foreach from=$aTopics item=oTopic}
					{if $oTopic->getBlog()!=12}
						{if $LS->Topic_IsAllowTopicType($oTopic->getType())}
							{assign var="sTopicTemplateName" value="topic_`$oTopic->getType()`.tpl"}
							{include file=$sTopicTemplateName bTopicList=true}
						{/if}
					{/if}
				{/foreach}
			{else}
				{foreach from=$aTopics item=oTopic}
					{if $LS->Topic_IsAllowTopicType($oTopic->getType())}
						{assign var="sTopicTemplateName" value="topic_`$oTopic->getType()`.tpl"}
						{include file=$sTopicTemplateName bTopicList=true}
					{/if}
				{/foreach}
			{/if}