[OLD] Top Five
-
d3ath2435
Извън линия - Рекламатор
- Мнения: 545
- Регистриран на: 04 Фев 2017, 19:59
- Се отблагодари: 64 пъти
- Получена благодарност: 127 пъти
- Обратна връзка:
Re: [EXT] Top Five
Ами да може да кажеш как да ги изкарам и тях
П.С.: Ако може някой да помогне да изкарам и аватарите и в трите раздела, ако няма аватар аз съм задал автоматично да слага аватар на всеки протребител.
П.С.: Ако може някой да помогне да изкарам и аватарите и в трите раздела, ако няма аватар аз съм задал автоматично да слага аватар на всеки протребител.
-
cgozzie
Извън линия - Потребител
- Мнения: 1319
- Регистриран на: 13 Окт 2016, 22:10
- Местоположение: Варна
- Се отблагодари: 245 пъти
- Получена благодарност: 43 пъти
Re: [EXT] Top Five
Дай си кода от топ файв topfive_body.html там също трябва да се зададе {top_five_active.USER_AVATAR} за да ти излезе аватара.
-
d3ath2435
Извън линия - Рекламатор
- Мнения: 545
- Регистриран на: 04 Фев 2017, 19:59
- Се отблагодари: 64 пъти
- Получена благодарност: 127 пъти
- Обратна връзка:
Re: [EXT] Top Five
Код за потвърждение: Избери целия код
<a class="category<!-- IF S_TOPFIVE_HIDDEN --> hidden-category<!-- ENDIF -->" style="display: none; height: 0"></a>
<div class="forabg responsive-hide" id="top_five">
<div class="inner">
<ul class="topiclist">
<li class="header">
<dl>
<dt><div class="list-inner"><span style="background: #7ba60d; vertical-align: middle; display: inline-block; height: 16px; line-height: 16px; padding: 0 5px; font-size: 11px; font-weight: bold; text-transform: uppercase; color: #fff; text-shadow: rgba(0,0,0,0.2) 0px -1px 0px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-repeat: repeat-x; background-position: 0 -1px;}">{L_NEWEST_TOPICS}</span></div></dt>
<dd class="topics tf-active-header"><span style="background: #7ba60d; vertical-align: middle; display: inline-block; height: 16px; line-height: 16px; padding: 0 5px; font-size: 11px; font-weight: bold; text-transform: uppercase; color: #fff; text-shadow: rgba(0,0,0,0.2) 0px -1px 0px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-repeat: repeat-x; background-position: 0 -1px;}">{L_TOP_FIVE_ACTIVE}</span></dd>
<dd class="lastpost"><span style="background: #7ba60d; vertical-align: middle; display: inline-block; height: 16px; line-height: 16px; padding: 0 5px; font-size: 11px; font-weight: bold; text-transform: uppercase; color: #fff; text-shadow: rgba(0,0,0,0.2) 0px -1px 0px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-repeat: repeat-x; background-position: 0 -1px;}">{L_TOP_FIVE_NEWEST}</span></dd>
</dl>
<!-- IF U_TOPFIVE_COLLAPSE_URL --><a href="{U_TOPFIVE_COLLAPSE_URL}" class="collapse-btn collapse-<!-- IF S_TOPFIVE_HIDDEN -->show<!-- ELSE -->hide<!-- ENDIF -->" data-hidden="{S_TOPFIVE_HIDDEN}" data-ajax="phpbb_collapse" data-overlay="true" title="{L_COLLAPSIBLE_CATEGORIES_TITLE}" style="display: none; line-height: 0;"></a><!-- ENDIF -->
</li>
</ul>
<ul class="topiclist forums">
<li class="row">
<dl>
<dt>
<div class="list-inner">
<ul>
<!-- BEGIN top_five_topic -->
<li>
<!-- IF top_five_topic.NO_TOPIC_TITLE-->
{top_five_topic.NO_TOPIC_TITLE}
<!-- ELSE -->
<a href="{top_five_topic.U_TOPIC}" class="topictitle subforum<!-- IF top_five_topic.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->">{top_five_topic.TOPIC_TITLE}</a><span class="meta">{top_five_topic.USERNAME_FULL} » {top_five_topic.LAST_TOPIC_TIME} </span><hr>
<!-- EVENT rmcgirr83_top_five_topiclist_row_append -->
<!-- ENDIF -->
</li>
<!-- END top_five_topic -->
</ul>
</div>
</dt>
<dd class="topics tf-most-active">
<ul>
<!-- BEGIN top_five_active -->
<li>
<span class="meta">{top_five_active.USERNAME_FULL}<span><br /> {L_POSTS}{L_COLON} <a href="{top_five_active.S_SEARCH_ACTION}">{top_five_active.POSTS}</a></span></span><hr>
</li>
<!-- END top_five_active -->
</ul>
</dd>
<dd class="lastpost tf-newest"><span>
<ul>
<!-- BEGIN top_five_newest -->
<li>
<span class="meta">{top_five_newest.USERNAME_FULL}<span><br /> {L_JOINED}{L_COLON} {top_five_newest.REG_DATE}</span></span><hr>
</li>
<!-- END top_five_newest -->
</ul>
</span></dd>
</dl>
</li>
</ul>
</div>
</div>
-
cgozzie
Извън линия - Потребител
- Мнения: 1319
- Регистриран на: 13 Окт 2016, 22:10
- Местоположение: Варна
- Се отблагодари: 245 пъти
- Получена благодарност: 43 пъти
Re: [EXT] Top Five
Направи си копие на сегащтния файл някаде да го имаш за да тестваме и презамести с този код.
Този topfive.php също го презамести с сегащтния ти.Намира се в rmcgirr83/topfive/core/topfive.php
И пиши как е ..
Код за потвърждение: Избери целия код
<a class="category<!-- IF S_TOPFIVE_HIDDEN --> hidden-category<!-- ENDIF -->" style="display: none; height: 0"></a>
<div class="forabg responsive-hide" id="top_five">
<div class="inner">
<ul class="topiclist">
<li class="header">
<dl>
<dt><div class="list-inner"><span style="background: #7ba60d; vertical-align: middle; display: inline-block; height: 16px; line-height: 16px; padding: 0 5px; font-size: 11px; font-weight: bold; text-transform: uppercase; color: #fff; text-shadow: rgba(0,0,0,0.2) 0px -1px 0px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-repeat: repeat-x; background-position: 0 -1px;}">{L_NEWEST_TOPICS}</span></div></dt>
<dd class="topics tf-active-header"><span style="background: #7ba60d; vertical-align: middle; display: inline-block; height: 16px; line-height: 16px; padding: 0 5px; font-size: 11px; font-weight: bold; text-transform: uppercase; color: #fff; text-shadow: rgba(0,0,0,0.2) 0px -1px 0px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-repeat: repeat-x; background-position: 0 -1px;}">{L_TOP_FIVE_ACTIVE}</span></dd>
<dd class="lastpost"><span style="background: #7ba60d; vertical-align: middle; display: inline-block; height: 16px; line-height: 16px; padding: 0 5px; font-size: 11px; font-weight: bold; text-transform: uppercase; color: #fff; text-shadow: rgba(0,0,0,0.2) 0px -1px 0px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; background-repeat: repeat-x; background-position: 0 -1px;}">{L_TOP_FIVE_NEWEST}</span></dd>
</dl>
<!-- IF U_TOPFIVE_COLLAPSE_URL --><a href="{U_TOPFIVE_COLLAPSE_URL}" class="collapse-btn collapse-<!-- IF S_TOPFIVE_HIDDEN -->show<!-- ELSE -->hide<!-- ENDIF -->" data-hidden="{S_TOPFIVE_HIDDEN}" data-ajax="phpbb_collapse" data-overlay="true" title="{L_COLLAPSIBLE_CATEGORIES_TITLE}" style="display: none; line-height: 0;"></a><!-- ENDIF -->
</li>
</ul>
<ul class="topiclist forums">
<li class="row">
<dl>
<dt>
<div class="list-inner">
<ul>
<!-- BEGIN top_five_topic -->
<li>
<!-- IF top_five_topic.NO_TOPIC_TITLE-->
{top_five_topic.NO_TOPIC_TITLE}
<!-- ELSE -->
<a href="{top_five_topic.U_TOPIC}" class="topictitle subforum<!-- IF top_five_topic.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->">{top_five_topic.TOPIC_TITLE}</a><span class="meta">{top_five_topic.USERNAME_FULL} » {top_five_topic.LAST_TOPIC_TIME} </span><hr>
<!-- EVENT rmcgirr83_top_five_topiclist_row_append -->
<!-- ENDIF -->
</li>
<!-- END top_five_topic -->
</ul>
</div>
</dt>
<dd class="topics tf-most-active">
<ul>
<!-- BEGIN top_five_active -->
<li>
<span class="meta"><div style="float:left;position:absolute;margin-left:2%;margin-top:-1px;">{top_five_active.USER_AVATAR}</div><div style="float:left;margin-left:28%;"> {top_five_active.USERNAME_FULL}</div><span><br /> {L_POSTS}{L_COLON} <a href="{top_five_active.S_SEARCH_ACTION}">{top_five_active.POSTS}</a></span></span><hr>
</li>
<!-- END top_five_active -->
</ul>
</dd>
<dd class="lastpost tf-newest"><span>
<ul>
<!-- BEGIN top_five_newest -->
<li>
<span class="meta">{top_five_newest.USERNAME_FULL}<span><br /> {L_JOINED}{L_COLON} {top_five_newest.REG_DATE}</span></span><hr>
</li>
<!-- END top_five_newest -->
</ul>
</span></dd>
</dl>
</li>
</ul>
</div>
</div>
Този topfive.php също го презамести с сегащтния ти.Намира се в rmcgirr83/topfive/core/topfive.php
Код за потвърждение: Избери целия код
<?php
/**
*
* @package Top Five
* @copyright (c) 2014 RMcGirr83
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*
*/
namespace rmcgirr83\topfive\core;
class topfive
{
/** @var \phpbb\auth\auth */
protected $auth;
/** @var \phpbb\config\config */
protected $config;
/** @var \phpbb\cache\driver\driver_interface */
protected $cache;
/** @var \phpbb\content_visibility */
protected $content_visibility;
/** @var \phpbb\db\driver\driver_interface */
protected $db;
/** @var \phpbb\event\dispatcher_interface */
protected $dispatcher;
/** @var \phpbb\template\template */
protected $template;
/** @var \phpbb\user */
protected $user;
/** @var string phpBB root path */
protected $phpbb_root_path;
/** @var string PHP extension */
protected $php_ext;
public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\cache\service $cache, \phpbb\content_visibility $content_visibility, \phpbb\db\driver\driver_interface $db, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\template\template $template, \phpbb\user $user, $phpbb_root_path, $php_ext)
{
$this->auth = $auth;
$this->config = $config;
$this->cache = $cache;
$this->content_visibility = $content_visibility;
$this->db = $db;
$this->dispatcher = $dispatcher;
$this->template = $template;
$this->user = $user;
$this->root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
}
public function toptopics($tpl_loopname = 'top_five_topic')
{
$howmany = $this->howmany();
$forum_ary = array();
$forum_read_ary = $this->auth->acl_getf('f_read');
foreach ($forum_read_ary as $forum_id => $allowed)
{
if ($allowed['f_read'])
{
$forum_ary[] = (int) $forum_id;
}
}
$forum_ary = array_unique($forum_ary);
if (sizeof($forum_ary))
{
/**
* Select topic_ids
*/
$sql = 'SELECT forum_id, topic_id, topic_type
FROM ' . TOPICS_TABLE . '
WHERE ' . $this->db->sql_in_set('forum_id', $forum_ary) . '
AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $forum_ary) . '
AND topic_status <> ' . ITEM_MOVED . '
ORDER BY topic_last_post_time DESC';
$result = $this->db->sql_query_limit($sql, $howmany);
$forums = $ga_topic_ids = $topic_ids = array();
while ($row = $this->db->sql_fetchrow($result))
{
$topic_ids[] = $row['topic_id'];
if ($row['topic_type'] == POST_GLOBAL)
{
$ga_topic_ids[] = $row['topic_id'];
}
else
{
$forums[$row['forum_id']][] = $row['topic_id'];
}
}
$this->db->sql_freeresult($result);
// Get topic tracking
$topic_ids_ary = $topic_ids;
$topic_tracking_info = array();
foreach ($forums as $forum_id => $topic_ids)
{
$topic_tracking_info[$forum_id] = get_complete_topic_tracking($forum_id, $topic_ids, $ga_topic_ids);
}
$topic_ids = $topic_ids_ary;
unset($topic_ids_ary);
// grab all posts that meet criteria and auths
$sql_array = array(
'SELECT' => 'u.user_id, u.username, u.user_colour, t.topic_title, t.forum_id, t.topic_id, t.topic_first_post_id, t.topic_last_post_id, t.topic_last_post_time,t.topic_status, t.topic_last_poster_name',
'FROM' => array(TOPICS_TABLE => 't'),
'LEFT_JOIN' => array(
array(
'FROM' => array(USERS_TABLE => 'u'),
'ON' => 't.topic_last_poster_id = u.user_id',
),
),
'WHERE' => $this->db->sql_in_set('t.topic_id', $topic_ids),
'ORDER_BY' => 't.topic_last_post_time DESC',
);
/**
* Event to modify the SQL query before the topics data is retrieved
*
* @event rmcgirr83.topfive.sql_pull_topics_data
* @var array sql_array The SQL array
* @since 1.0.0
*/
$vars = array('sql_array');
extract($this->dispatcher->trigger_event('rmcgirr83.topfive.sql_pull_topics_data', compact($vars)));
$result = $this->db->sql_query_limit($this->db->sql_build_query('SELECT', $sql_array), $howmany);
while( $row = $this->db->sql_fetchrow($result) )
{
$topic_id = $row['topic_id'];
$forum_id = $row['forum_id'];
$lock = $row['topic_status'];
if($lock ==1) {
$lock = "<img src='http://csdm.pro/images/lock.png' alt='' height='14' width='14' style='vertical-align:middle'/> ";
} else {
$lock = "";
}
$post_unread = (isset($topic_tracking_info[$forum_id][$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$topic_id]) ? true : false;
$view_topic_url = append_sid("{$this->phpbb_root_path}viewtopic.$this->php_ext", 'f=' . $row['forum_id'] . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id']);
$topic_title = censor_text($row['topic_title']);
if (utf8_strlen($topic_title) >= 60)
{
$topic_title = (utf8_strlen($topic_title) > 60 + 3) ? utf8_substr($topic_title, 0, 60) . '...' : $topic_title;
}
$is_guest = $row['user_id'] != ANONYMOUS ? false : true;
$tpl_ary = array(
'U_TOPIC' => $view_topic_url,
'MINI_POST_IMG' => ($post_unread) ? $this->user->img('icon_post_target_unread', 'NEW_POST') : $this->user->img('icon_post_target', 'POST'),
'USERNAME_FULL' => $is_guest ? $this->user->lang['POST_BY_AUTHOR'] . ' ' . get_username_string('no_profile', $row['user_id'], $row['username'], $row['user_colour'], $row['topic_last_poster_name']) : $this->user->lang['POST_BY_AUTHOR'] . ' ' . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'LAST_TOPIC_TIME' => $this->user->format_date($row['topic_last_post_time']),
'TOPIC_TITLE' => $lock . $topic_title,
);
/**
* Modify the topic data before it is assigned to the template
*
* @event rmcgirr83.topfive.modify_tpl_ary
* @var array row Array with topic data
* @var array tpl_ary Template block array with topic data
* @since 1.0.0
*/
$vars = array('row', 'tpl_ary');
extract($this->dispatcher->trigger_event('rmcgirr83.topfive.modify_tpl_ary', compact($vars)));
$this->template->assign_block_vars($tpl_loopname, $tpl_ary);
}
$this->db->sql_freeresult($result);
}
else
{
$this->template->assign_block_vars($tpl_loopname, array(
'NO_TOPIC_TITLE' => $this->user->lang['NO_TOPIC_EXIST'],
));
}
}
public function topposters()
{
$howmany = $this->howmany();
$sql_where = $this->ignore_users();
//set two variables for the sql
$sql_and = $sql_other = '';
if (($user_posts = $this->cache->get('_top_five_posters')) === false)
{
$user_posts = $admin_mod_array = array();
// quick check for forum moderators and administrators
// some may not want to show them
$show_admins_mods = $this->config['top_five_show_admins_mods'];
if (!$show_admins_mods)
{
// grab all admins
$admin_ary = $this->auth->acl_get_list(false, 'a_', false);
$admin_ary = (!empty($admin_ary[0]['a_'])) ? $admin_ary[0]['a_'] : array();
//grab all mods
$mod_ary = $this->auth->acl_get_list(false,'m_', false);
$mod_ary = (!empty($mod_ary[0]['m_'])) ? $mod_ary[0]['m_'] : array();
$admin_mod_array = array_unique(array_merge($admin_ary,$mod_ary));
if(sizeof($admin_mod_array))
{
$sql_and = empty($sql_where) ? ' WHERE ' . $this->db->sql_in_set('user_id', $admin_mod_array, true) : ' AND ' . $this->db->sql_in_set('user_id', $admin_mod_array, true);
}
}
$sql_other = (empty($sql_and) && empty($sql_where)) ? ' WHERE user_posts <> 0 ' : ' AND user_posts <> 0';
// do the main sql query
$sql = 'SELECT user_id, username, user_colour, user_posts,user_avatar, user_avatar_width, user_avatar_height, user_avatar_type
FROM ' . USERS_TABLE . '
' . $sql_where . ' ' . $sql_and . '
' . $sql_other . '
ORDER BY user_posts DESC';
$result = $this->db->sql_query_limit($sql, $howmany);
while ($row = $this->db->sql_fetchrow($result))
{
$user_posts[$row['user_id']] = array(
'user_id' => $row['user_id'],
'username' => $row['username'],
'user_colour' => $row['user_colour'],
'user_posts' => $row['user_posts'],
'user_avatar' => $row['user_avatar'],
'user_avatar_type' => $row['user_avatar_type'],
'user_avatar_width' => $row['user_avatar_width'],
'user_avatar_height' => $row['user_avatar_height'],
);
}
$this->db->sql_freeresult($result);
// cache this data for 5 minutes, this improves performance
$this->cache->put('_top_five_posters', $user_posts, 300);
}
foreach ($user_posts as $row)
{
$username_string = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
$this->template->assign_block_vars('top_five_active',array(
'S_SEARCH_ACTION' => append_sid("{$this->phpbb_root_path}search.$this->php_ext", 'author_id=' . $row['user_id'] . '&sr=posts'),
'POSTS' => number_format($row['user_posts']),
'USERNAME_FULL' => $username_string,
'USER_AVATAR' => !empty($row['user_avatar']) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 27 : (27 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 27 : (27 / $row['user_avatar_width']) * $row['user_avatar_height']) : '<img src="http://csdm.pro/images/avatars/gallery/no_avatar_hd.png" alt="" width="27" height="27"/>',
));
}
}
public function newusers()
{
$howmany = $this->howmany();
$sql_where = $this->ignore_users();
$sql_and = !empty($sql_where) ? ' AND user_inactive_reason = 0' : ' WHERE user_inactive_reason = 0';
// newest registered users
if (($newest_users = $this->cache->get('_top_five_newest_users')) === false)
{
$newest_users = array();
// grab most recent registered users
$sql = 'SELECT user_id, username, user_colour, user_regdate
FROM ' . USERS_TABLE . '
' . $sql_where . '
' . $sql_and . '
ORDER BY user_regdate DESC';
$result = $this->db->sql_query_limit($sql, $howmany);
while ($row = $this->db->sql_fetchrow($result))
{
$newest_users[$row['user_id']] = array(
'user_id' => $row['user_id'],
'username' => $row['username'],
'user_colour' => $row['user_colour'],
'user_regdate' => $row['user_regdate'],
);
}
$this->db->sql_freeresult($result);
// cache this data for 5 minutes, this improves performance
$this->cache->put('_top_five_newest_users', $newest_users, 300);
}
foreach ($newest_users as $row)
{
$username_string = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
$this->template->assign_block_vars('top_five_newest',array(
'REG_DATE' => $this->user->format_date($row['user_regdate']),
'USERNAME_FULL' => $username_string,
));
}
}
private function howmany()
{
$howmany = $this->config['top_five_how_many'];
return (int) $howmany;
}
private function ignore_users()
{
// an array of user types we dont' bother with
$ignore_users = $ignore_founders = array();
if ($this->config['top_five_ignore_inactive_users'])
{
$ignore_users = array(USER_IGNORE, USER_INACTIVE);
}
if ($this->config['top_five_ignore_founder'])
{
$ignore_founders = array(USER_FOUNDER);
}
$ignore_users = array_merge($ignore_users, $ignore_founders);
// Do we have anyone we want to ignore
$sql_where = '';
if (sizeof($ignore_users))
{
$sql_where = 'WHERE ' . $this->db->sql_in_set('user_type', $ignore_users, true);
}
return $sql_where;
}
}
Кой е на линия
Потребители разглеждащи този форум: 0 регистрирани и 16 госта