Ejemplo n.º 1
0
 function __construct($profile, $group, $action)
 {
     parent::__construct($profile, $action);
     $this->group = $group;
 }
Ejemplo n.º 2
0
 function __construct($profile, $peopletag, $action)
 {
     parent::__construct($profile, $action);
     $this->peopletag = $peopletag;
 }
Ejemplo n.º 3
0
 function __construct($profile, $owner = null, $action = null)
 {
     parent::__construct($profile, $action);
     $this->owner = $owner;
 }
Ejemplo n.º 4
0
 function __construct($profile, $terms, $action)
 {
     parent::__construct($profile, $action);
     $this->terms = array_map('preg_quote', array_map('htmlspecialchars', $terms));
     $this->pattern = '/(' . implode('|', $terms) . ')/i';
 }
Ejemplo n.º 5
0
 /**
  * Confirm with user.
  *
  * Shows a confirmation form.
  *
  * @return void
  */
 function areYouSureForm()
 {
     // @fixme if we ajaxify the confirmation form, skip the preview on ajax hits
     $profile = new ArrayWrapper(array($this->profile));
     $preview = new ProfileList($profile, $this);
     $preview->show();
     $id = $this->profile->id;
     $this->elementStart('form', array('id' => 'block-' . $id, 'method' => 'post', 'class' => 'form_settings form_entity_block', 'action' => common_local_url('block')));
     $this->elementStart('fieldset');
     $this->hidden('token', common_session_token());
     $this->element('legend', _('Block user'));
     $this->element('p', null, _('Are you sure you want to block this user? ' . 'Afterwards, they will be unsubscribed from you, ' . 'unable to subscribe to you in the future, and ' . 'you will not be notified of any @-replies from them.'));
     $this->element('input', array('id' => 'blockto-' . $id, 'name' => 'profileid', 'type' => 'hidden', 'value' => $id));
     foreach ($this->args as $k => $v) {
         if (substr($k, 0, 9) == 'returnto-') {
             $this->hidden($k, $v);
         }
     }
     $this->submit('form_action-no', _m('BUTTON', 'No'), 'submit form_action-primary', 'no', _('Do not block this user'));
     $this->submit('form_action-yes', _m('BUTTON', 'Yes'), 'submit form_action-secondary', 'yes', _('Block this user'));
     $this->elementEnd('fieldset');
     $this->elementEnd('form');
 }
Ejemplo n.º 6
0
 function showContent()
 {
     // XXX: Note I'm doing it this two-stage way because a raw query
     // with a JOIN was *not* working. --Zach
     $featured_nicks = common_config('nickname', 'featured');
     if (count($featured_nicks) > 0) {
         $quoted = array();
         foreach ($featured_nicks as $nick) {
             $quoted[] = "'{$nick}'";
         }
         $user = new User();
         $user->whereAdd(sprintf('nickname IN (%s)', implode(',', $quoted)));
         $user->limit(($this->page - 1) * PROFILES_PER_PAGE, PROFILES_PER_PAGE + 1);
         $user->orderBy(common_database_tablename('user') . '.nickname ASC');
         $user->find();
         $profile_ids = array();
         while ($user->fetch()) {
             $profile_ids[] = $user->id;
         }
         $profile = new Profile();
         $profile->whereAdd(sprintf('profile.id IN (%s)', implode(',', $profile_ids)));
         $profile->orderBy('nickname ASC');
         $cnt = $profile->find();
         if ($cnt > 0) {
             $featured = new ProfileList($profile, $this);
             $featured->show();
         }
         $profile->free();
         $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE, $this->page, 'featured');
     }
 }
Ejemplo n.º 7
0
 protected function handleLoad()
 {
     /*  params
                 id: profileId
                 items: string       [itemIds.join(':')]
                 unnamed: unixtime   [only to force the browser to reload instead of cache]
             return
                 lots...
         */
     // titles, achievements, characterData, talents (, pets)
     // and some onLoad-hook to .. load it registerProfile($data)
     // everything else goes through data.php .. strangely enough
     if (!$this->_get['id']) {
         return;
     }
     $char = new ProfileList(array(['id', $this->_get['id'][0]]));
     // or string or whatever
     $buff = '';
     if ($it = array_column($char->getField('inventory'), 0)) {
         $itemz = new ItemList(array(['id', $it, CFG_SQL_LIMIT_NONE]));
         $data = $itemz->getListviewData(ITEMINFO_JSON | ITEMINFO_SUBITEMS);
         // get and apply inventory
         foreach ($itemz->iterate() as $iId => $__) {
             $buff .= 'g_items.add(' . $iId . ', {name_' . User::$localeString . ":'" . Util::jsEscape($itemz->getField('name', true)) . "', quality:" . $itemz->getField('quality') . ", icon:'" . $itemz->getField('iconString') . "', jsonequip:" . Util::toJSON($data[$iId]) . "});\n";
         }
         $buff .= "\n";
     }
     if ($au = $char->getField('auras')) {
         $auraz = new SpellList(array(['id', $char->getField('auras')], CFG_SQL_LIMIT_NONE));
         $dataz = $auraz->getListviewData();
         $modz = $auraz->getProfilerMods();
         // get and apply aura-mods
         foreach ($dataz as $id => $data) {
             $mods = [];
             if (!empty($modz[$id])) {
                 foreach ($modz[$id] as $k => $v) {
                     if (is_array($v)) {
                         $mods[] = $v;
                     } else {
                         if ($str = @Util::$itemMods[$k]) {
                             $mods[$str] = $v;
                         }
                     }
                 }
             }
             $buff .= 'g_spells.add(' . $id . ", {id:" . $id . ", name:'" . Util::jsEscape(mb_substr($data['name'], 1)) . "', icon:'" . $data['icon'] . "', modifier:" . Util::toJSON($mods) . "});\n";
         }
         $buff .= "\n";
     }
     /* depending on progress-achievements
            // required by progress in JScript move to handleLoad()?
            Util::$pageTemplate->extendGlobalIds(TYPE_NPC, [29120, 31134, 29306, 29311, 23980, 27656, 26861, 26723, 28923, 15991]);
        */
     // load available titles
     Util::loadStaticFile('p-titles-' . $char->getField('gender'), $buff, true);
     // load available achievements
     if (!Util::loadStaticFile('p-achievements', $buff, true)) {
         $buff .= "\n\ng_achievement_catorder = [];";
         $buff .= "\n\ng_achievement_points = [0];";
     }
     // excludes; structure UNK type => [maskBit => [typeIds]] ?
     /*
         g_user.excludes = [type:[typeIds]]
         g_user.includes = [type:[typeIds]]
         g_user.excludegroups = groupMask        // requires g_user.settings != null
     
         maskBit are matched against fieldId from excludeGroups
         id: 1, label: LANG.dialog_notavail
         id: 2, label: LANG.dialog_tcg
         id: 4, label: LANG.dialog_collector
         id: 8, label: LANG.dialog_promo
         id: 16, label: LANG.dialog_nonus
         id: 96, label: LANG.dialog_faction
         id: 896, label: LANG.dialog_profession
         id: 1024, label: LANG.dialog_noexalted
     */
     // $buff .= "\n\ng_excludes = {};";
     // add profile to buffer
     $buff .= "\n\n\$WowheadProfiler.registerProfile(" . Util::toJSON($char->getEntry(2)) . ");";
     // can't use JSON_NUMERIC_CHECK or the talent-string becomes a float
     return $buff . "\n";
 }
Ejemplo n.º 8
0
 /**
  * Whips up a query to get a list of profiles based on the provided
  * people tag and page, initalizes a ProfileList widget, and displays
  * it to the user.
  *
  * @return nothing
  */
 function showContent()
 {
     $profile = new Profile();
     $offset = ($this->page - 1) * PROFILES_PER_PAGE;
     $limit = PROFILES_PER_PAGE + 1;
     if (common_config('db', 'type') == 'pgsql') {
         $lim = ' LIMIT ' . $limit . ' OFFSET ' . $offset;
     } else {
         $lim = ' LIMIT ' . $offset . ', ' . $limit;
     }
     // XXX: memcached this
     $qry = 'SELECT profile.* ' . 'FROM profile JOIN profile_tag ' . 'ON profile.id = profile_tag.tagger ' . 'WHERE profile_tag.tagger = profile_tag.tagged ' . "AND tag = '%s' " . 'ORDER BY profile_tag.modified DESC%s';
     $profile->query(sprintf($qry, $this->tag, $lim));
     $pl = new ProfileList($profile, null, $this);
     $cnt = $pl->show();
     $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE, $this->page, 'peopletag', array('tag' => $this->tag));
 }
Ejemplo n.º 9
0
 function showContent()
 {
     $offset = ($this->page - 1) * PROFILES_PER_PAGE;
     $limit = PROFILES_PER_PAGE + 1;
     $cnt = 0;
     $members = $this->group->getMembers($offset, $limit);
     if ($members) {
         $member_list = new ProfileList($members, null, $this);
         $cnt = $member_list->show();
     }
     $members->free();
     $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE, $this->page, 'groupmembers', array('nickname' => $this->group->nickname));
 }