Przedszkolak
Postów: 62 Ostrzeżeń: 2
Data rejestracji: 21.05.2009 17:24
|
Sony, nie mam field_group w tym pliku.
Plik usercp.php wygląda tak
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: setuser.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| Power Fusion Forum v.2.2.0
| Copyright © 2008-2009 Powered by .:MeF:.
| URL: http://x-iweb.ru/
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../maincore.php";
require_once FORUM."includes/function.php";
require_once THEMES."templates/header.php";
require_once LOCALE.LOCALESET."forum/main.php";
require_once LOCALE.LOCALESET."forum/usercp.php";
include LOCALE.LOCALESET."user_fields.php";
if (iMEMBER) {
$user_id = $userdata['user_id'];
$user_data = $userdata;
opentable($locale['CP100']);
nav_menu("main", false, false);
echo "<table cellpadding='0' cellspacing='1' width='100%' style='margin: 0.8em 0em 0em 0em;'>\n";
echo "<tr>\n";
echo "<td width='100%' valign='top'>\n";
echo "<div class='tbl-border' style='width:24%; float:left;'><div class='tbl2'>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr><td class='tbl2'><a href='".FUSION_SELF."'><b>".$locale['CP101']."</b></a></td></tr>\n";
echo "</table>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr><td class='tbl2'>".$locale['CP102']."</td></tr>\n";
echo "<tr><td class='tbl1'>";
echo "<div><img src='".THEME."images/bullet.gif' alt='' /><span> </span><a href='".FUSION_SELF."?pm&msg_send=0'>".$locale['CP103']."</a></div>\n";
echo "<div><img src='".FORUM."images/priv.png' alt='' style='vertical-align:middle; border: 0;' /><span> </span><a href='".FUSION_SELF."?pm&folder=inbox'>".$locale['CP104']."</a></div>\n";
echo "<div><img src='".FORUM."images/priv.png' alt='' style='vertical-align:middle; border: 0;' /><span> </span><a href='".FUSION_SELF."?pm&folder=outbox'>".$locale['CP105']."</a></div>\n";
echo "<div><img src='".THEME."images/bullet.gif' alt='' /><span> </span><a href='".FUSION_SELF."?pm&folder=archive'>".$locale['CP106']."</a></div>\n";
echo "<div><img src='".THEME."images/bullet.gif' alt='' /><span> </span><a href='".FUSION_SELF."?pm&folder=options'>".$locale['CP107']."</a></div>\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr><td class='tbl2'>".$locale['CP108']."</td></tr>\n";
echo "<tr><td class='tbl1'>";
echo "<div><img src='".THEME."images/bullet.gif' alt='' /><span> </span><a href='".FUSION_SELF."?subscription=".$user_id."'>".$locale['CP109']."</a></div>\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr><td class='tbl2'>".$locale['CP110']."</td></tr>\n";
echo "<tr><td class='tbl1'>";
echo "<div><img src='".THEME."images/bullet.gif' alt='' /><span> </span><a href='".FUSION_SELF."?editprofile=".$user_id."'>".$locale['CP111']."</a></div>\n";
echo "<div><img src='".THEME."images/bullet.gif' alt='' /><span> </span><a href='".FUSION_SELF."?editsignature=".$user_id."'>".$locale['CP112']."</a></div>\n";
echo "<div><img src='".THEME."images/bullet.gif' alt='' /><span> </span><a href='".FUSION_SELF."?editavatar=".$user_id."'>".$locale['CP113']."</a></div>\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
echo "<tr><td class='tbl2'>".$locale['CP114']."</td></tr>\n";
echo "<tr><td class='tbl1'>";
echo "<div><img src='".THEME."images/bullet.gif' alt='' /><span> </span><a href='".FUSION_SELF."?editattachments=".$user_id."'>".$locale['CP115']."</a></div>\n";
echo "<div><img src='".THEME."images/bullet.gif' alt='' /><span> </span><a href='".FUSION_SELF."?editpassword=".$user_id."'>".$locale['CP116']."</a></div>\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "</div></div><div class='tbl-border' style='width:75%; float:right'><div class='tbl2'>\n";
if (isset($_GET['editprofile']) && isnum($_GET['editprofile']) && $_GET['editprofile'] == $user_id) {
if (!isset($_GET['editprofile']) || !isnum($_GET['editprofile'])) { redirect("index.php"); }
require_once LOCALE.LOCALESET."edit_profile.php";
if (isset($_GET['update_profile'])) {
$db_values = "";
$result = dbquery("SELECT * FROM ".DB_USER_FIELDS." WHERE field_name != 'user_sig' ORDER BY field_order");
if (dbrows($result)) {
$profile_method = "validate_update";
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";
}
}
}
$result = dbquery("UPDATE ".DB_USERS." SET user_name='".$user_data['user_name']."'".$db_values." WHERE user_id='".$user_data['user_id']."'");
redirect("".FUSION_SELF."?editprofile=".$_GET['editprofile']."");
}
$offset_list = "";
for ($i = -13; $i < 17; $i++) {
if ($i > 0) { $offset = "+".$i; } else { $offset = $i; }
$offset_list .= "<option".($offset == $user_data['user_offset'] ? " selected='selected'" : "").">".$offset."</option>\n";
}
set_title($locale['CP111']." - ".$settings['sitename']);
echo "<form name='inputform' method='post' action='".FUSION_SELF."?editprofile=".$_GET['editprofile']."&update_profile'>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr><td class='tbl2' colspan='2'><b>".$locale['CP111']."</b></td></tr>\n";
echo "</table>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl1'>\n";
$profile_method = "input";
$result2 = dbquery("SELECT * FROM ".DB_USER_FIELDS." WHERE field_cat != '4' GROUP BY field_cat");
while($data2 = dbarray($result2)) {
$result3 = dbquery("SELECT * FROM ".DB_USER_FIELDS." WHERE field_cat='".$data2['field_cat']."' AND field_name != 'user_sig' ORDER BY field_order");
if (dbrows($result3)) {
echo "</tr>\n";
while($data3 = dbarray($result3)) {
if (file_exists(LOCALE.LOCALESET."user_fields/".$data3['field_name'].".php")) {
include LOCALE.LOCALESET."user_fields/".$data3['field_name'].".php";
}
if (file_exists(INCLUDES."user_fields/".$data3['field_name']."_include.php")) {
include INCLUDES."user_fields/".$data3['field_name']."_include.php";
}
}
}
}
echo "<tr>\n<td align='center' colspan='2' class='tbl'><br />\n";
echo "<input type='submit' name='' value='".$locale['CP201']."' class='button' /></td>\n";
echo "</tr>\n</table>\n</form>\n";
} else if (isset($_GET['editpassword']) && isnum($_GET['editpassword']) && $_GET['editpassword'] == $user_id) {
if (!isset($_GET['editpassword']) || !isnum($_GET['editpassword'])) { redirect("index.php"); }
require_once LOCALE.LOCALESET."edit_profile.php";
require_once LOCALE.LOCALESET."user_fields.php";
if (isset($_GET['update_profile'])) {
$user_name = trim(eregi_replace(" +", " ", $_POST['user_name']));
$user_email = trim(stripinput($_POST['user_email']));
$user_new_password = trim(stripinput($_POST['user_new_password']));
$user_new_password2 = trim(stripinput($_POST['user_new_password2']));
if (iADMIN) {
$user_new_admin_password = trim(stripinput($_POST['user_new_admin_password']));
$user_new_admin_password2 = trim(stripinput($_POST['user_new_admin_password2']));
} else {
$user_new_admin_password = "";
}
if ($user_name == "" || $user_email == "") {
$error .= $locale['430']."<br />\n";
} else {
if (preg_check("/^[-0-9A-Z_@\s]+$/i", $user_name)) {
if ($user_name != $user_data['user_name']) {
$result = dbquery("SELECT user_name FROM ".DB_USERS." WHERE user_name='".$user_name."' AND user_id<>'".$userdata['user_id']."'");
if (dbrows($result)) {
$error .= $locale['432']."<br />\n";
}
}
} else {
$error .= $locale['431']."<br />\n";
}
if (preg_check("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $user_email)) {
if ($user_email != $user_data['user_email']) {
if ((isset($_POST['user_password'])) && md5(md5($_POST['user_password'])) == $user_data['user_password']) {
$result = dbquery("SELECT user_email FROM ".DB_USERS." WHERE user_email='".$user_email."'");
if (dbrows($result)) {
$error .= $locale['434']."<br />\n";
}
} else {
$error .= $locale['437']."<br />\n";
}
}
} else {
$error .= $locale['433']."<br />\n";
}
}
if ($user_new_password) {
if ((isset($_POST['user_password'])) && md5(md5($_POST['user_password'])) == $user_data['user_password']) {
if ($user_new_password2 != $user_new_password) {
$error .= $locale['435']."<br />";
} else {
if (!preg_match("/^[0-9A-Z@]{6,20}$/i", $user_new_password)) {
$error .= $locale['436']."<br />\n";
}
if ((md5(md5($user_new_password)) == md5(md5($user_new_admin_password))) || (md5(md5($user_new_password)) == $user_data['user_admin_password'])) {
$error .= $locale['439']."<br><br>\n";
}
}
} else {
$error .= $locale['437']."<br />\n";
}
}
if (iADMIN && $user_new_admin_password) {
if ($user_data['user_admin_password']) {
if ((!isset($_POST['user_admin_password'])) || md5(md5($_POST['user_admin_password'])) != $user_data['user_admin_password']) {
$error .= $locale['441']."<br />\n";
}
}
if (!$error) {
if ($user_new_admin_password2 != $user_new_admin_password) {
$error .= $locale['438']."<br />";
} else {
if (!preg_match("/^[0-9A-Z@]{6,20}$/i", $user_new_admin_password)) {
$error .= $locale['440']."<br />\n";
}
if ((md5(md5($user_new_admin_password)) == md5(md5($user_new_password))) || (md5(md5($user_new_admin_password)) == $user_data['user_password'])) {
$error .= $locale['439']."<br><br>\n";
}
}
}
}
$user_hide_email = isnum($_POST['user_hide_email']) ? $_POST['user_hide_email'] : "1";
if ($user_new_password) { $new_pass = " user_password='".md5(md5($user_new_password))."', "; } else { $new_pass = " "; }
if (iADMIN && $user_new_admin_password) { $new_admin_pass = " user_admin_password='".md5(md5($user_new_admin_password))."', "; } else { $new_admin_pass = " "; }
$result = dbquery("UPDATE ".DB_USERS." SET user_name='$user_name',".$new_pass.$new_admin_pass."user_email='$user_email', user_hide_email='$user_hide_email' WHERE user_id='".$user_data['user_id']."'");
redirect("".FUSION_SELF."?editpassword=".$_GET['editpassword']."");
}
set_title($locale['CP116']." - ".$settings['sitename']);
echo "<form name='inputform' method='post' action='".FUSION_SELF."?editpassword=".$_GET['editpassword']."&update_profile'>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr><td class='tbl2' colspan='2'><b>".$locale['CP116']."</b></td></tr>\n";
echo "</table>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl1'>\n";
echo "<tr>\n<td align='center' colspan='2' class='tbl'>".$locale['CP203']."<br /><br />\n</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['u001'].":<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='user_name' value='".$user_data['user_name']."' maxlength='30' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['420'].":</td>\n";
echo "<td class='tbl'><input type='password' name='user_password' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['u003'].":</td>\n";
echo "<td class='tbl'><input type='password' name='user_new_password' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['u004'].":</td>\n";
echo "<td class='tbl'><input type='password' name='user_new_password2' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
if (iADMIN) {
if ($user_data['user_admin_password']) {
echo "<td class='tbl2'>".$locale['421'].":</td>\n";
echo "<td class='tbl2'><input type='password' name='user_admin_password' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
}
echo "<td class='tbl2'>".$locale['422'].":</td>\n";
echo "<td class='tbl2'><input type='password' name='user_new_admin_password' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl2'>".$locale['423'].":</td>\n";
echo "<td class='tbl2'><input type='password' name='user_new_admin_password2' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
}
echo "<td class='tbl'>".$locale['u005'].":<span style='color:#ff0000'>*</span></td>\n";
echo "<td class='tbl'><input type='text' name='user_email' value='".$user_data['user_email']."' maxlength='100' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl'>".$locale['u006'].":</td>\n";
echo "<td class='tbl'><label><input type='radio' name='user_hide_email' value='1'".($user_data['user_hide_email'] == "1" ? " checked='checked'" : "")." />".$locale['u007']."</label> ";
echo "<label><input type='radio' name='user_hide_email' value='0'".($user_data['user_hide_email'] == "0" ? " checked='checked'" : "")." />".$locale['u008']."</label></td>\n";
echo "</tr>\n";
echo "<tr>\n<td align='center' colspan='2' class='tbl'><br />\n";
echo "<input type='hidden' name='user_hash' value='".$user_data['user_password']."' />\n";
echo "<input type='submit' name='' value='".$locale['CP201']."' class='button' /></td>\n";
echo "</tr>\n</table>\n</form>\n";
} else if (isset($_GET['editavatar']) && isnum($_GET['editavatar']) && $_GET['editavatar'] == $user_id) {
if (!isset($_GET['editavatar']) || !isnum($_GET['editavatar'])) { redirect("index.php"); }
require_once LOCALE.LOCALESET."user_fields.php";
require_once LOCALE.LOCALESET."edit_profile.php";
if (isset($_GET['update_profile'])) {
$newavatar = $_FILES['user_avatar'];
$avatarext = strrchr($newavatar['name'],".");
$avatarname = substr($newavatar['name'], 0, strrpos($newavatar['name'], "."));
if (preg_check("/^[-0-9A-Z_\[\]]+$/i", $avatarname) && preg_check("/(\.gif|\.GIF|\.jpg|\.JPG|\.jpeg|\.JPEG|\.png|\.PNG)$/", $avatarext) && $newavatar['size'] <= 30720) {
$avatarname = $avatarname."[".$userdata['user_id']."]".$avatarext;
move_uploaded_file($newavatar['tmp_name'], IMAGES."avatars/".$avatarname);
chmod(IMAGES."avatars/".$avatarname,0644);
$set_avatar = $avatarname;
if ($size = @getimagesize(IMAGES."avatars/".$avatarname)) {
if ($size['0'] > 100 || $size['1'] > 100) {
createthumbnail($size['2'], IMAGES."avatars/".$avatarname, IMAGES."avatars/tmp_".$avatarname, 100, 100);
@unlink(IMAGES."avatars/".$avatarname);
rename(IMAGES."avatars/tmp_".$avatarname,IMAGES."avatars/".$avatarname);
} elseif (!verify_image(IMAGES."avatars/".$avatarname)) {
@unlink(IMAGES."avatars/".$avatarname);
$set_avatar = "";
}
} else {
@unlink(IMAGES."avatars/".$avatarname);
$set_avatar = "";
}
} else {
$set_avatar = "";
}
if (isset($_POST['del_avatar'])) {
@unlink(IMAGES."avatars/".$user_data['user_avatar']);
$set_avatar = "";
}
$result = dbquery("UPDATE ".DB_USERS." SET user_avatar='".$set_avatar."' WHERE user_id='".$user_data['user_id']."'");
redirect("".FUSION_SELF."?editavatar=".$_GET['editavatar']."");
}
set_title($locale['CP113']." - ".$settings['sitename']);
echo "<form name='inputform' method='post' action='".FUSION_SELF."?editavatar=".$_GET['editavatar']."&update_profile' enctype='multipart/form-data'>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr><td class='tbl2' colspan='2'><b>".$locale['CP113']."</b></td></tr>\n";
echo "</table>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
echo "<tr>\n";
echo "<td class='tbl1' width='30%' height='105' align='center' valign='middle'>";
if ($user_data['user_avatar'] && file_exists(IMAGES."avatars/".$user_data['user_avatar'])) {
echo "<img src='".BASEDIR."images/avatars/".$user_data['user_avatar']."' alt='' />";
} else { echo "<img src='".get_forum_image("no_avatar")."' alt='' style='vertical-align:middle; border: 0;' />"; }
echo "</td>\n";
echo "<td width='70%' class='tbl1'>".$locale['CP204']."<br /><input type='checkbox' name='del_avatar' value='y' /> ".$locale['CP207']."";
echo "<input type='hidden' name='user_avatar' value='".$user_data['user_avatar']."' /><br />".$locale['CP205']."</td>";
echo "<tr><td class='tbl2' colspan='2'></td></tr>\n";
echo "<tr>\n";
echo "<td valign='top' class='tbl1'>".$locale['CP206']."</td>\n";
echo "<td class='tbl1'><span class='small2'><input type='file' name='user_avatar' class='textbox' style='width:200px;' /><br />\n";
echo "<span class='small2'>".$locale['u011']."</span><br />\n";
echo "<span class='small2'>".sprintf($locale['u012'], parsebytesize(30720), 100, 100)."</span></td>\n";
echo "</tr>\n";
echo "<tr>\n<td align='center' colspan='2' class='tbl1'><br />\n";
echo "<input type='submit' name='update_profile' value='".$locale['CP201']."' class='button' /></td>\n";
echo "</tr>\n</table>\n</form>\n";
echo "</table>\n";
} else if (isset($_GET['editsignature']) && isnum($_GET['editsignature']) && $_GET['editsignature'] == $user_id) {
if (!isset($_GET['editsignature']) || !isnum($_GET['editsignature'])) { redirect("index.php"); }
if (isset($_GET['update_profile'])) {
$user_sig = trim(stripinput(censorwords($_POST['user_sig'])));
$result=dbquery("UPDATE ".DB_USERS." SET user_sig='".$user_sig."' WHERE user_id='".$user_data['user_id']."'");
redirect("".FUSION_SELF."?editsignature=".$_GET['editsignature']."");
}
require_once INCLUDES."bbcode_include.php";
set_title($locale['CP112']." - ".$settings['sitename']);
echo "<form name='inputform' method='post' action='".FUSION_SELF."?editsignature=".$_GET['editsignature']."&update_profile'>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr><td class='tbl2' colspan='2'><b>".$locale['CP112']."</b></td></tr>\n";
echo "</table>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr><td class='tbl2' colspan='2'>".$locale['CP202']."</td></tr>\n";
echo "<tr><td class='tbl1'><div>".nl2br(parseubb(parsesmileys($user_data['user_sig'])))."</div></td></tr>\n";
echo "</table>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
echo "<tr><td class='tbl2' colspan='2'>".$locale['CP208']."</td></tr>\n";
echo "<tr><td class='tbl1'>\n";
echo "<div class='tbl' style='width:98%'>".display_bbcodes("98%", "user_sig")."</div>\n";
echo "<textarea class='textbox' name='user_sig' cols='60' rows='15' style='width:98%'>".$user_data['user_sig']."</textarea></td></tr>\n";
echo "<tr>\n<td align='center' colspan='2' class='tbl1'><br />\n";
echo "<input type='submit' name='update_profile' value='".$locale['CP201']."' class='button' /></td>\n";
echo "</tr>\n</table>\n</form>\n";
} else if (isset($_GET['pm'])) {
require_once LOCALE.LOCALESET."messages.php";
$msg_settings = dbarray(dbquery("SELECT * FROM ".DB_MESSAGES_OPTIONS." WHERE user_id='0'"));
require_once FORUM."includes/privatmsg.php";
} else if (isset($_GET['subscription']) && isnum($_GET['subscription']) && $_GET['subscription'] == $user_id) {
if (!isset($_GET['subscription']) || !isnum($_GET['subscription'])) { redirect("index.php"); }
$result = dbquery ( "
select t.*, f.*, p.*, tu.user_id, tu.user_name, tu2.user_id as lastpost_id, tu2.user_name as lastpost_name, COUNT(post_id)-1 as replies from " . DB_THREAD_NOTIFY . " tn
left join " . DB_THREADS . " t on t.thread_id=tn.thread_id
left join " . DB_FORUMS . " f on f.forum_id=t.forum_id
left join " . DB_POSTS . " p on p.thread_id=t.thread_id
left join " . DB_USERS . " tu on tu.user_id=t.thread_author
left join " . DB_USERS . " tu2 on t.thread_lastuser = tu2.user_id
where tn.notify_user='".$userdata['user_id']."' and " . groupaccess ( 'forum_access' ) . "
group by p.thread_id order by tn.notify_status asc, t.thread_lastpost desc
" );
$rows = dbrows ( $result );
$unviewed = dbcount ( "(thread_id)", DB_THREAD_NOTIFY, "notify_user='" . $userdata ['user_id'] . "' and notify_status='0'" );
set_title($locale['CP210']." - ".$settings['sitename']);
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr>\n<td class='tbl2 navtitle' colspan='6'><b>".$locale['CP210']."</b> ($unviewed)</td>\n</tr>\n";
echo "</table>\n";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
if ($rows) {
echo "<tr>\n<td class='tbl1 bold' colspan='2' style='width:1%'> </td>\n";
echo "<td class='tbl1 bold'>".$locale['451']."</td>\n";
echo "<td class='tbl1 bold' style='width:1%;white-space:nowrap;'>".$locale['404']."</td>\n";
echo "<td class='tbl1 bold' style='width:1%;white-space:nowrap'>".$locale['454']."</td>\n";
echo "<td class='tbl1 bold' style='width:1%;white-space:nowrap'>".$locale['453']."</td>\n</tr>\n";
while ( $data = dbarray ( $result ) ) {
if ($data ['thread_locked']) {
$image = get_image ( "folderlock" );
$titlebold = "";
} else {
$thread_match = $data ['thread_id'] . "\|" . $data ['thread_lastpost'] . "\|" . $data ['forum_id'];
if ($data ['thread_lastpost'] > $lastvisited) {
if (iMEMBER && preg_match ( "(^\.{$thread_match}$|\.{$thread_match}\.|\.{$thread_match}$)", $userdata ['user_threads'] )) {
$image = get_image ( "folder" );
$titlebold = "";
} else {
$image = get_image ( "foldernew" );
$titlebold = "font-weight:bold;";
}
} else {
$image = get_image ( "folder" );
$titlebold = "";
}
}
echo "<tr>\n<td class='tbl1'><img src='$image' alt='' /></td>\n";
echo "<td class='tbl1'><img src='images/post_icons/".$data['thread_icon']."' alt='".$locale['PF600']."' style='border: 0;' /></td>\n";
$posts_per_page = $forum_settings['posts_num'];
$reps = ceil($data['thread_postcount'] / $posts_per_page);
$threadsubject = "<a href='viewthread.php?thread_id=".$data['thread_id']."'>".$data['thread_subject']."</a>";
if ($reps > 1) {
$ctr = 1; $pages = "";
while ($ctr <= $reps) {
$pnum = "<a href='viewthread.php?thread_id=".$data['thread_id']."&page=$ctr'>$ctr</a> ";
$post_page = "&page=$ctr";
$pages = $pages.$pnum; $ctr++;
}
$threadsubject .= "<br />(".$locale['455'].trim($pages).")";
$post_p = $post_page;
} else { $post_p = ""; }
echo "<td class='tbl2'>";
echo "<a href='" . FORUM . "viewthread.php?thread_id=" . $data ['thread_id'] . "' style='text-decoration:underline;'>" . $data ['thread_subject'] . "</a><br />\n";
echo "<a href='" . BASEDIR . "profile.php?lookup=" . $data ['user_id'] . "' class='alt'>" . $data ['user_name'] . "</a><br />\n";
echo "<a href='" . FORUM . "postify.php?post=off&forum_id=" . $data ['forum_id'] . "&thread_id=" . $data ['thread_id'] . "'>".$locale['CP209']."</a></td>\n";
echo "<td width='1%' class='tbl1' style='white-space:nowrap'>";
echo "<div style='float:left;'>".showdate("forumdate", $data['thread_lastpost'])."<br />\n";
echo "<span class='small'>".$locale['406']."<a href='".BASEDIR."profile.php?lookup=".$data['lastpost_id']."'>".$data['lastpost_name']."</a></span></div>\n";
echo "<div style='float:right;'><a href='forum/viewthread.php?thread_id=".$data['thread_id'].$post_p."#post_".$data['post_id']."' title='".$locale['PF658']."'><img alt='".$locale['PF658']."' src='images/new_post.gif' style='vertical-align:middle; border: 0;' /></a></div>\n";
echo "</td>\n";
echo "<td class='tbl2' style='text-align:center;'>" . number_format ( $data ['replies'] ) . "</td>\n";
echo "<td class='tbl1' style='text-align:center;'>" . number_format ( $data ['thread_views'] ) . "</td>\n</tr>\n";
}
} else {
echo "<tr>\n<td class='tbl1'>\n<div align='center'>".$locale['CP211']."</div>\n</td>\n</tr>\n";
}
echo "</table>\n";
} else if (isset($_GET['editattachments']) && isnum($_GET['editattachments']) && $_GET['editattachments'] == $user_id) {
if (!isset($_GET['editattachments']) || !isnum($_GET['editattachments'])) { redirect("index.php"); }
set_title($locale['CP115']." - ".$settings['sitename']);
if (isset($_GET['delattach']) && isnum($_GET['delattach'])) {
if (!isset($_GET['delattach']) || !isnum($_GET['delattach'])) { redirect("index.php"); }
$result = dbquery("SELECT * FROM ".DB_FORUM_ATTACHMENTS." WHERE attach_id='".$_GET['delattach']."'");
if (dbrows($result) != 0) {
$attach = dbarray($result);
@unlink(FORUM."attachments/".$attach['attach_name']);
$result2 = dbquery("DELETE FROM ".DB_FORUM_ATTACHMENTS." WHERE attach_id='".$_GET['delattach']."'");
}
} elseif(isset($_POST['delselect']) && $_POST['chk_mark']!="") {
if(is_array($_POST['chk_mark']) && count($_POST['chk_mark'])>1){
$result_attach_id="attach_id IN(".implode(',',$_POST['chk_mark']).")";
} else { $result_attach_id="attach_id=".$_POST['chk_mark'][0]; }
$result = dbquery("SELECT * FROM ".DB_FORUM_ATTACHMENTS." WHERE $result_attach_id");
if (dbrows($result) != 0) {
while($attach = dbarray($result)) { @unlink(FORUM."attachments/".$attach['attach_name']); }
$result2 = dbquery("DELETE FROM ".DB_FORUM_ATTACHMENTS." WHERE $result_attach_id");
}
}
if (!isset($_GET['rowstart']) || !isNum($_GET['rowstart'])) $_GET['rowstart'] = 0;
$result = dbquery("SELECT td.*,tdc.*, ttc.thread_subject FROM ".DB_FORUM_ATTACHMENTS." td
INNER JOIN ".DB_POSTS." tdc ON td.post_id=tdc.post_id
INNER JOIN ".DB_THREADS." ttc ON ttc.thread_id=tdc.thread_id
WHERE tdc.post_author = '".$_GET['editattachments']."'
ORDER BY attach_id LIMIT ".$_GET['rowstart'].",20"
);
$result2 = dbquery("SELECT td.post_id AS td_post_id, tdc.post_id
FROM ".DB_FORUM_ATTACHMENTS." td
INNER JOIN ".DB_POSTS." tdc ON td.post_id=tdc.post_id
WHERE tdc.post_author = '".$_GET['editattachments']."'"
);
$count = ""; $i = "";
while($data = dbarray($result2)) { $count = $data['td_post_id']; $i++; }
$rows = $i;
$total = $rows ? $rows : 0;
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr><td class='tbl2' colspan='2'><b>".$locale['CP115']."</b></td></tr>\n";
echo "</table>\n";
echo "<table width='100%' cellspacing='1' cellpadding='0' class='tbl-border'>\n";
echo "<tr><td class='tbl1' colspan='3'>".sprintf($locale['CP212'], $total)."</td></tr>\n";
echo "</table>";
if (dbrows($result) != 0) {
echo "<form name='delattachall' method='post' action='".FUSION_SELF."?editattachments=".$_GET['editattachments']."'>";
echo "<table width='100%' align='center' cellpadding='0' cellspacing='1' class='tbl-border'><tr>";
echo "<td width='1%' class='tbl2'></td>";
echo "<td class='tbl2'>".$locale['CP213']."</td>";
echo "<td class='tbl2'>".$locale['CP215']."</td>";
echo "<td class='tbl2'>".$locale['CP214']."</td>";
echo "<td class='tbl2'>".$locale['CP226']."</td>";
echo "<td class='tbl2'>".$locale['CP216']."</td></tr>";
while($attach = dbarray($result)) {
$fileattach = FORUM."attachments/".$attach['attach_name'];
if ($attach['post_title']) { $title = $attach['post_title']; } else {$title = $attach['thread_subject']; }
echo "<tr><td class='tbl1'><input type='checkbox' name='chk_mark[]' value='".$attach['attach_id']."'></td>";
echo "<td class='tbl1'><a href='$fileattach'>".$attach['attach_name']."</a></td>";
echo "<td class='tbl1'><a href='".FORUM."viewthread.php?forum_id=".$attach['forum_id']."&thread_id=".$attach['thread_id']."&pid=".$attach['post_id']."#post_".$attach['post_id']."'>".trimlink($title, 30)."</a><br /><span class='small'>Îò ".showdate("forumdate",$attach['post_datestamp'])."</span></td>";
echo "<td class='tbl1'>".parsebytesize($attach['attach_size'])."</td>";
echo "<td class='tbl1' align='center'>".$attach['attach_count']."</td>";
echo "<td class='tbl1' align='center'><a href='".FUSION_SELF."?editattachments=".$_GET['editattachments']."&delattach=".$attach['attach_id']."' onclick='return Deletefile();'>".$locale['CP217']."</a></td></tr>";
}
echo "<tr><td colspan='9' class='tbl2'><span class='small'><input type='button' class='button' title='".$locale['CP218']."' onclick=\"javascript:setChecked('delattachall','chk_mark[]',1);\" value='".$locale['CP219']."'>
<input type='button' class='button' title='".$locale['CP220']."' onclick=\"javascript:setChecked('delattachall','chk_mark[]',0);\" value='".$locale['CP221']."'>
<input type='submit' class='button' name='delselect' onclick='return Deletefiles();' value='".$locale['CP222']."'></span></td></tr></table>";
echo "</form>\n";
echo "<script language='Javascript' type='text/javascript'>
function setChecked(frmName,chkName,val){
dml=document.forms[frmName];
len=dml.elements.length;
for(i=0;i<len;i++){
if(dml.elements[i].name==chkName){
dml.elements[i].checked=val;
}}}
function Deletefile() {
return confirm('".$locale['CP223']."');
}
function Deletefiles() {
return confirm('".$locale['CP224']."');
}
</script>";
if ($rows > 20) echo "<div align='center' style='margin-top:5px;'>
".makepagenav($_GET['rowstart'],20,$rows,3,FUSION_SELF."?editattachments=".$_GET['editattachments']."&")."
</div>";
} else {
echo "<table width='100%' cellspacing='1' cellpadding='0' class='tbl-border'>\n";
echo "<tr><td class='tbl1' align='center' style='margin-top:5px;'>".$locale['CP225']."</td></tr>\n";
echo "</table>";
}
} else if ($user_id != "0") {
$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_id='".$user_id."'");
set_title("Ìîé êàáèíåò - ".$settings['sitename']);
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr><td class='tbl2' colspan='2'><b>".$locale['CP240']."</b></td></tr>\n";
echo "</table>\n";
echo "<table width='100%' cellspacing='1' cellpadding='0' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr><td class='tbl1' colspan='3'>".$locale['CP227']."</td></tr>\n";
echo "<tr><td width='120px' class='tbl1' align='center' rowspan='4'>";
if ($user_data['user_avatar'] && file_exists(IMAGES."avatars/".$user_data['user_avatar'])) {
echo "<img src='".BASEDIR."images/avatars/".$user_data['user_avatar']."' alt='".$locale['CP237']."' />";
} elseif ($forum_settings['not_avatar'] == "1") { echo "<img src='".get_forum_image("no_avatar")."' alt='".$locale['CP238']."' style='vertical-align:middle; border: 0;' />\n"; }
echo "</td><td class='tbl1' style='width:50%;text-align:right;'>".$locale['CP228']."</td>\n<td class='tbl1'>".$userdata['user_email']."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' style='width:50%;text-align:right;'>".$locale['CP229']."</td>\n<td class='tbl2'>".showdate("longdate", $userdata ['user_joined'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl1' style='width:50%;text-align:right;'>".$locale['CP231']."</td>\n<td class='tbl1'>" . number_format ( ($userdata ['user_posts'] / ((time () - $userdata ['user_joined']) / (3600 * 24))), 1 ) . "</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' style='width:50%;text-align:right;'>".$locale['CP232']."</td>\n<td class='tbl2'>" . number_format ( $userdata ['user_posts'] ) . "</td>\n</tr>\n";
echo "</table>\n";
$result = dbquery ( "
select t.*, f.*, p.*, tu.user_id, tu.user_name, tu2.user_id as lastpost_id, tu2.user_name as lastpost_name, COUNT(post_id)-1 as replies from " . DB_THREAD_NOTIFY . " tn
left join " . DB_THREADS . " t on t.thread_id=tn.thread_id
left join " . DB_FORUMS . " f on f.forum_id=t.forum_id
left join " . DB_POSTS . " p on p.thread_id=t.thread_id
left join " . DB_USERS . " tu on tu.user_id=t.thread_author
left join " . DB_USERS . " tu2 on t.thread_lastuser = tu2.user_id
where tn.notify_user='".$user_id."' and ".groupaccess('forum_access')." and notify_status='0'
group by p.thread_id order by tn.notify_status asc, t.thread_lastpost desc
" );
$rows = dbrows ( $result );
$unviewed = dbcount ( "(thread_id)", DB_THREAD_NOTIFY, "notify_user='".$user_id."' and notify_status='0'" );
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr>\n<td class='tbl2 ' colspan='6'>".$locale['CP233']." ($unviewed)</td>\n</tr>\n";
if ($rows) {
echo "<tr>\n<td class='tbl1 bold' colspan='2' style='width:1%'> </td>\n";
echo "<td class='tbl1 bold'>".$locale['451']."</td>\n";
echo "<td class='tbl1 bold' style='width:1%;white-space:nowrap'>".$locale['404']."</td>\n";
echo "<td class='tbl1 bold' style='width:1%;white-space:nowrap'>".$locale['454']."</td>\n";
echo "<td class='tbl1 bold' style='width:1%;white-space:nowrap'>".$locale['453']."</td>\n</tr>\n";
while ( $data = dbarray ( $result ) ) {
if ($data ['thread_locked']) {
$image = get_image ( "folderlock" );
$titlebold = "";
} else {
$thread_match = $data ['thread_id'] . "\|" . $data ['thread_lastpost'] . "\|" . $data ['forum_id'];
if ($data ['thread_lastpost'] > $lastvisited) {
if (iMEMBER && preg_match ( "(^\.{$thread_match}$|\.{$thread_match}\.|\.{$thread_match}$)", $userdata ['user_threads'] )) {
$image = get_image ( "folder" );
$titlebold = "";
} else {
$image = get_image ( "foldernew" );
$titlebold = "font-weight:bold;";
}
} else {
$image = get_image ( "folder" );
$titlebold = "";
}
}
echo "<tr>\n<td class='tbl1'><img src='$image' alt='' /></td>\n";
echo "<td class='tbl1'><img src='images/post_icons/".$data['thread_icon']."' alt='".$locale['PF600']."' style='border: 0;' /></td>\n";
$posts_per_page = $forum_settings['posts_num'];
$reps = ceil($data['thread_postcount'] / $posts_per_page);
$threadsubject = "<a href='viewthread.php?thread_id=".$data['thread_id']."'>".$data['thread_subject']."</a>";
if ($reps > 1) {
$ctr = 1; $pages = "";
while ($ctr <= $reps) {
$pnum = "<a href='viewthread.php?thread_id=".$data['thread_id']."&page=$ctr'>$ctr</a> ";
$post_page = "&page=$ctr";
$pages = $pages.$pnum; $ctr++;
}
$threadsubject .= "<br />(".$locale['455'].trim($pages).")";
$post_p = $post_page;
} else { $post_p = ""; }
echo "<td class='tbl2'><span>";
echo "<a href='" . FORUM . "viewthread.php?thread_id=" . $data ['thread_id'] . "' style='text-decoration:underline;'>" . $data ['thread_subject'] . "</a></span><br />\n";
echo "<a href='" . BASEDIR . "profile.php?lookup=" . $data ['user_id'] . "' class='alt'>" . $data ['user_name'] . "</a><br />\n";
echo "<a href='" . FORUM . "postify.php?post=off&forum_id=" . $data ['forum_id'] . "&thread_id=" . $data ['thread_id'] . "'>".$locale['CP235']."</a></td>\n";
echo "<td width='1%' class='tbl1' style='white-space:nowrap'>";
echo "<div style='float:left;'>".showdate("forumdate", $data['thread_lastpost'])."<br />\n";
echo "<span class='small'>".$locale['406']."<a href='".BASEDIR."profile.php?lookup=".$data['lastpost_id']."'>".$data['lastpost_name']."</a></span></div>\n";
echo "<div style='float:right;'><a href='forum/viewthread.php?thread_id=".$data['thread_id'].$post_p."#post_".$data['post_id']."' title='".$locale['PF658']."'><img alt='".$locale['PF658']."' src='images/new_post.gif' style='vertical-align:middle; border: 0;' /></a></div>\n";
echo "</td>\n";
echo "<td class='tbl2' style='text-align:center;'>" . number_format ( $data ['replies'] ) . "</td>\n";
echo "<td class='tbl1' style='text-align:center;'>" . number_format ( $data ['thread_views'] ) . "</td>\n</tr>\n";
}
} else {
echo "<tr>\n<td class='tbl1'>\n<div align='center'>".$locale['CP234']."</div>\n</td>\n</tr>\n";
}
echo "<tr>\n<td class='tbl1' style='text-align:right;'colspan='6'>\n<a href='".FUSION_SELF."?subscription=".$user_id."'>".$locale['CP236']."</a>\n</td>\n</tr>\n";
echo "</table>";
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
echo "<tr><td class='tbl2' colspan='3'>".$locale['CP241']."</td></tr>\n";
$result = dbquery(
"SELECT m.*, u.user_id, u.user_name FROM ".DB_MESSAGES." m
LEFT JOIN ".DB_USERS." u ON m.message_from=u.user_id
WHERE message_to='".$userdata['user_id']."' AND message_folder='0' AND message_read='0'
ORDER BY message_datestamp DESC LIMIT 5"
);
if (dbrows($result)) {
echo "<tr>\n<td class='tbl2'><i>".$locale['451']."</i></td>\n";
echo "<td width='1%' class='tbl2' style='white-space:nowrap'><i>".$locale['CP239']."</i></td>\n";
echo "<td width='1%' class='tbl2' style='white-space:nowrap'><i>".$locale['CP245']."</i></td>\n</tr>\n";
while ($data = dbarray($result)) {
$message_subject = $data['message_subject'];
if (!$data['message_read']) { $message_subject = "<strong>".$message_subject."</strong>"; }
echo "<tr>\n<td class='tbl1'>\n";
echo "<a href='".FUSION_SELF."?pm&folder=inbox&msg_read=".$data['message_id']."'>".$message_subject."</a></td>\n";
echo "<td width='1%' class='tbl1' style='white-space:nowrap'><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a></td>\n";
echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".showdate("shortdate", $data['message_datestamp'])."</td>\n</tr>\n";
}
} else { echo "<tr>\n<td class='tbl1' align='center'>".$locale['CP242']."</td></tr>\n"; }
echo "</table>\n";
$thanked = dbcount("(thanks_id)", DB_PREFIX."forum_thanks JOIN ".DB_POSTS." USING (post_id)", "post_author='".$user_id."'");
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
echo "<tr><td class='tbl2' colspan='3'><div style='float:left'>".$locale['CP243']."</div><div style='float:right' class='small'>".sprintf($locale['CP244'], "{$thanked}")."</div></td></tr>\n";
$thanks = "";
$thanks_r = dbquery("SELECT post_id FROM ".DB_PREFIX."forum_thanks");
if (dbrows($thanks_r)) {
while ($data_th = dbarray($thanks_r)) { $thanks .= $data_th['post_id'].",0"; }
} else { $thanks = "0"; }
$result = dbquery(
"SELECT p.forum_id, p.thread_id, p.post_id, p.post_message, p.post_smileys, t.thread_author, p.post_title, p.post_datestamp, t.thread_subject, t.thread_views, t.thread_postcount, t.thread_icon, f.forum_name, f.forum_access, u.user_id, u.user_name, th.thanks_datestamp
FROM ".DB_POSTS." p
LEFT JOIN ".DB_THREADS." t ON t.thread_id = p.thread_id
LEFT JOIN ".DB_FORUMS." f ON f.forum_id=p.forum_id
LEFT JOIN ".DB_PREFIX."forum_thanks th ON th.post_id = p.post_id
LEFT JOIN ".DB_USERS." u ON th.user_id = u.user_id
WHERE p.post_id IN($thanks) AND ".groupaccess('f.forum_access')." AND p.post_author = '".$user_id."'
ORDER BY th.thanks_datestamp DESC LIMIT 10"
);
if (dbrows($result)) {
echo "<tr>\n<td class='tbl2'><i>".$locale['451']."</i></td>\n";
echo "<td width='20%' class='tbl2' style='white-space:nowrap'><i>".$locale['CP246']."</i></td>\n";
echo "<td width='20%' class='tbl2' style='white-space:nowrap'><i>".$locale['CP245']."</i></td>\n</tr>\n";
while ($data = dbarray($result)) {
echo "<tr>\n<td class='tbl1'>\n";
echo "<a href='viewthread.php?thread_id=".$data['thread_id']."&pid=".$data['post_id']."#post_".$data['post_id']."' title='".$data['thread_subject']."'>".$data['thread_subject']."</a></td>\n";
echo "<td width='1%' class='tbl1' style='white-space:nowrap'><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a></td>\n";
echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".showdate("longdate", $data['thanks_datestamp'])."</td>\n</tr>\n";
}
} else { echo "<tr>\n<td class='tbl1' align='center'>".$locale['CP247']."</td></tr>\n"; }
echo "</table>\n";
}
echo "</div></div>\n";
echo "</td>\n</tr>\n</table>\n";
closetable();
} else {
require_once LOCALE.LOCALESET."forum/post.php";
set_title($locale['PF494']." - ".$settings['sitename']);
opentable($locale['PF494']);
require_once FORUM."includes/error_massege.php";
closetable();
}
require_once THEMES."templates/footer.php";
?>
|