예제 #1
0
/**
 * Constructs a Forum Jump Menu for use when moving an item to a new forum
 *
 * @param	integer	The "Root" ID from which to generate this Menu
 * @param	integer	A Forum ID to "exclude" from the menu
 * @param	integer	If 1, removes all previous information from the Forum Jump Menu
 * @param	string	Characters to prepend to the items in the Jump Box
 *
 * @return	string	The generated forum jump menu
 *
 */
function construct_move_forums_options($parentid = -1, $excludeforumid = NULL, $addbox = 1, $prependchars = '')
{
    global $vbulletin, $optionselected, $jumpforumid, $jumpforumtitle, $jumpforumbits, $vbphrase, $curforumid;
    if (empty($vbulletin->iforumcache)) {
        // get the vbulletin->iforumcache, as we use it all over the place, not just for forumjump
        cache_ordered_forums(0, 1);
    }
    if (empty($vbulletin->iforumcache["{$parentid}"]) or !is_array($vbulletin->iforumcache["{$parentid}"])) {
        return;
    }
    if ($addbox == 1) {
        $jumpforumbits = array();
    }
    foreach ($vbulletin->iforumcache["{$parentid}"] as $forumid) {
        $forumperms =& $vbulletin->userinfo['forumpermissions']["{$forumid}"];
        if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview'])) {
            continue;
        } else {
            // set $forum from the $vbulletin->forumcache
            $forum = $vbulletin->forumcache["{$forumid}"];
            $optionvalue = $forumid;
            $optiontitle = $prependchars . $forum[title];
            if ($forum['link']) {
                $optiontitle .= " ({$vbphrase['link']})";
            } else {
                if (!($forum['options'] & $vbulletin->bf_misc_forumoptions['cancontainthreads'])) {
                    $optiontitle .= " ({$vbphrase['category']})";
                } else {
                    if (!($forum['options'] & $vbulletin->bf_misc_forumoptions['allowposting'])) {
                        $optiontitle .= " ({$vbphrase['no_posting']})";
                    }
                }
            }
            $optionclass = 'd' . iif($forum['depth'] > 3, 3, $forum['depth']);
            if ($curforumid == $optionvalue) {
                $optionselected = ' ' . 'selected="selected"';
                $optionclass .= ' fjsel';
                $selectedone = 1;
            } else {
                $optionselected = '';
            }
            if ($excludeforumid == NULL or $excludeforumid != $forumid) {
                $jumpforumbits[$forumid] = array('optiontitle' => $optiontitle, 'optionvalue' => $optionvalue, 'optionselected' => $optionselected, 'optionclass' => $optionclass);
            }
            construct_move_forums_options($optionvalue, $excludeforumid, 0, $prependchars ? $prependchars . '    ' : '    ');
        }
        // if can view
    }
    // end foreach ($vbulletin->iforumcache[$parentid] AS $forumid)
    return $jumpforumbits;
}
예제 #2
0
/**
 * Constructs a Forum Jump Menu for use when moving an item to a new forum
 *
 * @param	integer	The "Root" ID from which to generate this Menu
 * @param	integer	A Forum ID to "exclude" from the menu
 * @param	integer	If 1, removes all previous information from the Forum Jump Menu
 * @param	string	Characters to prepend to the items in the Jump Box
 *
 * @return	string	The generated forum jump menu
 *
 */
function construct_move_forums_options($parentid = -1, $excludeforumid = NULL, $addbox = 1)
{
	global $vbulletin, $optionselected, $jumpforumid, $jumpforumtitle, $jumpforumbits, $vbphrase, $curforumid;
	if (empty($vbulletin->iforumcache))
	{
		// get the vbulletin->iforumcache, as we use it all over the place, not just for forumjump
		cache_ordered_forums(0, 1);
	}
	if (empty($vbulletin->iforumcache["$parentid"]) OR !is_array($vbulletin->iforumcache["$parentid"]))
	{
		return;
	}

	if ($addbox == 1)
	{
		$jumpforumbits = '';
	}

	foreach($vbulletin->iforumcache["$parentid"] AS $forumid)
	{
		$forumperms =& $vbulletin->userinfo['forumpermissions']["$forumid"];
		if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']))
		{
			continue;
		}
		else
		{
			// set $forum from the $vbulletin->forumcache
			$forum = $vbulletin->forumcache["$forumid"];

			$optionvalue = $forumid;
			$optiontitle = $forum[title];

			if ($forum['link'])
			{
				$optiontitle .= " ($vbphrase[link])";
			}
			else if (!($forum['options'] & $vbulletin->bf_misc_forumoptions['cancontainthreads']))
			{
				$optiontitle .= " ($vbphrase[category])";
			}
			else if (!($forum['options'] & $vbulletin->bf_misc_forumoptions['allowposting']))
			{
				$optiontitle .= " ($vbphrase[no_posting])";
			}

			
			$optionclass = 'd' . iif($forum['depth'] > 3, 3, $forum['depth']);

			if ($curforumid == $optionvalue)
			{
				$optionselected = ' ' . 'selected="selected"';
				$optionclass .= ' fjsel';
				$selectedone = 1;
			}
			else
			{
				$optionselected = '';
			}
			if ($excludeforumid == NULL OR $excludeforumid != $forumid)
			{
				$jumpforumbits .= render_option_template($optiontitle, $optionvalue, $optionselected, $optionclass);
			}

			construct_move_forums_options($optionvalue, $excludeforumid, 0);

		} // if can view
	} // end foreach ($vbulletin->iforumcache[$parentid] AS $forumid)

	return $jumpforumbits;
}
예제 #3
0
파일: inlinemod.php 프로젝트: holandacz/nb4
     $threadlist["{$post['threadid']}"] = true;
     $forumlist["{$post['forumid']}"] = true;
 }
 if (empty($postarray)) {
     eval(standard_error(fetch_error('no_applicable_posts_selected')));
 }
 $postcount = count($postarray);
 $threadcount = count($threadlist);
 $forumcount = count($forumlist);
 if ($postcount == 1) {
     $post = array_pop($postarray);
 } else {
     $post = array('title' => '');
 }
 $curforumid = $foruminfo['forumid'];
 $moveforumbits = construct_move_forums_options();
 if ($_REQUEST['do'] == 'moveposts') {
     $navbits_phrase = $vbphrase['move_posts'];
     $template = 'threadadmin_moveposts';
     ($hook = vBulletinHook::fetch_hook('inlinemod_moveposts')) ? eval($hook) : false;
 } else {
     $navbits_phrase = $vbphrase['copy_posts'];
     $template = 'threadadmin_copyposts';
     ($hook = vBulletinHook::fetch_hook('inlinemod_copyposts')) ? eval($hook) : false;
 }
 // draw navbar
 $navbits = array();
 $parentlist = array_reverse(explode(',', substr($foruminfo['parentlist'], 0, -3)));
 foreach ($parentlist as $forumID) {
     $forumTitle = $vbulletin->forumcache["{$forumID}"]['title'];
     $navbits['forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f={$forumID}"] = $forumTitle;
예제 #4
0
파일: postings.php 프로젝트: 0hyeah/yurivn
                print_no_permission();
            }
        }
    }
    $show['move'] = $_REQUEST['do'] == 'movethread';
    if ($show['move']) {
        require_once DIR . '/includes/functions_prefix.php';
        $prefix_options = fetch_prefix_html($threadinfo['forumid'], $threadinfo['prefixid'], true);
    } else {
        $prefix_options = '';
    }
    // check if there is a forum password and if so, ensure the user has it set
    verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
    $title =& $threadinfo['title'];
    $curforumid = $threadinfo['forumid'];
    $moveoptions = construct_move_forums_options();
    $option_templater = vB_Template::create('option');
    $option_templater->register('options', $moveoptions);
    $moveforumbits = $option_templater->render();
    // draw nav bar
    $navbits = construct_postings_nav($foruminfo, $threadinfo);
    ($hook = vBulletinHook::fetch_hook('threadmanage_move_copy_thread')) ? eval($hook) : false;
    $page_templater = vB_Template::create('threadadmin_movethread');
    $page_templater->register('moveforumbits', $moveforumbits);
    $page_templater->register('prefix_options', $prefix_options);
    $page_templater->register('threadid', $threadid);
    $page_templater->register('threadinfo', $threadinfo);
    $page_templater->register('title', $title);
    $remove_temp_render = $page_templater->render();
}
// ############################### start do move thread ###############################