Магазин
Правила Ответы на вопросы Конфиденциальность
Магазин
Правила Ответы на вопросы Конфиденциальность
  • Быстрые действия Ярлыки
    Общие действия
    Связаться с администрацией
    • Бот

       

Вопросы, ответы и примеры решений

  • Список форумов
  • ppkBB3cker
  • Вопросы, ответы и примеры решений

Модуль recent_center.html

11 сообщений
  • 1
  • 2
  • След.
Просмотры: 870 • 
bard0962
Благодаривший
Сообщения: 33
Зарегистрирован: 01 июн 2012, 20:31
Сообщение 29 июл 2015, 21:17
Уважаемые форумчане подскажите как добавить вывод даты в этом модуле?

Пробовал ставить коды из всех модулей,но результата нет.За ранее спасибо.
bard0962
Аватара пользователя
PPK
Администратор
Сообщения: 10514
Зарегистрирован: 21 мар 2009, 17:13
Сообщение 31 июл 2015, 15:53
portal/modules/portal_recent.php после

Код: Выделить всё

		global $config, $template, $db, $auth, $phpbb_root_path
вставить

Код: Выделить всё

, $user
после (в 3 местах)

Код: Выделить всё

$sql = 'SELECT topic_title, forum_id, topic_id
вставить

Код: Выделить всё

, topic_time
после (в 3 местах)

Код: Выделить всё

					'FULL_TITLE'	=> censor_text($row['topic_title']),
добавить

Код: Выделить всё

					'TOPIC_TIME'	=> $user->format_date($row['topic_time'], 'd-M'),
/styles/название_стиля/template/portal/modules/recent_center.html удалить

Код: Выделить всё

portal-navigation
заменить

Код: Выделить всё

<a href="{latest_announcements.U_VIEW_TOPIC}" title="{latest_announcements.FULL_TITLE}">{latest_announcements.TITLE}</a>
на

Код: Выделить всё

{latest_announcements.TOPIC_TIME}&nbsp;<a href="{latest_announcements.U_VIEW_TOPIC}" title="{latest_announcements.FULL_TITLE}">{latest_announcements.TITLE}</a><br />
заменить

Код: Выделить всё

<a href="{latest_hot_topics.U_VIEW_TOPIC}" title="{latest_hot_topics.FULL_TITLE}">{latest_hot_topics.TITLE}</a>
на

Код: Выделить всё

{latest_hot_topics.TOPIC_TIME}&nbsp;<a href="{latest_hot_topics.U_VIEW_TOPIC}" title="{latest_hot_topics.FULL_TITLE}">{latest_hot_topics.TITLE}</a><br />
заменить

Код: Выделить всё

<a href="{latest_topics.U_VIEW_TOPIC}" title="{latest_topics.FULL_TITLE}">{latest_topics.TITLE}</a>
на

Код: Выделить всё

{latest_topics.TOPIC_TIME}&nbsp;<a href="{latest_topics.U_VIEW_TOPIC}" title="{latest_topics.FULL_TITLE}">{latest_topics.TITLE}</a><br />
PPK
bard0962
Благодаривший
Сообщения: 33
Зарегистрирован: 01 июн 2012, 20:31
Сообщение 31 июл 2015, 16:35
Спасибо за ответ,но портал к сожалению отключился и пишет общую ошибку базы данных.
bard0962
Аватара пользователя
PPK
Администратор
Сообщения: 10514
Зарегистрирован: 21 мар 2009, 17:13
Сообщение 31 июл 2015, 17:22
значит неправильно что-то делаете ..
PPK
bard0962
Благодаривший
Сообщения: 33
Зарегистрирован: 01 июн 2012, 20:31
Сообщение 31 июл 2015, 17:26
PPK писал(а):portal-navigation
portal-navigation этого нет в html,соблюдал все запятые

Код: Выделить всё

<!-- IF .latest_announcements or .latest_hot_topics or .latest_topics -->
{$C_BLOCK_H_L}{$TITLE}{$C_BLOCK_H_R}
<table class="tablebg" cellspacing="1" width="100%">
	<tr>
		<!-- IF .latest_announcements --><td class="row1"><strong>{L_PORTAL_RECENT_ANN}</strong></td><!-- ENDIF -->
		<!-- IF .latest_hot_topics --><td class="row1"><strong>{L_PORTAL_RECENT_HOT_TOPIC}</strong></td><!-- ENDIF -->
		<!-- IF .latest_topics --><td class="row1"><strong>{L_PORTAL_RECENT_TOPIC}</strong></td><!-- ENDIF -->
	</tr>
	<tr>
		<!-- IF .latest_announcements -->
		<td class="row1" width="33%" valign="top">
			<!-- BEGIN latest_announcements -->
						<a href="{latest_announcements.U_VIEW_TOPIC}" title="{latest_announcements.FULL_TITLE}">{latest_announcements.TITLE}</a><br />
			<!-- END latest_announcements -->
		</td>
		<!-- ENDIF -->
		<!-- IF .latest_hot_topics -->
		<td class="row1" width="33%" valign="top">
			<!-- BEGIN latest_hot_topics -->
				<a href="{latest_hot_topics.U_VIEW_TOPIC}" title="{latest_hot_topics.FULL_TITLE}">{latest_hot_topics.TITLE}</a><br />
			<!-- END latest_hot_topics -->
		</td>
		<!-- ENDIF -->
		<!-- IF .latest_topics -->
		<td class="row1" width="33%" valign="top">
			<!-- BEGIN latest_topics -->
				<a href="{latest_topics.U_VIEW_TOPIC}" title="{latest_topics.FULL_TITLE}">{latest_topics.TITLE}</a><br />
			<!-- END latest_topics -->
		</td>
		<!-- ENDIF -->
	</tr>
</table>
{$C_BLOCK_F_L}{$C_BLOCK_F_R}
<!-- ENDIF -->
Последний раз редактировалось bard0962 31 июл 2015, 17:26, всего редактировалось 1 раз.
bard0962
Аватара пользователя
PPK
Администратор
Сообщения: 10514
Зарегистрирован: 21 мар 2009, 17:13
Сообщение 31 июл 2015, 17:39
нет - значит можно не удалять, ошибка бд в любом случае не от правки этого файла, а от первого ..
PPK
bard0962
Благодаривший
Сообщения: 33
Зарегистрирован: 01 июн 2012, 20:31
Сообщение 31 июл 2015, 17:41
Попробую еще
bard0962
Аватара пользователя
PPK
Администратор
Сообщения: 10514
Зарегистрирован: 21 мар 2009, 17:13
Сообщение 31 июл 2015, 17:42
содержание первого файла дайте..
PPK
bard0962
Благодаривший
Сообщения: 33
Зарегистрирован: 01 июн 2012, 20:31
Сообщение 31 июл 2015, 17:47

Код: Выделить всё

<?php
/**
*
* @package Board3 Portal v2 - Recent
* @copyright (c) Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* @package Recent
*/
class portal_recent_module
{
	/**
	* Allowed columns: Just sum up your options (Exp: left + right = 10)
	* top		1
	* left		2
	* center	4
	* right		8
	* bottom	16
	*/
	public $columns = 21;

	/**
	* Default modulename
	*/
	public $name = 'PORTAL_RECENT';

	/**
	* Default module-image:
	* file must be in "{T_THEME_PATH}/images/portal/"
	*/
	public $image_src = '';

	/**
	* module-language file
	* file must be in "language/{$user->lang}/mods/portal/"
	*/
	public $language = 'portal_recent_module';

	/**
	* custom acp template
	* file must be in "adm/style/portal/"
	*/
	public $custom_acp_tpl = '';

	public function get_template_center($module_id)
	{
		global $config, $template, $db, $auth, $phpbb_root_path, $user, $phpEx;

		//
		// Exclude forums
		//
		$sql_where = '';
		if ($config['board3_recent_forum_' . $module_id] > 0)
		{
			$exclude_forums = explode(',', $config['board3_recent_forum_' . $module_id]);

			$sql_where = ' AND ' . $db->sql_in_set('forum_id', array_map('intval', $exclude_forums), ($config['board3_recent_exclude_forums_' . $module_id]) ? true : false);
		}

		// Get a list of forums the user cannot read
		$forum_ary = array_unique(array_keys($auth->acl_getf('!f_read', true)));

		// Determine first forum the user is able to read (must not be a category)
		$sql = 'SELECT forum_id
			FROM ' . FORUMS_TABLE . '
			WHERE forum_type = ' . FORUM_POST;

		$forum_sql = '';
		if (sizeof($forum_ary))
		{
			$sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true);
			$forum_sql = ' AND ' . $db->sql_in_set('t.forum_id', $forum_ary, true);
		}

		$result = $db->sql_query_limit($sql, 1);
		$g_forum_id = (int) $db->sql_fetchfield('forum_id');
		$db->sql_freeresult($result);

		//
		// Recent announcements
		//
		$sql = 'SELECT topic_title, forum_id, topic_id
			FROM ' . TOPICS_TABLE . ' t
			WHERE topic_status <> ' . FORUM_LINK . '
				AND topic_approved = 1 
				AND (topic_type = ' . POST_ANNOUNCE . ' OR topic_type = ' . POST_GLOBAL . ')
				AND topic_moved_id = 0
				' . $sql_where . '' .  $forum_sql . '
			ORDER BY topic_time DESC';
		$result = $db->sql_query_limit($sql, $config['board3_max_topics_' . $module_id]);

		while(($row = $db->sql_fetchrow($result)) && ($row['topic_title']))
		{
			// auto auth
			if (($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
			{
				$template->assign_block_vars('latest_announcements', array(
					'TITLE'			=> character_limit($row['topic_title'], $config['board3_recent_title_limit_' . $module_id]),
					'FULL_TITLE'	=> censor_text($row['topic_title']),
					'TOPIC_TIME'   => $user->format_date($row['topic_time'], 'd-M'),
					'U_VIEW_TOPIC'	=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id'] == 0) ? $g_forum_id : $row['forum_id']) . '&t=' . $row['topic_id'])
				));
			}
		}
		$db->sql_freeresult($result);

		//
		// Recent hot topics
		//
		$sql = 'SELECT topic_title, forum_id, topic_id, topic_time
			FROM ' . TOPICS_TABLE . ' t
			WHERE topic_approved = 1 
				AND topic_replies >=' . $config['hot_threshold'] . '
				AND topic_moved_id = 0
				' . $sql_where . '' .  $forum_sql . '
			ORDER BY topic_time DESC';
		$result = $db->sql_query_limit($sql, $config['board3_max_topics_' . $module_id]);

		while(($row = $db->sql_fetchrow($result)) && ($row['topic_title']))
		{
			// auto auth
			if (($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
			{
				$template->assign_block_vars('latest_hot_topics', array(
					'TITLE'			=> character_limit($row['topic_title'], $config['board3_recent_title_limit_' . $module_id]),
					'FULL_TITLE'	=> censor_text($row['topic_title']),
					'TOPIC_TIME'   => $user->format_date($row['topic_time'], 'd-M'),
					'U_VIEW_TOPIC'	=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id'] == 0) ? $g_forum_id : $row['forum_id']) . '&t=' . $row['topic_id'])
				));
			}
		}
		$db->sql_freeresult($result);

		//
		// Recent topic (only show normal topic)
		//
		$sql = 'SELECT topic_title, forum_id, topic_id
			FROM ' . TOPICS_TABLE . ' t
			WHERE topic_status <> ' . ITEM_MOVED . '
				AND topic_approved = 1 
				AND topic_type = ' . POST_NORMAL . '
				AND topic_moved_id = 0
				' . $sql_where . '' .  $forum_sql . '
			ORDER BY topic_time DESC';
		$result = $db->sql_query_limit($sql, $config['board3_max_topics_' . $module_id]);

		while(($row = $db->sql_fetchrow($result)) && ($row['topic_title']))
		{
			// auto auth
			if (($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
			{
				$template->assign_block_vars('latest_topics', array(
					'TITLE'			=> character_limit($row['topic_title'], $config['board3_recent_title_limit_' . $module_id]),
					'FULL_TITLE'	=> censor_text($row['topic_title']),
					'TOPIC_TIME'   => $user->format_date($row['topic_time'], 'd-M'),
					'U_VIEW_TOPIC'	=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'])
				));
			}
		}
		$db->sql_freeresult($result);

		return 'recent_center.html';
	}

	public function get_template_acp($module_id)
	{
		return array(
			'title'	=> 'ACP_PORTAL_RECENT_SETTINGS',
			'vars'	=> array(
				'legend1'							=> 'ACP_PORTAL_RECENT_SETTINGS',
				'board3_max_topics_' . $module_id				=> array('lang' => 'PORTAL_MAX_TOPIC',			'validate' => 'int',		'type' => 'text:3:3',		'explain' => true),
				'board3_recent_title_limit_' . $module_id		=> array('lang' => 'PORTAL_RECENT_TITLE_LIMIT',	'validate' => 'int',		'type' => 'text:3:3',		'explain' => true),
				'board3_recent_forum_' . $module_id				=> array('lang' => 'PORTAL_RECENT_FORUM',		'validate' => 'string',		'type' => 'custom',			'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'),
				'board3_recent_exclude_forums_' . $module_id	=> array('lang' => 'PORTAL_EXCLUDE_FORUM',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
			)
		);
	}

	/**
	* API functions
	*/
	public function install($module_id)
	{
		set_config('board3_max_topics_' . $module_id, 10);
		set_config('board3_recent_title_limit_' . $module_id, 100);
		set_config('board3_recent_forum_' . $module_id, '');
		set_config('board3_recent_exclude_forums_' . $module_id, 1);
		return true;
	}

	public function uninstall($module_id)
	{
		global $db;

		$del_config = array(
			'board3_max_topics_' . $module_id,
			'board3_recent_title_limit_' . $module_id,
			'board3_recent_forum_' . $module_id,
			'board3_recent_exclude_forums_' . $module_id,
		);
		$sql = 'DELETE FROM ' . CONFIG_TABLE . '
			WHERE ' . $db->sql_in_set('config_name', $del_config);
		return $db->sql_query($sql);
	}

	// Create forum select box
	public function select_forums($value, $key, $module_id)
	{
		global $user, $config;

		$forum_list = make_forum_select(false, false, true, true, true, false, true);

		$selected = array();
		if(isset($config[$key]) && strlen($config[$key]) > 0)
		{
			$selected = explode(',', $config[$key]);
		}
		// Build forum options
		$s_forum_options = '<select id="' . $key . '" name="' . $key . '[]" multiple="multiple">';
		foreach ($forum_list as $f_id => $f_row)
		{
			$s_forum_options .= '<option value="' . $f_id . '"' . ((in_array($f_id, $selected)) ? ' selected="selected"' : '') . (($f_row['disabled']) ? ' disabled="disabled" class="disabled-option"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
		}
		$s_forum_options .= '</select>';

		return $s_forum_options;

	}

	// Store selected forums
	public function store_selected_forums($key, $module_id)
	{
		global $db, $cache;

		// Get selected extensions
		$values = request_var($key, array(0 => ''));

		$news = implode(',', $values);

		set_config($key, $news);

	}
}
bard0962
Аватара пользователя
PPK
Администратор
Сообщения: 10514
Зарегистрирован: 21 мар 2009, 17:13
Сообщение 31 июл 2015, 17:50
второй блок в моём сообщении у вас сделан только 1 раз, а там написано, что нужно 3
PPK
11 сообщений
  • 1
  • 2
  • След.

Вернуться в «Вопросы, ответы и примеры решений»

Time: 0.000s | Queries: 0 | Peak Memory Usage: 0.00 МБ | GZIP: Unknown | SQL Explain
  • Список форумов
2018, made with by ThemeKita Создано на основе phpBB® Forum Software © phpBB Limited Русская поддержка phpBB (C) 2009-2025 @ PPK
  • Часовой пояс: UTC+04:00
Участники темы
Список форумов Участники темы
Перейти
Сайт ↳   Новости по сайту ↳   Новости обновлений ↳   Вопросы по сайту ↳   Non-russian speakers forum phpBB 3.1-3.3 ↳   Вопросы по phpBB 3.1-3.3 ↳   Расширения для phpBB 3.1-3.3 ↳   Условно-бесплатные расширения ↳   Платные расширения ↳   Расширения для подписчиков ↳   Расширения в разработке ↳   База расширений ↳   Стили для phpBB 3.1-3.3 ↳   Переводы расширений для phpBB3.1-3.3 ↳   Поиск и запросы расширений ↳   Запросы расширений, функционала и переводов для подписчиков ppkBB3cker ↳   Новости по трекеру и обновлениям ↳   Ошибки, проблемы, недочёты ↳   Предложения по новым функциям и возможностям ↳   Вопросы, ответы и примеры решений ↳   Моды и стили для трекера ↳   Готовые стили для трекера ↳   Запросы стилей для трекера ↳   Стили в разработке ↳   Готовые моды для трекера ↳   Запросы модов для трекера ↳   Моды в разработке ↳   Остальное ↳   F.A.Q. ↳   Ваши трекеры ↳   Оффтопик xbtBB3cker ↳   Новости по трекеру и обновлениям ↳   Вопросы, ответы, ошибки и обсуждение phpBB 3.0 ↳   Другие моды для phpBB3 ↳   Минимоды и хаки для phpBB3 ↳   Вопросы по phpBB3 ↳   phpBB3 ppkBB3cker Edition ↳   Платные услуги, моды, стили ↳   BB2Spoiler/BB3Spoiler ↳   BB3Topics ↳   BB3Sape ↳   BB3UserAgentInfo