Вывод тем с Ipb на сайт(Мw)
Не моглибы поделиться скриптом вывода последних тем с форума IPB v2.3.5 на страницу сайта (MW)
Как я помню нужен еще специальный скрипт который имееться в stress web 7.0,Если решишь его поставить то
Тег
А что здесь писать О_о
PanaceASS: Как я помню нужен еще специальный скрипт который имееться в stress web 7.0,Если решишь его поставить то
Тегвставляй в шабон и все будет отлично !Раскрывающийся текст{FORUM_LINKS}
Он просит на MW а не stres.
Я заранее дал этот Тег ,на всякий так сказать пожарный случай ,если решиш поставить именно стресс
А что здесь писать О_о
kest3092: повтарюсь нужен именно под MW
if(!defined("DNREAD")) exit();
//======[ОСНОВНЫЕ НАСТРОЙКИ]======
//Префикс таблицы с IPB
$prefix = 'ibf';
//Сколько тем выводить
$num = 10;
//Сколько символов оставить в названии темы после урезания
$topic_num_sym = 40;
//Имя папки с картинками текущего скина
$img_path = '1';
//Формат времени
$time = 'd.m H:i';
//Форумы, которые мы не трогаем
$forumexclude = '11,21';
//Сервер БД на котором висит база форума
$host="localhost";
//Имя БД
$database="tbl_old";
//Логин БД
$username="root";
//Пароль БД
$password="";
//====[Если не знаем PHP - дальше ничего не трогаем :)]=========
$ipb_db = mysql_pconnect($host, $username, $password) or trigger_error(mysql_error(), E_USER_ERROR);
mysql_select_db($database, $ipb_db);
$bt = "<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" bgcolor=\"#dee2e5\">";
$bt.= "<th width=\"60%\" height=\"26\" align=\"center\"><font class=\"storytitle\">Название темы</font></th>";
$bt.= "<th width=\"10%\" height=\"26\" align=\"center\"><font class=\"storytitle\"><b>Автор</b></font></th>";
$bt.= "<th width=\"5%\" height=\"26\" align=\"center\"><font class=\"storytitle\">Ответов</font></th>";
$bt.= "<th width=\"5%\" height=\"26\" align=\"center\"><font class=\"storytitle\">Просмотров</font></th>";
$bt.= "<th width=\"20%\" height=\"26\" align=\"center\" colspan=\"2\"><font class=\"storytitle\"><b>Последний ответ</b></font></th>";
$resultf = mysql_query("SELECT tid, title, description, state, posts, starter_id, last_poster_id, last_post, icon_id, starter_name, last_poster_name, views, topic_hasattach FROM ".$prefix."_topics WHERE (forum_id NOT IN ($forumexclude)) ORDER BY last_post DESC LIMIT $num",$ipb_db) or die(mysql_error());
$row_resultf = mysql_fetch_assoc($resultf);
$totalRows_resultf = mysql_num_rows($resultf);
do {
$topicstrip = $row_resultf['title'];
if (strlen($topicstrip) > $topic_num_sym) {
$topicstrip = substr($topicstrip,0,$topic_num_sym);
$topicstrip = $topicstrip."...";
}
$status = ($row_resultf['state'] == "closed") ? "<img src=\"forum/style_images/$img_path/f_closed.gif\" border=\"0\" alt=\"Тема закрыта\">" : "";
$attach = ($row_resultf['topic_hasattach'] == "1") ? "<img src=\"temp/A-Vector/images/files.gif\" border=\"0\" alt=\"В сообщении есть прикрепленные файлы\"> " : "";
$icon = ($row_resultf['icon_id'] == "0") ? " <img border=\"0\" src=\"temp/Default/images/icon.gif\"> " : "<img src=\"forum/style_images/$img_path/folder_post_icons/icon$icon_id.gif\" border=\"0\" alt=\"Иконка сообщения\"> ";
$last_date = date($time,$row_resultf['last_post']);
$bt.= "<tr>";
$bt.= "<td bgcolor=\"#FFFFFF\">";
$bt.= "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\"><tr>";
$bt.= "<td>$icon</td>";
$bt.= "<td width=\"100%\"><a title=\"".$row_resultf['description']."\" href=\"forum/index.php?showtopic=".$row_resultf['tid']."&view=getlastpost\">$topicstrip</a></td>";
$bt.= "<td align=\"center\" valign=\"middle\">$attach</td>";
$bt.= "<td align=\"center\" valign=\"middle\">$status</td>";
$bt.= "</tr></table></td>";
$bt.= "<td bgcolor=\"#FFFFFF\" align=\"center\"><a href=\"forum/index.php?showuser=".$row_resultf['starter_id']."\">".$row_resultf['starter_name']."</a></td>";
$bt.= "<td bgcolor=\"#FFFFFF\" align=\"center\">".$row_resultf['posts']."</td>";
$bt.= "<td bgcolor=\"#FFFFFF\" align=\"center\">".$row_resultf['views']."</td>";
$bt.= "<td bgcolor=\"#FFFFFF\" align=\"center\">$last_date</td>";
$bt.= "<td bgcolor=\"#FFFFFF\" align=\"center\"><a href=\"forum/index.php?showuser=".$row_resultf['last_poster_id']."\">".$row_resultf['last_poster_name']."</a></td>";
$bt.= "</tr>";
} while($row_resultf = mysql_fetch_assoc($resultf));
$bt.= "</table>";
mysql_free_result($resultf);
return $bt;
?>
Kest я писал такой скрипт и выкладывал тут, так что поиск.
На Форуме я тоже Radar!
Я везде Radar!
неоднакратно искал восновном натыкался на стрит
уже ищу несколько дней не думай что не юзал поиск)
да и гоголь тож юзал ток находил старые версии скрипта которые неподходят!
если нетрудна выложи скрипт или ссылку на тему!
STORM:Раскрывающийся текстКод<?php
if(!defined("DNREAD")) exit();
//======[ОСНОВНЫЕ НАСТРОЙКИ]======
//Префикс таблицы с IPB
$prefix = 'ibf';
//Сколько тем выводить
$num = 10;
//Сколько символов оставить в названии темы после урезания
$topic_num_sym = 40;
//Имя папки с картинками текущего скина
$img_path = '1';
//Формат времени
$time = 'd.m H:i';
//Форумы, которые мы не трогаем
$forumexclude = '11,21';
//Сервер БД на котором висит база форума
$host="localhost";
//Имя БД
$database="tbl_old";
//Логин БД
$username="root";
//Пароль БД
$password="";
//====[Если не знаем PHP - дальше ничего не трогаем :)]=========
$ipb_db = mysql_pconnect($host, $username, $password) or trigger_error(mysql_error(), E_USER_ERROR);
mysql_select_db($database, $ipb_db);
$bt = "<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" bgcolor=\"#dee2e5\">";
$bt.= "<th width=\"60%\" height=\"26\" align=\"center\"><font class=\"storytitle\">Название темы</font></th>";
$bt.= "<th width=\"10%\" height=\"26\" align=\"center\"><font class=\"storytitle\"><b>Автор</b></font></th>";
$bt.= "<th width=\"5%\" height=\"26\" align=\"center\"><font class=\"storytitle\">Ответов</font></th>";
$bt.= "<th width=\"5%\" height=\"26\" align=\"center\"><font class=\"storytitle\">Просмотров</font></th>";
$bt.= "<th width=\"20%\" height=\"26\" align=\"center\" colspan=\"2\"><font class=\"storytitle\"><b>Последний ответ</b></font></th>";
$resultf = mysql_query("SELECT tid, title, description, state, posts, starter_id, last_poster_id, last_post, icon_id, starter_name, last_poster_name, views, topic_hasattach FROM ".$prefix."_topics WHERE (forum_id NOT IN ($forumexclude)) ORDER BY last_post DESC LIMIT $num",$ipb_db) or die(mysql_error());
$row_resultf = mysql_fetch_assoc($resultf);
$totalRows_resultf = mysql_num_rows($resultf);
do {
$topicstrip = $row_resultf['title'];
if (strlen($topicstrip) > $topic_num_sym) {
$topicstrip = substr($topicstrip,0,$topic_num_sym);
$topicstrip = $topicstrip."...";
}
$status = ($row_resultf['state'] == "closed") ? "<img src=\"forum/style_images/$img_path/f_closed.gif\" border=\"0\" alt=\"Тема закрыта\">" : "";
$attach = ($row_resultf['topic_hasattach'] == "1") ? "<img src=\"temp/A-Vector/images/files.gif\" border=\"0\" alt=\"В сообщении есть прикрепленные файлы\"> " : "";
$icon = ($row_resultf['icon_id'] == "0") ? " <img border=\"0\" src=\"temp/Default/images/icon.gif\"> " : "<img src=\"forum/style_images/$img_path/folder_post_icons/icon$icon_id.gif\" border=\"0\" alt=\"Иконка сообщения\"> ";
$last_date = date($time,$row_resultf['last_post']);
$bt.= "<tr>";
$bt.= "<td bgcolor=\"#FFFFFF\">";
$bt.= "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\"><tr>";
$bt.= "<td>$icon</td>";
$bt.= "<td width=\"100%\"><a title=\"".$row_resultf['description']."\" href=\"forum/index.php?showtopic=".$row_resultf['tid']."&view=getlastpost\">$topicstrip</a></td>";
$bt.= "<td align=\"center\" valign=\"middle\">$attach</td>";
$bt.= "<td align=\"center\" valign=\"middle\">$status</td>";
$bt.= "</tr></table></td>";
$bt.= "<td bgcolor=\"#FFFFFF\" align=\"center\"><a href=\"forum/index.php?showuser=".$row_resultf['starter_id']."\">".$row_resultf['starter_name']."</a></td>";
$bt.= "<td bgcolor=\"#FFFFFF\" align=\"center\">".$row_resultf['posts']."</td>";
$bt.= "<td bgcolor=\"#FFFFFF\" align=\"center\">".$row_resultf['views']."</td>";
$bt.= "<td bgcolor=\"#FFFFFF\" align=\"center\">$last_date</td>";
$bt.= "<td bgcolor=\"#FFFFFF\" align=\"center\"><a href=\"forum/index.php?showuser=".$row_resultf['last_poster_id']."\">".$row_resultf['last_poster_name']."</a></td>";
$bt.= "</tr>";
} while($row_resultf = mysql_fetch_assoc($resultf));
$bt.= "</table>";
mysql_free_result($resultf);
return $bt;
?>
kest3092
Ты хоть немного php знаешь? Ну или хотя бы запросы в БД в скриптах правил? Тогда данный скрипт ты настроишь минут за 20.
— Random Post Generator
Скрипт который выложил DarkGod - работает. Его всего лишь под себя переделать и будет отлично.






