Помогите с invision pover board 2

12
M
На сайте с 30.10.2005
Offline
31
1649

Пожалуйста, помогите мне с invision pover board 2

Я хочу, чтобы на главной странице сайта (не форума) выводились 10 последних сообщений форума. Как это сделать?

Заранее спасибо

Как ты хочешь жить потом, так живи и сейчас.
SiriuS
На сайте с 26.02.2005
Offline
244
#1

Об этом лучше спросить на http://www.ibresource.ru/

Новый форум Сочи о переезде на ПМЖ (https://forum-sochi.ru) - Бизнес и инвестиции в Сочи (https://forum-sochi.ru/forums/9/) - Новостройки и застройщики Сочи (https://forum-sochi.ru/forums/10/)
[Удален]
#2

Можно написать скрипт

(когда у меня стоял Ipb то наш програмер сделал такой за 5 минут и бутылку пива)

M
На сайте с 30.10.2005
Offline
31
#3

Я не могу зарегиться на http://www.ibresource.ru, пишет "доступ запрещён". Дайте кно-нибудь другую ссылку или закачайте на форум, пожалуйста.

[Удален]
#4

За исключением 2-3 авторов... большинство модов на http://www.ibresource.ru/ - перевод оригиналов с http://mods.invisionize.com/ 😂. Там и регистрируйтесь.

M
На сайте с 30.10.2005
Offline
31
#5

Скачал мод для моей версии. Но он не работает. Вот он:

<?
// **************************************** //
// Original mod submitted by Miles Johnson. //
// Completely rewritten by Anthony Petito.. //
// V2.0: 4 April 2005...................... //
// V2.1: 10 April 2005..................... //
// **************************************** //
// This mod will pull the latest X posts from your forum and display them on your website.
// This new version will also handle forums that you do not wish to show (excluded forums)
// Put this file where your FORUMS are located (e.g, http://domain.tld/forum).
// This should be in the same path as your conf_global.php file
// I've commented most of the code so that it's fairly understandable, however,
// if you're unsure of what's going on here, stick to the comments on where to edit this file for your site.
// For this to work properly, copy the following code into your website. Change it to match the link to THIS file.
/* <?php include("http://domain.tld/forum/latest_posts.php");?> */
/////////////////////////////
// User Editable variables //
/////////////////////////////
// Change this to the number of posts you would like to show.
$posts = 10;
// If you would like this mod to cut topics after a certain character length, leave this at 1. Otherwise, change it to 0.
$showtopiclength = 1;
// Length of title to display before cutting off. If topic title length exceeds this value, it is followed by ellipses (...)
// Only useful if the above varaible is set to 1.
$topiclength = 40;
// Add forumid's to exclude from. For example, you might want to exclude your private forums so that posts from it
// do not show up. Seperate each forumid by a comma and ensure there's no spaces in between.
$forumexclude = "";
// The following 2 lines can be changed to however you want the date and time to be displayed.
// Default date: dd month year
// Default time: hh:mm ampm TIMEZONE (12 hour time)
// For more information on how the next 2 lines can be changed, please reference the README file.
$datedisplay = 'd F Y';
$timedisplay = 'h:i A T';
//////////////
// Required //
//////////////
require "ips_kernel/class_db_mysql.php";
require "conf_global.php";
//////////////
// Database //
//////////////
$db = new db_driver;
$db->obj['sql_database'] = $INFO['sql_database'];
$db->obj['sql_user'] = $INFO['sql_user'];
$db->obj['sql_pass'] = $INFO['sql_pass'];
$db->obj['sql_host'] = $INFO['sql_host'];
$db->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix'];
// Connect to DB
$db->connect();
// Query the DB with the supplied user inputted variables.
$getposts = $db->query("SELECT posts, last_poster_name, last_poster_id, title, tid, forum_id, last_post FROM ibf_topics WHERE (forum_id NOT IN ($forumexclude)) ORDER BY last_post DESC LIMIT $posts");
// Format and display the results.
while ($post = $db->fetch_row($getposts)) {
$post[full_title] = $post[title];
if ($showtopiclength == 1 AND strlen($post[full_title]) > $topiclength) {
$post[short_title] = substr($post[full_title],0,$topiclength);
$post[short_title] = $post[short_title]."...";
}
else {
$post[short_title] = $post[full_title];
}
$posted_on = date($datedisplay, $post[last_post]); // Need to change mySQL timestamp to something more human readable.
$today_date = date($datedisplay, time()); // Grab today's date so we can compare it against the posted date
// If it was posted today, we want to display "Today, hh:mm AMPM"
If ($posted_on == $today_date) {
$datefield = "Today";
$datefield = $datefield . ", " . date($timedisplay, $post[last_post]);
}
// If it was posted yesterday, we want to display "Yesterday, hh:mm AMPM"
elseif (date('d F Y',strtotime("-1 day")) == $posted_on) {
$datefield = "Yesterday";
$datefield = $datefield . ", " . date($timedisplay, $post[last_post]);
}
else {
$datefield = $today_date;
}
echo
/////////////////
// Post Format //
/////////////////
// Between the EOD markers you can put whatever you want in HTML format. Just ensure that the link stays somewhat the same.
<<<EOD
<a href="$INFO[board_url]/index.php?showtopic=$post[tid]&view=getnewpost">$post[short_title]</a> by
<a href="$INFO[board_url]/index.php?showuser=$post[last_poster_id]">$post[last_poster_name]</a> <BR>
$datefield, with $post[posts] replies.<P>
EOD;
}
?>

Вот что получается: http://prokredit.ru/forum/latest_posts.php

Ну пожалуйста, подсткахите что мне делать

M
На сайте с 21.07.2005
Offline
70
#6

$forumexclude = "";

у Вас пустой или Вы туда таки вбили ID форумов, с которых не хотите брать темы ?

M
На сайте с 30.10.2005
Offline
31
#7

2 Mitos Пустой

[Удален]
#8

Не вижу форум клаба у вас

M
На сайте с 21.07.2005
Offline
70
#9
2 Mitos Пустой

ну так добавьте туда хотя бы 0 , если хотите , что бы учитывались темы из ВСЕХ форумов или номера форумов через запятую из которых Вы не хотите учитывать темы :)

M
На сайте с 30.10.2005
Offline
31
#10

2 Mitos

Спасибо. Всё заработало.

12

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий