本文整理汇总了PHP中Stats::clear方法的典型用法代码示例。如果您正苦于以下问题:PHP Stats::clear方法的具体用法?PHP Stats::clear怎么用?PHP Stats::clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stats
的用法示例。
在下文中一共展示了Stats::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* update
* This function is an all encompasing update function that
* calls the mini ones does all the error checking and all that
* good stuff
*/
public function update(array $data)
{
if (empty($data['username'])) {
AmpError::add('username', T_('Error Username Required'));
}
if ($data['password1'] != $data['password2'] and !empty($data['password1'])) {
AmpError::add('password', T_("Error Passwords don't match"));
}
if (AmpError::occurred()) {
return false;
}
if (!isset($data['fullname_public'])) {
$data['fullname_public'] = false;
}
foreach ($data as $name => $value) {
if ($name == 'password1') {
$name = 'password';
} else {
$value = scrub_in($value);
}
switch ($name) {
case 'password':
case 'access':
case 'email':
case 'username':
case 'fullname':
case 'fullname_public':
case 'website':
case 'state':
case 'city':
if ($this->{$name} != $value) {
$function = 'update_' . $name;
$this->{$function}($value);
}
break;
case 'clear_stats':
Stats::clear($this->id);
break;
default:
// Rien a faire
break;
}
}
return $this->id;
}
示例2: T_
UI::show_box_top(T_('Catalog Created'), 'box box_catalog_created');
echo "<h2>" . T_('Catalog Created') . "</h2>";
Error::display('general');
Error::display('catalog_add');
UI::show_box_bottom();
show_confirmation('', '', AmpConfig::get('web_path') . '/admin/catalog.php');
} else {
require AmpConfig::get('prefix') . '/templates/show_add_catalog.inc.php';
}
break;
case 'clear_stats':
if (AmpConfig::get('demo_mode')) {
UI::access_denied();
break;
}
Stats::clear();
$url = AmpConfig::get('web_path') . '/admin/catalog.php';
$title = T_('Catalog statistics cleared');
$body = '';
show_confirmation($title, $body, $url);
break;
case 'show_add_catalog':
require AmpConfig::get('prefix') . '/templates/show_add_catalog.inc.php';
break;
case 'clear_now_playing':
if (AmpConfig::get('demo_mode')) {
UI::access_denied();
break;
}
Stream::clear_now_playing();
show_confirmation(T_('Now Playing Cleared'), T_('All now playing data has been cleared'), AmpConfig::get('web_path') . '/admin/catalog.php');