Перейти к публикации
View in the app

A better way to browse. Learn more.

Дизайн и модификация Invision Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Не правильное отображение времени IPB 3.1.X

Опубликовано:

Здравствуйте еще раз. У меня еще вот такая проблемка. Время созданного сообщения наведении курсора на пост на 6 часов меньше чем время сервера. Часовой пояс стоит +3 Москва. Из за этого бага, у меня в Джумле отображается не правильное время сообщений. Подскажите пожалуйста. Скрин прилагаю)

post-44053-0-43865200-1302780889_thumb.jpg

Кстати, заметил у вас также показывает. Минус 6 часов(

Изменено пользователем t0lstiy

Рекомендованные сообщения

Опубликовано:

У нас нормально все показывает.

 

Серверное время спешит на 6 минут, надо починить. А в постах - ок

Зы.

В той строке космическое время :)

Для зеленых человечков.

Опубликовано:
  • Автор

Хм.. Замечательно))) А подскажите тогда пожалуйста, как исправить мод ipb_latest для joomla,который выводит последние темы с форума IPB в джумлу. Вот код мода:

 

 

<?php

 

defined('_JEXEC') or die('Direct Access to this location is not allowed.');

 

$document =& JFactory::getDocument();

$uri =& JURI::getInstance();

$document->addStyleSheet($uri->root().'modules/mod_ipb_latest/styles/common.css', 'text/css'); // Add stylesheet to the header of the docuemnt.

 

$topics = $params->get('topics'); // Get number of latest topics to display.

$symbols = $params->get('symbols'); // Get number of tipic title characters to show.

$dateformat = $params->get('dateformat'); // Get date format.

$above = $params->get('above'); // Get data to display ABOVE topics block.

$below = $params->get('below'); // Get data to display BELOW topics block.

$spacer = $params->get('spacer'); // Get spacer height.

$forum_location = $params->get('forum'); // Get forum location.

$exclude = $params->get('exclude'); // Get list of excluded forums.

 

$option = array(); // Open array with forum database parameters.

$option['driver'] = $params->get('driver'); // Set database driver.

$option['host'] = $params->get('host'); // Set database server.

$option['user'] = $params->get('user'); // Set database user.

$option['password'] = $params->get('password'); // Set database password.

$option['database'] = $params->get('database'); // Set database name.

$option['prefix'] = $params->get('prefix'); // Set database prefix.

 

$output = "";

 

$db = & JDatabase::getInstance($option); // Connect to forum database with given parameters.

$row = $db->loadAssocList($db->setQuery("SELECT * FROM ".$option['prefix']."topics WHERE forum_id NOT IN (".$exclude.") ORDER BY last_post DESC LIMIT 0,".$topics)); // Select X latest topics from corresponding table.

$row2 = $db->loadAssocList($db->setQuery("SELECT * FROM ".$option['prefix']."conf_settings WHERE conf_id IN (43,44)")); // Query conf_settings table for time values.

 

$output .= "<span class='aboveText'>".$above."</span><br>"; // Load data above posts block.

 

for ($i=0;$i<$topics;$i++) // Parse table rows from 0 to X.

{

$proper_time = $row[$i]['last_post'] + $row2[0]['conf_value']*60*60 + $row2[1]['conf_value']*60; // Adjust time according to IPB settings.

$post_date = gmdate($dateformat, $proper_time); // Get latest post date.

$author_name = htmlspecialchars_decode($row[$i]['last_poster_name']); // Get last poster name.

// $author_name = mb_convert_encoding(htmlspecialchars_decode($row[$i]['last_poster_name']), 'CP1252', 'UTF-8'); // Uncomment this line and comment the ABOVE one if you having problems with encoding.

$topic_title = htmlspecialchars_decode($row[$i]['title']); // Get recent topic title.

// $topic_title = mb_convert_encoding(htmlspecialchars_decode($row[$i]['title']), 'CP1252', 'UTF-8'); // Uncomment this line and comment the ABOVE one if you having problems with encoding.

$row3 = $db->loadAssoc($db->setQuery("SELECT * FROM ".$option['prefix']."forums WHERE id=".$row[$i]['forum_id']));

$forum_name = htmlspecialchars_decode($row3['name']);

// $forum_name = mb_convert_encoding(htmlspecialchars_decode($row3['name']), 'CP1252', 'UTF-8'); // Uncomment this line and comment the ABOVE one if you having problems with encoding.

if (($symbols != "") && (mb_strlen($topic_title) > $symbols))

{

$topic_title = mb_substr($topic_title, 0, $symbols, 'UTF-8')."..."; // Cut topic title to the length given in settings.

}

if (($symbols != "") && (mb_strlen($row[$i]['last_poster_name']) > $symbols-4))

{

$author_name = mb_substr($author_name, 0, $symbols-4, 'UTF-8')."..."; // Cut username to the length given in settings.

}

if (($symbols != "") && (mb_strlen($row3['name']) > $symbols-4))

{

$forum_name = mb_substr($forum_name, 0, $symbols-4, 'UTF-8')."..."; // Cut forum name to the length given in settings.

}

$output .= "<div id='spacer' style='height: ".$spacer."px'></div><a href='".$forum_location."/index.php?showtopic=".$row[$i]['tid']."&view=getlastpost' class='topicLink'>".$topic_title."</a><br>";

if ($params->get('display_name') == 0)

{

$output .= "<span class='authorLink'>".JText::_('AUTHOR LABEL').": <a href='".$forum_location."/index.php?showuser=".$row[$i]['last_poster_id']."'>".$author_name."</a></span><br>"; // Add last poster name to resulting output.

}

if ($params->get('display_date') == 0)

{

$output .= "<span class='postDate'>".JText::_('DATE LABEL').": ".$post_date."</span><br>"; // Add last post date to resulting output.

}

if ($params->get('display_forum') == 0)

{

$output .= "<span class='forumLink'>".JText::_('FORUM LABEL').": <a href='".$forum_location."/index.php?showforum=".$row[$i]['forum_id']."'>".$forum_name."</a></span><br>"; // Add last post forum name to resulting output.

}

}

 

$output .= "<span class='belowText'>".$below."</span>"; // Load data below posts block.

 

echo $output; // Display result.

 

?>

 

 

Опубликовано:
$proper_time = $row[$i]['last_post'] + $row2[0]['conf_value']*60*60 + $row2[1]['conf_value']*60; // Adjust time according to IPB settings.

$post_date = gmdate($dateformat, $proper_time); // Get latest post date.

 

$proper_time = $row[$i]['last_post'];

$post_date = date( 'd.m.Y H:i', $proper_time );

Опубликовано:
  • Автор

Спасибо огромное)))) Ловите плюсик)

  • 7 лет спустя...
Опубликовано:

А как такое может быть - время в админпанели настроил все правильно, а в php date("G") все равно показывает время с отставанием в три часа?

Опубликовано:

А в профиле выбрать свой часовой?

Опубликовано:

А как такое может быть - время в админпанели настроил все правильно, а в php date("G") все равно показывает время с отставанием в три часа?

я тут глупость сморозил... :) вопрос скорее по настройкам сервера :)

Создайте аккаунт или войдите в него для комментирования

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.