kas gali padeti predit mokejimo sistema kad norint sukurti bloga taip pat kaip ir registacijoi reikia issiusti sms ir suvesti koda ir permeta i ta psulapi.
Code
if (!defined(\"IN_FUSION\")) { header(\"Location: \".BASEDIR.\"index.php\"); }
if (file_exists(INFUSIONS.\"ti_blog_system/locale/\".LOCALESET.\"createblog.php\")) {
include INFUSIONS.\"ti_blog_system/locale/\".LOCALESET.\"createblog.php\";
include BASEDIR.\"locale/\".LOCALESET.\"register.php\";
} else {
include INFUSIONS.\"ti_blog_system/locale/English/createblog.php\";
}
if (isset($_GET['rowstart'])) $rowstart = $_GET['rowstart'];
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($settings['version'] >= 7) include_once INCLUDES.\"bbcode_include.php\";
if (file_exists(INFUSIONS.\"ti_blog_system/blog_includes.php\")) {
include INFUSIONS.\"ti_blog_system/blog_includes.php\";
ti_blog_createblog();
} else {
opentable(\"Error\");
echo 'Failed loading requested file (blog_include.php)! Please check your files.';
closetable();
}
echo \"\n\";
?>
registracijos
Code
require_once \"maincore.php\";
require_once THEMES.\"templates/header.php\";
include LOCALE.LOCALESET.\"register.php\";
include LOCALE.LOCALESET.\"user_fields.php\";
if (iMEMBER || !$settings['enable_registration']) { redirect(\"index.php\"); }
if (isset($_GET['activate'])) {
if (!preg_check(\"/^[0-9a-z]{32}$/\", $_GET['activate'])) { redirect(\"index.php\"); }
$result = dbquery(\"SELECT * FROM \".DB_NEW_USERS.\" WHERE user_code='\".$_GET['activate'].\"'\");
if (dbrows($result)) {
$data = dbarray($result);
$user_info = unserialize($data['user_info']);
$user_status = $settings['admin_activation'] == \"1\" ? \"2\" : \"0\";
$profile_method = \"validate_insert\"; $db_fields = \"\"; $db_values = \"\";
$result = dbquery(\"SELECT * FROM \".DB_USER_FIELDS.\" ORDER BY field_order\");
if (dbrows($result)) {
while($data = dbarray($result)) {
if (file_exists(LOCALE.LOCALESET.\"user_fields/\".$data['field_name'].\".php\")) {
include LOCALE.LOCALESET.\"user_fields/\".$data['field_name'].\".php\";
}
if (file_exists(INCLUDES.\"user_fields/\".$data['field_name'].\"_include.php\")) {
include INCLUDES.\"user_fields/\".$data['field_name'].\"_include.php\";
}
}
}
if (!isset($_POST['sms_kodas'])) redirect(\"index.php\"); //Jei kodas nenurodytas perkelia i index.php
$kodas = stripinput($_POST['sms_kodas']);
$kodas2 = md5(md5($kodas));
$result = dbquery(\"SELECT * FROM \".$db_prefix.\"moketojai WHERE moketojas_kodas='\".$kodas2.\"' && moketojas_aktyvus='0' LIMIT 1\"); //Patikrina ar toks kodas yra
if (!dbrows($result)) { //Jei rezultatu nerasta ismeta klaida ir neleidzia registruotis
opentable(\"Klaida\");
echo \"vestas kodas neteisingas!\";
closetable();
} else { //Viskas gerai, galite registruotis :)
$profile_method = \"validate_insert\"; $db_fields = \"\"; $db_values = \"\";
$result = dbquery(\"SELECT * FROM \".DB_USER_FIELDS.\" ORDER BY field_order\");
if (dbrows($result)) {
while($data = dbarray($result)) {
if (file_exists(LOCALE.LOCALESET.\"user_fields/\".$data['field_name'].\".php\")) {
include LOCALE.LOCALESET.\"user_fields/\".$data['field_name'].\".php\";
}
if (file_exists(INCLUDES.\"user_fields/\".$data['field_name'].\"_include.php\")) {
include INCLUDES.\"user_fields/\".$data['field_name'].\"_include.php\";
}
}
}
}
if ($error == \"\") {
if ($settings['email_verification'] == \"1\") {
require_once INCLUDES.\"sendmail_include.php\";
mt_srand((double)microtime()*1000000); $salt = \"\";
for ($i = 0; $i <= 7; $i++) { $salt .= chr(rand(97, 122)); }
$user_code = md5($email.$salt);
$activation_url = $settings['siteurl'].\"register.php?activate=\".$user_code;
if (sendemail($username,$email,$settings['siteusername'], $settings['siteemail'], $locale['449'], $locale['450'].$activation_url)) {
$user_info = serialize(array(
\"user_name\" => $username,
\"user_password\" => md5(md5($password1)),
\"user_email\" => $email,
\"user_hide_email\" => isnum($_POST['user_hide_email']) ? $_POST['user_hide_email'] : \"1\"
));
$result = dbquery(\"SELECT * FROM \".$db_prefix.\"moketojai WHERE moketojas_kodas='\".$kodas2.\"' && moketojas_aktyvus='0' LIMIT 1\"); //Iesko eilutes DB su ivestu kodu
if (dbrows($result)) { //Tikrina ar yra rezultatu
$result = dbquery(\"UPDATE \".$db_prefix.\"moketojai SET moketojas_aktyvus='1' WHERE moketojas_kodas='\".$kodas2.\"' && moketojas_aktyvus='0'\"); //Nustato, kad aktyvavimo kodas panaudotas
} else { //Jei rezutatu nera
redirect(\"index.php\"); //Permeta i index.php
}
$result = dbquery(\"INSERT INTO \".DB_NEW_USERS.\" (user_code, user_email, user_datestamp, user_info) VALUES('$user_code', '\".$email.\"', '\".time().\"', '$user_info')\");
opentable($locale['400']);
echo \"
$result = dbquery(\"SELECT * FROM \".$db_prefix.\"moketojai WHERE moketojas_kodas='\".$kodas2.\"' && moketojas_aktyvus='0' LIMIT 1\"); //Iesko eilutes DB su ivestu kodu
if (dbrows($result)) { //Tikrina ar yra rezultatu
$result = dbquery(\"UPDATE \".$db_prefix.\"moketojai SET moketojas_aktyvus='1' WHERE moketojas_kodas='\".$kodas2.\"' && moketojas_aktyvus='0'\"); //Nustato, kad aktyvavimo kodas panaudotas
} else { //Jei rezutatu nera
redirect(\"index.php\"); //Permeta i index.php
}