Example #1
0
 protected function generateTitle()
 {
     array_unshift($this->title, sprintf(Lang::user('profileTitle'), $this->user['displayName']));
 }
Example #2
0
 public static function getScreenshots($typeOrUser = 0, $typeId = 0, &$nFound = 0)
 {
     $screenshots = DB::Aowow()->selectPage($nFound, "\n            SELECT s.id, a.displayName AS user, s.date, s.width, s.height, s.caption, IF(s.status & ?d, 1, 0) AS 'sticky', s.type, s.typeId\n            FROM ?_screenshots s\n            LEFT JOIN ?_account a ON s.userIdOwner = a.id\n            WHERE {s.userIdOwner = ?d AND }{s.type = ? AND }{s.typeId = ? AND }s.status & ?d AND (s.status & ?d) = 0\n            {ORDER BY ?# DESC}\n            {LIMIT ?d}", CC_FLAG_STICKY, $typeOrUser < 0 ? -$typeOrUser : DBSIMPLE_SKIP, $typeOrUser > 0 ? $typeOrUser : DBSIMPLE_SKIP, $typeOrUser > 0 ? $typeId : DBSIMPLE_SKIP, CC_FLAG_APPROVED, CC_FLAG_DELETED, !$typeOrUser ? 'date' : DBSIMPLE_SKIP, !$typeOrUser ? CFG_SQL_LIMIT_SEARCH : DBSIMPLE_SKIP);
     if ($typeOrUser <= 0) {
         foreach ($screenshots as $s) {
             self::addSubject($s['type'], $s['typeId']);
         }
         self::getSubjects();
     }
     // format data to meet requirements of the js
     foreach ($screenshots as &$s) {
         if ($typeOrUser <= 0) {
             if (!empty(self::$subjCache[$s['type']][$s['typeId']]) && !is_numeric(self::$subjCache[$s['type']][$s['typeId']])) {
                 $s['subject'] = self::$subjCache[$s['type']][$s['typeId']];
             } else {
                 $s['subject'] = Lang::user('removed');
             }
         }
         $s['date'] = date(Util::$dateFormatInternal, $s['date']);
         if (!$s['sticky']) {
             unset($s['sticky']);
         }
         if (!$s['user']) {
             unset($s['user']);
         }
     }
     return $screenshots;
 }
Example #3
0
 private function createDashboard()
 {
     if (!User::$id) {
         $this->forwardToSignIn('account');
     }
     $user = DB::Aowow()->selectRow('SELECT * FROM ?_account WHERE id = ?d', User::$id);
     $bans = DB::Aowow()->select('SELECT ab.*, a.displayName, ab.id AS ARRAY_KEY FROM ?_account_banned ab LEFT JOIN ?_account a ON a.id = ab.staffId WHERE ab.userId = ?d', User::$id);
     /***********/
     /* Infobox */
     /***********/
     $infobox = [];
     $infobox[] = Lang::user('joinDate') . Lang::main('colon') . '[tooltip name=joinDate]' . date('l, G:i:s', $user['joinDate']) . '[/tooltip][span class=tip tooltip=joinDate]' . date(Lang::main('dateFmtShort'), $user['joinDate']) . '[/span]';
     $infobox[] = Lang::user('lastLogin') . Lang::main('colon') . '[tooltip name=lastLogin]' . date('l, G:i:s', $user['prevLogin']) . '[/tooltip][span class=tip tooltip=lastLogin]' . date(Lang::main('dateFmtShort'), $user['prevLogin']) . '[/span]';
     $infobox[] = Lang::account('lastIP') . Lang::main('colon') . $user['prevIP'];
     $infobox[] = Lang::account('email') . Lang::main('colon') . $user['email'];
     $groups = [];
     foreach (Lang::account('groups') as $idx => $key) {
         if ($idx >= 0 && $user['userGroups'] & 1 << $idx) {
             $groups[] = (!fMod(count($groups) + 1, 3) ? '[br]' : null) . Lang::account('groups', $idx);
         }
     }
     $infobox[] = Lang::user('userGroups') . Lang::main('colon') . ($groups ? implode(', ', $groups) : Lang::account('groups', -1));
     $infobox[] = Util::ucFirst(Lang::main('siteRep')) . Lang::main('colon') . User::getReputation();
     $this->infobox = '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]';
     /*************/
     /* Ban Popup */
     /*************/
     foreach ($bans as $b) {
         if (!($b['typeMask'] & (ACC_BAN_TEMP | ACC_BAN_PERM)) || $b['end'] && $b['end'] <= time()) {
             continue;
         }
         $this->banned = array('by' => [$b['staffId'], $b['displayName']], 'end' => $b['end'], 'reason' => $b['reason']);
         break;
         // one is enough
     }
     /************/
     /* Listview */
     /************/
     $this->forceTabs = true;
     // 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', User::$id)) {
         foreach ($repData as &$r) {
             $r['when'] = date(Util::$dateFormatInternal, $r['when']);
         }
         $this->lvTabs[] = ['reputationhistory', ['data' => $repData]];
     }
     // comments
     if ($_ = CommunityContent::getCommentPreviews(['user' => User::$id, 'replies' => false])) {
         // needs foundCount for params
         // _totalCount: 377,
         // note: $WH.sprintf(LANG.lvnote_usercomments, 377),
         $this->lvTabs[] = ['commentpreview', array('data' => $_, 'hiddenCols' => ['author'], 'onBeforeCreate' => '$Listview.funcBox.beforeUserComments')];
     }
     // replies
     if ($_ = CommunityContent::getCommentPreviews(['user' => User::$id, 'replies' => true])) {
         // needs commentid (parentComment) for data
         // needs foundCount for params
         // _totalCount: 377,
         // note: $WH.sprintf(LANG.lvnote_usercomments, 377),
         $this->lvTabs[] = ['replypreview', array('data' => $_, 'hiddenCols' => ['author'])];
     }
     /*
     <div id="description" class="left"><div id="description-generic"></div>
     <script type="text/javascript">//<![CDATA[
     Markup.printHtml("description text here", "description-generic", { allow: Markup.CLASS_PREMIUM, roles: "256" });
     //]]></script>
     </div>
     <script type="text/javascript">us_addDescription()</script>
     */
     // claimed characters
     // profiles
     // own screenshots
     // own videos
     // own comments (preview)
     // articles guides..?
     // cpmsg    change pass messaeg class:failure|success, msg:blabla
 }
Example #4
0
        <tr><td>
            <div class="infobox-spacer"></div>
            <div id="infobox-contents0"></div>
            <script type="text/javascript">
                Markup.printHtml("<?php 
    echo Util::jsEscape($this->infobox);
    ?>
", "infobox-contents0", { allow: Markup.CLASS_STAFF, dbpage: true });
            </script>
        </td></tr>
<?php 
}
if (!empty($this->contributions)) {
    ?>
        <tr><th id="infobox-contributions"><?php 
    echo Lang::user('contributions');
    ?>
</th></tr>
        <tr><td>
            <div class="infobox-spacer"></div>
            <div id="infobox-contents1"></div>
            <script type="text/javascript">
                Markup.printHtml('<?php 
    echo Util::jsEscape($this->contributions);
    ?>
', 'infobox-contents1', { allow: Markup.CLASS_STAFF });
            </script>
        </td></tr>
<?php 
}
if (!empty($this->series)) {
Example #5
0
, 1, null, <?php 
echo User::isInGroup(U_GROUP_PREMIUM) ? 0 : 2;
?>
, false, Icon.getPrivilegeBorder(<?php 
echo $this->user['sumRep'];
?>
)));
                </script>
                <h1 class="h1-icon"><?php 
echo $this->name;
?>
</h1>
            </div>

            <h3 class="first"><?php 
echo Lang::user('publicDesc');
?>
</h3>
            <div id="description" class="left"><?php 
#  must follow directly, no whitespaces allowed
if (!empty($this->user['description'])) {
    ?>
                <div id="description-generic"></div>
                <script type="text/javascript">//<![CDATA[
                    Markup.printHtml('<?php 
    echo $this->user['description'];
    ?>
', "description-generic", { allow: Markup.CLASS_USER, roles: "<?php 
    echo $this->user['userGroups'];
    ?>
" });