Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
if ($user->data['user_accept_rules'] == 0 && $user->data['is_registered'] && !$user->data['is_bot'] && (request_var('mode', '') != 'terms'))
{
if (confirm_box(true))
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_accept_rules = 1
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
}
else
{
confirm_box(false, sprintf($user->lang['NEW_RULES'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms') . '">', '</a>'));
header("Location: " . append_sid("{$phpbb_root_path}ucp.$phpEx?mode=logout&sid=" . $user->session_id));
}
}
if ($user->data['user_accept_rules'] == 0 && $user->data['is_registered'] && !$user->data['is_bot'] && (request_var('mode', '') != 'terms'))
&& $user->data['is_founder']
[phpBB Debug] PHP Notice: in file [ROOT]/includes/functions.php on line 5247: Undefined index: is_founder
if( $irgendwas == true )
$user->data['is_founder'] = 1;
if( isset( $user->data['is_founder'] ) && $user->data['is_founder'] == true )
{
...
}
<?php
/**
* Primitive Funktion zum testen, ob ein Array-Element true ist
* @param array $array Array, welches das Element enthält (oder nicht)
* @param mixed $key Element-Name, der geprüft werden soll
*
* @return boolean true, wenn das Element true ist, ansonsten false
*/
function is_true($array, $key)
{
if(empty($array[$key]))
return false;
if(!$array[$key])
return false;
return true;
}
$myArray = array();
$myArray['foo'] = true;
$myArray['bar'] = false;
echo "foo in myArray ist " . ( is_true($myArray, 'foo') ? 'true' : 'false' ) . '<br/>';
echo "bar in myArray ist " . ( is_true($myArray, 'bar') ? 'true' : 'false' ) . '<br/>';
echo "baz in myArray ist " . ( is_true($myArray, 'baz') ? 'true' : 'false' ) . '<br/>';
foo in myArray ist true
bar in myArray ist false
baz in myArray ist false
if( $is_founder == true )
$user->data['is_founder'] = 1;
if(isset($user->data['is_founder'] ) && $user->data['is_founder'] == true )
{
if ($user->data['user_accept_rules'] == 0 && $user->data['is_registered'] && !$user->data['is_bot'] && (request_var('mode', '') != 'rules'))
{
if (confirm_box(true))
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_accept_rules = 1
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
}
else
{
confirm_box(false, sprintf($user->lang['NEW_RULES'], '<a href="' . append_sid("{$phpbb_root_path}rules.php") . '">', '</a>'));
header("Location: " . append_sid("{$phpbb_root_path}ucp.$phpEx?mode=logout&sid=" . $user->session_id));
}
}
if ($user->data['user_accept_rules'] == 0 && $user->data['is_registered'] && $user->data['is_founder'] = 1; && !$user->data['is_bot'] && (request_var('mode', '') != 'rules'))
{
if (confirm_box(true))
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_accept_rules = 1
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
}
else
{
confirm_box(false, sprintf($user->lang['NEW_RULES'], '<a href="' . append_sid("{$phpbb_root_path}rules.php") . '">', '</a>'));
header("Location: " . append_sid("{$phpbb_root_path}ucp.$phpEx?mode=logout&sid=" . $user->session_id));
}
}
if(isset($user->data['is_founder'] ) && $user->data['is_founder'] == true)
{
if($is_founder == true)
$user->data['is_founder'] = 1
if ($user->data['user_accept_rules'] == 0 && $user->data['is_registered'] && !$user->data['is_bot'] && (request_var('mode', '') != 'rules'))
{
if (confirm_box(true))
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_accept_rules = 1
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
}
else
{
confirm_box(false, sprintf($user->lang['NEW_RULES'], '<a href="' . append_sid("{$phpbb_root_path}rules.php") . '">', '</a>'));
header("Location: " . append_sid("{$phpbb_root_path}ucp.$phpEx?mode=logout&sid=" . $user->session_id));
}
}