1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-13 06:18:18 +03:00

исправлена ошибка в главном меню, ошибка в шаблоне регистрации, добавлен функционал RSS каналов(прислал vovazol)

This commit is contained in:
Mzhelskiy Maxim 2008-09-21 07:45:56 +00:00
parent 10337a2051
commit 3bb05a5469
6 changed files with 314 additions and 49 deletions

View file

@ -0,0 +1,240 @@
<?
/*-------------------------------------------------------
*
* LiveStreet Engine Social Networking
* Copyright © 2008 Mzhelskiy Maxim
*
*--------------------------------------------------------
*
* Official site: www.livestreet.ru
* Contact e-mail: rus.engine@gmail.com
*
* GNU General Public License, version 2:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
---------------------------------------------------------
*/
/**
* Обрабатывает RSS
* Автор класса vovazol(http://livestreet.ru/profile/vovazol/)
*
*/
class ActionRss extends Action {
public function Init() {
$this->SetDefaultEvent('index');
}
protected function RegisterEvent() {
$this->AddEvent('index','RssGood');
$this->AddEvent('new','RssNew');
$this->AddEvent('allcomments','RssComments');
$this->AddEvent('comments','RssTopicComments');
$this->AddEvent('tag','RssTag');
$this->AddEvent('blog','RssColectiveBlog');
$this->AddEvent('log','RssPersonalBlog');
}
protected function RssGood() {
$aResult=$this->Topic_GetTopicsGood(1,BLOG_TOPIC_PER_PAGE*2);
$aTopics=$aResult['collection'];
$aChannel['title']=SITE_NAME;
$aChannel['link']=DIR_WEB_ROOT;
$aChannel['description']=SITE_NAME.' / RSS channel';
$aChannel['language']='ru';
$aChannel['managingEditor']=RSS_EDITOR_MAIL;
$aChannel['generator']=SITE_NAME;
$topics=array();
foreach ($aTopics as $oTopic){
$item['title']=$oTopic->getTitle();
$item['guid']=$oTopic->getUrl();
$item['link']=$oTopic->getUrl();
$item['description']=$oTopic->getText();
$item['pubDate']=$oTopic->getDateAdd();
$item['author']=$oTopic->getUserLogin();
$item['category']=$oTopic->getTags();
$topics[]=$item;
}
$this->Viewer_Assign('aChannel',$aChannel);
$this->Viewer_Assign('aItems',$topics);
$this->SetTemplateAction('index');
}
protected function RssNew() {
$aResult=$this->Topic_GetTopicsNew(1,BLOG_TOPIC_PER_PAGE*2);
$aTopics=$aResult['collection'];
$aChannel['title']=SITE_NAME;
$aChannel['link']=DIR_WEB_ROOT;
$aChannel['description']=SITE_NAME.' / RSS channel';
$aChannel['language']='ru';
$aChannel['managingEditor']=RSS_EDITOR_MAIL;
$aChannel['generator']=SITE_NAME;
$topics = array();
foreach ($aTopics as $oTopic){
$item['title']=$oTopic->getTitle();
$item['guid']=$oTopic->getUrl();
$item['link']=$oTopic->getUrl();
$item['description']=$oTopic->getText();
$item['pubDate']=$oTopic->getDateAdd();
$item['author']=$oTopic->getUserLogin();
$item['category']=$oTopic->getTags();
$topics[]=$item;
}
$this->Viewer_Assign('aChannel',$aChannel);
$this->Viewer_Assign('aItems',$topics);
$this->SetTemplateAction('index');
}
protected function RssComments() {
$aResult=$this->Comment_GetCommentsAll(0,1,BLOG_TOPIC_PER_PAGE*2);
$aComments=$aResult['collection'];
$aChannel['title']=SITE_NAME;
$aChannel['link']=DIR_WEB_ROOT;
$aChannel['description']=SITE_NAME.' / RSS channel';
$aChannel['language']='ru';
$aChannel['managingEditor']=RSS_EDITOR_MAIL;
$aChannel['generator']=SITE_NAME;
$comments=array();
foreach ($aComments as $oComment){
$item['title']='коментар до: '.$oComment->getTopicTitle();
$item['guid']=$oComment->getTopicUrl().'#comment'.$oComment->getId();
$item['link']=$oComment->getTopicUrl().'#comment'.$oComment->getId();
$item['description']=$oComment->getText();
$item['pubDate']=$oComment->getDate();
$item['author']=$oComment->getUserLogin();
$item['category']='comments';
$comments[]=$item;
}
$this->Viewer_Assign('aChannel',$aChannel);
$this->Viewer_Assign('aItems',$comments);
$this->SetTemplateAction('index');
}
protected function RssTopicComments() {
$sTopicId=$this->GetParam(0);
$aComments=$this->Comment_GetCommentsByTopicId($sTopicId);
$aChannel['title']=SITE_NAME;
$aChannel['link']=DIR_WEB_ROOT;
$aChannel['description']=SITE_NAME.' / RSS channel';
$aChannel['language']='ru';
$aChannel['managingEditor']=RSS_EDITOR_MAIL;
$aChannel['generator']=SITE_NAME;
$comments=array();
foreach ($aComments as $oComment){
$item['title']='коментар до: '.$oComment->getTopicTitle();
$item['guid']=$oComment->getTopicUrl().'#comment'.$oComment->getId();
$item['link']=$oComment->getTopicUrl().'#comment'.$oComment->getId();
$item['description']=$oComment->getText();
$item['pubDate']=$oComment->getDate();
$item['author']=$oComment->getUserLogin();
$item['category']='comments';
$comments[]=$item;
}
$this->Viewer_Assign('aChannel',$aChannel);
$this->Viewer_Assign('aItems',$comments);
$this->SetTemplateAction('index');
}
protected function RssTag() {
$sTag=urldecode($this->GetParam(0));
$aResult=$this->Topic_GetTopicsByTag($sTag,0,1,BLOG_TOPIC_PER_PAGE*2);
$aTopics=$aResult['collection'];
$aChannel['title']=SITE_NAME;
$aChannel['link']=DIR_WEB_ROOT;
$aChannel['description']=SITE_NAME.' / RSS channel';
$aChannel['language']='ru';
$aChannel['managingEditor']=RSS_EDITOR_MAIL;
$aChannel['generator']=SITE_NAME;
$topics=array();
foreach ($aTopics as $oTopic){
$item['title']=$oTopic->getTitle();
$item['guid']=$oTopic->getUrl();
$item['link']=$oTopic->getUrl();
$item['description']=$oTopic->getText();
$item['pubDate']=$oTopic->getDateAdd();
$item['author']=$oTopic->getUserLogin();
$item['category']=$oTopic->getTags();
$topics[]=$item;
}
$this->Viewer_Assign('aChannel',$aChannel);
$this->Viewer_Assign('aItems',$topics);
$this->SetTemplateAction('index');
}
protected function RssColectiveBlog() {
$sBlogUrl=$this->GetParam(0);
if (!$sBlogUrl or !($sBlog=$this->Blog_GetBlogByUrl($sBlogUrl))) {
$aResult['collection']=array();
}else{
$aResult=$this->Topic_GetTopicsByBlogGood($sBlog,0,1,BLOG_TOPIC_PER_PAGE*2);
}
$aTopics=$aResult['collection'];
$aChannel['title']=SITE_NAME;
$aChannel['link']=DIR_WEB_ROOT;
$aChannel['description']=SITE_NAME.' / RSS channel';
$aChannel['language']='ru';
$aChannel['managingEditor']=RSS_EDITOR_MAIL;
$aChannel['generator']=SITE_NAME;
$topics=array();
foreach ($aTopics as $oTopic){
$item['title']=$oTopic->getTitle();
$item['guid']=$oTopic->getUrl();
$item['link']=$oTopic->getUrl();
$item['description']=$oTopic->getText();
$item['pubDate']=$oTopic->getDateAdd();
$item['author']=$oTopic->getUserLogin();
$item['category']=$oTopic->getTags();
$topics[]=$item;
}
$this->Viewer_Assign('aChannel',$aChannel);
$this->Viewer_Assign('aItems',$topics);
$this->SetTemplateAction('index');
}
protected function RssPersonalBlog() {
$this->sUserLogin=$this->GetParam(0);
if (!$this->sUserLogin or !($this->oUserProfile=$this->User_GetUserByLogin($this->sUserLogin))) {
$aResult['collection']=array();
}else{
$aResult=$this->Topic_GetTopicsPersonalByUser($this->oUserProfile->getId(),1,0,1,BLOG_TOPIC_PER_PAGE*2);
}
$aTopics=$aResult['collection'];
$aChannel['title']=SITE_NAME;
$aChannel['link']=DIR_WEB_ROOT;
$aChannel['description']=SITE_NAME.' / RSS channel';
$aChannel['language']='ru';
$aChannel['managingEditor']=RSS_EDITOR_MAIL;
$aChannel['generator']=SITE_NAME;
$topics=array();
foreach ($aTopics as $oTopic){
$item['title']=$oTopic->getTitle();
$item['guid']=$oTopic->getUrl();
$item['link']=$oTopic->getUrl();
$item['description']=$oTopic->getText();
$item['pubDate']=$oTopic->getDateAdd();
$item['author']=$oTopic->getUserLogin();
$item['category']=$oTopic->getTags();
$topics[]=$item;
}
$this->Viewer_Assign('aChannel',$aChannel);
$this->Viewer_Assign('aItems',$topics);
$this->SetTemplateAction('index');
}
}
?>

View file

@ -107,6 +107,7 @@ define('BLOG_TOPIC_NEW_TIME',60*60*24*1); // Время в секундах в
define('BLOG_TOPIC_PER_PAGE',10); // число топиков на одну страницу
define('BLOG_COMMENT_PER_PAGE',20); // число комментариев на одну страницу(это касается только полного списка комментариев прямого эфира)
define('USER_PER_PAGE',15); // число юзеров на страницу на странице статистики
define('RSS_EDITOR_MAIL',SYS_MAIL_FROM_EMAIL); // мыло редактора РСС
/**

View file

@ -1,47 +1,48 @@
<?
/*-------------------------------------------------------
*
* LiveStreet Engine Social Networking
* Copyright © 2008 Mzhelskiy Maxim
*
*--------------------------------------------------------
*
* Official site: www.livestreet.ru
* Contact e-mail: rus.engine@gmail.com
*
* GNU General Public License, version 2:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
---------------------------------------------------------
*/
/**
* Настройки роутинга страниц
* Определяет какой экшен должен запускаться при определенном УРЛе
*/
return array(
'page' => array(
'error' => 'ActionError',
'registration' => 'ActionRegistration',
'profile' => 'ActionProfile',
'my' => 'ActionMy',
'blog' => 'ActionBlog',
'log' => 'ActionLog',
'top' => 'ActionTop',
'index' => 'ActionIndex',
'new' => 'ActionNew',
'topic' => 'ActionTopic',
'page' => 'ActionPage',
'login' => 'ActionLogin',
'people' => 'ActionPeople',
'settings' => 'ActionSettings',
'tag' => 'ActionTag',
'comments' => 'ActionComments',
'talk' => 'ActionTalk',
),
'config' => array(
'action_default' => 'index',
'action_not_found' => 'error',
),
);
<?
/*-------------------------------------------------------
*
* LiveStreet Engine Social Networking
* Copyright © 2008 Mzhelskiy Maxim
*
*--------------------------------------------------------
*
* Official site: www.livestreet.ru
* Contact e-mail: rus.engine@gmail.com
*
* GNU General Public License, version 2:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
---------------------------------------------------------
*/
/**
* Настройки роутинга страниц
* Определяет какой экшен должен запускаться при определенном УРЛе
*/
return array(
'page' => array(
'error' => 'ActionError',
'registration' => 'ActionRegistration',
'profile' => 'ActionProfile',
'my' => 'ActionMy',
'blog' => 'ActionBlog',
'log' => 'ActionLog',
'top' => 'ActionTop',
'index' => 'ActionIndex',
'new' => 'ActionNew',
'topic' => 'ActionTopic',
'page' => 'ActionPage',
'login' => 'ActionLogin',
'people' => 'ActionPeople',
'settings' => 'ActionSettings',
'tag' => 'ActionTag',
'comments' => 'ActionComments',
'talk' => 'ActionTalk',
'rss' => 'ActionRss',
),
'config' => array(
'action_default' => 'index',
'action_not_found' => 'error',
),
);
?>

View file

@ -26,7 +26,7 @@
<p><label for="pass"><span class="form">Пароль:</span></label><br />
<input type="password" id="pass" value="" name="password" size="25" tabindex="4" /><br />
<span class="form_note">Должен содержать не менее 4 символов и не может совпадать с логином. Не используйте простые пароли, будьте разумны.</span><br />
<span class="form_note">Должен содержать не менее 5 символов и не может совпадать с логином. Не используйте простые пароли, будьте разумны.</span><br />
</p>
<p><label for="repass"><span class="form">Повторите пароль:</span></label><br />

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>{$aChannel.title}</title>
<link>{$aChannel.link}</link>
<description><![CDATA[{$aChannel.description}]]></description>
<language>{$aChannel.language}</language>
<managingEditor>{$aChannel.managingEditor}</managingEditor>
<generator>{$aChannel.generator}</generator>
{foreach from=$aItems item=oItem}
<item>
<title><![CDATA[{$oItem.title|escape:'html'}]]></title>
<guid isPermaLink="true">{$oItem.guid}</guid>
<link>{$oItem.link}</link>
<description><![CDATA[{$oItem.description}]]></description>
<pubDate>{date_format date=$oItem.pubDate format="r"}</pubDate>
<author>{$oItem.author}</author>
<category>{$oItem.category|replace:',':'</category>
<category>'}</category>
</item>
{/foreach}
</channel>
</rss>

View file

@ -59,11 +59,11 @@
<TD vAlign=bottom width=10><IMG height=10 src="{$DIR_STATIC_SKIN}/img/green2_bl.gif" width=10></TD>
<TD class="subitem2 three_columns{if $sMenuSubItemSelect=='good'} active_personal{/if}" noWrap align=middle>
<IMG class=arrow_cc height=7 src="{$DIR_STATIC_SKIN}/img/{if $sMenuSubItemSelect=='good'}arrow_menu_main.gif{else}arrow_menu_main_un.gif{/if}" width=10><A href="{$sMenuSubBlogUrl}/">Хорошие</A>
<IMG class=arrow_cc height=7 src="{$DIR_STATIC_SKIN}/img/{if $sMenuSubItemSelect=='good'}arrow_menu_main.gif{else}arrow_menu_main_un.gif{/if}" width=10><A href="{$DIR_WEB_ROOT}/">Хорошие</A>
</TD>
<TD class="subitem2 three_columns{if $sMenuSubItemSelect=='new'} active_personal{/if}" noWrap align=middle>
<IMG class=arrow_cc height=7 src="{$DIR_STATIC_SKIN}/img/{if $sMenuSubItemSelect=='new'}arrow_menu_main.gif{else}arrow_menu_main_un.gif{/if}" width=10><A href="{$sMenuSubBlogUrl}/new/">Новые</A> {if ($iCountTopicsNew)>0}<span style="color: #339900;">+{$iCountTopicsNew}</span>{/if}
<IMG class=arrow_cc height=7 src="{$DIR_STATIC_SKIN}/img/{if $sMenuSubItemSelect=='new'}arrow_menu_main.gif{else}arrow_menu_main_un.gif{/if}" width=10><A href="{$DIR_WEB_ROOT}/new/">Новые</A> {if ($iCountTopicsNew)>0}<span style="color: #339900;">+{$iCountTopicsNew}</span>{/if}
</TD>
<TD style="BORDER-RIGHT: white 2px solid" vAlign=bottom width=10><IMG height=10 src="{$DIR_STATIC_SKIN}/img/green2_br.gif" width=10></TD>