LsBlocks: Как сделать Опрос на сайте


1.Создаете блог Наши опросы
2.Скачиваете плагин LsBlocks от k2fl, закидываете в папку /plugins/
3.В config.php, где Блок Новости пишите id блога Наши опросы и ставите вывод кол-ва публикаций 1
4.Далее в шаблоне block.News.tpl меняете на этот код
<div class="block stream">
	<div class="tl"><div class="tr"></div></div>
	<div class="cl"><div class="cr">
		<h1>{$aLang.block_news}</h1>
		<div class="block-content">
			<ul class="stream-content">
				{foreach from=$aNews item=oTopic name="lst"}
					{assign var="oUser" value=$oTopic->getUser()}
					{assign var="oBlog" value=$oTopic->getBlog()}
			<span style="font-weight:bold">
					{if $oTopic->getPublish()==0}	
						<img src="{cfg name='path.static.skin'}/images/topic_unpublish.gif" border="0" title="{$aLang.topic_unpublish}" width="16" height="16" alt="{$aLang.topic_unpublish}">
					{/if}
					{$oTopic->getTitle()|escape:'html'}
					{if $oTopic->getType()=='link'}
  						<img src="{cfg name='path.static.skin'}/images/link_url_big.gif" border="0" title="{$aLang.topic_link}" width="16" height="16" alt="{$aLang.topic_link}">
  					{/if}
				</span>

		{if $oTopic->getType()=='question'}   
    		
    		<div id="topic_question_area_{$oTopic->getId()}">
    		{if !$oTopic->getUserQuestionIsVote()} 		
    			<ul class="poll-new">	
				{foreach from=$oTopic->getQuestionAnswers() key=key item=aAnswer}				
					<li><label for="topic_answer_{$oTopic->getId()}_{$key}"><input type="radio" id="topic_answer_{$oTopic->getId()}_{$key}" name="topic_answer_{$oTopic->getId()}"  value="{$key}" onchange="$('topic_answer_{$oTopic->getId()}_value').setProperty('value',this.value);"/> {$aAnswer.text|escape:'html'}</label></li>				
				{/foreach}
					<li>
					<input type="submit"  value="{$aLang.topic_question_vote}" onclick="ajaxQuestionVote({$oTopic->getId()},$('topic_answer_{$oTopic->getId()}_value').getProperty('value'));">
					<input type="submit"  value="{$aLang.topic_question_abstain}"  onclick="ajaxQuestionVote({$oTopic->getId()},-1)">
					</li>				
					<input type="hidden" id="topic_answer_{$oTopic->getId()}_value" value="-1">				
				</ul>				
				<span>{$aLang.topic_question_vote_result}: {$oTopic->getQuestionCountVote()}. {$aLang.topic_question_abstain_result}: {$oTopic->getQuestionCountVoteAbstain()}</span>
			
			{else}			
				{include file='topic_question.tpl'}
			{/if}
			</div>
				
						
    		{/if}


				{/foreach}
			</ul>
		</div>
		<div class="right"><a href="{if $oTopic->getType()=='link'}{router page='link'}go/{$oTopic->getId()}/{else}{$oTopic->getUrl()}{/if}">{$aLang.block_news_full}</a> | 
<a href="{router page='blog/votes'}">{$aLang.block_news_all}</a> | <a href="{router page='rss'}blog/votes/">RSS</a></div>
	</div></div>
	<div class="bl"><div class="br"></div></div>
</div>


5.В language/russian.php меняете
/* Блок: Новости */
	'block_news' => 'Наш опрос',
	'block_news_all' => 'Все опросы',
	'block_news_full' => 'Страница опроса',

0 комментариев

Только зарегистрированные и авторизованные пользователи могут оставлять комментарии.