Zeile 48 | Zeile 48 |
---|
$errors[] = $lang->error_missing_posts; }
|
$errors[] = $lang->error_missing_posts; }
|
$query = $db->simple_select("usertitles", "utid", "posts= '".(int)$mybb->input['posts']."'");
| $query = $db->simple_select("usertitles", "utid", "posts= '".$mybb->get_input('posts', MyBB::INPUT_INT)."'");
|
if($db->num_rows($query)) { $errors[] = $lang->error_cannot_have_same_posts;
| if($db->num_rows($query)) { $errors[] = $lang->error_cannot_have_same_posts;
|
Zeile 58 | Zeile 58 |
---|
{ $new_title = array( "title" => $db->escape_string($mybb->input['title']),
|
{ $new_title = array( "title" => $db->escape_string($mybb->input['title']),
|
"posts" => (int)$mybb->input['posts'], "stars" => (int)$mybb->input['stars'],
| "posts" => $mybb->get_input('posts', MyBB::INPUT_INT), "stars" => $mybb->get_input('stars', MyBB::INPUT_INT),
|
"starimage" => $db->escape_string($mybb->input['starimage']) );
$utid = $db->insert_query("usertitles", $new_title);
|
"starimage" => $db->escape_string($mybb->input['starimage']) );
$utid = $db->insert_query("usertitles", $new_title);
|
$cache->update_usertitles();
$plugins->run_hooks("admin_user_titles_add_commit");
| $plugins->run_hooks("admin_user_titles_add_commit");
$cache->update_usertitles();
|
// Log admin action log_admin_action($utid, $mybb->input['title'], $mybb->input['posts']);
| // Log admin action log_admin_action($utid, $mybb->input['title'], $mybb->input['posts']);
|
Zeile 83 | Zeile 83 |
---|
'starimage' => '{theme}/star.png', ) );
|
'starimage' => '{theme}/star.png', ) );
|
}
| }
|
$page->add_breadcrumb_item($lang->add_new_user_title); $page->output_header($lang->user_titles." - ".$lang->add_new_user_title);
$page->output_nav_tabs($sub_tabs, 'add_title'); $form = new Form("index.php?module=user-titles&action=add", "post");
|
$page->add_breadcrumb_item($lang->add_new_user_title); $page->output_header($lang->user_titles." - ".$lang->add_new_user_title);
$page->output_nav_tabs($sub_tabs, 'add_title'); $form = new Form("index.php?module=user-titles&action=add", "post");
|
|
|
if($errors) { $page->output_inline_error($errors); }
|
if($errors) { $page->output_inline_error($errors); }
|
|
|
$form_container = new FormContainer($lang->add_new_user_title);
|
$form_container = new FormContainer($lang->add_new_user_title);
|
$form_container->output_row($lang->title_to_assign."<em>*</em>", $lang->title_to_assign_desc, $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title'); $form_container->output_row($lang->minimum_posts, $lang->minimum_posts_desc, $form->generate_text_box('posts', $mybb->input['posts'], array('id' => 'posts')), 'posts'); $form_container->output_row($lang->number_of_stars, $lang->number_of_stars_desc, $form->generate_text_box('stars', $mybb->input['stars'], array('id' => 'stars')), 'stars'); $form_container->output_row($lang->star_image, $lang->star_image_desc, $form->generate_text_box('starimage', $mybb->input['starimage'], array('id' => 'starimage')), 'starimage'); $form_container->end();
$buttons[] = $form->generate_submit_button($lang->save_user_title);
$form->output_submit_wrapper($buttons);
| $form_container->output_row($lang->title_to_assign."<em>*</em>", $lang->title_to_assign_desc, $form->generate_text_box('title', $mybb->get_input('title'), array('id' => 'title')), 'title'); $form_container->output_row($lang->minimum_posts, $lang->minimum_posts_desc, $form->generate_numeric_field('posts', $mybb->get_input('posts'), array('id' => 'posts', 'min' => 0)), 'posts'); $form_container->output_row($lang->number_of_stars, $lang->number_of_stars_desc, $form->generate_numeric_field('stars', $mybb->get_input('stars'), array('id' => 'stars', 'min' => 0)), 'stars'); $form_container->output_row($lang->star_image, $lang->star_image_desc, $form->generate_text_box('starimage', $mybb->get_input('starimage'), array('id' => 'starimage')), 'starimage'); $form_container->end();
$buttons[] = $form->generate_submit_button($lang->save_user_title);
$form->output_submit_wrapper($buttons);
|
$form->end();
$page->output_footer();
| $form->end();
$page->output_footer();
|
Zeile 114 | Zeile 114 |
---|
if($mybb->input['action'] == "edit") {
|
if($mybb->input['action'] == "edit") {
|
$query = $db->simple_select("usertitles", "*", "utid='".(int)$mybb->input['utid']."'");
| $query = $db->simple_select("usertitles", "*", "utid='".$mybb->get_input('utid', MyBB::INPUT_INT)."'");
|
$usertitle = $db->fetch_array($query);
|
$usertitle = $db->fetch_array($query);
|
if(!$usertitle['utid'])
| if(!$usertitle)
|
{ flash_message($lang->error_invalid_user_title, 'error'); admin_redirect("index.php?module=user-titles");
| { flash_message($lang->error_invalid_user_title, 'error'); admin_redirect("index.php?module=user-titles");
|
Zeile 137 | Zeile 137 |
---|
$errors[] = $lang->error_missing_posts; }
|
$errors[] = $lang->error_missing_posts; }
|
$query = $db->simple_select("usertitles", "utid", "posts= '".(int)$mybb->input['posts']."' AND utid!= '".(int)$mybb->input['utid']."'");
| $query = $db->simple_select("usertitles", "utid", "posts= '".$mybb->get_input('posts', MyBB::INPUT_INT)."' AND utid!= '".$mybb->get_input('utid', MyBB::INPUT_INT)."'");
|
if($db->num_rows($query)) { $errors[] = $lang->error_cannot_have_same_posts;
| if($db->num_rows($query)) { $errors[] = $lang->error_cannot_have_same_posts;
|
Zeile 147 | Zeile 147 |
---|
{ $updated_title = array( "title" => $db->escape_string($mybb->input['title']),
|
{ $updated_title = array( "title" => $db->escape_string($mybb->input['title']),
|
"posts" => (int)$mybb->input['posts'], "stars" => (int)$mybb->input['stars'],
| "posts" => $mybb->get_input('posts', MyBB::INPUT_INT), "stars" => $mybb->get_input('stars', MyBB::INPUT_INT),
|
"starimage" => $db->escape_string($mybb->input['starimage']) );
|
"starimage" => $db->escape_string($mybb->input['starimage']) );
|
$db->update_query("usertitles", $updated_title, "utid='{$usertitle['utid']}'");
| $plugins->run_hooks("admin_user_titles_edit_commit");
|
|
|
$cache->update_usertitles();
$plugins->run_hooks("admin_user_titles_edit_commit");
| $db->update_query("usertitles", $updated_title, "utid='{$usertitle['utid']}'");
$cache->update_usertitles();
|
// Log admin action log_admin_action($usertitle['utid'], $mybb->input['title'], $mybb->input['posts']);
| // Log admin action log_admin_action($usertitle['utid'], $mybb->input['title'], $mybb->input['posts']);
|
Zeile 165 | Zeile 165 |
---|
admin_redirect("index.php?module=user-titles"); } }
|
admin_redirect("index.php?module=user-titles"); } }
|
|
|
$page->add_breadcrumb_item($lang->edit_user_title); $page->output_header($lang->user_titles." - ".$lang->edit_user_title);
|
$page->add_breadcrumb_item($lang->edit_user_title); $page->output_header($lang->user_titles." - ".$lang->edit_user_title);
|
|
|
$sub_tabs['edit_title'] = array( 'title' => $lang->edit_user_title,
|
$sub_tabs['edit_title'] = array( 'title' => $lang->edit_user_title,
|
'link' => "index.php?module=user-titles&action=edit&uid=".$mybb->input['uid'],
| 'link' => "index.php?module=user-titles&action=edit&utid=".$usertitle['utid'],
|
'description' => $lang->edit_user_title_desc );
| 'description' => $lang->edit_user_title_desc );
|
Zeile 190 | Zeile 190 |
---|
$form_container = new FormContainer($lang->edit_user_title); $form_container->output_row($lang->title_to_assign."<em>*</em>", $lang->title_to_assign_desc, $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
|
$form_container = new FormContainer($lang->edit_user_title); $form_container->output_row($lang->title_to_assign."<em>*</em>", $lang->title_to_assign_desc, $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
|
$form_container->output_row($lang->minimum_posts, $lang->minimum_posts_desc, $form->generate_text_box('posts', $mybb->input['posts'], array('id' => 'posts')), 'posts'); $form_container->output_row($lang->number_of_stars, $lang->number_of_stars_desc, $form->generate_text_box('stars', $mybb->input['stars'], array('id' => 'stars')), 'stars');
| $form_container->output_row($lang->minimum_posts, $lang->minimum_posts_desc, $form->generate_numeric_field('posts', $mybb->input['posts'], array('id' => 'posts', 'min' => 0)), 'posts'); $form_container->output_row($lang->number_of_stars, $lang->number_of_stars_desc, $form->generate_numeric_field('stars', $mybb->input['stars'], array('id' => 'stars', 'min' => 0)), 'stars');
|
$form_container->output_row($lang->star_image, $lang->star_image_desc, $form->generate_text_box('starimage', $mybb->input['starimage'], array('id' => 'starimage')), 'starimage'); $form_container->end();
| $form_container->output_row($lang->star_image, $lang->star_image_desc, $form->generate_text_box('starimage', $mybb->input['starimage'], array('id' => 'starimage')), 'starimage'); $form_container->end();
|
Zeile 206 | Zeile 206 |
---|
if($mybb->input['action'] == "delete") {
|
if($mybb->input['action'] == "delete") {
|
$query = $db->simple_select("usertitles", "*", "utid='".(int)$mybb->input['utid']."'");
| $query = $db->simple_select("usertitles", "*", "utid='".$mybb->get_input('utid', MyBB::INPUT_INT)."'");
|
$usertitle = $db->fetch_array($query);
|
$usertitle = $db->fetch_array($query);
|
if(!$usertitle['utid'])
| if(!$usertitle)
|
{ flash_message($lang->error_invalid_user_title, 'error'); admin_redirect("index.php?module=user-titles"); }
// User clicked no
|
{ flash_message($lang->error_invalid_user_title, 'error'); admin_redirect("index.php?module=user-titles"); }
// User clicked no
|
if($mybb->input['no'])
| if($mybb->get_input('no'))
|
{ admin_redirect("index.php?module=user-titles"); }
| { admin_redirect("index.php?module=user-titles"); }
|
Zeile 230 | Zeile 230 |
---|
$plugins->run_hooks("admin_user_titles_delete_commit");
$cache->update_usertitles();
|
$plugins->run_hooks("admin_user_titles_delete_commit");
$cache->update_usertitles();
|
|
|
// Log admin action log_admin_action($usertitle['utid'], $usertitle['title'], $usertitle['posts']);
| // Log admin action log_admin_action($usertitle['utid'], $usertitle['title'], $usertitle['posts']);
|
Zeile 271 | Zeile 271 |
---|
{ $table->construct_cell($lang->no_user_titles, array('colspan' => 4)); $table->construct_row();
|
{ $table->construct_cell($lang->no_user_titles, array('colspan' => 4)); $table->construct_row();
|
$no_results = true;
| |
}
$table->output($lang->manage_user_titles);
| }
$table->output($lang->manage_user_titles);
|