Template/Update (Part 12)

* convert user page
 * update db to handle custom avatars
This commit is contained in:
Sarjuuk
2025-08-07 02:14:46 +02:00
parent b3b790d424
commit 2899cc881b
12 changed files with 531 additions and 406 deletions

359
endpoints/user/user.php Normal file
View File

@@ -0,0 +1,359 @@
<?php
namespace Aowow;
if (!defined('AOWOW_REVISION'))
die('illegal access');
class UserBaseResponse extends TemplateResponse
{
protected string $template = 'user';
protected string $pageName = 'user';
protected array $scripts = array(
[SC_JS_FILE, 'js/user.js'],
[SC_JS_FILE, 'js/profile.js'],
[SC_CSS_FILE, 'css/Profiler.css']
);
// for PageTemplate
public ?InfoboxMarkup $infobox;
public ?InfoboxMarkup $contributions = null;
public ?Markup $description = null;
public array $userIcon = [];
public string $username = '';
public array $charactersLvData = [];
public array $profilesLvData = [];
private array $user = [];
public function __construct($pageParam)
{
parent::__construct($pageParam);
if (!$pageParam && User::isLoggedIn())
$this->forward('?user='.User::$username);
if (!$pageParam)
$this->forwardToSignIn('user');
if ($user = DB::Aowow()->selectRow('SELECT a.`id`, a.`username`, a.`consecutiveVisits`, a.`userGroups`, a.`avatar`, a.`wowicon`, a.`title`, a.`description`, a.`joinDate`, a.`prevLogin`, IFNULL(SUM(ar.`amount`), 0) AS "sumRep", a.`prevIP`, a.`email` FROM ?_account a LEFT JOIN ?_account_reputation ar ON a.`id` = ar.`userId` WHERE LOWER(a.`username`) = LOWER(?) GROUP BY a.`id`', $pageParam))
$this->user = $user;
else
$this->generateNotFound(Lang::user('notFound', [$pageParam]));
}
protected function generate() : void
{
/*********/
/* Title */
/*********/
array_unshift($this->title, Lang::user('profileTitle', [$this->user['username']]));
/***********/
/* Infobox */
/***********/
$infobox = $contrib = $groups = [];
foreach (Lang::account('groups') as $idx => $grp)
if ($idx >= 0 && $this->user['userGroups'] & (1 << $idx))
$groups[] = (!fMod(count($groups) + 1, 3) ? '[br]' : '').$grp;
if (User::isInGroup(U_GROUP_STAFF))
{
$infobox[] = Lang::account('lastIP'). $this->user['prevIP'];
$infobox[] = Lang::account('email') . Lang::main('colon') . $this->user['email'];
}
if ($this->user['joinDate'])
$infobox[] = Lang::user('joinDate') . '[tooltip name=joinDate]'. date('l, G:i:s', $this->user['joinDate']). '[/tooltip][span class=tip tooltip=joinDate]'. date(Lang::main('dateFmtShort'), $this->user['joinDate']). '[/span]';
if ($this->user['prevLogin'])
$infobox[] = Lang::user('lastLogin') . '[tooltip name=lastLogin]'.date('l, G:i:s', $this->user['prevLogin']).'[/tooltip][span class=tip tooltip=lastLogin]'.date(Lang::main('dateFmtShort'), $this->user['prevLogin']).'[/span]';
if ($groups)
$infobox[] = Lang::user('userGroups') . implode(', ', $groups);
$infobox[] = Lang::user('consecVisits'). $this->user['consecutiveVisits'];
$infobox[] = Lang::main('siteRep') . Lang::nf($this->user['sumRep']);
if ($infobox)
$this->infobox = new InfoboxMarkup($infobox, ['allow' => Markup::CLASS_STAFF], 'infobox-contents0');
if ($_ = $this->getCommentStats())
$contrib[] = $_;
if ($_ = $this->getScreenshotStats())
$contrib[] = $_;
if ($_ = $this->getVideoStats())
$contrib[] = $_;
if ($_ = $this->getForumStats())
$contrib[] = $_;
// $contrib[] = [url=http://www.wowhead.com/client]Data uploads: n [small]([tooltip=tooltip_totaldatauploads]xx.y MB[/tooltip])[/small][/url]
if ($contrib)
$this->contributions = new InfoboxMarkup($contrib, ['allow' => Markup::CLASS_STAFF], 'infobox-contents1');
/****************/
/* Main Content */
/****************/
$this->h1 = $this->user['title'] ? $this->user['username'].'&nbsp;&lt;'.$this->user['title'].'&gt;' : Lang::user('profileTitle', [$this->user['username']]);
if ($this->user['avatar'])
{
$avatarMore = match ((int)$this->user['avatar'])
{
1 => $this->user['wowicon'],
2 => DB::Aowow()->selectCell('SELECT `id` FROM ?_account_avatars WHERE `current` = 1 AND `userId` = ?d', $this->user['id']),
default => ''
};
$this->userIcon = array( // JS: Icon.createUser()
$this->user['avatar'], // avatar: 1(iconString), 2(customId)
$avatarMore, // avatarMore: iconString or customId
IconElement::SIZE_MEDIUM, // size: (always medium)
null, // url: (always null)
User::isInGroup(U_GROUP_PREMIUM) ? 0 : 2, // premiumLevel: affixes css class ['-premium', '-gold', '', '-premiumred', '-red']
false, // noBorder: always false
'$Icon.getPrivilegeBorder('.$this->user['sumRep'].')' // reputationLevel: calculated in js from passed rep points
);
}
$this->username = $this->user['username'];
if ($this->user['description']) // seen CLASS_STAFF, but wouldn't dare.. filtered for restricted tags before sent?
$this->description = new Markup($this->user['description'], ['allow' => ($this->user['userGroups'] & U_GROUP_PREMIUM) ? Markup::CLASS_PREMIUM : Markup::CLASS_USER], 'description-generic');
/**************/
/* Extra Tabs */
/**************/
$this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"], 'tabsRelated', true);
// [unused] Site Achievements
// Reputation changelog (params only for comment-events)
if (User::$id == $this->user['id'] || User::isInGroup(U_GROUP_MODERATOR))
if ($repData = DB::Aowow()->select('SELECT `action`, `amount`, `date` AS "when", IF(`action` IN (3, 4, 5), `sourceA`, 0) AS "param" FROM ?_account_reputation WHERE `userId` = ?d', $this->user['id']))
{
array_walk($repData, fn(&$x) => $x['when'] = date(Util::$dateFormatInternal, $x['when']));
$this->lvTabs->addListviewTab(new Listview(['data' => $repData], 'reputationhistory'));
}
// Comments
if ($_ = CommunityContent::getCommentPreviews(['user' => $this->user['id'], 'comments' => true], $nFound))
{
$tabData = array(
'data' => $_,
'hiddenCols' => ['author'],
'onBeforeCreate' => '$Listview.funcBox.beforeUserComments',
'_totalCount' => $nFound
);
if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT'))
{
$tabData['name'] = '$LANG.tab_latestcomments';
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_usercomments, '.$nFound.')';
}
$this->lvTabs->addListviewTab(new Listview($tabData, 'commentpreview'));
}
// Comment Replies
if ($_ = CommunityContent::getCommentPreviews(['user' => $this->user['id'], 'replies' => true], $nFound))
{
$tabData = array(
'data' => $_,
'hiddenCols' => ['author'],
'onBeforeCreate' => '$Listview.funcBox.beforeUserComments',
'_totalCount' => $nFound
);
if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT'))
{
$tabData['name'] = '$LANG.tab_latestreplies';
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_userreplies, '.$nFound.')';
}
$this->lvTabs->addListviewTab(new Listview($tabData, 'replypreview'));
}
// Screenshots
if ($_ = CommunityContent::getScreenshots(-$this->user['id'], 0, $nFound))
{
$tabData = array(
'data' => $_,
'_totalCount' => $nFound
);
if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT'))
{
$tabData['name'] = '$LANG.tab_latestscreenshots';
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_userscreenshots, '.$nFound.')';
}
$this->lvTabs->addListviewTab(new Listview($tabData, 'screenshot'));
}
// Videos
if ($_ = CommunityContent::getVideos(-$this->user['id'], 0, $nFound))
{
$tabData = array(
'data' => $_,
'_totalCount' => $nFound
);
if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT'))
{
$tabData['name'] = '$LANG.tab_latestvideos';
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_uservideos, '.$nFound.')';
}
$this->lvTabs->addListviewTab(new Listview($tabData, 'video'));
}
// forum -> latest topics [unused]
// forum -> latest replies [unused]
if (Cfg::get('PROFILER_ENABLE'))
{
$conditions = array(
['OR', ['cuFlags', PROFILER_CU_PUBLISHED, '&'], ['ap.extraFlags', PROFILER_CU_PUBLISHED, '&']],
[['cuFlags', PROFILER_CU_DELETED, '&'], 0],
['OR', ['user', $this->user['id']], ['ap.accountId', $this->user['id']]]
);
if (User::isInGroup(U_GROUP_ADMIN | U_GROUP_BUREAU))
$conditions = array_slice($conditions, 2);
else if (User::$id == $this->user['id'])
array_shift($conditions);
$profiles = new LocalProfileList($conditions);
if (!$profiles->error)
{
$this->addDataLoader('weight-presets');
// Characters
if ($chars = $profiles->getListviewData(PROFILEINFO_CHARACTER | PROFILEINFO_USER))
$this->charactersLvData = array_values($chars);
// Profiles
if ($prof = $profiles->getListviewData(PROFILEINFO_PROFILE | PROFILEINFO_USER))
$this->profilesLvData = array_values($prof);
}
}
// My Guides
$guides = new GuideList(['status', [GUIDE_STATUS_APPROVED, GUIDE_STATUS_ARCHIVED]], ['userId', $this->user['id']]);
if (!$guides->error)
{
$this->lvTabs->addListviewTab(new Listview(array(
'data' => $guides->getListviewData(),
'hiddenCols' => ['patch']
), GuideList::$brickFile));
}
parent::generate();
}
private function getCommentStats() : ?string
{
$co = DB::Aowow()->selectRow(
'SELECT COUNT(DISTINCT c.`id`) AS "0", SUM(IFNULL(ur.`value`, 0)) AS "1" FROM ?_comments c LEFT JOIN ?_user_ratings ur ON ur.`entry` = c.`id` AND ur.`type` = ?d AND ur.`userId` <> 0 WHERE c.`replyTo` = 0 AND c.`userId` = ?d',
RATING_COMMENT, $this->user['id']
);
if (!$co)
return null;
[$sum, $nRatings] = $co;
return Lang::user('comments').$sum.($nRatings ? ' [small]([tooltip=tooltip_totalratings]'.$nRatings.'[/tooltip])[/small]' : '');
}
private function getScreenshotStats() : ?string
{
$ss = DB::Aowow()->selectRow(
'SELECT COUNT(*) AS "0", SUM(IF(`status` & ?d, 1, 0)) AS "1", SUM(IF(`status` & ?d, 0, 1)) AS "2" FROM ?_screenshots WHERE `userIdOwner` = ?d AND (`status` & ?d) = 0',
CC_FLAG_STICKY, CC_FLAG_APPROVED, $this->user['id'], CC_FLAG_DELETED
);
if (!$ss)
return null;
[$sum, $nSticky, $nPending] = $ss;
$buff = [];
if ($nSticky || $nPending)
{
if ($normal = ($sum - $nSticky - $nPending))
$buff[] = '[tooltip=tooltip_normal]'.$normal.'[/tooltip]';
if ($nSticky)
$buff[] = '[tooltip=tooltip_sticky]'.$nSticky.'[/tooltip]';
if ($nPending)
$buff[] = '[tooltip=tooltip_pending]'.$nPending.'[/tooltip]';
}
return Lang::user('screenshots').$sum.($buff ? ' [small]('.implode(' + ', $buff).')[/small]' : '');
}
private function getVideoStats() : ?string
{
$vi = DB::Aowow()->selectRow(
'SELECT COUNT(*) AS "0", SUM(IF(`status` & ?d, 1, 0)) AS "1", SUM(IF(`status` & ?d, 0, 1)) AS "2" FROM ?_videos WHERE `userIdOwner` = ?d AND (`status` & ?d) = 0',
CC_FLAG_STICKY, CC_FLAG_APPROVED, $this->user['id'], CC_FLAG_DELETED
);
if (!$vi)
return null;
[$sum, $nSticky, $nPending] = $vi;
$buff = [];
if ($nSticky || $nPending)
{
if ($normal = ($sum - $nSticky - $nPending))
$buff[] = '[tooltip=tooltip_normal]'.$normal.'[/tooltip]';
if ($nSticky)
$buff[] = '[tooltip=tooltip_sticky]'.$nSticky.'[/tooltip]';
if ($nPending)
$buff[] = '[tooltip=tooltip_pending]'.$nPending.'[/tooltip]';
}
return Lang::user('videos').$sum.($buff ? ' [small]('.implode(' + ', $buff).')[/small]' : '');
}
private function getForumStats() : ?string
{
$fo = null; // some query
if (!$fo)
return null;
[$nTopics, $nReplies] = $fo;
$buff = [];
if ($nTopics)
$buff[] = '[tooltip=topics]'.$nTopics.'[/tooltip]';
if ($nReplies)
$buff[] = '[tooltip=replies]'.$nReplies.'[/tooltip]';
return Lang::user('posts').($nTopics + $nReplies).($buff ? ' [small]('.implode(' + ', $buff).')[/small]' : '');
}
}
?>

View File

@@ -23,7 +23,7 @@ class UserList extends DBTypeList
{ {
$data = []; $data = [];
foreach ($this->iterate() as $__) foreach ($this->iterate() as $userId => $__)
{ {
$data[$this->curTpl['username']] = array( $data[$this->curTpl['username']] = array(
'border' => 0, // border around avatar (rarityColors) 'border' => 0, // border around avatar (rarityColors)
@@ -40,10 +40,19 @@ class UserList extends DBTypeList
if ($_ = $this->curTpl['title']) if ($_ = $this->curTpl['title'])
$data[$this->curTpl['username']]['title'] = $_; $data[$this->curTpl['username']]['title'] = $_;
if ($_ = $this->curTpl['avatar']) switch ($this->curTpl['avatar'])
{ {
$data[$this->curTpl['username']]['avatar'] = is_numeric($_) ? 2 : 1; case 1:
$data[$this->curTpl['username']]['avatarmore'] = $_; $data[$this->curTpl['username']]['avatar'] = $this->curTpl['avatar'];
$data[$this->curTpl['username']]['avatarmore'] = $this->curTpl['wowicon'];
break;
case 2:
if ($av = DB::Aowow()->selectCell('SELECT `id` FROM ?_account_avatars WHERE `userId` = ?d AND `current` = 1 AND `status` <> 2', $userId))
{
$data[$this->curTpl['username']]['avatar'] = $this->curTpl['avatar'];
$data[$this->curTpl['username']]['avatarmore'] = $av;
}
break;
} }
// more optional data // more optional data

View File

@@ -73,15 +73,16 @@ define('SESSION_LOGOUT', 2);
define('SESSION_FORCED_LOGOUT', 3); define('SESSION_FORCED_LOGOUT', 3);
define('SESSION_EXPIRED', 4); define('SESSION_EXPIRED', 4);
define('ACC_BAN_NONE', 0x00); // all clear define('ACC_BAN_NONE', 0x0000); // all clear
define('ACC_BAN_TEMP', 0x01); define('ACC_BAN_TEMP', 0x0001);
define('ACC_BAN_PERM', 0x02); define('ACC_BAN_PERM', 0x0002);
define('ACC_BAN_RATE', 0x04); // cannot rate community items (overrides site reputation) define('ACC_BAN_RATE', 0x0004); // cannot rate community items (overrides site reputation)
define('ACC_BAN_COMMENT', 0x08); // cannot comment and reply define('ACC_BAN_COMMENT', 0x0008); // cannot comment and reply
define('ACC_BAN_UPLOAD', 0x10); // cannot upload avatar / signature files [originally: ban from data upload] define('ACC_BAN_UPLOAD', 0x0010); // cannot upload avatar / signature files [originally: ban from data upload]
define('ACC_BAN_SCREENSHOT', 0x20); // cannot upload screenshots define('ACC_BAN_SCREENSHOT', 0x0020); // cannot upload screenshots
define('ACC_BAN_VIDEO', 0x40); // cannot suggest videos define('ACC_BAN_VIDEO', 0x0040); // cannot suggest videos
define('ACC_BAN_GUIDE', 0x80); // cannot write a guide define('ACC_BAN_GUIDE', 0x0080); // cannot write a guide
define('ACC_BAN_FORUM', 0x0100); // cannot post on forums [not used here]
// Site Reputation/Privileges // Site Reputation/Privileges
define('SITEREP_ACTION_REGISTER', 1); // Registered account define('SITEREP_ACTION_REGISTER', 1); // Registered account

View File

@@ -47,7 +47,7 @@ $lang = array(
'gains' => "Belohnungen", 'gains' => "Belohnungen",
'login' => "Login", 'login' => "Login",
'forum' => "Forum", 'forum' => "Forum",
'siteRep' => "Ruf", 'siteRep' => "Ruf: ",
'yourRepHistory'=> "Dein Ruf-Verlauf", 'yourRepHistory'=> "Dein Ruf-Verlauf",
'aboutUs' => "Über Aowow", 'aboutUs' => "Über Aowow",
'and' => " und ", 'and' => " und ",
@@ -908,18 +908,18 @@ $lang = array(
'passConfirm' => "Kennwort bestätigen", 'passConfirm' => "Kennwort bestätigen",
// dashboard // dashboard
'ipAddress' => "IP-Adresse", 'ipAddress' => "IP-Adresse: ",
'lastIP' => "Letzte bekannte IP", 'lastIP' => "Letzte bekannte IP: ",
'myAccount' => "Mein Account", // 'myAccount' => "Mein Account",
'editAccount' => "Benutze die folgenden Formulare um deine Account-Informationen zu aktualisieren", // 'editAccount' => "Benutze die folgenden Formulare um deine Account-Informationen zu aktualisieren",
'viewPubDesc' => 'Die Beschreibung in deinem <a href="?user=%s">öffentlichen Profil</a> ansehen', // 'viewPubDesc' => 'Die Beschreibung in deinem <a href="?user=%s">öffentlichen Profil</a> ansehen',
// bans // bans
'accBanned' => "Dieses Konto wurde geschlossen", 'accBanned' => "Dieses Konto wurde geschlossen",
'bannedBy' => "Gebannt durch", 'bannedBy' => "Gebannt durch: ",
'ends' => "Endet am", 'reason' => "Grund: ",
'ends' => "Endet am: ",
'permanent' => "Der Bann ist permanent", 'permanent' => "Der Bann ist permanent",
'reason' => "Grund",
'noReason' => "Es wurde kein Grund angegeben.", 'noReason' => "Es wurde kein Grund angegeben.",
// form-text // form-text
@@ -947,18 +947,18 @@ $lang = array(
'user' => array( 'user' => array(
'notFound' => "Der Benutzer \"%s\" wurde nicht gefunden!", 'notFound' => "Der Benutzer \"%s\" wurde nicht gefunden!",
'removed' => "(Entfernt)", 'removed' => "(Entfernt)",
'joinDate' => "Mitglied seit", 'joinDate' => "Mitglied seit: ",
'lastLogin' => "Letzter Besuch", 'lastLogin' => "Letzter Besuch: ",
'userGroups' => "Rolle", 'userGroups' => "Rolle: ",
'consecVisits' => "Aufeinanderfolgende Besuche", 'consecVisits' => "Aufeinanderfolgende Besuche: ",
'publicDesc' => "Öffentliche Beschreibung", 'publicDesc' => "Öffentliche Beschreibung",
'profileTitle' => "Profil von %s", 'profileTitle' => "Profil von %s",
'contributions' => "Beiträge", 'contributions' => "Beiträge",
'uploads' => "Hochladevorgänge", 'uploads' => "Hochladevorgänge: ",
'comments' => "Kommentare", 'comments' => "Kommentare: ",
'screenshots' => "Screenshots", 'screenshots' => "Screenshots: ",
'videos' => "Videos", 'videos' => "Videos: ",
'posts' => "Forenbeiträge" 'posts' => "Forenbeiträge: "
), ),
'emote' => array( 'emote' => array(
'notFound' => "Dieses Emote existiert nicht.", 'notFound' => "Dieses Emote existiert nicht.",

View File

@@ -47,7 +47,7 @@ $lang = array(
'gains' => "Gains", 'gains' => "Gains",
'login' => "Login", 'login' => "Login",
'forum' => "Forum", 'forum' => "Forum",
'siteRep' => "Reputation", 'siteRep' => "Reputation: ",
'yourRepHistory'=> "Your Reputation History", 'yourRepHistory'=> "Your Reputation History",
'aboutUs' => "About us & contact", 'aboutUs' => "About us & contact",
'and' => " and ", 'and' => " and ",
@@ -908,18 +908,18 @@ $lang = array(
'passConfirm' => "Confirm password", 'passConfirm' => "Confirm password",
// dashboard // dashboard
'ipAddress' => "IP address", 'ipAddress' => "IP address: ",
'lastIP' => "last used IP", 'lastIP' => "last used IP: ",
'myAccount' => "My Account", // 'myAccount' => "My Account",
'editAccount' => "Simply use the forms below to update your account information", // 'editAccount' => "Simply use the forms below to update your account information",
'viewPubDesc' => 'View your Public Description in your <a href="?user=%s">Profile Page</a>', // 'viewPubDesc' => 'View your Public Description in your <a href="?user=%s">Profile Page</a>',
// bans // bans
'accBanned' => "This Account was closed", 'accBanned' => "This account was closed",
'bannedBy' => "Banned by", 'bannedBy' => "Banned by: ",
'ends' => "Ends on", 'reason' => "Reason: ",
'ends' => "Ends on: ",
'permanent' => "The ban is permanent", 'permanent' => "The ban is permanent",
'reason' => "Reason",
'noReason' => "No reason was given.", 'noReason' => "No reason was given.",
// form-text // form-text
@@ -947,18 +947,18 @@ $lang = array(
'user' => array( 'user' => array(
'notFound' => "User \"%s\" not found!", 'notFound' => "User \"%s\" not found!",
'removed' => "(Removed)", 'removed' => "(Removed)",
'joinDate' => "Joined", 'joinDate' => "Joined: ",
'lastLogin' => "Last visit", 'lastLogin' => "Last visit: ",
'userGroups' => "Role", 'userGroups' => "Role: ",
'consecVisits' => "Consecutive visits", 'consecVisits' => "Consecutive visits: ",
'publicDesc' => "Public Description", 'publicDesc' => "Public Description",
'profileTitle' => "%s's Profile", 'profileTitle' => "%s's Profile",
'contributions' => "Contributions", 'contributions' => "Contributions",
'uploads' => "Data uploads", 'uploads' => "Data uploads: ",
'comments' => "Comments", 'comments' => "Comments: ",
'screenshots' => "Screenshots", 'screenshots' => "Screenshots: ",
'videos' => "Videos", 'videos' => "Videos: ",
'posts' => "Forum posts" 'posts' => "Forum posts: "
), ),
'emote' => array( 'emote' => array(
'notFound' => "This Emote doesn't exist.", 'notFound' => "This Emote doesn't exist.",

View File

@@ -47,7 +47,7 @@ $lang = array(
'gains' => "Ganancias", 'gains' => "Ganancias",
'login' => "Ingresar", 'login' => "Ingresar",
'forum' => "Foro", 'forum' => "Foro",
'siteRep' => "Reputación", 'siteRep' => "Reputación: ",
'yourRepHistory'=> "Tu Historial de Reputación", 'yourRepHistory'=> "Tu Historial de Reputación",
'aboutUs' => "Sobre Aowow", 'aboutUs' => "Sobre Aowow",
'and' => " y ", 'and' => " y ",
@@ -908,18 +908,18 @@ $lang = array(
'passConfirm' => "Confirmar contraseña", 'passConfirm' => "Confirmar contraseña",
// dashboard // dashboard
'ipAddress' => "Dirección IP", 'ipAddress' => "Dirección IP: ",
'lastIP' => "Última IP usada", 'lastIP' => "Última IP usada: ",
'myAccount' => "Mi cuenta", // 'myAccount' => "Mi cuenta",
'editAccount' => "Use el formulario siguienta para actualizar la información de la cuenta.", // 'editAccount' => "Use el formulario siguienta para actualizar la información de la cuenta.",
'viewPubDesc' => 'Mira tu descripción pública en tu <a href="?user=%s">Página de perfil</a>', // 'viewPubDesc' => 'Mira tu descripción pública en tu <a href="?user=%s">Página de perfil</a>',
// bans // bans
'accBanned' => "Esta cuenta fue cerrada.", 'accBanned' => "Esta cuenta fue cerrada.",
'bannedBy' => "Suspendida por", 'bannedBy' => "Suspendida por: ",
'ends' => "Finaliza en", 'reason' => "Razón: ",
'ends' => "Finaliza en: ",
'permanent' => "La restricción es permanente", 'permanent' => "La restricción es permanente",
'reason' => "Razón",
'noReason' => "Ningúna razón fue escrita.", 'noReason' => "Ningúna razón fue escrita.",
// form-text // form-text
@@ -947,18 +947,18 @@ $lang = array(
'user' => array( 'user' => array(
'notFound' => "¡No se encontró el usuario \"%s\"!", 'notFound' => "¡No se encontró el usuario \"%s\"!",
'removed' => "(Removido)", 'removed' => "(Removido)",
'joinDate' => "Se unió", 'joinDate' => "Se unió: ",
'lastLogin' => "Última visita", 'lastLogin' => "Última visita: ",
'userGroups' => "Rol", 'userGroups' => "Rol: ",
'consecVisits' => "Visitas consecutivas", 'consecVisits' => "Visitas consecutivas: ",
'publicDesc' => "Descripción pública", 'publicDesc' => "Descripción pública",
'profileTitle' => "Perfíl de %s", 'profileTitle' => "Perfíl de %s",
'contributions' => "Contribuciones", 'contributions' => "Contribuciones",
'uploads' => "Datos enviados", 'uploads' => "Datos enviados: ",
'comments' => "Comentarios", 'comments' => "Comentarios: ",
'screenshots' => "Capturas de pantalla", 'screenshots' => "Capturas de pantalla: ",
'videos' => "Vídeos", 'videos' => "Vídeos: ",
'posts' => "Mensajes en los foros" 'posts' => "Mensajes en los foros: "
), ),
'emote' => array( 'emote' => array(
'notFound' => "Este emoticón no existe.", 'notFound' => "Este emoticón no existe.",

View File

@@ -47,7 +47,7 @@ $lang = array(
'gains' => "Gains", 'gains' => "Gains",
'login' => "[Login]", 'login' => "[Login]",
'forum' => "Forum", 'forum' => "Forum",
'siteRep' => "Réputation", 'siteRep' => "Réputation : ",
'yourRepHistory'=> "Votre historique de réputation", 'yourRepHistory'=> "Votre historique de réputation",
'aboutUs' => "À propos de Aowow", 'aboutUs' => "À propos de Aowow",
'and' => " et ", 'and' => " et ",
@@ -908,18 +908,18 @@ $lang = array(
'passConfirm' => "Confirmez", 'passConfirm' => "Confirmez",
// dashboard // dashboard
'ipAddress' => "Addresse IP", 'ipAddress' => "Addresse IP : ",
'lastIP' => "Dernière IP utilisée", 'lastIP' => "Dernière IP utilisée : ",
'myAccount' => "Mon compte", // 'myAccount' => "Mon compte",
'editAccount' => "Utilisez les formulaires ci-dessous pour mettre à jour vos informations.", // 'editAccount' => "Utilisez les formulaires ci-dessous pour mettre à jour vos informations.",
'viewPubDesc' => 'Voyez vos informations publiques dans votre <a href="?user=%s">Profile Page</a>', // 'viewPubDesc' => 'Voyez vos informations publiques dans votre <a href="?user=%s">Profile Page</a>',
// bans // bans
'accBanned' => "Ce compte a été fermé.", 'accBanned' => "Ce compte a été fermé.",
'bannedBy' => "Banni par", 'bannedBy' => "Banni par : ",
'ends' => "Termine le", 'reason' => "Raison : ",
'ends' => "Termine le : ",
'permanent' => "Ce bannissement est permanent", 'permanent' => "Ce bannissement est permanent",
'reason' => "Raison",
'noReason' => "Aucune raison donnée.", 'noReason' => "Aucune raison donnée.",
// form-text // form-text
@@ -947,18 +947,18 @@ $lang = array(
'user' => array( 'user' => array(
'notFound' => "Utilisateur \"%s\" non trouvé!", 'notFound' => "Utilisateur \"%s\" non trouvé!",
'removed' => "(Supprimé)", 'removed' => "(Supprimé)",
'joinDate' => "Inscription", 'joinDate' => "Inscription : ",
'lastLogin' => "Dernière visite", 'lastLogin' => "Dernière visite : ",
'userGroups' => "Role", 'userGroups' => "Role : ",
'consecVisits' => "Visites consécutives", 'consecVisits' => "Visites consécutives : ",
'publicDesc' => "Description publique", 'publicDesc' => "Description publique",
'profileTitle' => "Profil de %s", 'profileTitle' => "Profil de %s",
'contributions' => "Contributions", 'contributions' => "Contributions",
'uploads' => "Envois de données", 'uploads' => "Envois de données : ",
'comments' => "Commentaires", 'comments' => "Commentaires : ",
'screenshots' => "Captures d'écran", 'screenshots' => "Captures d'écran : ",
'videos' => "Vidéos", 'videos' => "Vidéos : ",
'posts' => "Messages sur le forum" 'posts' => "Messages sur le forum : "
), ),
'emote' => array( 'emote' => array(
'notFound' => "[This Emote doesn't exist.]", 'notFound' => "[This Emote doesn't exist.]",

View File

@@ -47,7 +47,7 @@ $lang = array(
'gains' => "Бонус", 'gains' => "Бонус",
'login' => "[Login]", 'login' => "[Login]",
'forum' => "Форум", 'forum' => "Форум",
'siteRep' => "Репутация", 'siteRep' => "Репутация: ",
'yourRepHistory'=> "История вашей репутации", 'yourRepHistory'=> "История вашей репутации",
'aboutUs' => "О Aowow", 'aboutUs' => "О Aowow",
'and' => " и ", 'and' => " и ",
@@ -908,19 +908,19 @@ $lang = array(
'passConfirm' => "Повторите пароль", 'passConfirm' => "Повторите пароль",
// dashboard // dashboard
'ipAddress' => "IP-Adress", 'ipAddress' => "[IP-Adress]: ",
'lastIP' => "last used IP", 'lastIP' => "[last used IP]: ",
'myAccount' => "My Account", // 'myAccount' => "[My Account]",
'editAccount' => "Simply use the forms below to update your account information", // 'editAccount' => "[Simply use the forms below to update your account information]",
'viewPubDesc' => 'View your Public Description in your <a href="?user=%s">Profile Page</a>', // 'viewPubDesc' => '[View your Public Description in your <a href="?user=%s">Profile Page</a>]',
// bans // bans
'accBanned' => "This Account was closed", 'accBanned' => "[This Account was closed]",
'bannedBy' => "Banned by", 'bannedBy' => "[Banned by]: ",
'ends' => "Ends on", 'reason' => "[Reason]: ",
'permanent' => "The ban is permanent", 'ends' => "[Ends on]: ",
'reason' => "Reason", 'permanent' => "[The ban is permanent]",
'noReason' => "No reason was given.", 'noReason' => "[No reason was given.]",
// form-text // form-text
'emailInvalid' => "Недопустимый адрес email.", // message_emailnotvalid 'emailInvalid' => "Недопустимый адрес email.", // message_emailnotvalid
@@ -947,18 +947,18 @@ $lang = array(
'user' => array( 'user' => array(
'notFound' => "Пользователь \"%s\" не найден!", 'notFound' => "Пользователь \"%s\" не найден!",
'removed' => "(Удалено)", 'removed' => "(Удалено)",
'joinDate' => "Зарегистрировался", 'joinDate' => "Зарегистрировался:",
'lastLogin' => "Последняя активность", 'lastLogin' => "Последняя активность:",
'userGroups' => "Роль", 'userGroups' => "Роль:",
'consecVisits' => "Регулярные посещения", 'consecVisits' => "Регулярные посещения:",
'publicDesc' => "Описание", 'publicDesc' => "Описание",
'profileTitle' => "Профиль %s", 'profileTitle' => "Профиль %s",
'contributions' => "Вклад", 'contributions' => "Вклад",
'uploads' => "Данных загружено", 'uploads' => "Данных загружено: ",
'comments' => "Комментарии", 'comments' => "Комментарии: ",
'screenshots' => "Скриншоты", 'screenshots' => "Скриншоты: ",
'videos' => "Видео", 'videos' => "Видео: ",
'posts' => "Сообщений на форумах" 'posts' => "Сообщений на форумах: "
), ),
'emote' => array( 'emote' => array(
'notFound' => "[This Emote doesn't exist.]", 'notFound' => "[This Emote doesn't exist.]",

View File

@@ -48,7 +48,7 @@ $lang = array(
'gains' => "获得", 'gains' => "获得",
'login' => "登录", 'login' => "登录",
'forum' => "论坛", 'forum' => "论坛",
'siteRep' => "站点声望", 'siteRep' => "站点声望",
'yourRepHistory'=> "您的声望历史", 'yourRepHistory'=> "您的声望历史",
'aboutUs' => "关于我们 & 联系我们", 'aboutUs' => "关于我们 & 联系我们",
'and' => "", 'and' => "",
@@ -71,7 +71,7 @@ $lang = array(
'oneFilter' => "至少一个", 'oneFilter' => "至少一个",
'applyFilter' => "应用过滤", 'applyFilter' => "应用过滤",
'resetForm' => "清除表单", 'resetForm' => "清除表单",
'refineSearch' => '提示: 通过浏览 <a href="javascript:;" id="fi_subcat">子类别</a>搜索。', 'refineSearch' => '提示通过浏览 <a href="javascript:;" id="fi_subcat">子类别</a>搜索。',
'clear' => "清除", 'clear' => "清除",
'exactMatch' => "精确匹配", 'exactMatch' => "精确匹配",
'_reqLevel' => "要求等级", '_reqLevel' => "要求等级",
@@ -111,7 +111,7 @@ $lang = array(
'addWeight' => "添加另一个权重", 'addWeight' => "添加另一个权重",
'createWS' => "创建一个权重比例", 'createWS' => "创建一个权重比例",
'jcGemsOnly' => "包含<span%s>JC-only</span>宝石", 'jcGemsOnly' => "包含<span%s>JC-only</span>宝石",
'cappedHint' => '提示: <a href="javascript:;" onclick="fi_presetDetails();">移除</a> 命中等级等上限属性的权重。', 'cappedHint' => '提示<a href="javascript:;" onclick="fi_presetDetails();">移除</a> 命中等级等上限属性的权重。',
'groupBy' => "按组", 'groupBy' => "按组",
'gb' => array( 'gb' => array(
["", "none"], ["插槽", "slot"], ["等级", "level"], ["来源", "source"] ["", "none"], ["插槽", "slot"], ["等级", "level"], ["来源", "source"]
@@ -270,7 +270,7 @@ $lang = array(
'thanks' => array( 'thanks' => array(
'contrib' => "非常感谢你的贡献!", 'contrib' => "非常感谢你的贡献!",
'goBack' => '<a href="?%s=%d">点击这里</a>返回上一页。', 'goBack' => '<a href="?%s=%d">点击这里</a>返回上一页。',
'note' => "注意: 你的截图显示在网站前需要审核。这需要最多72小时。" 'note' => "注意你的截图显示在网站前需要审核。这需要最多72小时。"
), ),
'error' => array( 'error' => array(
'unkFormat' => "未知图像格式。", 'unkFormat' => "未知图像格式。",
@@ -908,18 +908,18 @@ $lang = array(
'passConfirm' => "确认密码", 'passConfirm' => "确认密码",
// dashboard // dashboard
'ipAddress' => "IP地址", 'ipAddress' => "IP地址",
'lastIP' => "上次使用IP地址", 'lastIP' => "上次使用IP地址",
'myAccount' => "我的账号", // 'myAccount' => "我的账号",
'editAccount' => "只需使用以下表格就能更新你的帐户信息", // 'editAccount' => "只需使用以下表格就能更新你的帐户信息",
'viewPubDesc' => '在你的<a href="?user=%s">简介页面</a>查看你公共描述', // 'viewPubDesc' => '在你的<a href="?user=%s">简介页面</a>查看你公共描述',
// bans // bans
'accBanned' => "这个账号已被关闭", 'accBanned' => "这个账号已被关闭",
'bannedBy' => "冻结操作者", 'bannedBy' => "冻结操作者",
'ends' => "结束于", 'reason' => "理由:",
'ends' => "结束于:",
'permanent' => "永久冻结", 'permanent' => "永久冻结",
'reason' => "理由",
'noReason' => "没有理由提供。", 'noReason' => "没有理由提供。",
// form-text // form-text
@@ -947,18 +947,18 @@ $lang = array(
'user' => array( 'user' => array(
'notFound' => "用户 \"%s\" 未找到", 'notFound' => "用户 \"%s\" 未找到",
'removed' => "(已移除)", 'removed' => "(已移除)",
'joinDate' => "加入", 'joinDate' => "加入",
'lastLogin' => "上次访问", 'lastLogin' => "上次访问",
'userGroups' => "角色", 'userGroups' => "角色",
'consecVisits' => "连续访问", 'consecVisits' => "连续访问",
'publicDesc' => "公共描述", 'publicDesc' => "公共描述",
'profileTitle' => "%s的简介", 'profileTitle' => "%s的简介",
'contributions' => "贡献", 'contributions' => "贡献",
'uploads' => "数据上传", 'uploads' => "数据上传",
'comments' => "评论", 'comments' => "评论",
'screenshots' => "截图", 'screenshots' => "截图",
'videos' => "视频", 'videos' => "视频",
'posts' => "论坛帖子" 'posts' => "论坛帖子"
), ),
'emote' => array( 'emote' => array(
'notFound' => "这个表情不存在。", 'notFound' => "这个表情不存在。",

View File

@@ -1,269 +0,0 @@
<?php
namespace Aowow;
if (!defined('AOWOW_REVISION'))
die('illegal access');
class UserPage extends GenericPage
{
protected $lvTabs = [];
protected $forceTabs = true;
protected $infobox = [];
protected $contributions = '';
protected $tpl = 'user';
protected $scripts = array(
[SC_JS_FILE, 'js/user.js'],
[SC_JS_FILE, 'js/profile.js'],
[SC_CSS_FILE, 'css/Profiler.css']
);
protected $mode = CACHE_TYPE_NONE;
protected $pageName = '';
protected $user = [];
public function __construct($pageCall, $pageParam)
{
parent::__construct($pageCall, $pageParam);
if ($pageParam)
{
// todo: check if account is disabled or something
if ($user = DB::Aowow()->selectRow('SELECT a.`id`, a.`username`, a.`consecutiveVisits`, a.`userGroups`, a.`avatar`, a.`title`, a.`description`, a.`joinDate`, a.`prevLogin`, IFNULL(SUM(ar.`amount`), 0) AS "sumRep" FROM ?_account a LEFT JOIN ?_account_reputation ar ON a.`id` = ar.`userId` WHERE LOWER(a.`username`) = LOWER(?) GROUP BY a.`id`', $pageParam))
$this->user = $user;
else
$this->notFound(sprintf(Lang::user('notFound'), $pageParam));
}
else if (User::isLoggedIn())
{
header('Location: ?user='.User::$username, true, 302);
die();
}
else
$this->forwardToSignIn('user');
}
protected function generateContent()
{
if (!$this->user) // shouldn't happen .. but did
return;
/***********/
/* Infobox */
/***********/
$infobox = $contrib = $groups = [];
foreach (Lang::account('groups') as $idx => $key)
if ($idx >= 0 && $this->user['userGroups'] & (1 << $idx))
$groups[] = (!fMod(count($groups) + 1, 3) ? '[br]' : null).Lang::account('groups', $idx);
$infobox[] = Lang::user('joinDate'). Lang::main('colon').'[tooltip name=joinDate]'. date('l, G:i:s', $this->user['joinDate']). '[/tooltip][span class=tip tooltip=joinDate]'. date(Lang::main('dateFmtShort'), $this->user['joinDate']). '[/span]';
$infobox[] = Lang::user('lastLogin').Lang::main('colon').'[tooltip name=lastLogin]'.date('l, G:i:s', $this->user['prevLogin']).'[/tooltip][span class=tip tooltip=lastLogin]'.date(Lang::main('dateFmtShort'), $this->user['prevLogin']).'[/span]';
$infobox[] = Lang::user('userGroups').Lang::main('colon').($groups ? implode(', ', $groups) : Lang::account('groups', -1));
$infobox[] = Lang::user('consecVisits').Lang::main('colon').$this->user['consecutiveVisits'];
$infobox[] = Util::ucFirst(Lang::main('siteRep')).Lang::main('colon').Lang::nf($this->user['sumRep']);
// contrib -> [url=http://www.wowhead.com/client]Data uploads: n [small]([tooltip=tooltip_totaldatauploads]xx.y MB[/tooltip])[/small][/url]
$co = DB::Aowow()->selectRow(
'SELECT COUNT(DISTINCT c.id) AS sum, SUM(IFNULL(ur.value, 0)) AS nRates FROM ?_comments c LEFT JOIN ?_user_ratings ur ON ur.entry = c.id AND ur.type = ?d AND ur.userId <> 0 WHERE c.replyTo = 0 AND c.userId = ?d',
RATING_COMMENT,
$this->user['id']
);
if ($co['sum'])
$contrib[] = Lang::user('comments').Lang::main('colon').$co['sum'].($co['nRates'] ? ' [small]([tooltip=tooltip_totalratings]'.$co['nRates'].'[/tooltip])[/small]' : null);
$ss = DB::Aowow()->selectRow('SELECT COUNT(*) AS sum, SUM(IF(status & ?d, 1, 0)) AS nSticky, SUM(IF(status & ?d, 0, 1)) AS nPending FROM ?_screenshots WHERE userIdOwner = ?d AND (status & ?d) = 0',
CC_FLAG_STICKY,
CC_FLAG_APPROVED,
$this->user['id'],
CC_FLAG_DELETED
);
if ($ss['sum'])
{
$buff = [];
if ($ss['nSticky'] || $ss['nPending'])
{
if ($normal = ($ss['sum'] - $ss['nSticky'] - $ss['nPending']))
$buff[] = '[tooltip=tooltip_normal]'.$normal.'[/tooltip]';
if ($ss['nSticky'])
$buff[] = '[tooltip=tooltip_sticky]'.$ss['nSticky'].'[/tooltip]';
if ($ss['nPending'])
$buff[] = '[tooltip=tooltip_pending]'.$ss['nPending'].'[/tooltip]';
}
$contrib[] = Lang::user('screenshots').Lang::main('colon').$ss['sum'].($buff ? ' [small]('.implode(' + ', $buff).')[/small]' : null);
}
$vi = DB::Aowow()->selectRow('SELECT COUNT(id) AS sum, SUM(IF(status & ?d, 1, 0)) AS nSticky, SUM(IF(status & ?d, 0, 1)) AS nPending FROM ?_videos WHERE userIdOwner = ?d AND (status & ?d) = 0',
CC_FLAG_STICKY,
CC_FLAG_APPROVED,
$this->user['id'],
CC_FLAG_DELETED
);
if ($vi['sum'])
{
$buff = [];
if ($vi['nSticky'] || $vi['nPending'])
{
if ($normal = ($vi['sum'] - $vi['nSticky'] - $vi['nPending']))
$buff[] = '[tooltip=tooltip_normal]'.$normal.'[/tooltip]';
if ($vi['nSticky'])
$buff[] = '[tooltip=tooltip_sticky]'.$vi['nSticky'].'[/tooltip]';
if ($vi['nPending'])
$buff[] = '[tooltip=tooltip_pending]'.$vi['nPending'].'[/tooltip]';
}
$contrib[] = Lang::user('videos').Lang::main('colon').$vi['sum'].($buff ? ' [small]('.implode(' + ', $buff).')[/small]' : null);
}
// contrib -> Forum posts: 5769 [small]([tooltip=topics]579[/tooltip] + [tooltip=replies]5190[/tooltip])[/small]
$this->infobox = '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]';
if ($contrib)
$this->contributions = '[ul][li]'.implode('[/li][li]', $contrib).'[/li][/ul]';
/****************/
/* Main Content */
/****************/
$this->name = $this->user['title'] ? $this->user['username'].'&nbsp;&lt;'.$this->user['title'].'&gt;' : Lang::user('profileTitle', [$this->user['username']]);
/**************/
/* Extra Tabs */
/**************/
// [unused] Site Achievements
// Reputation changelog (params only for comment-events)
if ($repData = DB::Aowow()->select('SELECT action, amount, date AS \'when\', IF(action IN (3, 4, 5), sourceA, 0) AS param FROM ?_account_reputation WHERE userId = ?d', $this->user['id']))
{
foreach ($repData as &$r)
$r['when'] = date(Util::$dateFormatInternal, $r['when']);
$this->lvTabs[] = ['reputationhistory', ['data' => $repData]];
}
// Comments
if ($_ = CommunityContent::getCommentPreviews(['user' => $this->user['id'], 'comments' => true], $nFound))
{
$tabData = array(
'data' => $_,
'hiddenCols' => ['author'],
'onBeforeCreate' => '$Listview.funcBox.beforeUserComments',
'_totalCount' => $nFound
);
if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT'))
{
$tabData['name'] = '$LANG.tab_latestcomments';
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_usercomments, '.$nFound.')';
}
$this->lvTabs[] = ['commentpreview', $tabData];
}
// Comment Replies
if ($_ = CommunityContent::getCommentPreviews(['user' => $this->user['id'], 'replies' => true], $nFound))
{
$tabData = array(
'data' => $_,
'hiddenCols' => ['author'],
'onBeforeCreate' => '$Listview.funcBox.beforeUserComments',
'_totalCount' => $nFound
);
if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT'))
{
$tabData['name'] = '$LANG.tab_latestreplies';
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_userreplies, '.$nFound.')';
}
$this->lvTabs[] = ['replypreview', $tabData];
}
// Screenshots
if ($_ = CommunityContent::getScreenshots(-$this->user['id'], 0, $nFound))
{
$tabData = array(
'data' => $_,
'_totalCount' => $nFound
);
if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT'))
{
$tabData['name'] = '$LANG.tab_latestscreenshots';
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_userscreenshots, '.$nFound.')';
}
$this->lvTabs[] = ['screenshot', $tabData];
}
// Videos
if ($_ = CommunityContent::getVideos(-$this->user['id'], 0, $nFound))
{
$tabData = array(
'data' => $_,
'_totalCount' => $nFound
);
if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT'))
{
$tabData['name'] = '$LANG.tab_latestvideos';
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_uservideos, '.$nFound.')';
}
$this->lvTabs[] = ['video', $tabData];
}
// forum -> latest topics [unused]
// forum -> latest replies [unused]
$conditions = array(
['OR', ['cuFlags', PROFILER_CU_PUBLISHED, '&'], ['ap.extraFlags', PROFILER_CU_PUBLISHED, '&']],
[['cuFlags', PROFILER_CU_DELETED, '&'], 0],
['OR', ['user', $this->user['id']], ['ap.accountId', $this->user['id']]]
);
if (User::isInGroup(U_GROUP_ADMIN | U_GROUP_BUREAU))
$conditions = array_slice($conditions, 2);
else if (User::$id == $this->user['id'])
array_shift($conditions);
$profiles = new LocalProfileList($conditions);
if (!$profiles->error)
{
$this->addScript([SC_JS_FILE, '?data=weight-presets']);
// Characters
if ($chars = $profiles->getListviewData(PROFILEINFO_CHARACTER | PROFILEINFO_USER))
$this->user['characterData'] = $chars;
// Profiles
if ($prof = $profiles->getListviewData(PROFILEINFO_PROFILE | PROFILEINFO_USER))
$this->user['profileData'] = $prof;
}
}
protected function generateTitle()
{
if (!$this->user) // shouldn't happen .. but did
return;
array_unshift($this->title, Lang::user('profileTitle', [$this->user['username']]));
}
protected function generatePath() { }
}
?>

View File

@@ -0,0 +1,17 @@
ALTER TABLE `aowow_account`
CHANGE COLUMN `avatar` `wowicon` varchar(55) NOT NULL DEFAULT '' COMMENT 'iconname as avatar',
ADD COLUMN `avatar` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'selected avatar mode' AFTER `userGroups`;
DROP TABLE IF EXISTS `aowow_account_avatars`;
CREATE TABLE `aowow_account_avatars` (
`id` mediumint unsigned NOT NULL,
`userId` int unsigned NOT NULL,
`name` varchar(20) NOT NULL,
`size` mediumint unsigned NOT NULL,
`when` int unsigned NOT NULL,
`current` tinyint unsigned NOT NULL DEFAULT 0,
`status` tinyint unsigned NOT NULL DEFAULT 0,
UNIQUE KEY `id` (`id`) USING BTREE,
KEY `userId` (`userId`) USING BTREE,
CONSTRAINT `FK_acc_avatars` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;

View File

@@ -1,7 +1,10 @@
<?php namespace Aowow; ?> <?php
namespace Aowow\Template;
<?php $this->brick('header'); ?> use \Aowow\Lang;
$this->brick('header');
?>
<div class="main" id="main"> <div class="main" id="main">
<div class="main-precontents" id="main-precontents"></div> <div class="main-precontents" id="main-precontents"></div>
<div class="main-contents" id="main-contents"> <div class="main-contents" id="main-contents">
@@ -14,23 +17,28 @@
$this->brick('infobox'); $this->brick('infobox');
?> ?>
<script type="text/javascript">var g_pageInfo = { username: '<?=Util::jsEscape($this->user['username']); ?>' }</script> <script type="text/javascript">var g_pageInfo = { username: '<?=$this->escJS($this->username); ?>' }</script>
<div class="text"> <div class="text">
<?php
if ($this->userIcon):
?>
<div id="h1-icon-generic" class="h1-icon"></div> <div id="h1-icon-generic" class="h1-icon"></div>
<script type="text/javascript"> <script type="text/javascript">
$WH.ge('h1-icon-generic').appendChild(Icon.createUser(<?=(is_numeric($this->user['avatar']) ? 2 : 1).', \''.($this->user['avatar'] ?: 'inv_misc_questionmark').'\''?>, 1, null, <?=User::isInGroup(U_GROUP_PREMIUM) ? 0 : 2; ?>, false, Icon.getPrivilegeBorder(<?=$this->user['sumRep']; ?>))); $WH.ge('h1-icon-generic').appendChild(Icon.createUser(<?=substr($this->json('userIcon'), 1, -1); ?>));
</script> </script>
<h1 class="h1-icon"><?=$this->name; ?></h1> <h1 class="h1-icon"><?=$this->h1; ?></h1>
<?php else: ?>
<h1><?=$this->h1; ?></h1>
<?php endif; ?>
</div> </div>
<h3 class="first"><?=Lang::user('publicDesc'); ?></h3> <h3 class="first"><?=Lang::user('publicDesc'); ?></h3>
<div id="description" class="left"><?php # must follow directly, no whitespaces allowed <div id="description" class="left"><?php # must follow directly, no whitespaces allowed
if (!empty($this->user['description'])): if ($this->description):
?> ?>
<div id="description-generic"></div> <div id="description-generic"></div>
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
Markup.printHtml('<?=$this->user['description']; ?>', "description-generic", { allow: Markup.CLASS_USER, roles: "<?=$this->user['userGroups']; ?>" }); <?=$this->description; ?>
//]]></script> //]]></script>
<?php <?php
endif; endif;
@@ -39,7 +47,7 @@ endif;
<div id="roster-status" class="profiler-message clear" style="display: none"></div> <div id="roster-status" class="profiler-message clear" style="display: none"></div>
<?php $this->brick('lvTabs', ['relTabs' => true]); ?> <?php $this->brick('lvTabs'); ?>
<div class="clear"></div> <div class="clear"></div>
</div><!-- main-contents --> </div><!-- main-contents -->