1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-01 14:05:07 +03:00

fix topic-photoset

This commit is contained in:
Mzhelskiy Maxim 2011-08-14 10:00:58 +00:00
parent 6f8764e386
commit 56e119db3d
5 changed files with 48 additions and 49 deletions

View file

@ -431,13 +431,18 @@ class ActionPhotoset extends Action {
$oTopic->setUserId($this->oUserCurrent->getId()); $oTopic->setUserId($this->oUserCurrent->getId());
$oTopic->setType('photoset'); $oTopic->setType('photoset');
$oTopic->setTitle(getRequest('topic_title')); $oTopic->setTitle(getRequest('topic_title'));
$oTopic->setText(htmlspecialchars(getRequest('topic_text'))); /**
$oTopic->setTextShort(htmlspecialchars(getRequest('topic_text'))); * Получаемый и устанавливаем разрезанный текст по тегу <cut>
*/
list($sTextShort,$sTextNew,$sTextCut) = $this->Text_Cut(getRequest('topic_text'));
$oTopic->setCutText($sTextCut);
$oTopic->setText($this->Text_Parser($sTextNew));
$oTopic->setTextShort($this->Text_Parser($sTextShort));
$oTopic->setTextSource(getRequest('topic_text')); $oTopic->setTextSource(getRequest('topic_text'));
$oTopic->setTags(getRequest('topic_tags')); $oTopic->setTags(getRequest('topic_tags'));
$oTopic->setDateAdd(date("Y-m-d H:i:s")); $oTopic->setDateAdd(date("Y-m-d H:i:s"));
$oTopic->setUserIp(func_getIp()); $oTopic->setUserIp(func_getIp());
$oTopic->setCutText(null);
$oTopic->setTextHash(md5($oTopic->getType().$oTopic->getText().$oTopic->getTitle())); $oTopic->setTextHash(md5($oTopic->getType().$oTopic->getText().$oTopic->getTitle()));
$sTargetTmp=$_COOKIE['ls_photoset_target_tmp']; $sTargetTmp=$_COOKIE['ls_photoset_target_tmp'];
@ -571,8 +576,15 @@ class ActionPhotoset extends Action {
* Теперь можно смело редактировать топик * Теперь можно смело редактировать топик
*/ */
$oTopic->setBlogId($oBlog->getId()); $oTopic->setBlogId($oBlog->getId());
$oTopic->setText(htmlspecialchars(getRequest('topic_text'))); $oTopic->setTitle(getRequest('topic_title'));
$oTopic->setTextShort(htmlspecialchars(getRequest('topic_text'))); /**
* Получаемый и устанавливаем разрезанный текст по тегу <cut>
*/
list($sTextShort,$sTextNew,$sTextCut) = $this->Text_Cut(getRequest('topic_text'));
$oTopic->setCutText($sTextCut);
$oTopic->setText($this->Text_Parser($sTextNew));
$oTopic->setTextShort($this->Text_Parser($sTextShort));
$oTopic->setTextSource(getRequest('topic_text')); $oTopic->setTextSource(getRequest('topic_text'));
$oTopic->setTags(getRequest('topic_tags')); $oTopic->setTags(getRequest('topic_tags'));
$oTopic->setUserIp(func_getIp()); $oTopic->setUserIp(func_getIp());

View file

@ -34,15 +34,16 @@
</div> </div>
<!-- /Topic Photo Preview --> <!-- /Topic Photo Preview -->
{assign var=iPhotosCount value=$oTopic->getPhotosetCount()}
<div class="content"> <div class="content">
{if $bTopicList} {if $bTopicList}
{$oTopic->getTextShort()} {$oTopic->getTextShort()}
{if $oTopic->getTextShort()!=$oTopic->getText()} {if $oTopic->getTextShort()!=$oTopic->getText()}
<a href="{$oTopic->getUrl()}#cut" title="{$aLang.topic_read_more}"> <br /><a href="{$oTopic->getUrl()}#cut" title="{$aLang.topic_read_more}">
{if $oTopic->getCutText()} {if $oTopic->getCutText()}
{$oTopic->getCutText()} {$oTopic->getCutText()}
{else} {else}
{$aLang.topic_read_more} {$aLang.topic_photoset_show_all|ls_lang:"COUNT%%`$iPhotosCount`"} &rarr;
{/if} {/if}
</a> </a>
{/if} {/if}

View file

@ -37,25 +37,18 @@
</div> </div>
<!-- /Topic Photo Preview --> <!-- /Topic Photo Preview -->
{assign var=iPhotosCount value=$oTopic->getPhotosetCount()}
<div class="content"> <div class="content">
{if $bTopicList} {if $bTopicList}
{$oTopic->getTextShort()} {$oTopic->getTextShort()}
<!-- Cut link -->
<br /><br /><a href="{$oTopic->getUrl()}">{$aLang.topic_photoset_show_all|ls_lang:"COUNT%%`$iPhotosCount`"} &rarr;</a>
<!-- /Cut link -->
{if $oTopic->getTextShort()!=$oTopic->getText()} {if $oTopic->getTextShort()!=$oTopic->getText()}
<br><br>( <a href="{$oTopic->getUrl()}#cut" title="{$aLang.topic_read_more}"> <br /><a href="{$oTopic->getUrl()}#cut" title="{$aLang.topic_read_more}">
{if $oTopic->getCutText()} {if $oTopic->getCutText()}
{$oTopic->getCutText()} {$oTopic->getCutText()}
{else} {else}
{$aLang.topic_read_more} {$aLang.topic_photoset_show_all|ls_lang:"COUNT%%`$iPhotosCount`"} &rarr;
{/if} {/if}
</a> ) </a>
{/if} {/if}
{else} {else}
{$oTopic->getText()} {$oTopic->getText()}

View file

@ -38,16 +38,16 @@
<img src="{$oMainPhoto->getWebPath(500)}" alt="image" /> <img src="{$oMainPhoto->getWebPath(500)}" alt="image" />
</div> </div>
{assign var=iPhotosCount value=$oTopic->getPhotosetCount()}
<div class="content"> <div class="content">
{if $bTopicList} {if $bTopicList}
{$oTopic->getTextShort()} {$oTopic->getTextShort()}
{if $oTopic->getTextShort()!=$oTopic->getText()} {if $oTopic->getTextShort()!=$oTopic->getText()}
<a href="{$oTopic->getUrl()}#cut" title="{$aLang.topic_read_more}"> <br /><a href="{$oTopic->getUrl()}#cut" title="{$aLang.topic_read_more}">
{if $oTopic->getCutText()} {if $oTopic->getCutText()}
{$oTopic->getCutText()} {$oTopic->getCutText()}
{else} {else}
{$aLang.topic_read_more} {$aLang.topic_photoset_show_all|ls_lang:"COUNT%%`$iPhotosCount`"} &rarr;
{/if} {/if}
</a> </a>
{/if} {/if}

View file

@ -28,7 +28,7 @@
{/if} {/if}
</ul> </ul>
{assign var=iPhotosCount value=$oTopic->getPhotosCount()} {assign var=iPhotosCount value=$oTopic->getPhotosetCount()}
<!-- Topic Photo Preview --> <!-- Topic Photo Preview -->
<div class="topic-photo-preview" style="width: 500px"> <div class="topic-photo-preview" style="width: 500px">
{assign var=oMainPhoto value=$oTopic->getPhotosetMainPhoto()} {assign var=oMainPhoto value=$oTopic->getPhotosetMainPhoto()}
@ -44,21 +44,14 @@
<div class="content"> <div class="content">
{if $bTopicList} {if $bTopicList}
{$oTopic->getTextShort()} {$oTopic->getTextShort()}
<!-- Cut link -->
<br /><br /><a href="{$oTopic->getUrl()}">{$aLang.topic_photoset_show_all|ls_lang:"COUNT%%`$iPhotosCount`"} &rarr;</a>
<!-- /Cut link -->
{if $oTopic->getTextShort()!=$oTopic->getText()} {if $oTopic->getTextShort()!=$oTopic->getText()}
<br><br>( <a href="{$oTopic->getUrl()}#cut" title="{$aLang.topic_read_more}"> <br /><a href="{$oTopic->getUrl()}#cut" title="{$aLang.topic_read_more}">
{if $oTopic->getCutText()} {if $oTopic->getCutText()}
{$oTopic->getCutText()} {$oTopic->getCutText()}
{else} {else}
{$aLang.topic_read_more} {$aLang.topic_photoset_show_all|ls_lang:"COUNT%%`$iPhotosCount`"} &rarr;
{/if} {/if}
</a> ) </a>
{/if} {/if}
{else} {else}
{$oTopic->getText()} {$oTopic->getText()}