echoheader("user", "Personal Data", make_breadcrumbs('main/options=options/Personal Data')); } foreach ($member_db as $key => $value) { $member_db[$key] = stripslashes(preg_replace(array("'\"'", "'\\''"), array(""", "'"), $member_db[$key])); } // define access level $access_level = array(ACL_LEVEL_ADMIN => 'administrator', ACL_LEVEL_EDITOR => 'editor', ACL_LEVEL_JOURNALIST => 'journalist', ACL_LEVEL_COMMENTER => 'commenter'); echo proc_tpl('options/personal', array('member_db[2]' => $member_db[UDB_NAME], 'member_db[4]' => $member_db[UDB_NICK], 'member_db[5]' => $member_db[UDB_EMAIL], 'member_db[6]' => $member_db[UDB_COUNT], 'member_db[8]' => $member_db[UDB_AVATAR], 'ifchecked' => $member_db[UDB_CBYEMAIL] == 1 ? "checked" : false, 'access_level' => $access_level[$member_db[UDB_ACL]], 'registrationdate' => date("D, d F Y", $member_db[0]), 'bg' => $member_db[UDB_ACL] < ACL_LEVEL_COMMENTER ? "bgcolor=#F7F6F4" : false), array('NOTCOMMENTER' => $member_db[UDB_ACL] < ACL_LEVEL_COMMENTER)); echofooter(); } elseif ($action == "dosavepersonal") { CSRFCheck(); $username = $member_db[UDB_NAME]; $editnickname = replace_comment("add", $editnickname); $editmail = replace_comment("add", $editmail); $edithidemail = replace_comment("add", $edithidemail); $change_avatar = replace_comment("add", $change_avatar); if ($editpassword and !preg_match("/^[\\.A-z0-9_\\-]{1,31}\$/i", $editpassword)) { msg("error", lang('Error!'), lang("Your password must contain only valid characters and numbers"), '#GOBACK'); } $edithidemail = $edithidemail ? 1 : 0; $pack = user_search($username); // editing password (with confirm) if ($editpassword) { if ($confirmpassword == $editpassword) { $hashs = hash_generate($editpassword); $pack[UDB_PASS] = $hashs[count($hashs) - 1]; } else { msg('error', lang('Error!'), lang('Confirm password not match'), "#GOBACK"); } } $pack[UDB_NICK] = $editnickname;
if ($config_auto_wrap > 1) { $comments_arr = explode("\n", $comments); foreach ($comments_arr as $line) { $wraped_comm .= preg_replace("([^ \\/\\/]{" . $config_auto_wrap . "})", "\\1\n", $line) . "\n"; } if (strlen($name) > $config_auto_wrap) { $name = substr($name, 0, $config_auto_wrap) . " ..."; } $comments = $wraped_comm; } //---------------------------------- // Do some validation check 4 name, mail.. //---------------------------------- $comments = replace_comment("add", $comments); $name = replace_comment("add", preg_replace("/\n/", "", $name)); $mail = replace_comment("add", preg_replace("/\n/", "", $mail)); if (trim($name) == false) { echo '<div class="blocking_posting_comment">' . lang('You must enter name') . '.<br /><a href="javascript:history.go(-1)">' . lang('go back') . '</a></div>'; return FALSE; } if (trim($mail) == false) { $mail = "none"; } else { $ok = false; if (preg_match("/^[\\.A-z0-9_\\-\\+]+[@][A-z0-9_\\-]+([.][A-z0-9_\\-]+)+[A-z]{1,4}\$/i", $mail)) { $ok = true; } elseif ($config_allow_url_instead_mail == "yes" and preg_match("/((http(s?):\\/\\/)|(www\\.))([\\w\\.]+)([\\/\\w+\\.-?]+)/i", $mail)) { $ok = true; } elseif ($config_allow_url_instead_mail != "yes") { echo '<div class="blocking_posting_comment">' . lang('This is not a valid e-mail') . '<br /><a href="javascript:history.go(-1)">' . lang('go back') . '</a></div>'; return FALSE;
$row = mysql_fetch_object($result); $msgid = $row->msgid; $msgid = addslashes($msgid) . " " . $extra; $sql = "update {$db_table} set msgid = '{$msgid}' where id={$last_id}"; $result = mysql_query($sql) or die("Can't do the additional msgid insert"); break; } // end of switch statement } // end of elseif statement } // end of while (fileread) loop // close the file fclose($fp) or die("Can't close " . $import_file . " ..."); // replace the header info in the file with standard kartouche headers // specify the headers in the replace_comment and replace_msgstr functions in // includes/fns.php $comment = replace_comment(); $msgstr = addslashes(replace_msgstr()); $sql = "update {$db_table}\n set comment='{$comment}',\n msgstr='{$msgstr}',\n suggestion=' '\n where id=1"; $result = mysql_query($sql) or die("Can't update the header"); // report success to the user echo $import_file . " " . $success_msg . "<br>"; } } } else { echo $dir_name . " ~~~ " . $dir_value . "<br>"; } } echo "</div>"; include "../includes/footer.php";
# {comnum} & altcolors if ($i % 2 == 0) { $com_alternating = "cn_comment_odd"; } else { $com_alternating = "cn_comment_even"; } $output = str_replace("{alternating}", $com_alternating, $output); $i++; $output = str_replace("{comnum}", $cjnumber, $output); if ($config_reverse_comments == "yes") { $cjnumber--; } else { $cjnumber++; } $output = run_filters('news-comment', $output); $output = replace_comment("show", $output); echo $output; } } } } # Comments Pagination if ($config_comments_pagination == "Yes") { $cprev_next_msg = $template_cprev_next; $nextcstart = $cstart + $cnum; $prevcstart = $cstart - $cnum; $COM_REQUEST_URI = $PHP_SELF . "?" . cute_query_string($QUERY_STRING, array("cstart")); # <--- Previous if ($cstart > 1 + $cghost) { $cprev_next_msg = preg_replace("'\\[prev-link\\](.*?)\\[/prev-link\\]'si", "<a href=\"{$COM_REQUEST_URI}&cstart={$prevcstart}\">\\1</a>", $cprev_next_msg); } else {