Zeile 1 | Zeile 1 |
---|
<?php /** * MyBB 1.6
|
<?php /** * MyBB 1.6
|
* Copyright � 2010 MyBB Group, All Rights Reserved
| * Copyright 2010 MyBB Group, All Rights Reserved
|
* * Website: http://mybb.com * License: http://mybb.com/about/license *
|
* * Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: group_promotions.php 5297 2010-12-28 22:01:14Z Tomm $
| * $Id: group_promotions.php 5832 2012-05-24 08:08:19Z Tomm $
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 51 | Zeile 51 |
---|
flash_message($lang->error_no_promo_id, 'error'); admin_redirect("index.php?module=user-group_promotions"); }
|
flash_message($lang->error_no_promo_id, 'error'); admin_redirect("index.php?module=user-group_promotions"); }
|
$query = $db->simple_select("promotions", "*", "pid='".intval($mybb->input['pid'])."'"); $promotion = $db->fetch_array($query);
if(!$promotion['pid']) { flash_message($lang->error_invalid_promo_id, 'error'); admin_redirect("index.php?module=user-group_promotions"); }
| $query = $db->simple_select("promotions", "*", "pid='".intval($mybb->input['pid'])."'"); $promotion = $db->fetch_array($query);
if(!$promotion['pid']) { flash_message($lang->error_invalid_promo_id, 'error'); admin_redirect("index.php?module=user-group_promotions"); }
|
if($mybb->request_method == "post") { $promotion = array(
| if($mybb->request_method == "post") { $promotion = array(
|
Zeile 69 | Zeile 69 |
---|
$db->update_query("promotions", $promotion, "pid = '{$mybb->input['pid']}'");
|
$db->update_query("promotions", $promotion, "pid = '{$mybb->input['pid']}'");
|
$plugins->run_hooks("admin_user_group_promotions_disable_commit");
| $plugins->run_hooks("admin_user_group_promotions_disable_commit");
|
// Log admin action log_admin_action($promotion['pid'], $promotion['title']);
| // Log admin action log_admin_action($promotion['pid'], $promotion['title']);
|
Zeile 95 | Zeile 95 |
---|
if(!trim($mybb->input['pid'])) { flash_message($lang->error_no_promo_id, 'error');
|
if(!trim($mybb->input['pid'])) { flash_message($lang->error_no_promo_id, 'error');
|
admin_redirect("index.php?module=user-group_promotions"); }
| admin_redirect("index.php?module=user-group_promotions"); }
|
$query = $db->simple_select("promotions", "*", "pid='".intval($mybb->input['pid'])."'"); $promotion = $db->fetch_array($query);
| $query = $db->simple_select("promotions", "*", "pid='".intval($mybb->input['pid'])."'"); $promotion = $db->fetch_array($query);
|
Zeile 126 | Zeile 126 |
---|
}
if($mybb->input['action'] == "enable")
|
}
if($mybb->input['action'] == "enable")
|
{ $plugins->run_hooks("admin_user_group_promotions_enable");
| { $plugins->run_hooks("admin_user_group_promotions_enable");
|
if(!verify_post_check($mybb->input['my_post_key'])) { flash_message($lang->invalid_post_verify_key2, 'error');
|
if(!verify_post_check($mybb->input['my_post_key'])) { flash_message($lang->invalid_post_verify_key2, 'error');
|
admin_redirect("index.php?module=user-group_promotions"); }
if(!trim($mybb->input['pid'])) { flash_message($lang->error_no_promo_id, 'error'); admin_redirect("index.php?module=user-group_promotions"); }
| admin_redirect("index.php?module=user-group_promotions"); }
if(!trim($mybb->input['pid'])) { flash_message($lang->error_no_promo_id, 'error'); admin_redirect("index.php?module=user-group_promotions"); }
|
$query = $db->simple_select("promotions", "*", "pid='".intval($mybb->input['pid'])."'"); $promotion = $db->fetch_array($query);
if(!$promotion['pid'])
|
$query = $db->simple_select("promotions", "*", "pid='".intval($mybb->input['pid'])."'"); $promotion = $db->fetch_array($query);
if(!$promotion['pid'])
|
{ flash_message($lang->error_invalid_promo_id, 'error');
| { flash_message($lang->error_invalid_promo_id, 'error');
|
admin_redirect("index.php?module=user-group_promotions"); }
$promotion = array( "enabled" => 1 );
|
admin_redirect("index.php?module=user-group_promotions"); }
$promotion = array( "enabled" => 1 );
|
|
|
$db->update_query("promotions", $promotion, "pid = '{$mybb->input['pid']}'"); $plugins->run_hooks("admin_user_group_promotions_enable_commit");
// Log admin action log_admin_action($promotion['pid'], $promotion['title']);
|
$db->update_query("promotions", $promotion, "pid = '{$mybb->input['pid']}'"); $plugins->run_hooks("admin_user_group_promotions_enable_commit");
// Log admin action log_admin_action($promotion['pid'], $promotion['title']);
|
|
|
flash_message($lang->success_promo_enabled, 'success'); admin_redirect("index.php?module=user-group_promotions"); }
| flash_message($lang->success_promo_enabled, 'success'); admin_redirect("index.php?module=user-group_promotions"); }
|
Zeile 172 | Zeile 172 |
---|
if(!trim($mybb->input['pid'])) { flash_message($lang->error_no_promo_id, 'error');
|
if(!trim($mybb->input['pid'])) { flash_message($lang->error_no_promo_id, 'error');
|
admin_redirect("index.php?module=user-group_promotions"); }
| admin_redirect("index.php?module=user-group_promotions"); }
|
$query = $db->simple_select("promotions", "*", "pid = '{$mybb->input['pid']}'"); $promotion = $db->fetch_array($query);
|
$query = $db->simple_select("promotions", "*", "pid = '{$mybb->input['pid']}'"); $promotion = $db->fetch_array($query);
|
|
|
if(!$promotion)
|
if(!$promotion)
|
{
| {
|
flash_message($lang->error_invalid_promo_id, 'error'); admin_redirect("index.php?module=user-group_promotions");
|
flash_message($lang->error_invalid_promo_id, 'error'); admin_redirect("index.php?module=user-group_promotions");
|
} if($mybb->request_method == "post") { if(!trim($mybb->input['title'])) { $errors[] = $lang->error_no_title; }
if(!trim($mybb->input['description'])) { $errors[] = $lang->error_no_desc; } if(empty($mybb->input['requirements'])) { $errors[] = $lang->error_no_requirements; }
if(empty($mybb->input['originalusergroup'])) { $errors[] = $lang->error_no_orig_usergroup; } if(!trim($mybb->input['newusergroup']))
| } if($mybb->request_method == "post") { if(!trim($mybb->input['title'])) { $errors[] = $lang->error_no_title; }
if(!trim($mybb->input['description'])) { $errors[] = $lang->error_no_desc; } if(empty($mybb->input['requirements'])) { $errors[] = $lang->error_no_requirements; }
if(empty($mybb->input['originalusergroup'])) { $errors[] = $lang->error_no_orig_usergroup; } if(!trim($mybb->input['newusergroup']))
|
{ $errors[] = $lang->error_no_new_usergroup; }
| { $errors[] = $lang->error_no_new_usergroup; }
|
Zeile 343 | Zeile 343 |
---|
$form_container->output_row($lang->orig_user_group." <em>*</em>", $lang->orig_user_group_desc, $form->generate_select_box('originalusergroup[]', $options, $mybb->input['originalusergroup'], array('id' => 'originalusergroup', 'multiple' => true, 'size' => 5)), 'originalusergroup'); unset($options['*']); // Remove the all usergroups option
|
$form_container->output_row($lang->orig_user_group." <em>*</em>", $lang->orig_user_group_desc, $form->generate_select_box('originalusergroup[]', $options, $mybb->input['originalusergroup'], array('id' => 'originalusergroup', 'multiple' => true, 'size' => 5)), 'originalusergroup'); unset($options['*']); // Remove the all usergroups option
|
$form_container->output_row($lang->new_user_group." <em>*</em>", $lang->new_user_group_desc, $form->generate_select_box('newusergroup', $options, $mybb->input['newusergroup'], array('id' => 'newusergroup')), 'newusergroup');
$options = array( 'primary' => $lang->primary_user_group, 'secondary' => $lang->secondary_user_group ); $form_container->output_row($lang->user_group_change_type." <em>*</em>", $lang->user_group_change_type_desc, $form->generate_select_box('usergroupchangetype', $options, $mybb->input['usergroupchangetype'], array('id' => 'usergroupchangetype')), 'usergroupchangetype');
$form_container->output_row($lang->enabled." <em>*</em>", "", $form->generate_yes_no_radio("enabled", $mybb->input['enabled'], true)); $form_container->output_row($lang->enable_logging." <em>*</em>", "", $form->generate_yes_no_radio("logging", $mybb->input['logging'], true)); $form_container->end();
$buttons[] = $form->generate_submit_button($lang->update_promotion);
$form->output_submit_wrapper($buttons); $form->end();
$page->output_footer();
| $form_container->output_row($lang->new_user_group." <em>*</em>", $lang->new_user_group_desc, $form->generate_select_box('newusergroup', $options, $mybb->input['newusergroup'], array('id' => 'newusergroup')), 'newusergroup');
$options = array( 'primary' => $lang->primary_user_group, 'secondary' => $lang->secondary_user_group ); $form_container->output_row($lang->user_group_change_type." <em>*</em>", $lang->user_group_change_type_desc, $form->generate_select_box('usergroupchangetype', $options, $mybb->input['usergroupchangetype'], array('id' => 'usergroupchangetype')), 'usergroupchangetype');
$form_container->output_row($lang->enabled." <em>*</em>", "", $form->generate_yes_no_radio("enabled", $mybb->input['enabled'], true)); $form_container->output_row($lang->enable_logging." <em>*</em>", "", $form->generate_yes_no_radio("logging", $mybb->input['logging'], true)); $form_container->end();
$buttons[] = $form->generate_submit_button($lang->update_promotion);
$form->output_submit_wrapper($buttons); $form->end();
$page->output_footer();
|
}
if($mybb->input['action'] == "add")
| }
if($mybb->input['action'] == "add")
|
Zeile 372 | Zeile 372 |
---|
if($mybb->request_method == "post") { if(!trim($mybb->input['title']))
|
if($mybb->request_method == "post") { if(!trim($mybb->input['title']))
|
{
| {
|
$errors[] = $lang->error_no_title;
|
$errors[] = $lang->error_no_title;
|
}
| }
|
if(!trim($mybb->input['description'])) {
| if(!trim($mybb->input['description'])) {
|
Zeile 382 | Zeile 382 |
---|
} if(empty($mybb->input['requirements']))
|
} if(empty($mybb->input['requirements']))
|
{
| {
|
$errors[] = $lang->error_no_requirements;
|
$errors[] = $lang->error_no_requirements;
|
}
| }
|
if(empty($mybb->input['originalusergroup'])) {
| if(empty($mybb->input['originalusergroup'])) {
|
Zeile 392 | Zeile 392 |
---|
} if(!trim($mybb->input['newusergroup']))
|
} if(!trim($mybb->input['newusergroup']))
|
{
| {
|
$errors[] = $lang->error_no_new_usergroup; }
| $errors[] = $lang->error_no_new_usergroup; }
|
Zeile 411 | Zeile 411 |
---|
{ $mybb->input['originalusergroup'] = implode(',', array_map('intval', $mybb->input['originalusergroup'])); }
|
{ $mybb->input['originalusergroup'] = implode(',', array_map('intval', $mybb->input['originalusergroup'])); }
|
|
|
$new_promotion = array( "title" => $db->escape_string($mybb->input['title']), "description" => $db->escape_string($mybb->input['description']),
| $new_promotion = array( "title" => $db->escape_string($mybb->input['title']), "description" => $db->escape_string($mybb->input['description']),
|
Zeile 440 | Zeile 440 |
---|
flash_message($lang->success_promo_added, 'success'); admin_redirect("index.php?module=user-group_promotions");
|
flash_message($lang->success_promo_added, 'success'); admin_redirect("index.php?module=user-group_promotions");
|
}
| }
|
} $page->add_breadcrumb_item($lang->add_new_promotion); $page->output_header($lang->user_group_promotions." - ".$lang->add_new_promotion);
| } $page->add_breadcrumb_item($lang->add_new_promotion); $page->output_header($lang->user_group_promotions." - ".$lang->add_new_promotion);
|
Zeile 595 | Zeile 595 |
---|
{ $log['oldusergroup'] = htmlspecialchars_uni($groupscache[$log['oldusergroup']]['title']); $log['newusergroup'] = htmlspecialchars_uni($groupscache[$log['newusergroup']]['title']);
|
{ $log['oldusergroup'] = htmlspecialchars_uni($groupscache[$log['oldusergroup']]['title']); $log['newusergroup'] = htmlspecialchars_uni($groupscache[$log['newusergroup']]['title']);
|
}
| }
|
if($log['type'] == "secondary") { $log['type'] = $lang->secondary;
| if($log['type'] == "secondary") { $log['type'] = $lang->secondary;
|
Zeile 612 | Zeile 612 |
---|
$table->construct_cell($log['oldusergroup'], array('style' => 'text-align: center;')); $table->construct_cell($log['newusergroup'], array('style' => 'text-align: center;')); $table->construct_cell($log['dateline'], array('style' => 'text-align: center;'));
|
$table->construct_cell($log['oldusergroup'], array('style' => 'text-align: center;')); $table->construct_cell($log['newusergroup'], array('style' => 'text-align: center;')); $table->construct_cell($log['dateline'], array('style' => 'text-align: center;'));
|
$table->construct_row(); } if($table->num_rows() == 0) {
| $table->construct_row(); } if($table->num_rows() == 0) {
|
$table->construct_cell($lang->no_promotion_logs, array("colspan" => "5")); $table->construct_row(); }
|
$table->construct_cell($lang->no_promotion_logs, array("colspan" => "5")); $table->construct_row(); }
|
|
|
$table->output($lang->promotion_logs); $query = $db->simple_select("promotionlogs", "COUNT(plid) as promotionlogs"); $total_rows = $db->fetch_field($query, "promotionlogs");
|
$table->output($lang->promotion_logs); $query = $db->simple_select("promotionlogs", "COUNT(plid) as promotionlogs"); $total_rows = $db->fetch_field($query, "promotionlogs");
|
echo "<br />".draw_admin_pagination($mybb->input['page'], "20", $total_rows, "index.php?module=user-group_promotions&action=logs&page={page}");
| echo "<br />".draw_admin_pagination($mybb->input['page'], "20", $total_rows, "index.php?module=user-group_promotions&action=logs&page={page}");
|
$page->output_footer(); }
| $page->output_footer(); }
|
Zeile 645 | Zeile 645 |
---|
$query = $db->simple_select("promotions", "*", "", array("order_by" => "title", "order_dir" => "asc")); while($promotion = $db->fetch_array($query))
|
$query = $db->simple_select("promotions", "*", "", array("order_by" => "title", "order_dir" => "asc")); while($promotion = $db->fetch_array($query))
|
{
| {
|
$promotion['title'] = htmlspecialchars_uni($promotion['title']); $promotion['description'] = htmlspecialchars_uni($promotion['description']); $table->construct_cell("<div><strong><a href=\"index.php?module=user-group_promotions&action=edit&pid={$promotion['pid']}\">{$promotion['title']}</a></strong><br /><small>{$promotion['description']}</small></div>");
| $promotion['title'] = htmlspecialchars_uni($promotion['title']); $promotion['description'] = htmlspecialchars_uni($promotion['description']); $table->construct_cell("<div><strong><a href=\"index.php?module=user-group_promotions&action=edit&pid={$promotion['pid']}\">{$promotion['title']}</a></strong><br /><small>{$promotion['description']}</small></div>");
|
Zeile 655 | Zeile 655 |
---|
if($promotion['enabled'] == 1) { $popup->add_item($lang->disable_promotion, "index.php?module=user-group_promotions&action=disable&pid={$promotion['pid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_promo_disable}')");
|
if($promotion['enabled'] == 1) { $popup->add_item($lang->disable_promotion, "index.php?module=user-group_promotions&action=disable&pid={$promotion['pid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_promo_disable}')");
|
}
| }
|
else { $popup->add_item($lang->enable_promotion, "index.php?module=user-group_promotions&action=enable&pid={$promotion['pid']}&my_post_key={$mybb->post_code}");
| else { $popup->add_item($lang->enable_promotion, "index.php?module=user-group_promotions&action=enable&pid={$promotion['pid']}&my_post_key={$mybb->post_code}");
|
Zeile 675 | Zeile 675 |
---|
$page->output_footer(); }
|
$page->output_footer(); }
|
| |
?>
| ?>
|