<?php
/*-------------------------------------------------------+
| <span style="border-bottom: 1px dotted black;">PHP</span>-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| <a href='http://www.php-fusion.co.uk/' target='_blank'><span style='color:005C5B'>http://www.php-fusion.co.uk/</span></a>
+--------------------------------------------------------+
| Filename: profile.php
| Author: Hans Kristian Flaatten {Starefossen}
+--------------------------------------------------------+
| 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 <a href='http://www.gnu.org/licenses/agpl.html.' target='_blank'><span style='color:005C5B'>www.gnu.org/licenses/agpl.html.</span></a> Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
require_once CLASSES."UserFields.class.php";
include LOCALE.LOCALESET."user_fields.php";
if (!iMEMBER && $settings['hide_userprofiles'] == 1) { redirect(BASEDIR."login.php"); }
if (isset($_GET['lookup']) && isnum($_GET['lookup'])) {
$user_status = " AND (user_status='0' OR user_status='3' OR user_status='7')";
if (iADMIN) {
$user_status = "";
}
$result = dbquery(
"SELECT u.*, s.suspend_reason
FROM ".DB_USERS." u
LEFT JOIN ".DB_SUSPENDS." s ON u.user_id=s.suspended_user
WHERE user_id='".$_GET['lookup']."'".$user_status."
ORDER BY suspend_date DESC
LIMIT 1"
);
if (dbrows($result)) { $user_data = dbarray($result); } else { redirect("index.php"); }
add_to_title($locale['global_200'].$locale['u103'].$locale['global_201'].$user_data['user_name']);
if (iADMIN && checkrights("UG") && $_GET['lookup'] != $userdata['user_id']) {
if ((isset($_POST['add_to_group'])) && (isset($_POST['user_group']) && isnum($_POST['user_group']))) {
if (!preg_match("(^\.{$_POST['user_group']}$|\.{$_POST['user_group']}\.|\.{$_POST['user_group']}$)", $user_data['user_groups'])) {
$result = dbquery("UPDATE ".DB_USERS." SET user_groups='".$user_data['user_groups'].".".$_POST['user_group']."' WHERE user_id='".$_GET['lookup']."'");
}
redirect(FUSION_SELF."?lookup=".$user_data['user_id']);
}
}
opentable($locale['u104']." ".$user_data['user_name']);
$userFields = new UserFields();
$userFields->userData = $user_data;
$userFields->showAdminOptions = true;
$userFields->displayOutput();
} elseif (isset($_GET['group_id']) && isnum($_GET['group_id'])) {
$result = dbquery("SELECT group_id, group_name FROM ".DB_USER_GROUPS." WHERE group_id='".$_GET['group_id']."'");
if (dbrows($result)) {
$data = dbarray($result);
$result = dbquery(
"SELECT user_id, user_name, user_level, user_status
FROM ".DB_USERS."
WHERE user_groups REGEXP('^\\\.{$_GET['group_id']}$|\\\.{$_GET['group_id']}\\\.|\\\.{$_GET['group_id']}$')
ORDER BY user_level DESC, user_name"
);
opentable($locale['u110']);
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
echo "<td align='center' colspan='2' class='tbl1'><strong>".$data['group_name']."</strong>\n";
echo "(".sprintf((dbrows($result) == 1 ? $locale['u111'] : $locale['u112']), dbrows($result)).")";
echo "</td>\n</tr>\n<tr>\n";
if (dbrows($result)) {
echo "<td class='tbl2'><strong>".$locale['u113']."</strong></td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['u114']."</strong></td>\n";
echo "</tr>\n";
while ($data = dbarray($result)) {
$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;
echo "<tr>\n<td class='".$cell_color."'>\n".profile_link($data['user_id'], $data['user_name'], $data['user_status'])."</td>\n";
echo "<td align='center' width='1%' class='$cell_color' style='white-space:nowrap'>".getuserlevel($data['user_level'])."</td>\n</tr>";
}
}
echo "</table>\n";
} else {
redirect("index.php");
}
} else {
redirect(BASEDIR."index.php");
}
echo "
<center>Gal norite padovanoti draugui doavana? padovankok jam (jai).</br>
VIP'o statusa vos už 2.00LT/mėn</br>
</br>
Jai norite tai padaryti Siūsk </br>
Textas: <strong>FVIP2 VARDAS </strong></br>
Numeriu: <strong>1398</strong></br>
</br>
ši paslauga užsidės šiam žmogui nuo <span style='color:red'>15</span> iki <span style='color:red'>20</span>Min.</br></center>
";
closetable();
require_once THEMES."templates/footer.php";
?>