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

Изменение мода последние сообщения (3.2.3)

Recommended Posts

Моя версия IPB: 3.2.3

Суть такая никак не получается в шаблон воткнуть мини фото, как на моде в боковой панели последние темы hookRecentTopics

<if test="recenttopics:|:is_array( $topics ) && count( $topics )">
<div class='ipsSideBlock clearfix'>
<h3>{$this->lang->words['recently_added_topics']}</h3>
<div class='_sbcollapsable'>
	<ul class='ipsList_withminiphoto'>
	<foreach loop="topics_hook:$topics as $r">
	<li class='clearfix'>
		<if test="$r['member_id']">
			<a href='{parse url="showuser={$r['member_id']}" seotitle="{$r['members_seo_name']}" template="showuser" base="public"}' title='{$this->lang->words['view_profile']}' class='ipsUserPhotoLink'>
		</if>
		<img src='{$r['pp_mini_photo']}' alt="{parse expression="sprintf($this->lang->words['users_photo'],$r['members_display_name'])"}" class='ipsUserPhoto ipsUserPhoto_mini left' />
		<if test="$r['member_id']">
			</a>
		</if>
		<div class='list_content'>
			<a href='{parse url="showtopic={$r['tid']}" base="public" template="showtopic" seotitle="{$r['title_seo']}"}' rel='bookmark' class='ipsType_small' title='{$this->lang->words['view_topic']}'>{$r['topic_title']}</a>
			<p class='desc ipsType_smaller'>
				<if test="$r['members_display_name']">{parse template="userHoverCard" group="global" params="$r"}<else />{$this->settings['guest_name_pre']}{$r['starter_name']}{$this->settings['guest_name_suf']}</if>
				- {parse date="$r['start_date']" format="short"}
			</p>
		</div>
	</li>
	</foreach>
	</ul>
</div>
</div>
</if>

Вот шаблон последние сообщения

<div class='ipsSideBlock'>
<h3><img src='{$this->settings['img_url']}/comment_new.png' alt='' /> {$this->lang->words['recentposts_title']}</h3>
   <div class='_sbcollapsable'>
	<foreach loop="posts:$recentPosts as $post">
           <div class='ipsBox_container ipsPad'>
           <a href='{parse url="showtopic={$post['tid']}" base="public" seotitle="{$post['title_seo']}" template="showtopic"}'><b>{$post['title']}</b></a> <a href='{parse url="showtopic={$post['tid']}&view=getlastpost" base="public" template="showtopic" seotitle="{$post['title_seo']}"}' title='{$this->lang->words['view_last_post']}'>{parse replacement="f_lastpost"}</a>
           <br/>
           <if test="forum:|:$this->settings['hsc_rp_showforum'] == 1">
           {$this->lang->words['forum']}: <a href='{parse url="showforum={$post['forum_id']}" base="public" seotitle="{$post['forum_name_seo']}" template="showforum"}'>{$post['forum_name']}</a>
           <br/>
           </if>
           <if test="starterInfo:|:$this->settings['hsc_rp_start'] == 1">
           {$this->lang->words['started_by']}: <a href='{parse url="showuser={$post['starter_id']}" base="public" seotitle="{$post['seo_first_name']}" template="showuser"}'>{$post['starter_name']}</a> <span class='date'>({$post['start_date']})</span>
           <br/>
           </if>
           <if test="firstPost:|:$this->settings['hsc_rp_post'] == 'F'">
           {$post['post']}
           <br/>
           </if>
           <if test="views:|:$this->settings['hsc_rp_views'] == 1">
           {$this->lang->words['views']}: {parse format_number="$post['views']"}   {$this->lang->words['replies']}: {parse format_number="$post['posts']"}
           <br/>
           </if>
           <if test="lastPostInfo:|:$this->settings['hsc_rp_last'] == 1">
           {$this->lang->words['last_reply']}: <a href='{parse url="showuser={$post['last_poster_id']}" base="public" seotitle="{$post['seo_last_name']}" template="showuser"}'>{$post['last_poster_name']}</a> <span class='date'>({$post['last_post']})</span>
           <br/>
           </if>
           <if test="lastPost:|:$this->settings['hsc_rp_post'] == 'L' and $post['post']">
           {$post['post']}
           </if>
           </div>
	</foreach>
  </div>
</div>
<br />

Как я понял из мода последние темы, отвечает за это код

<img src='{$r['pp_mini_photo']}' alt="{parse expression="sprintf($this->lang->words['users_photo'],$r['members_display_name'])"}" class='ipsUserPhoto ipsUserPhoto_mini left' />

Вот как я его переделал и вставил, после в шаблон последние сообщения. Но ничего не произошло, то есть окантовка появилось, но ссылки до фото не прописались.

<foreach loop="posts:$recentPosts as $post">

<img src='{$post['pp_mini_photo']}' alt="{parse expression="sprintf($this->lang->words['users_photo'],$post['members_display_name'])"}" class='ipsUserPhoto ipsUserPhoto_mini left' />

То есть, я заменил все $r на $post. Но всё равно попробовал так и так, и ничего не вышло. Не могли бы вы подсказать, из-за чего ничего не получилось?

Share this post


Link to post
Share on other sites

Непосредственно сам мод где? Очевидно, в отличие от "последних тем", он не выполняет IPSMember::buildDisplayData() для массива последних постов, потому фотографий и нет. Но можно добавить.

 

А ваш форум доступен только для белорусов? Хотел посмотреть, что там у вас получилось, а он не откывается. И бот на то же самое жалуется...

  • Upvote 1

Share this post


Link to post
Share on other sites

Вот файл хука, он бесплатный. Так что думаю ничего не нарушаю.

hook.xml

<?xml version="1.0" encoding="utf-8"?>
<hookexport>
 <hookdata>
   <config>
     <hook_name><![CDATA[[HSC] Recent Posts (Sidebar Block)]]></hook_name>
     <hook_desc>Добавляет в боковую панель форума блок с последними сообщениями с форума.</hook_desc>
     <hook_author>Esther Eisner (Русификация от XobotyI)</hook_author>
     <hook_email>esther@headstandconsulting.com</hook_email>
     <hook_website>http://www.headstandconsulting.com</hook_website>
     <hook_update_check/>
     <hook_requirements><![CDATA[a:3:{s:21:"required_applications";a:1:{s:6:"forums";a:3:{s:8:"app_name";s:8:"IP.Board";s:11:"min_version";i:32000;s:11:"max_version";i:0;}}s:20:"hook_php_version_min";s:0:"";s:20:"hook_php_version_max";s:0:"";}]]></hook_requirements>
     <hook_version_human>2.0.0.0</hook_version_human>
     <hook_version_long>2000</hook_version_long>
     <hook_extra_data><![CDATA[a:5:{s:7:"display";a:3:{s:8:"settings";s:213:"Setting groups: [HSC] Recent Posts (Sidebar Block)<br />Settings: Display Last Post Info?, Display Topic Start Info?, Display Topic Viewing Info?, Forums, Groups, Number of Topics, Post Content, Post Content Limit";s:8:"language";s:82:"From forums_public_boards: forum, last_reply, recentposts_title, started_by, views";s:9:"templates";s:29:"From skin_boards: recentPosts";}s:13:"settingGroups";a:1:{s:0:"";s:23:"hsc_recentposts_sidebar";}s:8:"settings";a:8:{s:0:"";s:11:"hsc_rp_last";i:1;s:12:"hsc_rp_start";i:2;s:12:"hsc_rp_views";i:3;s:13:"hsc_rp_forums";i:4;s:13:"hsc_rp_groups";i:5;s:12:"hsc_rp_limit";i:6;s:11:"hsc_rp_post";i:7;s:16:"hsc_rp_postlimit";}s:8:"language";a:1:{s:20:"forums_public_boards";a:5:{s:0:"";s:5:"forum";i:1;s:10:"last_reply";i:2;s:17:"recentposts_title";i:3;s:10:"started_by";i:4;s:5:"views";}}s:9:"templates";a:1:{s:11:"skin_boards";a:1:{s:0:"";s:11:"recentPosts";}}}]]></hook_extra_data>
     <hook_key>hsc_recentposts_sidebar</hook_key>
     <hook_global_caches/>
   </config>
 </hookdata>
 <hookfiles>
   <file>
     <hook_file_real>boardIndexRecentPosts.php</hook_file_real>
     <hook_type>templateHooks</hook_type>
     <hook_classname>boardIndexRecentPosts</hook_classname>
     <hook_data><![CDATA[a:8:{s:12:"dataLocation";s:0:"";s:14:"libApplication";s:0:"";s:15:"classToOverload";s:0:"";s:9:"skinGroup";s:11:"skin_boards";s:12:"skinFunction";s:18:"boardIndexTemplate";s:4:"type";s:7:"foreach";s:2:"id";s:11:"side_blocks";s:8:"position";s:9:"outer.pre";}]]></hook_data>
     <hooks_source><![CDATA[<?php

/*
+--------------------------------------------------------------------------
|   [HSC] Recent Posts (Sidebar Block) 1.0.0.0
|   =============================================
|   by Esther Eisner
|   Copyright 2011 HeadStand Consulting
|   esther@headstandconsulting.com
+--------------------------------------------------------------------------
*/

if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}

class boardIndexRecentPosts
{
   public function __construct()
   {
       $this->registry = ipsRegistry::instance();
       $this->DB = $this->registry->DB();
       $this->settings =& $this->registry->fetchSettings();
       $this->memberData =& $this->registry->member()->fetchMemberData();
   }

   public function getOutput()
   {
       if($this->settings['hsc_rp_groups']!='' && !in_array($this->memberData['member_group_id'],explode(",",$this->settings['hsc_rp_groups'])))
           return '';

       $topics = $this->_getTopics();
       if(!is_array($topics) || !count($topics))
           return '';

       foreach($topics as $id => $t)
       {
           if($this->settings['hsc_rp_post']!='N')
               $topics[$id]['post'] = $this->_formatPost($t['post']);

           $topics[$id]['start_date'] = $this->_formatDate($t['start_date']);
           $topics[$id]['last_post'] = $this->_formatDate($t['last_post']);
       }

       return $this->registry->output->getTemplate('boards')->recentPosts($topics);
   }

   private function _getTopics()
   {
       $forumIds = $this->_loadForumIds();
       if(!is_array($forumIds) || !count($forumIds))
           return '';

       $query = array('select' => 't.*',
                       'from' => array('topics' => 't'),
                       'where' => "t.state='open' and t.approved=1 and t.forum_id in (".implode(",",$forumIds).")",
                       'order' => 't.last_post desc',
                       'limit' => array(0,$this->settings['hsc_rp_limit']));

       $query['add_join'][] = array('select' => 'f.name as forum_name, f.name_seo as forum_name_seo', 'from' => array('forums' => 'f'), 'where' => 't.forum_id=f.id', 'type' => 'left');

       if ($this->settings['hsc_rp_post'] == 'F')
       {
           $query['add_join'][] = array('select' => 'p.pid, p.post',
                                       'from' => array('posts' => 'p'),
                                       'where' => 't.topic_firstpost=p.pid',
                                       'type' => 'left');
       }

       $this->DB->build($query);
       $tQuery = $this->DB->execute();
       while($t = $this->DB->fetch($tQuery))
       {
           if($this->settings['hsc_rp_post']=='L')
           {
               $post = $this->DB->buildAndFetch(array('select' => 'pid,post', 'from' => 'posts', 'where' => 'topic_id='.$t['tid'],
                               'order' => 'post_date desc', 'limit' => array(0,1)));
               $t = array_merge($t,$post);
           }
           $topics[] = $t;
       }

       return $topics;
   }

   private function _formatPost($post)
   {
       // Strip out line breaks or the regex does not work
       $post = preg_replace('/[\n\r]/i','',$post);

       // Strip out quotes
       $post = preg_replace('/\[quote(.*?)\[\/quote\]/i','',$post);

       // Strip out emoticon images
       $post = preg_replace('/<img(.*?)\/>/i','',$post);

       // Strip out other images
       $post = preg_replace('/\[img(.*?)\[\/img\]/i','',$post);

       $post = $this->_parseBBCode($post);

       if($this->settings['hsc_rp_postlimit'] > 0 && strlen($post) > $this->settings['hsc_rp_postlimit'])
           $post = IPSText::truncate($post, $this->settings['hsc_rp_postlimit']);

       $post = strip_tags($post);
       return $post;
   }

   private function _formatDate($date)
   {
       return $this->registry->class_localization->getDate( $date, SHORT );
   }

   private function _parseBBCode($post)
   {
       IPSText::stripAttachTag($post);

       IPSText::getTextClass( 'bbcode' )->parse_smilies			= 1;
       IPSText::getTextClass( 'bbcode' )->parse_html				= 1;
	IPSText::getTextClass( 'bbcode' )->parse_nl2br				= 1;
	IPSText::getTextClass( 'bbcode' )->parse_bbcode				= 1;
	IPSText::getTextClass( 'bbcode' )->parsing_section			= 'topics';
	IPSText::getTextClass( 'bbcode' )->parsing_mgroup			= $this->memberdata['member_group_id'];
	IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others	= $this->memberData['mgroup_others'];

	return IPSText::getTextClass('bbcode')->preDisplayParse( $post );
   }

   private function _loadForumIds()
   {
       $forums = $this->registry->getClass('class_forums')->fetchSearchableForumIds();

       if ($this->settings['hsc_rp_forums'] != '')
       {
           foreach(explode(",",$this->settings['hsc_rp_forums']) as $f)
           {
               if(in_array($f,$forums))
                   $forumIds[] = $f;
           }
           if(!is_array($forumIds) || !count($forumIds))
               return;

           return $forumIds;
       }

       return $forums;
   }
}



?>]]></hooks_source>
   </file>
 </hookfiles>
 <hookextras_settings>
   <setting>
     <conf_is_title>1</conf_is_title>
     <conf_title_title><![CDATA[[HSC] Recent Posts (Sidebar Block)]]></conf_title_title>
     <conf_title_desc>Настройки хука.</conf_title_desc>
     <conf_title_noshow>0</conf_title_noshow>
     <conf_title_keyword>hsc_recentposts_sidebar</conf_title_keyword>
     <conf_title_app>forums</conf_title_app>
     <conf_title_tab>Hooks</conf_title_tab>
   </setting>
   <setting>
     <conf_id>791</conf_id>
     <conf_title>Форумы</conf_title>
     <conf_description><![CDATA[Сообщения тем из указанных форумов попадут в список, в боковой панели.<br>Используйте кнопку Ctrl для множественного выделения.]]></conf_description>
     <conf_group>58</conf_group>
     <conf_type>multi</conf_type>
     <conf_key>hsc_rp_forums</conf_key>
     <conf_value/>
     <conf_default/>
     <conf_extra>#show_forums#</conf_extra>
     <conf_evalphp><![CDATA[$key = 'hsc_rp_forums';
if($save==1)
{
  $_POST[$key] = is_array($_POST[$key]) ? implode(",",$_POST[$key]) : '';
}
if($show==1)
$key .= '[]';]]></conf_evalphp>
     <conf_protected>1</conf_protected>
     <conf_position>2</conf_position>
     <conf_start_group/>
     <conf_add_cache>1</conf_add_cache>
     <conf_keywords/>
     <conf_title_keyword>hsc_recentposts_sidebar</conf_title_keyword>
     <conf_is_title>0</conf_is_title>
   </setting>
   <setting>
     <conf_id>797</conf_id>
     <conf_title>Группы</conf_title>
     <conf_description><![CDATA[Укажите группы пользователей, которые будут видеть блок в боковой панели форума.<br>По умолчанию, все группы видят блок.]]></conf_description>
     <conf_group>58</conf_group>
     <conf_type>multi</conf_type>
     <conf_key>hsc_rp_groups</conf_key>
     <conf_value/>
     <conf_default/>
     <conf_extra>#show_groups#</conf_extra>
     <conf_evalphp><![CDATA[$key = 'hsc_rp_groups';
if($save==1)
{
 $_POST[$key] = is_array($_POST[$key]) ? implode(",",$_POST[$key]) : "";
}
if($show==1)
{
 $key .= '[]';
}]]></conf_evalphp>
     <conf_protected>1</conf_protected>
     <conf_position>9</conf_position>
     <conf_start_group/>
     <conf_add_cache>1</conf_add_cache>
     <conf_keywords/>
     <conf_title_keyword>hsc_recentposts_sidebar</conf_title_keyword>
     <conf_is_title>0</conf_is_title>
   </setting>
   <setting>
     <conf_id>793</conf_id>
     <conf_title>Отображать информацию о сообщении?</conf_title>
     <conf_description>Отобразить/скрыть имя пользователя и время последних сообщений.</conf_description>
     <conf_group>58</conf_group>
     <conf_type>yes_no</conf_type>
     <conf_key>hsc_rp_last</conf_key>
     <conf_value/>
     <conf_default>1</conf_default>
     <conf_extra/>
     <conf_evalphp/>
     <conf_protected>1</conf_protected>
     <conf_position>5</conf_position>
     <conf_start_group/>
     <conf_add_cache>1</conf_add_cache>
     <conf_keywords/>
     <conf_title_keyword>hsc_recentposts_sidebar</conf_title_keyword>
     <conf_is_title>0</conf_is_title>
   </setting>
   <setting>
     <conf_id>790</conf_id>
     <conf_title>Количество сообщений</conf_title>
     <conf_description>Максимальное количество новых сообщений отображающихся в блоке боковой панели.</conf_description>
     <conf_group>58</conf_group>
     <conf_type>input</conf_type>
     <conf_key>hsc_rp_limit</conf_key>
     <conf_value/>
     <conf_default>5</conf_default>
     <conf_extra/>
     <conf_evalphp/>
     <conf_protected>1</conf_protected>
     <conf_position>1</conf_position>
     <conf_start_group/>
     <conf_add_cache>1</conf_add_cache>
     <conf_keywords/>
     <conf_title_keyword>hsc_recentposts_sidebar</conf_title_keyword>
     <conf_is_title>0</conf_is_title>
   </setting>
   <setting>
     <conf_id>795</conf_id>
     <conf_title>Отображать текст</conf_title>
     <conf_description>Shows/hides the content of the first or last post in the topic.</conf_description>
     <conf_group>58</conf_group>
     <conf_type>dropdown</conf_type>
     <conf_key>hsc_rp_post</conf_key>
     <conf_value/>
     <conf_default>L</conf_default>
     <conf_extra>N=Не отображать
F=Первого сообщения
L=Последнего сообщения</conf_extra>
     <conf_evalphp/>
     <conf_protected>1</conf_protected>
     <conf_position>7</conf_position>
     <conf_start_group/>
     <conf_add_cache>1</conf_add_cache>
     <conf_keywords/>
     <conf_title_keyword>hsc_recentposts_sidebar</conf_title_keyword>
     <conf_is_title>0</conf_is_title>
   </setting>
   <setting>
     <conf_id>796</conf_id>
     <conf_title>Максимально символов в превью сообщения</conf_title>
     <conf_description><![CDATA[Максимальное количество символов сообщения которое будет выведено в качестве превью в боковой блок панели.<br>Укажите 0(ноль) для отключения.]]></conf_description>
     <conf_group>58</conf_group>
     <conf_type>input</conf_type>
     <conf_key>hsc_rp_postlimit</conf_key>
     <conf_value/>
     <conf_default>100</conf_default>
     <conf_extra/>
     <conf_evalphp/>
     <conf_protected>1</conf_protected>
     <conf_position>8</conf_position>
     <conf_start_group/>
     <conf_add_cache>1</conf_add_cache>
     <conf_keywords/>
     <conf_title_keyword>hsc_recentposts_sidebar</conf_title_keyword>
     <conf_is_title>0</conf_is_title>
   </setting>
   <setting>
     <conf_id>798</conf_id>
     <conf_title>Отображать информацию о форуме?</conf_title>
     <conf_description>Отображает/скрывает название форума, в которой находится тема.</conf_description>
     <conf_group>58</conf_group>
     <conf_type>yes_no</conf_type>
     <conf_key>hsc_rp_showforum</conf_key>
     <conf_value/>
     <conf_default>1</conf_default>
     <conf_extra/>
     <conf_evalphp/>
     <conf_protected>1</conf_protected>
     <conf_position>3</conf_position>
     <conf_start_group/>
     <conf_add_cache>1</conf_add_cache>
     <conf_keywords/>
     <conf_title_keyword>hsc_recentposts_sidebar</conf_title_keyword>
     <conf_is_title>0</conf_is_title>
   </setting>
   <setting>
     <conf_id>792</conf_id>
     <conf_title>Отображать информацию о теме?</conf_title>
     <conf_description>Отобразить/скрыть автора темы и время создания темы.</conf_description>
     <conf_group>58</conf_group>
     <conf_type>yes_no</conf_type>
     <conf_key>hsc_rp_start</conf_key>
     <conf_value/>
     <conf_default>1</conf_default>
     <conf_extra/>
     <conf_evalphp/>
     <conf_protected>1</conf_protected>
     <conf_position>4</conf_position>
     <conf_start_group/>
     <conf_add_cache>1</conf_add_cache>
     <conf_keywords/>
     <conf_title_keyword>hsc_recentposts_sidebar</conf_title_keyword>
     <conf_is_title>0</conf_is_title>
   </setting>
   <setting>
     <conf_id>794</conf_id>
     <conf_title>Отображать информацию о просмотре темы?</conf_title>
     <conf_description>Отобразить/скрыть информацию о количестве просмотров темы.</conf_description>
     <conf_group>58</conf_group>
     <conf_type>yes_no</conf_type>
     <conf_key>hsc_rp_views</conf_key>
     <conf_value/>
     <conf_default>1</conf_default>
     <conf_extra/>
     <conf_evalphp/>
     <conf_protected>1</conf_protected>
     <conf_position>6</conf_position>
     <conf_start_group/>
     <conf_add_cache>1</conf_add_cache>
     <conf_keywords/>
     <conf_title_keyword>hsc_recentposts_sidebar</conf_title_keyword>
     <conf_is_title>0</conf_is_title>
   </setting>
 </hookextras_settings>
 <hookextras_language>
   <language>
     <word_app>forums</word_app>
     <word_pack>public_boards</word_pack>
     <word_key>forum</word_key>
     <word_default>Форум</word_default>
     <word_custom/>
     <word_js>0</word_js>
   </language>
   <language>
     <word_app>forums</word_app>
     <word_pack>public_boards</word_pack>
     <word_key>views</word_key>
     <word_default>Просмотров</word_default>
     <word_custom/>
     <word_js>0</word_js>
   </language>
   <language>
     <word_app>forums</word_app>
     <word_pack>public_boards</word_pack>
     <word_key>started_by</word_key>
     <word_default>Автор</word_default>
     <word_custom/>
     <word_js>0</word_js>
   </language>
   <language>
     <word_app>forums</word_app>
     <word_pack>public_boards</word_pack>
     <word_key>recentposts_title</word_key>
     <word_default>Последнее сообщение</word_default>
     <word_custom/>
     <word_js>0</word_js>
   </language>
   <language>
     <word_app>forums</word_app>
     <word_pack>public_boards</word_pack>
     <word_key>last_reply</word_key>
     <word_default>Автор сообщения</word_default>
     <word_custom/>
     <word_js>0</word_js>
   </language>
 </hookextras_language>
 <hookextras_modules/>
 <hookextras_help/>
 <hookextras_templates>
   <templates>
     <template_group>skin_boards</template_group>
     <template_content><![CDATA[<div class='ipsSideBlock'>
<h3><img src='{$this->settings['img_url']}/comment_new.png' alt='' /> {$this->lang->words['recentposts_title']}</h3>
   <div class='_sbcollapsable'>
	<foreach loop="posts:$recentPosts as $post">
           <div class='ipsBox_container ipsPad'>
           <a href='{parse url="showtopic={$post['tid']}" base="public" seotitle="{$post['title_seo']}" template="showtopic"}'><b>{$post['title']}</b></a> <a href='{parse url="showtopic={$post['tid']}&view=getlastpost" base="public" template="showtopic" seotitle="{$post['title_seo']}"}' title='{$this->lang->words['view_last_post']}'>{parse replacement="f_lastpost"}</a>
           <br/>
           <if test="forum:|:$this->settings['hsc_rp_showforum'] == 1">
           {$this->lang->words['forum']}: <a href='{parse url="showforum={$post['forum_id']}" base="public" seotitle="{$post['forum_name_seo']}" template="showforum"}'>{$post['forum_name']}</a>
           <br/>
           </if>
           <if test="starterInfo:|:$this->settings['hsc_rp_start'] == 1">
           {$this->lang->words['started_by']}: <a href='{parse url="showuser={$post['starter_id']}" base="public" seotitle="{$post['seo_first_name']}" template="showuser"}'>{$post['starter_name']}</a> <span class='date'>({$post['start_date']})</span>
           <br/>
           </if>
           <if test="firstPost:|:$this->settings['hsc_rp_post'] == 'F'">
           {$post['post']}
           <br/>
           </if>
           <if test="views:|:$this->settings['hsc_rp_views'] == 1">
           {$this->lang->words['views']}: {parse format_number="$post['views']"}   {$this->lang->words['replies']}: {parse format_number="$post['posts']"}
           <br/>
           </if>
           <if test="lastPostInfo:|:$this->settings['hsc_rp_last'] == 1">
           {$this->lang->words['last_reply']}: <a href='{parse url="showuser={$post['last_poster_id']}" base="public" seotitle="{$post['seo_last_name']}" template="showuser"}'>{$post['last_poster_name']}</a> <span class='date'>({$post['last_post']})</span>
           <br/>
           </if>
           <if test="lastPost:|:$this->settings['hsc_rp_post'] == 'L' and $post['post']">
           {$post['post']}
           </if>
           </div>
	</foreach>
  </div>
</div>
<br />]]></template_content>
     <template_name>recentPosts</template_name>
     <template_data>$recentPosts</template_data>
     <template_updated>1312951434</template_updated>
     <template_removable>1</template_removable>
     <template_added_to>1</template_added_to>
     <template_user_added>1</template_user_added>
     <template_user_edited>1</template_user_edited>
     <template_master_key/>
   </templates>
 </hookextras_templates>
 <hookextras_css/>
 <hookextras_tasks/>
 <hookextras_database_create/>
 <hookextras_database_alter/>
 <hookextras_database_update/>
 <hookextras_database_insert/>
</hookexport>

Share this post


Link to post
Share on other sites

From this:

        while($t = $this->DB->fetch($tQuery))
       {
           if($this->settings['hsc_rp_post']=='L')
           {
               $post = $this->DB->buildAndFetch(array('select' => 'pid,post', 'from' => 'posts', 'where' => 'topic_id='.$t['tid'],
                               'order' => 'post_date desc', 'limit' => array(0,1)));
               $t = array_merge($t,$post);
           }
           $topics[] = $t;
       }

 

To this:

        while($t = $this->DB->fetch($tQuery))
       {
           if($this->settings['hsc_rp_post']=='L')
           {
               $post = $this->DB->buildAndFetch(array('select' => 'pid,post', 'from' => 'posts', 'where' => 'topic_id='.$t['tid'],
                               'order' => 'post_date desc', 'limit' => array(0,1)));
               $t = array_merge($t,$post);
           }
           $topics[] = IPSMember::buildDisplayData( $t );
       }

  • Upvote 3

Share this post


Link to post
Share on other sites

Всем добрый день, столкнулся с аналогичной проблемой. Привел мод "новые сообщения" к более красивому виду, сделал все по советам этой темы, выглядит примерно так:

 

vgnkNd8.png

 

 

Но возникает проблема, как видно на скрине, не отображается аватар автора последнего сообщения.

Вчера на сонную голову пришла мысль вставлять переменную, отвечающуюю за ID автора последнего сообщения в код <img>, однако расширения аватаров профиля у всех разные.

Как решить данную проблему?

Заранее, спасибо за ответ.

Edited by mklist

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...