Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-19-2009, 10:26 AM
Dj Sagi Dj Sagi is offline
 
Join Date: Oct 2008
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default how id do it? thx!

hellow all
i want to do in the admin threads options
on the bottom in FORUMDISPLAY in the options
more option
that move the threads that i mark in V
to the forum with id 168
without choose any forum
i want that it move without choose the forum with the id...
i try add action but i dont success...
please help.
thx =]
Reply With Quote
  #2  
Old 06-19-2009, 03:02 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Post the code you tried to add and maybe we can spot what you did wrong. Please use the code tags and if it is a plugin, tell us what hook you used.
Reply With Quote
  #3  
Old 06-19-2009, 09:29 PM
Dj Sagi Dj Sagi is offline
 
Join Date: Oct 2008
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in inlinemod.php file
i add to (2 times)
PHP Code:
switch ($_POST['do'])
{
    case 
'dodeletethreads':
    case 
'domovethreads'
this:
PHP Code:
    case 'domovethreadsbin'
my bin forum id is 168

so i add this:
PHP Code:
if ($_POST['do'] == 'domovethreadsbin')
{
    
$vbulletin->input->clean_array_gpc('p', array(
        
'destforumid' => TYPE_UINT,
        
'redirect'    => TYPE_STR,
        
'frame'       => TYPE_STR,
        
'period'      => TYPE_UINT,
    ));

    
// check whether dest can contain posts
    
$destforumid verify_id('forum''168');
    
$destforuminfo fetch_foruminfo($destforumid);
    if (!
$destforuminfo['cancontainthreads'] OR $destforuminfo['link'])
    {
        eval(
standard_error(fetch_error('moveillegalforum')));
    }

    
// check destination forum permissions
    
$forumperms fetch_permissions($destforuminfo['forumid']);
    if (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['canview']))
    {
        
print_no_permission();
    }

    if (
$vbulletin->GPC['redirect'] == 'none')
    {
        
$method 'move';
    }
    else
    {
        
$method 'movered';
    }

    
$countingthreads = array();
    
$redirectids = array();

    
// Validate threads
    
$threads $db->query_read_slave("
        SELECT threadid, visible, open, pollid, title, prefixid, postuserid, forumid
        " 
. ($method == 'movered' ", lastpost, replycount, postusername, lastposter, dateline, views, iconid" "") . "
        FROM " 
TABLE_PREFIX "thread
        WHERE threadid IN(" 
implode(','$threadids) . ")
    "
);
    while (
$thread $db->fetch_array($threads))
    {
        
$forumperms fetch_permissions($thread['forumid']);
        if     (
            !(
$forumperms $vbulletin->bf_ugp_forumpermissions['canview'])
                OR
            !(
$forumperms $vbulletin->bf_ugp_forumpermissions['canviewthreads'])
                OR
            (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND $thread['postuserid'] != $vbulletin->userinfo['userid'])
            )
        {
            
print_no_permission();
        }

        
$thread['prefix_plain_html'] = ($thread['prefixid'] ? htmlspecialchars_uni($vbphrase["prefix_$thread[prefixid]_title_plain"]) . ' ' '');

        if (!
can_moderate($thread['forumid'], 'canmanagethreads'))
        {
            eval(
standard_error(fetch_error('you_do_not_have_permission_to_manage_threads_and_posts'$vbphrase['n_a'], $thread['prefix_plain_html'] . $thread['title'], $vbulletin->forumcache["$thread[forumid]"]['title'])));
        }
        else if (!
$thread['visible'] AND !can_moderate($thread['forumid'], 'canmoderateposts'))
        {
            eval(
standard_error(fetch_error('you_do_not_have_permission_to_manage_moderated_threads_and_posts')));
        }
        else if (
$thread['visible'] == AND !can_moderate($thread['forumid'], 'candeleteposts'))
        {
            eval(
standard_error(fetch_error('you_do_not_have_permission_to_manage_deleted_threads_and_posts'$vbphrase['n_a'], $thread['prefix_plain_html'] . $thread['title'], $vbulletin->forumcache["$thread[forumid]"]['title'])));
        }

        if (
$thread['visible'] == AND !can_moderate($destforuminfo['forumid'], 'candeleteposts'))
        {
            eval(
standard_error(fetch_error('you_do_not_have_permission_to_manage_deleted_threads_and_posts_in_destination_forum')));
        }
        else if (!
$thread['visible'] AND !can_moderate($destforuminfo['forumid'], 'canmoderateposts'))
        {
            eval(
standard_error(fetch_error('you_do_not_have_permission_to_manage_moderated_threads_and_posts_in_destination_forum')));
        }

        
// Ignore all threads that are already in the destination forum
        
if ($thread['forumid'] == $destforuminfo['forumid'])
        {
            
$sameforum true;
            continue;
        }

        
$threadarray["$thread[threadid]"] = $thread;
        
$forumlist["$thread[forumid]"] = true;

        if (
$thread['open'] == 10)
        {
            
$redirectids["$thread[pollid]"][] = $thread['threadid'];
        }
        else if (
$thread['visible'])
        {
            
$countingthreads[] = $thread['threadid'];
        }
    }

    if (empty(
$threadarray))
    {
        if (
$sameforum)
        {
            eval(
standard_error(fetch_error('thread_is_already_in_the_forum')));
        }
        else
        {
            eval(
standard_error(fetch_error('you_did_not_select_any_valid_threads')));
        }
    }

    
// check to see if these threads are being returned to a forum they've already been in
    // if redirects exist in the destination forum, remove them
    
$checkprevious $db->query_read_slave("
        SELECT threadid
        FROM " 
TABLE_PREFIX "thread
        WHERE forumid = 
$destforuminfo[forumid]
            AND open = 10
            AND pollid IN(" 
implode(','array_keys($threadarray)) . ")
    "
);
    while (
$check $db->fetch_array($checkprevious))
    {
        
$old_redirect =& datamanager_init('Thread'$vbulletinERRTYPE_SILENT'threadpost');
        
$old_redirect->set_existing($check);
        
$old_redirect->delete(falsetrueNULLfalse);
        unset(
$old_redirect);
    }

    
// check to see if a redirect is being moved to a forum where its destination thread already exists
    // if so delete the redirect
    
if (!empty($redirectids))
    {
        
$checkprevious $db->query_read_slave("
            SELECT threadid
            FROM " 
TABLE_PREFIX "thread
            WHERE forumid = 
$destforuminfo[forumid]
                AND threadid IN(" 
implode(','array_keys($redirectids)) . ")

        "
);
        while (
$check $db->fetch_array($checkprevious))
        {
            if (!empty(
$redirectids["$check[threadid]"]))
            {
                foreach(
$redirectids["$check[threadid]"] AS $threadid)
                {
                    
$old_redirect =& datamanager_init('Thread'$vbulletinERRTYPE_SILENT'threadpost');
                    
$old_redirect->set_existing($threadarray["$threadid"]);
                    
$old_redirect->delete(falsetrueNULLfalse);
                    unset(
$old_redirect);

                    
# Remove redirect threadids from $threadarray so no log entry is entered below or new redirect is added
                    
unset($threadarray["$threadid"]);
                }
            }
        }
    }

    if (!empty(
$threadarray))
    {
        
// Move threads
        // If mod can not manage threads in destination forum then unstick all moved threads
        
$db->query_write("
            UPDATE " 
TABLE_PREFIX "thread
            SET forumid = 
$destforuminfo[forumid]
            " 
. (!can_moderate($destforuminfo['forumid'], 'canmanagethreads') ? ", sticky = 0" "") . "
            WHERE threadid IN(" 
implode(','array_keys($threadarray)) . ")
        "
);

        require_once(
DIR '/includes/functions_prefix.php');
        
remove_invalid_prefixes(array_keys($threadarray), $destforuminfo['forumid']);

        
// update canview status of thread subscriptions
        
update_subscriptions(array('threadids' => array_keys($threadarray)));

        
// kill the post cache for these threads
        
delete_post_cache_threads(array_keys($threadarray));

        
$movelog = array();
        
// Insert Redirects FUN FUN FUN
        
if ($method == 'movered')
        {
            
$redirectsql = array();
            if (
$vbulletin->GPC['redirect'] == 'expires')
            {
                switch(
$vbulletin->GPC['frame'])
                {
                    case 
'h':
                        
$expires mktime(date('H') + $vbulletin->GPC['period'], date('i'), date('s'), date('m'), date('d'), date('y'));
                        break;
                    case 
'd':
                        
$expires mktime(date('H'), date('i'), date('s'), date('m'), date('d') + $vbulletin->GPC['period'], date('y'));
                        break;
                    case 
'w':
                        
$expires $vbulletin->GPC['period'] * 60 60 24 TIMENOW;
                        break;
                    case 
'y':
                        
$expires =  mktime(date('H'), date('i'), date('s'), date('m'), date('d'), date('y') + $vbulletin->GPC['period']);
                        break;
                    case 
'm':
                        default:
                        
$expires =  mktime(date('H'), date('i'), date('s'), date('m') + $vbulletin->GPC['period'], date('d'), date('y'));
                }
            }
            foreach(
$threadarray AS $threadid => $thread)
            {
                if (
$thread['visible'] == 1)
                {
                    
$thread['open'] = 10;
                    
$thread['pollid'] = $threadid;
                    unset(
$thread['threadid']);
                    
$redir =& datamanager_init('Thread'$vbulletinERRTYPE_SILENT'threadpost');
                    foreach (
array_keys($thread) AS $field)
                    {
                        
// bypassing the verify_* calls; this data should be valid as is
                        
if (isset($redir->validfields["$field"]))
                        {
                            
$redir->setr($field$thread["$field"], truefalse);
                        }
                    }
                    
$redirthreadid $redir->save();
                    if (
$vbulletin->GPC['redirect'] == 'expires')
                    {
                        
$redirectsql[] = "$redirthreadid$expires";
                    }
                    unset(
$redir);
                }
                else
                {
                    
// else this is a moderated or deleted thread so leave no redirect behind
                    // insert modlog entry of just "move", not "moved with redirect"
                    // unset threadarray[threadid] so thread_moved_with_redirect log entry is not entered below.

                    
unset($threadarray["$threadid"]);
                    
$movelog = array(
                        
'userid'   =>& $vbulletin->userinfo['userid'],
                        
'forumid'  =>& $thread['forumid'],
                        
'threadid' => $threadid,
                    );
                }
            }

            if (!empty(
$redirectsql))
            {
                
$db->query_write("
                    INSERT INTO " 
TABLE_PREFIX "threadredirect
                        (threadid, expires)
                    VALUES
                        (" 
implode("), ("$redirectsql) . ")
                "
);
            }
        }

        if (!empty(
$movelog))
        {
            
log_moderator_action($movelog'thread_moved_to_x'$destforuminfo['title']);
        }

        if (!empty(
$threadarray))
        {
            foreach (
$threadarray AS $threadid => $thread)
            {
                
$modlog[] = array(
                    
'userid'   =>& $vbulletin->userinfo['userid'],
                    
'forumid'  =>& $thread['forumid'],
                    
'threadid' => $threadid,
                );
            }

            
log_moderator_action($modlog, ($method == 'move') ? 'thread_moved_to_x' 'thread_moved_with_redirect_to_a'$destforuminfo['title']);

            if (!empty(
$countingthreads))
            {
                
$posts $db->query_read_slave("
                    SELECT userid, threadid
                    FROM " 
TABLE_PREFIX "post
                    WHERE threadid IN(" 
implode(','$countingthreads) . ")
                        AND visible = 1
                        AND    userid > 0
                "
);
                
$userbyuserid = array();
                while (
$post $db->fetch_array($posts))
                {
                    
$foruminfo fetch_foruminfo($threadarray["$post[threadid]"]['forumid']);
                    if (
$foruminfo['countposts'] AND !$destforuminfo['countposts'])
                    {    
// Take away a post
                        
if (!isset($userbyuserid["$post[userid]"]))
                        {
                            
$userbyuserid["$post[userid]"] = -1;
                        }
                        else
                        {
                            
$userbyuserid["$post[userid]"]--;
                        }
                    }
                    else if (!
$foruminfo['countposts'] AND $destforuminfo['countposts'])
                    {    
// Add a post
                        
if (!isset($userbyuserid["$post[userid]"]))
                        {
                            
$userbyuserid["$post[userid]"] = 1;
                        }
                        else
                        {
                            
$userbyuserid["$post[userid]"]++;
                        }
                    }
                }

                if (!empty(
$userbyuserid))
                {
                    
$userbypostcount = array();
                    
$alluserids '';

                    foreach (
$userbyuserid AS $postuserid => $postcount)
                    {
                        
$alluserids .= ",$postuserid";
                        
$userbypostcount["$postcount"] .= ",$postuserid";
                    }
                    foreach (
$userbypostcount AS $postcount => $userids)
                    {
                        
$casesql .= " WHEN userid IN (0$userids) THEN $postcount";
                    }

                    
$db->query_write("
                        UPDATE " 
TABLE_PREFIX "user
                        SET posts = CAST(posts AS SIGNED) +
                        CASE
                            
$casesql
                            ELSE 0
                        END
                        WHERE userid IN (0
$alluserids)
                    "
);
                }
            }
        }
    }

    foreach(
array_keys($forumlist) AS $forumid)
    {
        
build_forum_counters($forumid);
    }
    
build_forum_counters($destforuminfo['forumid']);

    
// empty cookie
    
setcookie('vbulletin_inlinethread'''TIMENOW 3600'/');

    (
$hook vBulletinHook::fetch_hook('inlinemod_domovethread')) ? eval($hook) : false;

    eval(
print_standard_redirect('redirect_inline_moved'true$forceredirect));


i only take the domovethreads action and i copy
and i change the acion name to domovethreadsbin
after i change in the 10 first lines this line:
PHP Code:
    $destforumid verify_id('forum'$vbulletin->GPC['destforumid']); 
to this line:

PHP Code:
    $destforumid verify_id('forum''168'); 
and it is say that i dont choose any forum...

thx for help!
Reply With Quote
  #4  
Old 06-19-2009, 10:38 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But, how to you get to domovethreadsbin? If you look at the Moderation dropdown, movethread is an action in there, not domovethread. domovethread is not a case available until you get to the second page after selecting all the threads. Did you add anything to the dropdown menu itself?
Reply With Quote
  #5  
Old 06-20-2009, 08:32 AM
Dj Sagi Dj Sagi is offline
 
Join Date: Oct 2008
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i add one more option to dropdown with value "domovethreadsbin" and it dont work...
i must your help!
thx!

--------------- Added [DATE]1245575789[/DATE] at [TIME]1245575789[/TIME] ---------------

please someone!!
help me...
thx.
Reply With Quote
  #6  
Old 06-21-2009, 11:38 AM
Dj Sagi Dj Sagi is offline
 
Join Date: Oct 2008
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

someone plz =]
Reply With Quote
  #7  
Old 06-23-2009, 01:51 PM
Dj Sagi Dj Sagi is offline
 
Join Date: Oct 2008
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

UP plz i must your help!
Reply With Quote
  #8  
Old 06-25-2009, 08:58 PM
Dj Sagi Dj Sagi is offline
 
Join Date: Oct 2008
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

someone??
plz

--------------- Added [DATE]1246045941[/DATE] at [TIME]1246045941[/TIME] ---------------

nobody wanna help?
please.
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 10:02 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06253 seconds
  • Memory Usage 2,399KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete