форум vBSupport.ru > vBulletin > Вопрос — Ответ > Помогите найти!
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'а физически не в состоянии проверять все стили, хаки и нули, выкладываемые пользователями.
Помните: безопасность Вашего проекта - Ваша забота.
Убедительная просьба: при обнаружении уязвимостей или сомнительных кодов обязательно отписывайтесь в теме хака/стиля
Спасибо за понимание
 
 
 
 
snoopi
Знаток
Question Удалить все сообщения кроме первого
0

Здравствуйте..
Ищу хак (если такой есть) который позволяет удалять все сообщения в теме, кроме естественно первого сообщения.
Т.е. нафлудили например за ночь в теме 150 страниц и надо как-то удалить весь флуд разом =)
Спасибо
Bot
Yandex Bot Yandex Bot is online now
 
Join Date: 05.05.2005
Реклама на форуме А что у нас тут интересного? =)
 
 
Ghost
Гуру
 
Ghost's Avatar
Default
3

  1. Создай шаблон "threadadmin_clearthread":
    HTML Code:
    <form action="postings.php?do=clearthread&amp;threadid=$threadid" method="post" name="vbform">
    <input type="hidden" name="s" value="$session[sessionhash]" />
    <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
    <input type="hidden" name="t" value="$threadid" />
    <input type="hidden" name="do" value="clearthread" />
    <input type="hidden" name="confirmed" value="yes" />
    
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
    <tr>
    	<td class="tcat">Очистка темы</td>
    </tr>
    <tr>
    	<td class="thead">$vbphrase[title]: <span style="font-weight:normal">$threadinfo[title]</span></td>
    </tr>
    
    <tr>
    	<td class="panelsurround" align="center">
    		Тема будет очищена, т.е. будут удалены все сообщения кроме первого.<br /><br />
    		Вы уверены?<br /><br />
    	
    		<div style="margin-top:$stylevar[cellpadding]px">
    			<input type="submit" class="button" value="Очистить" accesskey="s" />
    			<input type="reset" class="button" value="$vbphrase[reset_fields]" accesskey="r" onclick="history.back();" />
    		</div>
    	</td>
    </tr>
    </table>
    
    </form>
  2. В шаблон "SHOWTHREAD" после
    HTML Code:
    <if condition="$show['deletethread']"><div><label for="ao_dlt"><input type="radio" name="do" id="ao_dlt" value="deletethread" />$vbphrase[delete_thread]</label></div></if>
    вставь
    HTML Code:
    <if condition="$show['deletethread']"><div><label for="ao_clr"><input type="radio" name="do" id="ao_clr" value="clearthread" />Очистить тему</label></div></if>
  3. Создай на хуке "threadmanage_start" модуль следующего содержания
    PHP Code:
    if ($_POST['do'] == 'clearthread')
    {
        
    $templatename 'threadadmin_clearthread';

        if ((
    $threadinfo['isdeleted'] AND !can_moderate($threadinfo['forumid'], 'canremoveposts')) OR (!$threadinfo['visible'] AND !can_moderate($threadinfo['forumid'], 'canmoderateposts')))
        {
            if (
    can_moderate($threadinfo['forumid']))
            {
                
    print_no_permission();
            }
            else
            {
                eval(
    standard_error(fetch_error('invalidid'$idname$vbulletin->options['contactuslink'])));
            }
        }

        
    // permission check
        
    if (!can_moderate($threadinfo['forumid'], 'candeleteposts') AND !can_moderate($threadinfo['forumid'], 'canremoveposts'))
        {
            
    $forumperms fetch_permissions($threadinfo['forumid']);
            if (!(
    $forumperms $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms $vbulletin->bf_ugp_forumpermissions['canviewthreads']) OR !($forumperms $vbulletin->bf_ugp_forumpermissions['candeletepost']) OR !($forumperms $vbulletin->bf_ugp_forumpermissions['candeletethread']))
            {
                
    print_no_permission();
            }
            else if (
    $threadinfo['dateline'] < (TIMENOW - ($vbulletin->options['edittimelimit'] * 60)) AND $vbulletin->options['edittimelimit'] != 0)
            {
                
    print_no_permission();
            }
            else
            {
                if (!
    $threadinfo['open'])
                {
                    
    $vbulletin->url 'showthread.php?' $vbulletin->session->vars['sessionurl'] . "t=$threadid";
                    eval(
    print_standard_redirect('redirect_threadclosed'));
                }
                
    // make sure this thread is owned by the user trying to delete it
                
    if (!is_first_poster($threadid))
                {
                    
    print_no_permission();
                }
            }
        }

        
    // check if there is a forum password and if so, ensure the user has it set
        
    verify_forum_password($foruminfo['forumid'], $foruminfo['password']);

        
    // draw nav bar
        
    $navbits construct_postings_nav($foruminfo$threadinfo);

        if (isset (
    $_POST['confirmed']))
        {
            require_once(
    DIR '/includes/functions_threadmanage.php');
            require_once(
    DIR '/includes/functions_databuild.php');

            
    $postarray    = array ();
            
    $threadlist    = array ();
            
    $forumlist    = array ();
            
    $firstpost    = array ();

            
    $sql "
                SELECT     post.postid, post.threadid, post.parentid, post.visible, post.title,
                    thread.forumid, thread.title AS thread_title, thread.postuserid, thread.firstpostid, thread.visible AS thread_visible
                FROM " 
    TABLE_PREFIX "post AS post
                JOIN " 
    TABLE_PREFIX "thread AS thread ON post.threadid = thread.threadid
                WHERE post.threadid = 
    $threadinfo[threadid] AND post.postid <> $threadinfo[firstpostid]
            "
    ;
            
    $res $vbulletin->db->query_read ($sql);
            while (
    $row $vbulletin->db->fetch_array ($res))
            {
                
    $postarray[$row['postid']] = $row;

                if (!isset (
    $threadlist[$row['threadid']]))    $threadlist[$row['threadid']]    = 0$threadlist[$row['threadid']]++;
                if (!isset (
    $forumlist[$row['forumid']]))    $forumlist[$row['forumid']]    = 0$forumlist[$row['forumid']]++;

                if (
    $post['firstpostid'] == $post['postid'])
                {
                    
    $firstpost["$post[threadid]"] = true;
                }
                elseif (!empty(
    $firstpost["$post[threadid]"]))
                {
                    
    $postarray["$post[postid]"]['skippostcount'] = true;
                }
            }

            
    $physicaldel true;

            foreach (
    $postarray AS $postid => $post)
            {
                
    $foruminfo fetch_foruminfo ($post['forumid']);

                
    $postman =& datamanager_init('Post'$vbulletinERRTYPE_SILENT'threadpost');
                
    $postman->set_existing ($post);
                
    $postman->delete (($foruminfo['countposts'] AND !$post['skippostcount']), $post['threadid'], $physicaldel, array (
                    
    'userid'        => 1,
                    
    'username'        => 'admin',
                    
    'reason'        => 'Clear thread',
                    
    'keepattachments'    => false
                
    ));
                unset (
    $postman);
            }

            foreach (
    array_keys ($threadlist) AS $threadid)
            {
                
    build_thread_counters ($threadid);
            }

            foreach (
    array_keys ($forumlist) AS $forumid)
            {
                
    build_forum_counters ($forumid);
            }

            
    $vbulletin->url 'showthread.php?' $vbulletin->session->vars['sessionurl'] . "t=$threadid";
            eval(
    print_standard_redirect('redirect_openclose'truetrue));
        }

  4. На хуке "threadmanage_action_switch" -- модуль:
    PHP Code:
    if ($_REQUEST['do'] == 'clearthread')
    {
        if (!
    $threadinfo['threadid'])
        {
            eval(
    standard_error(fetch_error('invalidid'$vbphrase['thread'], $vbulletin->options['contactuslink'])));
        }
        
    $handled_do true;

З.Ы. Установлено и проверено на vBulletin 3.6.8.
Attached Thumbnails
clearthread_managethread.jpg   clearthread_showthread.jpg  

Last edited by Ghost : 05-12-2009 at 03:55 PM. Reason: Внес все исправления, чтобы по теме не лазать...
 
 
snoopi
Знаток
Default
0

Немного не понял что значит на хуке)
Местоположение модуля ничего похожего на хук не нашел)
 
 
Ghost
Гуру
 
Ghost's Avatar
Default
0

Quote:
Originally Posted by snoopi View Post
Местоположение модуля ничего похожего на хук не нашел
Это оно и есть.
 
 
snoopi
Знаток
Default
0

А какое там выбрать?
global_start?)
 
 
Ghost
Гуру
 
Ghost's Avatar
Default
0

Для 3.7.х скорее всего потребуется в шаблон "threadadmin_clearthread" после
HTML Code:
<input type="hidden" name="s" value="$session[sessionhash]" />
добавить
HTML Code:
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
Я хз, начиная с какой версии в vBulletin появился маркер безопасности (линейку 3.7.х не использовал), но если потребует -- сделай такое исправление.

Ghost добавил 12.05.2009 в 14:23
Quote:
Originally Posted by snoopi View Post
А какое там выбрать?
global_start?)
Я же вроде ясно написал
Quote:
Originally Posted by Ghost View Post
на хуке "threadmanage_start"
Вот и выбирай "threadmanage_start".

Last edited by Ghost : 05-12-2009 at 03:23 PM. Reason: Добавлено сообщение
 
 
snoopi
Знаток
Default
0

Сделал global_start
Редиректит на postings.php?t=7341&pollid= после выбора "Очистить тему" и пишет Указано неправильное действие
Это и с маркером безопасности и без него
 
 
Ghost
Гуру
 
Ghost's Avatar
Default
0

Quote:
Originally Posted by snoopi View Post
Сделал global_start
Ты каким местом читаешь?
Quote:
Originally Posted by Ghost View Post
на хуке "threadmanage_start"
Quote:
Originally Posted by Ghost View Post
выбирай "threadmanage_start"
 
 
snoopi
Знаток
Default
0

Не так прочитал ))
Переделал, но ошибка та же!
 
 
Ghost
Гуру
 
Ghost's Avatar
Default
0

snoopi, открой файл "postings.php", найди в нем
PHP Code:
switch ($_REQUEST['do'])
{
    case 
'openclosethread':
    case 
'dodeletethread':
    case 
'dodeleteposts':
    case 
'domovethread':
    case 
'updatethread':
    case 
'domergethread':
    case 
'stick':
    case 
'removeredirect':
    case 
'deletethread'
и добавь строчку
PHP Code:
    case 'clearthread'
Ghost добавил 12.05.2009 в 14:45
Или создай модуль на хуке "threadmanage_action_switch" (местоположение) с содержанием
PHP Code:
if ($_REQUEST['do'] == 'clearthread')
{
    if (!
$threadinfo['threadid'])
    {
        eval(
standard_error(fetch_error('invalidid'$vbphrase['thread'], $vbulletin->options['contactuslink'])));
    }
    
$handled_do true;


Last edited by Ghost : 05-12-2009 at 03:45 PM. Reason: Добавлено сообщение
 

Tags
ужас


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 10:06 AM.


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