форум vBSupport.ru > vBSupport.ru > Requests > Кандидатский
Register Меню vBsupport Изображения Files Manager О рекламе Today's Posts Search
  • Родная гавань
  • Блок РКН снят
  • Premoderation
  • For English speaking users
  • Каталог Фрилансеров
  • If you want to buy some product or script
  • Администраторам
VBsupport перешел с домена .ORG на родной .RU Ура! Пожалуйста, обновите свои закладки - VBsupport.ru
Блок РКН снят, форум доступен на всей территории России, включая новые терртории, без VPN
На форуме введена премодерация ВСЕХ новых пользователей

Почта с временных сервисов, типа mailinator.com, gawab.com и/или прочих, которые предоставляют временный почтовый ящик без регистрации и/или почтовый ящик для рассылки спама, отслеживается и блокируется, а так же заносится в спам-блок форума, аккаунты удаляются
for English speaking users:
You may be surprised with restriction of access to the attachments of the forum. The reason is the recent change in vbsupport.org strategy:

- users with reputation < 10 belong to "simple_users" users' group
- if your reputation > 10 then administrator (kerk, Luvilla) can decide to move you into an "improved" group, but only manually

Main idea is to increase motivation of community members to share their ideas and willingness to support to each other. You may write an article for the subject where you are good enough, you may answer questions, you may share vbulletin.com/org content with vbsupport.org users, receiving "thanks" equal your reputation points. We should not only consume, we should produce something.

- you may:
* increase your reputation (doing something useful for another members of community) and being improved
* purchase temporary access to the improved category:
10 $ for 3 months. - this group can download attachments, reputation/posts do not matter.
20 $ for 3 months. - this group can download attachments, reputation/posts do not matter + adds eliminated + Inbox capacity increased + files manager increased permissions.

Please contact kerk or Luvilla regarding payments.

Important!:
- if your reputation will become less then 0, you will be moved into "simple_users" users' group automatically.*
*for temporary groups (pre-paid for 3 months) reputation/posts do not matter.
Уважаемые пользователи!

На форуме открыт новый раздел "Каталог фрилансеров"

и отдельный раздел для платных заказов "Куплю/Закажу"

Если вы хотите приобрести какой то скрипт/продукт/хак из каталогов перечисленных ниже:
Каталог модулей/хаков
Ещё раз обращаем Ваше внимание: всё, что Вы скачиваете и устанавливаете на свой форум, Вы устанавливаете исключительно на свой страх и риск.
Сообщество vBSupport'а физически не в состоянии проверять все стили, хаки и нули, выкладываемые пользователями.
Помните: безопасность Вашего проекта - Ваша забота.
Убедительная просьба: при обнаружении уязвимостей или сомнительных кодов обязательно отписывайтесь в теме хака/стиля
Спасибо за понимание
 
 
 
 
Xokage
Гость
Arrow Вывод последних сообщений с возможностью вставки в любое место шаблона

Всем Привет! Завалялся у меня один модуль для булки. Здесь на форуме подобного не нашел.

И так суть модуля заключается в том что он позволяет вывести последние сообщения на форуме, в любой шаблон в любое место.

Это очень удобно для тех кто хочет, поместить последние сообщения в боковую колонку, или что бы они отображались на каждой странице, так же возможна интеграция с VbAdvanced.

Пример:


И так, если все понятно, можно перейти к установке:

1. В файле postlast.php указать путь к базе данных:

Code:
## CUSTOMIZE SETTINGS FOR YOUR SITE ## 
$db_host = "localhost"; // ОСНОВНОЙ АДРЕС СЕРВЕРА С БАЗОЙ ДАННЫХ. 
$db_name = "db_name"; // НАЗВАНИЕ БАЗЫ ДАННЫХ. 
$db_user = "db_user"; // Имя пользователя к БД. 
$db_pw = "db_password"; // Пароль к БД. 

$forum_url = "http://ВАШСАЙТ.ru"; // Change this to reflect to your forum's URL. 
$forum_id = ""; // If you wish to display the posts from a specific forum, enter the forum id here. Otherwise, leave it blank. 
$limit = "7"; // Number of posts displayed. 
$excludeforums = ""; // The forums you want to exclude from being displayed 
$titlecolor = "#0000FF"; // This is the color of the title. 
$postedcolor = "#404040"; // This is the color of the bottom text. 
$txtlimit = "120"; // This is the character limit. 
#######################################
2. Заливаем файл postlast.php в корневую директорию форума.

3. Идем в админку - Продукты и модули - Сохранить/загрузить модули и загружаем файл latest_posts.xml

4. Вставляем переменную $news в нужный вам шаблон.

И все.

Файл postlast.php можно переименовать с правкой latest_posts.xml.

Мной тестировалось начиная от линейки 3.6.х до 3.8.х. Возможно работает и на других версиях.

Статью не копипастил, писал своими словами, если что не ясно можете спрашивать. Надеюсь что кому то эта информация будет полезной.
Attached Files
File Type: rar postlast.rar (1.7 KB, 16 views)

Last edited by Xokage : 01-23-2013 at 12:10 AM.
Bot
Yandex Bot Yandex Bot is online now
 
Join Date: 05.05.2005
Реклама на форуме А что у нас тут интересного? =)
 
 
StenLi
На доске почёта
Пожизненный блэк
 
banned nax
Default
0

Xokage, Это для vbulletin 0.000001 версии?
PHP Code:
<?php 

#########################
## LAST X POSTS v3.1   ##
## PHASE(1) MEDIA      ##
## WWW.PHASE1MEDIA.COM ##
## TRE@PHASE1MEDIA.COM ##
#########################

/* This script shows the last X numbers of posts (titles) posted last on a non-VB page.
You may customize it in any way you wish. If you have any problems with it, you can
post them at vB.org or send me an email to tre@phase1media.com.

Enjoy!
*/

## CUSTOMIZE SETTINGS FOR YOUR SITE ##
$db_host "localhost"// Change this if your MySQL database host is different.
$db_name "db_name"// Change this to the name of your database.
$db_user "db_user"// Change this to your database username.
$db_pw "db_password"// Change this to your database password.

$forum_url "http://site.ru"// Change this to reflect to your forum's URL.
$forum_id ""// If you wish to display the posts from a specific forum, enter the forum id here. Otherwise, leave it blank.
$limit "7"// Number of posts displayed.
$excludeforums ""// The forums you want to exclude from being displayed
$titlecolor "#0000FF"// This is the color of the title.
$postedcolor "#404040"// This is the color of the bottom text.
$txtlimit "120"// This is the character limit.
#######################################

// Connecting to your database
mysql_connect($db_host$db_user$db_pw
OR die (
"Cannot connect to your database"); 
mysql_select_db($db_name) OR die("Cannot connect to your database"); 

// Below is the beginning of a table. If you feel you don't need it, you may remove it.
echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">";

if (
$forum_id) {
    
$forum_id "AND forumid=$forum_id";
}

if (
$limit) {
    
$limited "LIMIT $limit";
}
if (
$excludeforums == "" or $excludeforums <= "0") {
    
$quarter "no";
} else {
    
$excfid explode(",",$excludeforums); $i 0$a count($excfid);
    while (
$i $a) {
        
$wheresql .= " AND thread.forumid!='$excfid[$i]'";    ++$i;
    }
}
$qw "SELECT threadid,title,lastpost,lastposter,forumid FROM thread WHERE visible=1 $wheresql AND open=1 $forum_id ORDER BY lastpost DESC $limited";
//PRINT $qw;
$thread_sql mysql_query($qw);

while(
$thread_get=mysql_fetch_array($thread_sql))
{
$lastpost $thread_get['lastpost'];
$poster $thread_get['lastposter'];
$tid $thread_get['threadid'];
$psql mysql_query("SELECT postid FROM post WHERE threadid=$tid ORDER BY postid DESC");
$getp=mysql_fetch_array($psql);
$pid $getp['postid'];
$date2 date ("d/m H:i" ,$lastpost);
$title $thread_get['title'];
$title substr($title,0,$txtlimit);
echo 
"<tr><td><font size=\"1\" face=\"arial,verdana,geneva\"><a href=\"$forum_url/showthread.php?p=$pid#post$pid\"><FONT SIZE=\"1\" COLOR=\"$titlecolor\" face=\"arial,verdana,geneva\">$title</FONT></a></font> <font color=\"$postedcolor\" face=\"arial,verdana,geneva\" size='1'>ответ от $poster <i>$date2</i></FONT></td></tr>";
}
echo 
"</table>";

?>
 
 
kerk
k0t
 
kerk's Avatar
Default
0

Quote:
Originally Posted by StenLi View Post
Это для vbulletin 0.000001 версии?
поправь для актуальной, выложи =)
 
 
Xokage
Гость
Default

Quote:
Originally Posted by StenLi View Post
Это для vbulletin 0.000001 версии?
Ну я же говорю "Завалялся" где то с 2006 года

Но пользуюсь до теперь, удобно.
 
 
StenLi
На доске почёта
Пожизненный блэк
 
banned nax
Default
4

Quote:
Originally Posted by kerk View Post
поправь для актуальной, выложи =)
Если заморачиваться, то получится какой-нибудь TOP STATS AJAX, а если просто переделать на современное вобло апи кода, то как-то так:


PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
#define('NO_REGISTER_GLOBALS', 1);
#define('THIS_SCRIPT', 'page');

// ################### PRE-CACHE TEMPLATES AND DATA ######################

// get special data templates from the datastore
$specialtemplates = array(
);

// pre-cache templates used by all actions
$globaltemplates = array(
);

// pre-cache templates used by specific actions
$actiontemplates = array(
);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

$forum_id "10";  #ID Раздела
$limit "7"#Количество тем
$postedcolor "black"#Цвет текста
$txtlimit "27"#Количество отображаемых символов в названии

echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">";

  
$vbulletin->db->query_first("SELECT tb1.threadid, tb2.postid, title, lastpost, lastposter, forumid FROM " TABLE_PREFIX "thread tb1, " TABLE_PREFIX "post tb2 WHERE tb1.forumid='$forum_id' AND tb1.threadid = tb2.threadid AND tb1.open='1' AND tb1.visible='1' ORDER BY lastpost DESC LIMIT $limit");
 while (
$thread_info $db->fetch_array())
    {
         
$lastpost $thread_get['lastpost'];
         
$poster $thread_get['lastposter'];
         
$tid $thread_get['threadid'];
         
$pid $thread_get['postid'];
         
$date2 date ("d/m H:i" ,$lastpost);
         
$title $thread_get['title'];
         
$title substr($title,0,$txtlimit);
   echo 
"<tr><td><font size=\"1\" face=\"arial,verdana,geneva\"><a href=\"$vbulletin->options[bburl]/showthread.php?p=$pid#post$pid\"><FONT SIZE=\"1\" COLOR=\"$titlecolor\" face=\"arial,verdana,geneva\">$title</FONT></a></font> <font color=\"$postedcolor\" face=\"arial,verdana,geneva\" size='1'>ответ от $poster <i>$date2</i></FONT></td></tr>";
        }

 echo 
"</table>";

?>
PS. Писал прямо в окне редактора формы ответа на форуме, т.ч. не тестил.
kerk, Это ты хотел увидеть?
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT +4. The time now is 03:11 AM.


Powered by vBulletin® Version 3.6.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.