Vergleich admin/inc/functions.php - 1.8.20 - 1.8.22

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 205Zeile 205

reset($pforumcache);
reset($pforumcache[$fid]);


reset($pforumcache);
reset($pforumcache[$fid]);

 

$navigation = '';


foreach($pforumcache[$fid] as $key => $forum)
{


foreach($pforumcache[$fid] as $key => $forum)
{

Zeile 213Zeile 215
			if($pforumcache[$forum['pid']])
{
$navigation = make_parent_list($forum['pid'], $navsep).$navigation;

			if($pforumcache[$forum['pid']])
{
$navigation = make_parent_list($forum['pid'], $navsep).$navigation;

			}


			}


			if($navigation)
{
$navigation .= $navsep;

			if($navigation)
{
$navigation .= $navsep;

Zeile 224Zeile 226
	}
return $navigation;
}

	}
return $navigation;
}





/**
* @param int $fid
*/
function save_quick_perms($fid)
{
global $db, $inherit, $canview, $canpostthreads, $canpostreplies, $canpostpolls, $canpostattachments, $cache;

/**
* @param int $fid
*/
function save_quick_perms($fid)
{
global $db, $inherit, $canview, $canpostthreads, $canpostreplies, $canpostpolls, $canpostattachments, $cache;





	$permission_fields = array();

	$permission_fields = array();





	$field_list = $db->show_fields_from("forumpermissions");
foreach($field_list as $field)
{

	$field_list = $db->show_fields_from("forumpermissions");
foreach($field_list as $field)
{

Zeile 253Zeile 255
	{
$query2 = $db->simple_select("forumpermissions", $db->escape_string(implode(',', array_keys($permission_fields))), "fid='{$fid}' AND gid='{$usergroup['gid']}'", array('limit' => 1));
$existing_permissions = $db->fetch_array($query2);

	{
$query2 = $db->simple_select("forumpermissions", $db->escape_string(implode(',', array_keys($permission_fields))), "fid='{$fid}' AND gid='{$usergroup['gid']}'", array('limit' => 1));
$existing_permissions = $db->fetch_array($query2);





		if(!$existing_permissions)
{
$query2 = $db->simple_select("usergroups", $db->escape_string(implode(',', array_keys($usergroup_permission_fields))), "gid='{$usergroup['gid']}'", array('limit' => 1));
$existing_permissions = $db->fetch_array($query2);
}

		if(!$existing_permissions)
{
$query2 = $db->simple_select("usergroups", $db->escape_string(implode(',', array_keys($usergroup_permission_fields))), "gid='{$usergroup['gid']}'", array('limit' => 1));
$existing_permissions = $db->fetch_array($query2);
}





		// Delete existing permissions
$db->delete_query("forumpermissions", "fid='{$fid}' AND gid='{$usergroup['gid']}'");

		// Delete existing permissions
$db->delete_query("forumpermissions", "fid='{$fid}' AND gid='{$usergroup['gid']}'");





		// Only insert the new ones if we're using custom permissions
if($inherit[$usergroup['gid']] != 1)
{

		// Only insert the new ones if we're using custom permissions
if($inherit[$usergroup['gid']] != 1)
{

Zeile 282Zeile 284
			else
{
$pthreads = 0;

			else
{
$pthreads = 0;

			}


			}


			if($canpostreplies[$usergroup['gid']] == 1)
{
$preplies = 1;

			if($canpostreplies[$usergroup['gid']] == 1)
{
$preplies = 1;

Zeile 516Zeile 518
 * @return string The iconv/mb encoding
*/
function fetch_iconv_encoding($mysql_encoding)

 * @return string The iconv/mb encoding
*/
function fetch_iconv_encoding($mysql_encoding)

{

{

    $mysql_encoding = explode("_", $mysql_encoding);
switch($mysql_encoding[0])
{

    $mysql_encoding = explode("_", $mysql_encoding);
switch($mysql_encoding[0])
{

Zeile 546Zeile 548
	while($adminoption = $db->fetch_array($query))
{
$adminoption['permissions'] = my_unserialize($adminoption['permissions']);

	while($adminoption = $db->fetch_array($query))
{
$adminoption['permissions'] = my_unserialize($adminoption['permissions']);





		if($default == -1)
{
if(!empty($page))

		if($default == -1)
{
if(!empty($page))

Zeile 565Zeile 567
				if($adminoption['uid'] == 0)
{
$adminoption['permissions'][$tab][$page] = 0;

				if($adminoption['uid'] == 0)
{
$adminoption['permissions'][$tab][$page] = 0;

				}

				}

				else
{
$adminoption['permissions'][$tab][$page] = $default;

				else
{
$adminoption['permissions'][$tab][$page] = $default;

Zeile 594Zeile 596
 * @param integer $uid The uid of the admin to check
* @param boolean $return_num Return an array of the number of attempts and expiry time? (default false)
* @return mixed Return an array if the second parameter is true, boolean otherwise.

 * @param integer $uid The uid of the admin to check
* @param boolean $return_num Return an array of the number of attempts and expiry time? (default false)
* @return mixed Return an array if the second parameter is true, boolean otherwise.

 */

 */

function login_attempt_check_acp($uid=0, $return_num=false)
{
global $db, $mybb;

function login_attempt_check_acp($uid=0, $return_num=false)
{
global $db, $mybb;

Zeile 633Zeile 635
	}

return false;

	}

return false;

}

}


/**
* Checks whether the administrator is on a mobile device


/**
* Checks whether the administrator is on a mobile device

Zeile 662Zeile 664

// System calls via backtick
if(preg_match('#\$\s*\{#', $template))


// System calls via backtick
if(preg_match('#\$\s*\{#', $template))

	{

	{

		return true;
}


		return true;
}


Zeile 671Zeile 673
	if(preg_match("~\\{\\$.+?\\}~s", preg_replace('~\\{\\$+[a-zA-Z_][a-zA-Z_0-9]*((?:-\\>|\\:\\:)\\$*[a-zA-Z_][a-zA-Z_0-9]*|\\[\s*\\$*([\'"]?)[a-zA-Z_ 0-9 ]+\\2\\]\s*)*\\}~', '', $template)))
{
return true;

	if(preg_match("~\\{\\$.+?\\}~s", preg_replace('~\\{\\$+[a-zA-Z_][a-zA-Z_0-9]*((?:-\\>|\\:\\:)\\$*[a-zA-Z_][a-zA-Z_0-9]*|\\[\s*\\$*([\'"]?)[a-zA-Z_ 0-9 ]+\\2\\]\s*)*\\}~', '', $template)))
{
return true;

	}

	}


return false;
}


return false;
}

Zeile 827Zeile 829

return $values;
}


return $values;
}

 
}

/**
* Output the auto redirect block.
*
* @param \Form $form An existing form instance to wrap the redirect within.
* @param string $prompt The prompt to show.
*/
function output_auto_redirect($form, $prompt)
{
global $lang;

echo <<<HTML
<div class="confirm_action">
<p>{$prompt}</p>
<br />
<script type="text/javascript">
$(function() {
var button = $("#proceed_button");
if (button.length > 0) {
// create a temporary div element to render the text within, un-escaping HTML entities
var textElement = $('<div/>').html('{$lang->automatically_redirecting}');

button.val(textElement.text());
button.attr("disabled", true);
button.css("color", "#aaa");
button.css("borderColor", "#aaa");

var parent_form = button.closest('form');

if (parent_form.length > 0) {
parent_form.submit();
}
}
});
</script>
<p class="buttons">
{$form->generate_submit_button($lang->proceed, array('class' => 'button_yes', 'id' => 'proceed_button'))}
</p>
</div>
HTML;

}

}