Example #1
0
function print_move_prune_rows($permcheck = '')
{
    global $vbphrase;
    print_description_row($vbphrase['date_options'], 0, 2, 'thead', 'center');
    print_input_row($vbphrase['original_post_date_is_at_least_xx_days_ago'], 'thread[originaldaysolder]', 0, 1, 5);
    print_input_row($vbphrase['original_post_date_is_at_most_xx_days_ago'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '0') . '</dfn>', 'thread[originaldaysnewer]', 0, 1, 5);
    print_input_row($vbphrase['last_post_date_is_at_least_xx_days_ago'], 'thread[lastdaysolder]', 0, 1, 5);
    print_input_row($vbphrase['last_post_date_is_at_most_xx_days_ago'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '0') . '</dfn>', 'thread[lastdaysnewer]', 0, 1, 5);
    print_description_row($vbphrase['view_options'], 0, 2, 'thead', 'center');
    print_input_row($vbphrase['thread_has_at_least_xx_replies'], 'thread[repliesleast]', 0, 1, 5);
    print_input_row($vbphrase['thread_has_at_most_xx_replies'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '-1') . '</dfn>', 'thread[repliesmost]', -1, 1, 5);
    print_input_row($vbphrase['thread_has_at_least_xx_views'], 'thread[viewsleast]', 0, 1, 5);
    print_input_row($vbphrase['thread_has_at_most_xx_views'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '-1') . '</dfn>', 'thread[viewsmost]', -1, 1, 5);
    print_description_row($vbphrase['status_options'], 0, 2, 'thead', 'center');
    print_yes_no_other_row($vbphrase['thread_is_sticky'], 'thread[issticky]', $vbphrase['either'], 0);
    $state = array('visible' => $vbphrase['visible'], 'moderation' => $vbphrase['awaiting_moderation'], 'deleted' => $vbphrase['deleted'], 'any' => $vbphrase['any']);
    print_radio_row($vbphrase['thread_state'], 'thread[state]', $state, 'any');
    $status = array('open' => $vbphrase['open'], 'closed' => $vbphrase['closed'], 'redirect' => $vbphrase['redirect'], 'not_redirect' => $vbphrase['not_redirect'], 'any' => $vbphrase['any']);
    print_radio_row($vbphrase['thread_status'], 'thread[status]', $status, 'not_redirect');
    print_description_row($vbphrase['other_options'], 0, 2, 'thead', 'center');
    print_input_row($vbphrase['username'], 'thread[posteduser]');
    print_input_row($vbphrase['title'], 'thread[titlecontains]');
    print_moderator_forum_chooser('thread[forumid]', -1, $vbphrase['all_forums'], $vbphrase['forum'], true, false, true, $permcheck);
    print_yes_no_row($vbphrase['include_child_forums'], 'thread[subforums]');
    if ($prefix_options = construct_prefix_options(0, '', true, true)) {
        print_label_row($vbphrase['prefix'], '<select name="thread[prefixid]" class="bginput">' . $prefix_options . '</select>', '', 'top', 'prefixid');
    }
}
Example #2
0
 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     $commentinfo =& $this->content['album_picturecomment'][$activity['contentid']];
     $albuminfo =& $this->content['album'][$commentinfo['albumid']];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $preview = strip_quotes($commentinfo['pagetext']);
     $commentinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($preview, false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     $userinfo = $this->fetchUser($activity['userid'], $commentinfo['postusername']);
     $userinfo2 = $this->fetchUser($albuminfo['userid']);
     if ($fetchphrase) {
         if ($userinfo['userid']) {
             $phrase = construct_phrase($this->vbphrase['x_commented_on_a_photo_in_album_y'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('member', $userinfo2), $userinfo2['username'], vB::$vbulletin->session->vars['sessionurl'], $albuminfo['albumid'], $albuminfo['title']);
         } else {
             $phrase = construct_phrase($this->vbphrase['guest_x_commented_on_a_photo_in_album_y'], $userinfo['username'], fetch_seo_url('member', $userinfo2), $userinfo2['username'], vB::$vbulletin->session->vars['sessionurl'], $albuminfo['albumid'], $albuminfo['title']);
         }
         return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('userinfo2', $userinfo2);
         $templater->register('activity', $activity);
         $templater->register('commentinfo', $commentinfo);
         $templater->register('albuminfo', $albuminfo);
         return $templater->render();
     }
 }
Example #3
0
 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     $messageinfo =& $this->content['visitormessage'][$activity['contentid']];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $userinfo2 =& $this->content['user'][$messageinfo['userid']];
     $messageinfo['preview'] = strip_quotes($messageinfo['pagetext']);
     $messageinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($messageinfo['preview'], false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     $userinfo = $this->fetchUser($activity['userid'], $messageinfo['postusername']);
     if ($fetchphrase) {
         if ($userinfo['userid']) {
             $phrase = construct_phrase($this->vbphrase['x_created_a_visitormessage_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('member', $userinfo2, $linkinfo), $messageinfo['vmid'], fetch_seo_url('member', $userinfo2), $userinfo2['username']);
         } else {
             $phrase = construct_phrase($this->vbphrase['guest_x_created_a_visitormessage_y_in_z'], $userinfo['username'], fetch_seo_url('member', $userinfo2, $linkinfo), $messageinfo['vmid'], fetch_seo_url('member', $userinfo2), $userinfo2['username']);
         }
         return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('userinfo2', $userinfo2);
         $templater->register('linkinfo', array('vmid' => $messageinfo['vmid']));
         $templater->register('linkinfo2', array('tab' => 'visitor_messaging'));
         $templater->register('activity', $activity);
         $templater->register('messageinfo', $messageinfo);
         return $templater->render();
     }
 }
Example #4
0
 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     $postinfo =& $this->content['cms_post'][$activity['contentid']];
     $nodeinfo =& $this->content['cms_node'][$postinfo['nodeid']];
     $articleinfo =& $this->content['cms_article'][$nodeinfo['contentid']];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $preview = strip_quotes($postinfo['pagetext']);
     $articleinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($preview, false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     $articleinfo['fullurl'] = vB_Route::create('vBCms_Route_Content', $nodeinfo['nodeid'] . ($nodeinfo['url'] == '' ? '' : '-' . $nodeinfo['url']))->getCurrentURL();
     $nodeinfo['parenturl'] = $this->fetchParentUrl($nodeinfo['parentnode']);
     $nodeinfo['parenttitle'] = $this->fetchParentTitle($nodeinfo['parentnode']);
     $userinfo = $this->fetchUser($activity['userid'], $postinfo['username']);
     if ($fetchphrase) {
         if ($userinfo['userid']) {
             $phrase = construct_phrase($this->vbphrase['x_commented_on_an_article_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], $articleinfo['fullurl'], $nodeinfo['title'], $nodeinfo['parenturl'], $nodeinfo['parenttitle']);
         } else {
             $phrase = construct_phrase($this->vbphrase['guest_x_commented_on_an_article_y_in_z'], $userinfo['username'], $articleinfo['fullurl'], $nodeinfo['title'], $nodeinfo['parenturl'], $nodeinfo['parenttitle']);
         }
         return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('postinfo', $postinfo);
         $templater->register('activity', $activity);
         $templater->register('nodeinfo', $nodeinfo);
         $templater->register('articleinfo', $articleinfo);
         return $templater->render();
     }
 }
 function showItem()
 {
     global $vbulletin, $vbphrase, $itembit_right_column;
     $showvalues = false;
     $this->getExtraInfo();
     if ($this->data['status'] == KBANK_ITEM_ENABLED) {
         if ($this->itemtypedata['options']['postbg']) {
             if ($this->data['options']['postbg']) {
                 $postbg_url = $this->data['options']['postbg'];
                 $postbgs = explode("\r\n", $this->itemtypedata['options']['postbg_list']);
                 $postbg_name = '';
                 foreach ($postbgs as $postbg) {
                     $tmp = explode(':', $postbg);
                     if ($tmp[0] == $postbg_url and isset($tmp[1])) {
                         $postbg_name = $tmp[1];
                     }
                 }
                 if ($postbg_name == '') {
                     $postbg_name = basename($postbg_url);
                 }
                 $postbg_position = $this->itemtype->options['postbg_positions'][$this->data['options']['postbg_position']];
                 $itembit_right_column .= construct_phrase($vbphrase['kbank_itemshow_customize_postdisplay_postbg'], $postbg_url, $postbg_name, $postbg_position);
             }
         }
     }
     return parent::showItem();
 }
Example #6
0
 function showItem()
 {
     global $vbulletin, $vbphrase, $itembit_right_column;
     $this->getExtraInfo();
     if ($this->data['status'] == KBANK_ITEM_ENABLED) {
         $itembit_right_column .= construct_phrase($vbphrase['kbank_announce_show_link'], $this->data['options']['url'], $vbulletin->kbankBBCodeParser->parse($this->data['options']['text'], 'nonforum'));
     }
     return parent::showItem();
 }
/**
* Returns the phrase name for an error message
*
* @param	integer	Magic error number
*
* @return	string
*/
function fetch_announcement_permission_error_phrase($errno)
{
    global $vbphrase;
    switch ($errno) {
        case 1:
            return 'you_do_not_have_permission_global';
            break;
        case 2:
            return 'you_do_not_have_permission_forum';
            break;
        default:
            return construct_phrase($vbphrase['unknown_error'], $errno);
    }
}
Example #8
0
 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     $groupinfo =& $this->content['socialgroup'][$activity['contentid']];
     $userinfo =& $this->content['user'][$activity['userid']];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     if ($fetchphrase) {
         return array('phrase' => construct_phrase($this->vbphrase['x_created_a_group_y'], fetch_seo_url('member', $userinfo), $userinfo['username'], vB::$vbulletin->session->vars['sessionurl'], $groupinfo['groupid'], $groupinfo['name']), 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('activity', $activity);
         $templater->register('groupinfo', $groupinfo);
         return $templater->render();
     }
 }
Example #9
0
 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     $userinfo =& $this->content['user'][$activity['userid']];
     $bloginfo =& $this->content['blog'][$activity['contentid']];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $preview = strip_quotes($bloginfo['pagetext']);
     $bloginfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($preview, false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     if ($fetchphrase) {
         return array('phrase' => construct_phrase($this->vbphrase['x_created_a_blog_entry_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('entry', $bloginfo), $bloginfo['title'], fetch_seo_url('blog', $bloginfo), $bloginfo['blog_title']), 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('activity', $activity);
         $templater->register('bloginfo', $bloginfo);
         return $templater->render();
     }
 }
Example #10
0
 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     global $show;
     $postinfo =& $this->content['post'][$activity['contentid']];
     $threadinfo =& $this->content['thread'][$postinfo['threadid']];
     $foruminfo =& vB::$vbulletin->forumcache[$threadinfo['forumid']];
     $threadinfo['prefix_plain_html'] = htmlspecialchars_uni($this->vbphrase["prefix_{$threadinfo['prefixid']}_title_plain"]);
     $threadinfo['prefix_rich'] = $this->vbphrase["prefix_{$threadinfo['prefixid']}_title_rich"];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $preview = strip_quotes($postinfo['pagetext']);
     $postinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($preview, false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     $forumperms = fetch_permissions($threadinfo['forumid']);
     $show['threadcontent'] = $forumperms & vB::$vbulletin->bf_ugp_forumpermissions['canviewthreads'] ? true : false;
     $userinfo = $this->fetchUser($activity['userid'], $postinfo['username']);
     if ($fetchphrase) {
         if ($threadinfo['pollid']) {
             if ($userinfo['userid']) {
                 $phrase = construct_phrase($this->vbphrase['x_replied_to_a_poll_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
             } else {
                 $phrase = construct_phrase($this->vbphrase['guest_x_replied_to_a_poll_y_in_z'], $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
             }
         } else {
             if ($userinfo['userid']) {
                 $phrase = construct_phrase($this->vbphrase['x_replied_to_a_thread_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
             } else {
                 $phrase = construct_phrase($this->vbphrase['guest_x_replied_to_a_thread_y_in_z'], $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
             }
         }
         return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('activity', $activity);
         $templater->register('threadinfo', $threadinfo);
         $templater->register('postinfo', $postinfo);
         $templater->register('pageinfo', array('p' => $postinfo['postid']));
         $templater->register('foruminfo', $foruminfo);
         return $templater->render();
     }
 }
Example #11
0
function construct_pagenavigation($pagenumber, $perpage, $results, $address)
{
    global $vbphrase;
    $pagenav = '<li><a style="background:-moz-linear-gradient(center top , rgb(0, 0, 0) 5%, rgb(125, 125, 125) 100%) repeat scroll 0% 0% red;background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #000000), color-stop(1, #7D7D7D) );"><span>' . $pagenumber . '</span></a></li>';
    if ($pagenumber - 1 > 0) {
        $pagenav = '<li><a href="' . $address . '&page=' . ($pagenumber - 1) . '" class="active"><span>' . ($pagenumber - 1) . '</span></a></li>' . $pagenav;
    }
    if ($pagenumber - 2 > 0) {
        $pagenav = '<li><a href="' . $address . '&page=' . ($pagenumber - 2) . '" class="active"><span>' . ($pagenumber - 2) . '</span></a></li>' . $pagenav;
    }
    if ($pagenumber + 1 <= ceil($results / $perpage)) {
        $pagenav = $pagenav . '<li><a href="' . $address . '&page=' . ($pagenumber + 1) . '" class="active"><span>' . ($pagenumber + 1) . '</span></a></li>';
    }
    if ($pagenumber + 2 <= ceil($results / $perpage)) {
        $pagenav = $pagenav . '<li><a href="' . $address . '&page=' . ($pagenumber + 2) . '" class="active"><span>' . ($pagenumber + 2) . '</span></a></li>';
    }
    $pagenav = '<ul>
              <li><a><span>' . construct_phrase($vbphrase['page_x_of_y'], $pagenumber, ceil($results / $perpage)) . '</span></a></li>
              <li><a href="' . $address . '&page=1" class="active"><span>' . $vbphrase['first'] . '</span></a></li>
              ' . $pagenav . '
              <li><a href="' . $address . '&page=' . ceil($results / $perpage) . '" class="active"><span>' . $vbphrase['last'] . '</span></a></li>
              </ul>';
    return $pagenav;
}
Example #12
0
 /**
  * Import System Dependencies
  *
  */
 public function import_dependencies($dependencylist = null)
 {
     // get system version info
     $system_versions = array('php' => PHP_VERSION, 'vbulletin' => $this->registry->options['templateversion'], 'products' => fetch_product_list(true));
     $mysql_version = $this->db->query_first("SELECT VERSION() AS version");
     $system_versions['mysql'] = $mysql_version['version'];
     if ($dependencylist) {
         $this->productobj['dependencies']['dependency'] = $dependencylist;
     }
     // ############## import dependencies
     if (is_array($this->productobj['dependencies']['dependency'])) {
         $dependencies =& $this->productobj['dependencies']['dependency'];
         if (!isset($dependencies[0])) {
             $dependencies = array($dependencies);
         }
         $dependency_errors = array();
         $ignore_dependency_errors = array();
         // let's check the dependencies
         foreach ($dependencies as $dependency) {
             // if we get an error, we haven't met this dependency
             // if we go through without a problem, we have automatically met
             // all dependencies for this "class" (mysql, php, vb, a specific product, etc)
             $this_dependency_met = true;
             // build a phrase for the version compats -- will look like (minver / maxver)
             if ($dependency['minversion']) {
                 $compatible_phrase = construct_phrase($this->vbphrase['compatible_starting_with_x'], htmlspecialchars_uni($dependency['minversion']));
             } else {
                 $compatible_phrase = '';
             }
             if ($dependency['maxversion']) {
                 $incompatible_phrase = construct_phrase($this->vbphrase['incompatible_with_x_and_greater'], htmlspecialchars_uni($dependency['maxversion']));
             } else {
                 $incompatible_phrase = '';
             }
             if ($compatible_phrase or $incompatible_phrase) {
                 $required_version_info = "({$compatible_phrase}";
                 if ($compatible_phrase and $incompatible_phrase) {
                     $required_version_info .= ' / ';
                 }
                 $required_version_info .= "{$incompatible_phrase})";
             }
             // grab the appropriate installed version string
             if ($dependency['dependencytype'] == 'product') {
                 // group dependencies into types -- individual products get their own group
                 $dependency_type_key = "product-{$dependency['parentproductid']}";
                 // undocumented feature -- you can put a producttitle attribute in a dependency so the id isn't displayed
                 $parent_product_title = !empty($dependency['producttitle']) ? $dependency['producttitle'] : $dependency['parentproductid'];
                 $parent_product = $system_versions['products']["{$dependency['parentproductid']}"];
                 if (!$parent_product) {
                     // required product is not installed
                     $dependency_errors["{$dependency_type_key}"] = construct_phrase($this->vbphrase['product_x_must_be_installed'], htmlspecialchars_uni($parent_product_title), $required_version_info);
                     continue;
                     // can't do version checks if the product isn't installed
                 } else {
                     if ($parent_product['active'] == 0) {
                         // product is installed, but inactive
                         $dependency_errors["{$dependency_type_key}-inactive"] = construct_phrase($this->vbphrase['product_x_must_be_activated'], htmlspecialchars_uni($parent_product_title));
                         $this_dependency_met = false;
                         // allow version checks to continue
                     }
                 }
                 $sys_version_str = $parent_product['version'];
                 $version_incompatible_phrase = 'product_incompatible_version_x_product_y';
             } else {
                 $dependency_type_key = $dependency['dependencytype'];
                 $parent_product_title = '';
                 $sys_version_str = $system_versions["{$dependency['dependencytype']}"];
                 $version_incompatible_phrase = 'product_incompatible_version_x_' . $dependency['dependencytype'];
             }
             // if no version string, we are trying to do an unsupported dep check
             if ($sys_version_str == '') {
                 continue;
             }
             $sys_version = fetch_version_array($sys_version_str);
             // error if installed version < minversion
             if ($dependency['minversion']) {
                 $dep_version = fetch_version_array($dependency['minversion']);
                 for ($i = 0; $i <= 5; $i++) {
                     if ($sys_version["{$i}"] < $dep_version["{$i}"]) {
                         // installed version is too old
                         $dependency_errors["{$dependency_type_key}"] = construct_phrase($this->vbphrase["{$version_incompatible_phrase}"], htmlspecialchars_uni($sys_version_str), $required_version_info, $parent_product_title);
                         $this_dependency_met = false;
                         break;
                     } else {
                         if ($sys_version["{$i}"] > $dep_version["{$i}"]) {
                             break;
                         }
                     }
                 }
             }
             // error if installed version >= maxversion
             if ($dependency['maxversion']) {
                 $dep_version = fetch_version_array($dependency['maxversion']);
                 $all_equal = true;
                 for ($i = 0; $i <= 5; $i++) {
                     if ($sys_version["{$i}"] > $dep_version["{$i}"]) {
                         // installed version is newer than the maxversion
                         $dependency_errors["{$dependency_type_key}"] = construct_phrase($this->vbphrase["{$version_incompatible_phrase}"], htmlspecialchars_uni($sys_version_str), $required_version_info, $parent_product_title);
                         $this_dependency_met = false;
                         break;
                     } else {
                         if ($sys_version["{$i}"] < $dep_version["{$i}"]) {
                             // not every part is the same and since we've got less we can exit
                             $all_equal = false;
                             break;
                         } else {
                             if ($sys_version["{$i}"] != $dep_version["{$i}"]) {
                                 // not every part is the same
                                 $all_equal = false;
                             }
                         }
                     }
                 }
                 if ($all_equal == true) {
                     // installed version is same as the max version, which is the first incompat version
                     $dependency_errors["{$dependency_type_key}"] = construct_phrase($this->vbphrase["{$version_incompatible_phrase}"], htmlspecialchars_uni($sys_version_str), $required_version_info, $parent_product_title);
                     $this_dependency_met = false;
                 }
             }
             if ($this_dependency_met) {
                 // we met 1 dependency for this type -- this emulates or'ing together groups
                 $ignore_dependency_errors["{$dependency_type_key}"] = true;
             }
         }
         // for any group we met a dependency for, ignore any errors we might
         // have gotten for the group
         foreach ($ignore_dependency_errors as $dependency_type_key => $devnull) {
             unset($dependency_errors["{$dependency_type_key}"]);
         }
         if ($dependency_errors) {
             $dependency_errors = array_unique($dependency_errors);
             if ($this->outputtype == 'html') {
                 $dependency_errors = '<ol class="deperrors"><li>' . implode('</li><li>', $dependency_errors) . '</li></ol>';
             } else {
                 $dependency_errors = implode("\r\n", $dependency_errors);
             }
             print_dots_stop();
             throw new vB_Exception_AdminStopMessage(array('dependencies_not_met_x', $dependency_errors));
         }
     }
     // look to see if we already have this product installed
     if ($existingprod = $this->db->query_first("\n\t\t\tSELECT *\n\t\t\tFROM " . TABLE_PREFIX . "product\n\t\t\tWHERE productid = '" . $this->db->escape_string($this->productinfo['productid']) . "'")) {
         if (!$this->productinfo['allow_overwrite']) {
             print_dots_stop();
             throw new vB_Exception_AdminStopMessage(array('product_x_installed_no_overwrite', $this->productinfo['title']));
         }
         $this->active = $existingprod['active'];
         // not sure what we're deleting, so rebuild everything
         $this->rebuild = array('templates' => true, 'plugins' => true, 'phrases' => true, 'options' => true, 'cron' => true);
         $this->installed_version = $existingprod['version'];
     } else {
         $this->active = $this->productinfo['active'] ? 1 : 0;
         $this->rebuild = array('templates' => false, 'plugins' => false, 'phrases' => false, 'options' => false, 'cron' => false);
         $this->installed_version = null;
     }
 }
Example #13
0
	function ______handle_bbcode_img($bbcode, $do_imgcode, $has_img_code = false)
	{
		global $vbphrase, $vbulletin;

	
		//if this user doesn't have authorization, we're done.
		if (! $this->candownload)
		{
			return '';
		}

		if (($has_img_code == 2 OR $has_img_code == 3) AND preg_match_all('#\[attach(?:=(right|left|config))?\](\d+)\[/attach\]#i', $bbcode, $matches))
		{
			$search = $replace = $configids = $alignids = array();

			foreach($matches[1] AS $key => $type)
			{
				if (strtolower($type) == 'config')
				{
					$configids[$matches[2][$key]] = true;
				}
				else
				{
					$otherids[$matches[2][$key]] = true;
				}
			}

			if (!is_array($this->attachments))
			{
				$this->attachments = array();
				// query all the attachments associated with this article at once
				$attachments = $vbulletin->db->query_read("
					SELECT a.attachmentid, a.settings, a.dateline, a.filename, a.counter, a.contentid,
						fd.filesize
					FROM " . TABLE_PREFIX . "attachment AS a
					LEFT JOIN " . TABLE_PREFIX . "filedata AS fd ON (a.filedataid = fd.filedataid)
					WHERE attachmentid IN (" . implode(", ", $matches[2]) . ")
				");
				while ($attachment = vB::$vbulletin->db->fetch_array($attachments))
				{
					$this->attachments[] = $attachment;
				}
			}

			// loop through each attachment to apply appropriate classes when bbcode replace happens
			foreach($this->attachments AS $attachment)
			{
				$attachmentid = $attachment['attachmentid'];
				$contentid = $attachment['contentid'];
	
				if ($configids[$attachmentid])
				{
					$settings = unserialize($attachment['settings']);

					// get the proper css classes for the alignment setting
					if (isset($settings['alignment']))
					{
						switch ($settings['alignment'])
						{
							case 'left':
								$align_class = 'align_left';
								break;
							case 'center':
								$align_class = 'align_center';
								break;
							case 'right':
								$align_class = 'align_right';
								break;
							case '0':
							default:
								// no special css class for none
								$align_class = '';
								break;
						}
					}

					// get the proper css classes for the size setting
					if (isset($settings['size']))
					{
						switch ($settings['size'])
						{
							case 'thumbnail':
								$size_class = 'size_thumbnail';
								break;
							case 'medium':
								$size_class = 'size_medium';
								break;
							case 'large':
								$size_class = 'size_large';
								break;
							case 'fullsize':
								$size_class = 'size_fullsize';
								break;
							default:
								// no special css class for none
								$size_class = '';
								break;
						}
					}

					// get the image caption if there is one
					if ( isset($settings['caption']) AND $settings['caption']!='' )
					{
						$caption_tag = '<p class="caption '.$size_class.'">'.$settings['caption'].'</p>';
					}

					// get the title, which we will use for the alt attribute (this may change)
					if (isset($settings['title']))
					{
						$title_text = $settings['title'];
					}

					// get the description, which we will use for the title attribute (this may change)
					if (isset($settings['description']))
					{
						$description_text = $settings['description'];
					}

					// get the inline styles
					if (isset($settings['styles']))
					{
						$styles = $settings['styles'];
					}

					$search[] = '#\[attach=config\](' . $attachmentid . ')\[/attach\]#i';

					// TODO, uncomment this line, when we want to add the captions back in
					// we still need to prevent the caption text from being saved as part of the article
					//$replace[] = "<span><img class=\"previewthumb $align_class $size_class\" style=\"$styles\" src=\"{$vbulletin->options['bburl']}/attachment.php?attachmentid=$attachmentid&amp;stc=1\" class=\"previewthumb\" alt=\"$description_text\" title=\"$title_text\" />$caption_tag</span>";
					$img_url = "{$vbulletin->options['bburl']}/attachment.php?attachmentid=$attachmentid&amp;stc=1";
					$replace[] = "<a id=\"attachment$attachmentid\" rel=\"Lightbox_$contentid\" href=\"$img_url\"><img class=\"previewthumb $align_class $size_class\" style=\"$styles\" src=\"$img_url\" alt=\"$description_text\" title=\"$title_text\" /></a>";
				}
				else
				{
					$align = $matches[1][$key];
					$search[] = '#\[attach' . (!empty($align) ? '=' . $align : '') . '\](' . $attachmentid . ')\[/attach\]#i';
					$replace[] = "<img src=\"{$this->registry->options['bburl']}/attachment.php?{$this->registry->session->vars['sessionurl']}attachmentid=\\1&amp;d=$attachment[dateline]\" border=\"0\" alt=\""
						. construct_phrase($vbphrase['image_x_y_z'], $attachment['filename'], $attachment['counter'], $attachment['filesize'])
						. "\" " . (!empty($align) ? " style=\"float: $align\"" : '') . " />";
				}
			}
			$bbcode = preg_replace($search, $replace, $bbcode);
		}

		if ($has_img_code == 1 OR $has_img_code == 3)
		{
			if ($do_imgcode AND ($this->registry->userinfo['userid'] == 0 OR $this->registry->userinfo['showimages']))
			{
				// do [img]xxx[/img]
				$bbcode = preg_replace('#\[img\]\s*(https?://([^*\r\n]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "\$this->handle_bbcode_img_match('\\1')", $bbcode);
			}
		}

		return $bbcode;
	}
    if (empty($vbulletin->GPC['amount'])) {
        print_stop_message('please_complete_required_fields');
    }
    if (empty($vbulletin->GPC['infractionbanid'])) {
        $db->query_write("INSERT INTO " . TABLE_PREFIX . "infractionban (amount) VALUES (0)");
        $vbulletin->GPC['infractionbanid'] = $db->insert_id();
    }
    $db->query_write("\n\t\tUPDATE " . TABLE_PREFIX . "infractionban\n\t\tSET amount = " . $vbulletin->GPC['amount'] . ",\n\t\t\tmethod = '" . $db->escape_string($vbulletin->GPC['method']) . "',\n\t\t\tusergroupid = " . $vbulletin->GPC['usergroupid'] . ",\n\t\t\tbanusergroupid = " . $vbulletin->GPC['banusergroupid'] . ",\n\t\t\tperiod = '" . $db->escape_string($vbulletin->GPC['period']) . "'\n\t\tWHERE infractionbanid = " . $vbulletin->GPC['infractionbanid'] . "\n\t");
    define('CP_REDIRECT', 'admininfraction.php?do=modify');
    print_stop_message('saved_automatic_ban_successfully');
}
// ###################### Start Remove #######################
if ($_REQUEST['do'] == 'removebangroup') {
    print_form_header('admininfraction', 'killbangroup');
    construct_hidden_code('infractionbanid', $vbulletin->GPC['infractionbanid']);
    print_table_header(construct_phrase($vbphrase['confirm_deletion_x'], $vbphrase['automatic_ban']));
    print_description_row($vbphrase['are_you_sure_you_want_to_delete_this_automatic_ban']);
    print_submit_row($vbphrase['yes'], '', 2, $vbphrase['no']);
}
// ###################### Start Kill #######################
if ($_POST['do'] == 'killbangroup') {
    $db->query_write("DELETE FROM " . TABLE_PREFIX . "infractionban WHERE infractionbanid = " . $vbulletin->GPC['infractionbanid']);
    define('CP_REDIRECT', 'admininfraction.php?do=modify');
    print_stop_message('deleted_automatic_ban_successfully');
}
print_cp_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:39, Wed May 30th 2012
|| # CVS: $RCSfile$ - $Revision: 39862 $
|| ####################################################################
Example #15
0
		{
			case 'edit': window.location = "usertitle.php?<?php 
    echo vB::getCurrentSession()->get('sessionurl_js');
    ?>
do=edit&usertitleid=" + usertitleid; break;
			case 'kill': window.location = "usertitle.php?<?php 
    echo vB::getCurrentSession()->get('sessionurl_js');
    ?>
do=remove&usertitleid=" + usertitleid; break;
			default: return false; break;
		}
	}
	</script>
	<?php 
    $options = array('edit' => $vbphrase['edit'], 'kill' => $vbphrase['delete']);
    print_form_header('usertitle', 'add');
    print_table_header($vbphrase['user_title_manager_gcpuser'], 3);
    print_description_row('<p>' . construct_phrase($vbphrase['it_is_recommended_that_you_update_user_titles'], vB::getCurrentSession()->get('sessionurl')) . '</p>', 0, 3);
    print_cells_row(array($vbphrase['user_title_guser'], $vbphrase['minimum_posts'], $vbphrase['controls']), 1);
    foreach ($usertitles as $usertitle) {
        print_cells_row(array('<b>' . $usertitle['title'] . '</b>', $usertitle['minposts'], "\n\t<select name=\"u{$usertitle['usertitleid']}\" onchange=\"js_usergroup_jump({$usertitle['usertitleid']}, this);\" class=\"bginput\">\n" . construct_select_options($options) . "\t</select>\n\t<input type=\"button\" value=\"" . $vbphrase['go'] . "\" onclick=\"js_usergroup_jump({$usertitle['usertitleid']}, this.form.u{$usertitle['usertitleid']});\" />\n\t"));
    }
    print_submit_row($vbphrase['add_new_user_title_gcpuser'], 0, 3);
}
print_cp_footer();
/*=========================================================================*\
|| #######################################################################
|| # Downloaded: 15:45, Tue Sep 8th 2015
|| # CVS: $RCSfile$ - $Revision: 83432 $
|| #######################################################################
\*=========================================================================*/
Example #16
0
		{
			els[i].checked = toggle.checked;
		}

	}
	// -->
	</script>
	<?php 
    if (!$prefixsets) {
        print_description_row($vbphrase['no_prefix_sets_defined_click_create'], false, 3, '', 'center');
    } else {
        // display existing sets
        foreach ($prefixsets as $prefixset) {
            print_cells_row(array('<input id="' . $prefixset['prefixsetid'] . '" type="checkbox" onclick="selectprefixes(\'' . $prefixset['prefixsetid'] . '\')" />' . '<label for="' . $prefixset['prefixsetid'] . '">' . htmlspecialchars_uni($vbphrase["prefixset_{$prefixset['prefixsetid']}_title"]) . '</label>', '<input type="text" size="3" class="bginput" name="prefixset_order[' . $prefixset['prefixsetid'] . ']" value="' . $prefixset['displayorder'] . '" />', '<div class="normal">' . construct_link_code($vbphrase['add_prefix'], "prefix.php?do=addprefix&amp;prefixsetid={$prefixset['prefixsetid']}") . construct_link_code($vbphrase['edit'], "prefix.php?do=editset&amp;prefixsetid={$prefixset['prefixsetid']}") . construct_link_code($vbphrase['delete'], "prefix.php?do=deleteset&amp;prefixsetid={$prefixset['prefixsetid']}") . '</div>'), 1);
            if (!$prefixset['prefixes']) {
                print_description_row(construct_phrase($vbphrase['no_prefixes_defined_click_create'], $prefixset['prefixsetid']), false, 3, '', 'center');
            } else {
                foreach ($prefixset['prefixes'] as $prefix) {
                    print_cells_row(array('<label for="' . $prefixset['prefixsetid'] . '_' . $prefix['prefixid'] . '">' . '<input type="checkbox" name="prefixids[' . $prefix["prefixid"] . ']" id="' . $prefixset['prefixsetid'] . '_' . $prefix['prefixid'] . '" class="' . $prefixset['prefixsetid'] . '" />' . htmlspecialchars_uni($vbphrase["prefix_{$prefix['prefixid']}_title_plain"]) . '</label>', '<input type="text" size="3" class="bginput" name="prefix_order[' . $prefix['prefixid'] . ']" value="' . $prefix['displayorder'] . '" />', '<div class="smallfont">' . construct_link_code($vbphrase['edit'], "prefix.php?do=editprefix&amp;prefixid={$prefix['prefixid']}") . construct_link_code($vbphrase['delete'], "prefix.php?do=deleteprefix&amp;prefixid={$prefix['prefixid']}") . construct_link_code($vbphrase['edit_permissions'], "prefix.php?do=permissions&amp;prefixid={$prefix['prefixid']}") . '</div>'));
                }
            }
        }
    }
    print_cells_row(array('<input type="image" style="width: 1px; height: 1px;" src="' . $vbulletin->options['cleargifurl'] . '" />' . '<input class="button" type="submit" name="dopermissionsmultiple" value="' . $vbphrase['edit_selected_prefix_permissions'] . '" />', '<input class="button" type="submit" value="' . $vbphrase['save_display_order'] . '" />', '<input class="button" type="button" onclick="window.location = \'prefix.php?do=addset\';" value="' . $vbphrase['add_prefix_set'] . '" />'), false, 'tfoot');
    print_table_footer();
}
print_cp_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 23:48, Wed Mar 24th 2010
|| # CVS: $RCSfile$ - $Revision: 32878 $
Example #17
0
    // find child products -- these may break if we uninstall this
    $dependency_list = array();
    while ($dependency = $db->fetch_array($dependency_result)) {
        $dependency_list["{$dependency['parentproductid']}"][] = $dependency['productid'];
    }
    $children = fetch_product_dependencies($vbulletin->GPC['productid'], $dependency_list);
    $product_list = fetch_product_list(true);
    $children_text = array();
    foreach ($children as $childproductid) {
        $childproduct = $product_list["{$childproductid}"];
        if ($childproduct) {
            $children_text[] = $childproduct['title'];
        }
    }
    if ($children_text) {
        $affected_children = construct_phrase($vbphrase['uninstall_product_break_products_x'], '<li>' . implode('</li><li>', $children_text) . '</li>');
    } else {
        $affected_children = '';
    }
    print_delete_confirmation('product', $vbulletin->GPC['productid'], 'plugin', 'productkill', '', 0, $affected_children);
}
// #############################################################################
if ($_POST['do'] == 'productimport') {
    $vbulletin->input->clean_array_gpc('p', array('serverfile' => TYPE_STR, 'allowoverwrite' => TYPE_BOOL));
    $vbulletin->input->clean_array_gpc('f', array('productfile' => TYPE_FILE));
    if (file_exists($vbulletin->GPC['productfile']['tmp_name'])) {
        // got an uploaded file?
        $xml = file_read($vbulletin->GPC['productfile']['tmp_name']);
    } else {
        if (file_exists($vbulletin->GPC['serverfile'])) {
            // no uploaded file - got a local file?
Example #18
0
/**
* Reads XML style file and imports data from it into the database
*
* @param	string	XML data
* @param	integer	Style ID
* @param	integer	Parent style ID
* @param	string	New style title
* @param	boolean	Allow vBulletin version mismatch
* @param	integer	Display order for new style
* @param	boolean	Allow user selection of new style
*/
function xml_import_style($xml = false, $styleid = -1, $parentid = -1, $title = '', $anyversion = false, $displayorder = 1, $userselect = true)
{
    // $GLOBALS['path'] needs to be passed into this function or reference $vbulletin->GPC['path']
    global $vbulletin, $vbphrase;
    print_dots_start('<b>' . $vbphrase['importing_style'] . "</b>, {$vbphrase['please_wait']}", ':', 'dspan');
    require_once DIR . '/includes/class_xml.php';
    $xmlobj = new vB_XML_Parser($xml, $vbulletin->GPC['path']);
    if ($xmlobj->error_no == 1) {
        print_dots_stop();
        print_stop_message('no_xml_and_no_path');
    } else {
        if ($xmlobj->error_no == 2) {
            print_dots_stop();
            print_stop_message('please_ensure_x_file_is_located_at_y', 'vbulletin-style.xml', $vbulletin->GPC['path']);
        }
    }
    if (!($arr = $xmlobj->parse())) {
        print_dots_stop();
        print_stop_message('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line());
    }
    if (!$arr['templategroup']) {
        print_dots_stop();
        print_stop_message('invalid_file_specified');
    }
    $version = $arr['vbversion'];
    $master = $arr['type'] == 'master' ? 1 : 0;
    $title = empty($title) ? $arr['name'] : $title;
    $product = empty($arr['product']) ? 'vbulletin' : $arr['product'];
    $arr = $arr['templategroup'];
    if (empty($arr[0])) {
        $arr = array($arr);
    }
    $full_product_info = fetch_product_list(true);
    $product_info = $full_product_info["{$product}"];
    // version check
    if ($version != $product_info['version'] and !$anyversion and !$master) {
        print_dots_stop();
        print_stop_message('upload_file_created_with_different_version', $product_info['version'], $version);
    }
    if ($master) {
        // overwrite master style
        echo "<h3>{$vbphrase['master_style']}</h3>\n<p>{$vbphrase['please_wait']}</p>";
        vbflush();
        $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "template WHERE styleid = -10 AND (product = '" . $vbulletin->db->escape_string($product) . "'" . iif($product == 'vbulletin', " OR product = ''") . ")");
        $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "template SET styleid = -10 WHERE styleid = -1 AND (product = '" . $vbulletin->db->escape_string($product) . "'" . iif($product == 'vbulletin', " OR product = ''") . ")");
        $styleid = -1;
    } else {
        if ($styleid == -1) {
            // creating a new style
            if ($test = $vbulletin->db->query_first("SELECT styleid FROM " . TABLE_PREFIX . "style WHERE title = '" . $vbulletin->db->escape_string($title) . "'")) {
                print_dots_stop();
                print_stop_message('style_already_exists', $title);
            } else {
                echo "<h3><b>" . construct_phrase($vbphrase['creating_a_new_style_called_x'], $title) . "</b></h3>\n<p>{$vbphrase['please_wait']}</p>";
                vbflush();
                /*insert query*/
                $styleresult = $vbulletin->db->query_write("\n\t\t\t\t\tINSERT INTO " . TABLE_PREFIX . "style\n\t\t\t\t\t(title, parentid, displayorder, userselect)\n\t\t\t\t\tVALUES\n\t\t\t\t\t('" . $vbulletin->db->escape_string($title) . "', {$parentid}, {$displayorder}, " . ($userselect ? 1 : 0) . ")\n\t\t\t\t");
                $styleid = $vbulletin->db->insert_id($styleresult);
            }
        } else {
            // overwriting an existing style
            if ($getstyle = $vbulletin->db->query_first("SELECT title FROM " . TABLE_PREFIX . "style WHERE styleid = {$styleid}")) {
                echo "<h3><b>" . construct_phrase($vbphrase['overwriting_style_x'], $getstyle['title']) . "</b></h3>\n<p>{$vbphrase['please_wait']}</p>";
                vbflush();
            } else {
                print_dots_stop();
                print_stop_message('cant_overwrite_non_existent_style');
            }
        }
    }
    // types array...
    $types = array($vbphrase['template'], $vbphrase['stylevar'], $vbphrase['css'], $vbphrase['replacement_variable']);
    $querybits = array();
    $querytemplates = 0;
    foreach ($arr as $templategroup) {
        if (empty($templategroup['template'][0])) {
            $tg = array($templategroup['template']);
        } else {
            $tg =& $templategroup['template'];
        }
        foreach ($tg as $template) {
            $title = $vbulletin->db->escape_string($template['name']);
            $template['template'] = $vbulletin->db->escape_string($template['value']);
            $template['username'] = $vbulletin->db->escape_string($template['username']);
            if ($template['templatetype'] != 'template') {
                // template is a special template
                $querybits[] = "({$styleid}, '{$template['templatetype']}', '{$title}', '{$template['template']}', '', {$template['date']}, '{$template['username']}', '" . $vbulletin->db->escape_string($template['version']) . "', '" . $vbulletin->db->escape_string($product) . "')";
            } else {
                // template is a standard template
                $querybits[] = "({$styleid}, '{$template['templatetype']}', '{$title}', '" . $vbulletin->db->escape_string(compile_template($template['value'])) . "', '{$template['template']}', {$template['date']}, '{$template['username']}', '" . $vbulletin->db->escape_string($template['version']) . "', '" . $vbulletin->db->escape_string($product) . "')";
            }
            if (++$querytemplates % 20 == 0) {
                /*insert query*/
                $vbulletin->db->query_write("\n\t\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "template\n\t\t\t\t\t(styleid, templatetype, title, template, template_un, dateline, username, version, product)\n\t\t\t\t\tVALUES\n\t\t\t\t\t" . implode(',', $querybits) . "\n\t\t\t\t");
                $querybits = array();
            }
        }
    }
    // insert any remaining templates
    if (!empty($querybits)) {
        /*insert query*/
        $vbulletin->db->query_write("\n\t\t\tREPLACE INTO " . TABLE_PREFIX . "template\n\t\t\t(styleid, templatetype, title, template, template_un, dateline, username, version, product)\n\t\t\tVALUES\n\t\t\t" . implode(',', $querybits) . "\n\t\t");
    }
    unset($querybits);
    // now delete any templates that were moved into the temporary styleset for safe-keeping
    $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "template WHERE styleid = -10 AND (product = '" . $vbulletin->db->escape_string($product) . "'" . iif($product == 'vbulletin', " OR product = ''") . ")");
    print_dots_stop();
}
Example #19
0
 function parse_bbcode_thanks($message, $thanks_required)
 {
     global $vbphrase, $stylevar;
     //prepair variables
     include_once DIR . '/kbank/award_functions.php';
     //include kBank Award functions
     $thanks = fetchAwarded($this->vars['postid'], true, false, $this->registry->userinfo['userid']);
     if ($this->registry->kbank['hide']['thanksMax'] != 0) {
         //there is a limit for maximum required thank amount
         $thanks_required = min($thanks_required, $this->registry->kbank['hide']['thanksMax']);
     }
     //fix " issue
     $message = str_replace('\\"', '"', $message);
     //check permission
     $canview = false;
     if (!$this->settings['banned']) {
         if ($this->can_override()) {
             $canview = true;
         } else {
             if ($this->registry->userinfo['userid'] and is_numeric($thanks[$this->registry->userinfo['userid']]['points']) and $thanks[$this->registry->userinfo['userid']]['points'] >= $thanks_required) {
                 $canview = true;
             }
         }
     }
     //build info message
     if ($thanks_required) {
         $info_message = construct_phrase($vbphrase['kbank_hide_thanks_required_with_amount'], $thanks_required, $this->registry->kbank['name']);
     } else {
         $info_message = construct_phrase($vbphrase['kbank_hide_thanks_required']);
     }
     //prepair output
     if ($this->settings['dohtml']) {
         eval('$message = "' . fetch_template('kbank_hide_replacement_thanks') . '";');
     } else {
         $message = $canview ? $message : construct_phrase($vbphrase['kbank_hide_message_nohtml'], $info_message);
     }
     //Everything done! Return result
     return $message;
 }
function fetch_event_criteria($option)
{
    global $vbphrase, $months, $days, $period;
    $options = explode('|', $option['recuroption']);
    if ($option['recurring'] == 1) {
        // Recurring Daily Event
        $desc = construct_phrase($vbphrase['this_event_occurs_every_x_days'], $options[0]);
    } else {
        if ($option['recurring'] == 2) {
            // Every Weekday
            $desc = $vbphrase['this_event_occurs_every_weekday'];
        } else {
            if ($option['recurring'] == 3) {
                // Weekly Recurring Event
                if ($options[1] & 1) {
                    // Sunday
                    $seldays = $vbphrase['sunday'];
                }
                if ($options[1] & 2) {
                    // Monday
                    if ($seldays) {
                        $seldays .= ", {$vbphrase['monday']}";
                    } else {
                        $seldays = $vbphrase['monday'];
                    }
                }
                if ($options[1] & 4) {
                    // Tuesday
                    if ($seldays) {
                        $seldays .= ", {$vbphrase['tuesday']}";
                    } else {
                        $seldays = $vbphrase['tuesday'];
                    }
                }
                if ($options[1] & 8) {
                    // Wednesday
                    if ($seldays) {
                        $seldays .= ", {$vbphrase['wednesday']}";
                    } else {
                        $seldays = $vbphrase['wednesday'];
                    }
                }
                if ($options[1] & 16) {
                    // Thursday
                    if ($seldays) {
                        $seldays .= ", {$vbphrase['thursday']}";
                    } else {
                        $seldays = $vbphrase['thursday'];
                    }
                }
                if ($options[1] & 32) {
                    // Friday
                    if ($seldays) {
                        $seldays .= ", {$vbphrase['friday']}";
                    } else {
                        $seldays = $vbphrase['friday'];
                    }
                }
                if ($options[1] & 64) {
                    // Saturday
                    if ($seldays) {
                        $seldays .= ", {$vbphrase['saturday']}";
                    } else {
                        $seldays = $vbphrase[saturday];
                    }
                }
                $desc = construct_phrase($vbphrase['this_event_occurs_every_x_weeks_on_y'], $options[0], $seldays);
            } else {
                if ($option['recurring'] == 4) {
                    // Monthly Event
                    $desc = construct_phrase($vbphrase['this_event_occurs_on_day_x_of_every_y_months'], $options[0], $options[1]);
                } else {
                    if ($option['recurring'] == 5) {
                        // Monthly Event
                        $desc = construct_phrase($vbphrase['this_event_occurs_on_the_x_y_of_every_z_months'], $vbphrase["{$period["{$options['0']}"]}"], $vbphrase["{$days["{$options['1']}"]}"], $options[2]);
                    } else {
                        if ($option['recurring'] == 6) {
                            // Yearly Event
                            $desc = construct_phrase($vbphrase['this_event_occurs_every_x_y'], $vbphrase["{$months["{$options['0']}"]}"], $options[1]);
                        } else {
                            if ($option['recurring'] == 7) {
                                // Yearly Event
                                $desc = construct_phrase($vbphrase['this_event_occurs_on_every_x_y_of_z'], $vbphrase["{$period["{$options['0']}"]}"], $vbphrase["{$days["{$options['1']}"]}"], $vbphrase["{$months["{$options['2']}"]}"]);
                            }
                        }
                    }
                }
            }
        }
    }
    return $desc;
}
Example #21
0
	// check we got a record back and that the returned user is in a banned group
	if (!$user OR !$user['isnotbannedgroup'])
	{
		print_stop_message('invalid_user_specified');
	}

	if (is_unalterable_user($user['userid']))
	{
		print_stop_message('user_is_protected_from_alteration_by_undeletableusers_var');
	}

	// show confirmation message
	print_form_header('banning', 'doliftban');
	construct_hidden_code('userid', $vbulletin->GPC['userid']);
	print_table_header($vbphrase['lift_ban']);
	print_description_row(construct_phrase($vbphrase['confirm_ban_lift_on_x'], $user['username']));
	print_submit_row($vbphrase['yes'], '', 2, $vbphrase['no']);

}

if ($_POST['do'] == 'doliftban')
{
	$vbulletin->input->clean_array_gpc('p', array(
		'userid' => TYPE_INT
	));

	if (!$canunbanuser)
	{
		print_stop_message('no_permission_un_ban_users');
	}
Example #22
0
 sanitize_pageresults($totalrep, $vbulletin->GPC['pagenumber'], $vbulletin->GPC['perpage']);
 $startat = ($vbulletin->GPC['pagenumber'] - 1) * $vbulletin->GPC['perpage'];
 $totalpages = ceil($totalrep / $vbulletin->GPC['perpage']);
 $comments = $db->query_read("\n\t\tSELECT post.postid, rep.userid AS userid, whoadded, rep.reason, rep.dateline, rep.reputationid, rep.reputation,\n\t\t\tleftfor_user.username AS leftfor_username,\n\t\t\tleftby_user.username AS leftby_username,\n\t\t\tpost.title, post.threadid\n\t\tFROM " . TABLE_PREFIX . "reputation AS rep\n\t\tLEFT JOIN " . TABLE_PREFIX . "post AS post ON (rep.postid = post.postid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS leftby_user ON (rep.whoadded = leftby_user.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS leftfor_user ON (rep.userid = leftfor_user.userid)\n\t\t{$condition}\n\t\tORDER BY {$orderbysql}\n\t\tLIMIT {$startat}, " . $vbulletin->GPC['perpage']);
 if ($vbulletin->GPC['pagenumber'] != 1) {
     $prv = $vbulletin->GPC['pagenumber'] - 1;
     $firstpage = "<input type=\"button\" class=\"button\" value=\"&laquo; " . $vbphrase['first_page'] . "\" tabindex=\"1\" onclick=\"window.location='adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . "&u=" . $vbulletin->GPC['userid'] . "&whoadded=" . $vbulletin->GPC['whoadded'] . "&pp=" . $vbulletin->GPC['perpage'] . "&page=1" . "&startstamp=" . $vbulletin->GPC['start'] . "&endstamp=" . $vbulletin->GPC['end'] . "&orderby=" . $vbulletin->GPC['orderby'] . "'\">";
     $prevpage = "<input type=\"button\" class=\"button\" value=\"&lt; " . $vbphrase['prev_page'] . "\" tabindex=\"1\" onclick=\"window.location='adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . "&u=" . $vbulletin->GPC['userid'] . "&whoadded=" . $vbulletin->GPC['whoadded'] . "&pp=" . $vbulletin->GPC['perpage'] . "&page=" . $prv . "&startstamp=" . $vbulletin->GPC['start'] . "&endstamp=" . $vbulletin->GPC['end'] . "&orderby=" . $vbulletin->GPC['orderby'] . "'\">";
 }
 if ($vbulletin->GPC['pagenumber'] != $totalpages) {
     $nxt = $vbulletin->GPC['pagenumber'] + 1;
     $nextpage = "<input type=\"button\" class=\"button\" value=\"" . $vbphrase['next_page'] . " &gt;\" tabindex=\"1\" onclick=\"window.location='adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . "&u=" . $vbulletin->GPC['userid'] . "&whoadded=" . $vbulletin->GPC['whoadded'] . "&pp=" . $vbulletin->GPC['perpage'] . "&page=" . $nxt . "&startstamp=" . $vbulletin->GPC['start'] . "&endstamp=" . $vbulletin->GPC['end'] . "&orderby=" . $vbulletin->GPC['orderby'] . "'\">";
     $lastpage = "<input type=\"button\" class=\"button\" value=\"" . $vbphrase['last_page'] . " &raquo;\" tabindex=\"1\" onclick=\"window.location='adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . "&u=" . $vbulletin->GPC['userid'] . "&whoadded=" . $vbulletin->GPC['whoadded'] . "&pp=" . $vbulletin->GPC['perpage'] . "&page=" . $totalpages . "&startstamp=" . $vbulletin->GPC['start'] . "&endstamp=" . $vbulletin->GPC['end'] . "&orderby=" . $vbulletin->GPC['orderby'] . "'\">";
 }
 print_form_header('adminreputation', 'dolist');
 print_table_header(construct_phrase($vbphrase['x_reputation_comments_page_y_z'], vb_number_format($totalrep), $vbulletin->GPC['pagenumber'], vb_number_format($totalpages)), 7);
 $headings = array();
 $headings[] = "<a href='adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . "&amp;u=" . $vbulletin->GPC['userid'] . "&amp;whoadded=" . $vbulletin->GPC['whoadded'] . "&amp;pp=" . $vbulletin->GPC['perpage'] . "&amp;orderby=leftbyuser" . "&amp;page=" . $vbulletin->GPC['pagenumber'] . "&amp;startstamp=" . $vbulletin->GPC['start'] . "&amp;endstamp=" . $vbulletin->GPC['end'] . "' title='" . $vbphrase['order_by_username'] . "'>" . $vbphrase['leftby'] . "</a>";
 $headings[] = "<a href='adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . "&amp;u=" . $vbulletin->GPC['userid'] . "&amp;whoadded=" . $vbulletin->GPC['whoadded'] . "&amp;pp=" . $vbulletin->GPC['perpage'] . "&amp;orderby=leftforuser" . "&amp;page=" . $vbulletin->GPC['pagenumber'] . "&amp;startstamp=" . $vbulletin->GPC['start'] . "&amp;endstamp=" . $vbulletin->GPC['end'] . "' title='" . $vbphrase['order_by_username'] . "'>" . $vbphrase['leftfor'] . "</a>";
 $headings[] = "<a href='adminreputation.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . "&amp;u=" . $vbulletin->GPC['userid'] . "&amp;whoadded=" . $vbulletin->GPC['whoadded'] . "&amp;pp=" . $vbulletin->GPC['perpage'] . "&amp;orderby=date" . "&amp;page=" . $vbulletin->GPC['pagenumber'] . "&amp;startstamp=" . $vbulletin->GPC['start'] . "&amp;endstamp=" . $vbulletin->GPC['end'] . "' title='" . $vbphrase['order_by_date'] . "'>" . $vbphrase['date'] . "</a>";
 $headings[] = $vbphrase['reputation'];
 $headings[] = $vbphrase['reason'];
 $headings[] = $vbphrase['post'];
 $headings[] = $vbphrase['controls'];
 print_cells_row($headings, 1);
 while ($comment = $db->fetch_array($comments)) {
     $postlink = '';
     if (!empty($comment['postid'])) {
         //deliberately don't use the title.  We don't have it in our result set (or
         //in any of the tables in our result set) and we'll catch it on redirect.
         //Plus the admincp isn't a big SEO issue -- we just want to get the links
Example #23
0
 // work out the $startat value
 $startat = ($vbulletin->GPC['pagenumber'] - 1) * $vbulletin->GPC['perpage'];
 // array to store private messages in period groups
 $pm_period_groups = array();
 // query private messages
 $pms = $db->query_read_slave("\n\t\t\tSELECT pm.*, pmtext.*\n\t\t\t\t" . iif($vbulletin->options['privallowicons'], ", icon.title AS icontitle, icon.iconpath") . "\n\t\t\tFROM " . TABLE_PREFIX . "pm AS pm\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "pmtext AS pmtext ON(pmtext.pmtextid = pm.pmtextid)\n\t\t\t" . iif($vbulletin->options['privallowicons'], "LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = pmtext.iconid)") . "\n\t\t\tWHERE pm.userid=" . $vbulletin->userinfo['userid'] . " AND pm.folderid=" . $vbulletin->GPC['folderid'] . "\n\t\t\tORDER BY pmtext.dateline DESC\n\t\t\tLIMIT {$startat}, " . $vbulletin->GPC['perpage'] . "\n\t\t");
 while ($pm = $db->fetch_array($pms)) {
     $pm_period_groups[fetch_period_group($pm['dateline'])]["{$pm['pmid']}"] = $pm;
 }
 $db->free_result($pms);
 // display returned messages
 $show['pmcheckbox'] = true;
 require_once DIR . '/includes/functions_bigthree.php';
 foreach ($pm_period_groups as $groupid => $pms) {
     if (preg_match('#^(\\d+)_([a-z]+)_ago$#i', $groupid, $matches)) {
         $groupname = construct_phrase($vbphrase["x_{$matches['2']}_ago"], $matches[1]);
     } else {
         $groupname = $vbphrase["{$groupid}"];
     }
     $groupid = $vbulletin->GPC['folderid'] . '_' . $groupid;
     $collapseobj_groupid =& $vbcollapse["collapseobj_pmf{$groupid}"];
     $collapseimg_groupid =& $vbcollapse["collapseimg_pmf{$groupid}"];
     $messagesingroup = sizeof($pms);
     $messagelistbits = '';
     foreach ($pms as $pmid => $pm) {
         if (in_array($pm['fromuserid'], $ignoreusers)) {
             // from user is on Ignore List
             eval('$messagelistbits .= "' . fetch_template('pm_messagelistbit_ignore') . '";');
         } else {
             switch ($pm['messageread']) {
                 case 0:
Example #24
0
        //print_stop_message('saved_template_x_successfully', $vbulletin->GPC['title']);
    } else {
        print_rebuild_style($vbulletin->GPC['dostyleid'], '', 0, 0, 0, 0);
        print_cp_redirect($goto, 1);
    }
}
// #############################################################################
// edit form for an existing template
if ($_REQUEST['do'] == 'edit') {
    $vbulletin->input->clean_array_gpc('r', array('group' => TYPE_STR, 'searchstring' => TYPE_STR, 'expandset' => TYPE_STR));
    $template = $db->query_first("\n\t\tSELECT template.*, style.title AS style\n\t\tFROM " . TABLE_PREFIX . "template AS template\n\t\tLEFT JOIN " . TABLE_PREFIX . "style AS style USING(styleid)\n\t\tWHERE templateid = " . $vbulletin->GPC['templateid'] . "\n\t");
    if ($template['styleid'] == -1) {
        $template['style'] = $vbphrase['global_templates'];
    }
    print_form_header('template', 'updatetemplate');
    print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['template'], $template['title'], $template['templateid']));
    construct_hidden_code('templateid', $template['templateid']);
    construct_hidden_code('group', $vbulletin->GPC['group']);
    construct_hidden_code('searchstring', $vbulletin->GPC['searchstring']);
    construct_hidden_code('dostyleid', $template['styleid']);
    construct_hidden_code('expandset', $vbulletin->GPC['expandset']);
    construct_hidden_code('oldtitle', $template['title']);
    construct_hidden_code('lastedit', $template['dateline']);
    $backlink = "template.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify&amp;expandset={$template['styleid']}&amp;group=" . $vbulletin->GPC['group'] . "&amp;templateid=" . $vbulletin->GPC['templateid'] . "&amp;searchstring=" . urlencode($vbulletin->GPC['searchstring']);
    $products = fetch_product_list();
    if ($template['styleid'] == -1) {
        print_select_row($vbphrase['product'], 'product', $products, $template['product']);
    } else {
        print_label_row($vbphrase['product'], $products[$template['product'] ? $template['product'] : 'vbulletin']);
        construct_hidden_code('product', $template['product'] ? $template['product'] : 'vbulletin');
    }
Example #25
0
                construct_hidden_code('query', $query);
                construct_hidden_code('perpage', $vbulletin->GPC['perpage']);
                construct_hidden_code('confirmquery', 1);
                print_table_header($vbphrase['confirm_query_execution']);
                print_description_row($vbphrase['query_may_modify_database']);
                print_submit_row($vbphrase['continue'], false, 2, $vbphrase['go_back']);
            } else {
                $time_before = microtime();
                $db->query_write($query);
                $time_taken = fetch_microtime_difference($time_before);
                print_form_header('queries', 'doquery');
                print_table_header($vbphrase['vbulletin_message']);
                if ($errornum = $db->errno()) {
                    print_description_row(construct_phrase($vbphrase['an_error_occured_while_attempting_to_run_your_query'], $errornum, nl2br(htmlspecialchars_uni($db->error()))));
                } else {
                    print_description_row(construct_phrase($vbphrase['affected_rows'], vb_number_format($db->affected_rows()), vb_number_format($time_taken, 4)));
                }
                print_table_footer();
            }
            break;
    }
}
// ##################### START MODIFY #####################
if ($_REQUEST['do'] == 'modify') {
    print_form_header('queries', 'doquery');
    print_table_header($vbphrase['execute_sql_query']);
    print_select_row($vbphrase['auto_query'], 'autoquery', $queryoptions, -1);
    print_textarea_row($vbphrase['manual_query'], 'query', '', 10, 55);
    print_input_row($vbphrase['results_to_show_per_page'], 'perpage', 20);
    print_submit_row($vbphrase['continue']);
}
Example #26
0
        $admindm->set_bitfield('adminpermissions', $key, $value);
    }
    ($hook = vBulletinHook::fetch_hook('admin_permissions_process')) ? eval($hook) : false;
    $admindm->set('cssprefs', $vbulletin->GPC['cssprefs']);
    $admindm->set('dismissednews', $vbulletin->GPC['dismissednews']);
    $admindm->save();
    define('CP_REDIRECT', "adminpermissions.php?" . $vbulletin->session->vars['sessionurl'] . "#user{$user['userid']}");
    print_stop_message('saved_administrator_permissions_successfully');
}
// #############################################################################
if ($_REQUEST['do'] == 'edit') {
    echo "<p align=\"center\">{$vbphrase['give_admin_access_arbitrary_html']}</p>";
    print_form_header('adminpermissions', 'update');
    construct_hidden_code('userid', $vbulletin->GPC['userid']);
    construct_hidden_code('oldpermissions', $user['adminpermissions']);
    print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['administrator_permissions'], $user['username'], $user['userid']));
    print_label_row("{$vbphrase['administrator']}: <a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;u=" . $vbulletin->GPC['userid'] . "\">{$user['username']}</a>", '<div align="' . $stylevar['right'] . '"><input type="button" class="button" value=" ' . $vbphrase['all_yes'] . ' " onclick="js_check_all_option(this.form, 1);" /> <input type="button" class="button" value=" ' . $vbphrase['all_no'] . ' " onclick="js_check_all_option(this.form, 0);" /></div>', 'thead');
    foreach (convert_bits_to_array($user['adminpermissions'], $ADMINPERMISSIONS) as $field => $value) {
        print_yes_no_row($permsphrase["{$field}"] == '' ? $vbphrase['n_a'] : $permsphrase["{$field}"], "adminpermissions[{$field}]", $value);
    }
    ($hook = vBulletinHook::fetch_hook('admin_permissions_form')) ? eval($hook) : false;
    print_select_row($vbphrase['control_panel_style_choice'], 'cssprefs', array_merge(array('' => "({$vbphrase['default']})"), fetch_cpcss_options()), $user['cssprefs']);
    print_input_row($vbphrase['dismissed_news_item_ids'], 'dismissednews', $user['dismissednews']);
    print_submit_row();
}
// #############################################################################
if ($_REQUEST['do'] == 'modify') {
    print_form_header('adminpermissions', 'edit');
    print_table_header($vbphrase['administrator_permissions'], 3);
    $users = $db->query_read("\n\t\tSELECT user.username, usergroupid, membergroupids, infractiongroupids, administrator.*\n\t\tFROM " . TABLE_PREFIX . "administrator AS administrator\n\t\tINNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)\n\t\tORDER BY user.username\n\t");
    while ($user = $db->fetch_array($users)) {
Example #27
0
function construct_online_bit($userinfo, $doall = 0)
{
    global $vbulletin, $limitlower, $limitupper, $stylevar, $vbphrase, $ipclass, $show;
    global $wol_album, $wol_attachment, $wol_calendar, $wol_event, $wol_inf, $wol_pm, $wol_post, $wol_search, $wol_socialgroup, $wol_thread, $wol_user;
    static $count;
    $count++;
    $show['nopermission'] = false;
    $show['lockedout'] = false;
    $show['errormessage'] = false;
    if ($doall == 1 and ($count > $limitupper or $count < $limitlower)) {
        return '';
    }
    if ($userinfo['attachmentid']) {
        $postid = $wol_attachment["{$userinfo['attachmentid']}"];
    } else {
        $postid = $userinfo['postid'];
    }
    if ($postid) {
        $threadid = $wol_post["{$postid}"];
    } else {
        $threadid = $userinfo['threadid'];
    }
    $forumid = $userinfo['forumid'];
    $calendarid = $userinfo['calendarid'];
    $eventid = $userinfo['eventid'];
    $searchid = $userinfo['searchid'];
    $groupid = $userinfo['socialgroupid'];
    $albumid = $userinfo['albumid'];
    if ($albumid) {
        require_once DIR . '/includes/functions_album.php';
        $albumname = fetch_censored_text($wol_album["{$albumid}"]['title']);
        $canviewalbum = true;
        if ($wol_album["{$albumid}"]['state'] == 'profile' and !can_view_profile_albums($wol_album["{$albumid}"]['userid'])) {
            $canviewalbum = false;
        } else {
            if ($wol_album["{$albumid}"]['state'] == 'private' and !can_view_private_albums($wol_album["{$albumid}"]['userid'])) {
                $canviewalbum = false;
            }
        }
    }
    if ($groupid) {
        $groupname = fetch_censored_text($wol_socialgroup["{$groupid}"]['name']);
        $canviewgroup = true;
    }
    if ($searchid) {
        $searchquery = $wol_search["{$searchid}"]['query'];
        $searchuser = $wol_search["{$searchid}"]['searchuser'];
        $searchuserid = $wol_search["{$searchid}"]['userid'];
    }
    if (!$forumid and isset($wol_thread["{$threadid}"]['forumid'])) {
        $forumid = $wol_thread["{$threadid}"]['forumid'];
    } else {
        if (!$forumid and isset($wol_thread["{$wol_post[$postid]}"]['forumid'])) {
            $forumid = $wol_thread["{$wol_post[$postid]}"]['forumid'];
        }
    }
    $threadtitle = fetch_censored_text($wol_thread["{$threadid}"]['title']);
    $threadprefix = $wol_thread["{$threadid}"]['prefixid'] ? $vbphrase['prefix_' . $wol_thread["{$threadid}"]['prefixid'] . '_title_rich'] . ' ' : '';
    $canview = $vbulletin->userinfo['forumpermissions']["{$forumid}"] & $vbulletin->bf_ugp_forumpermissions['canview'];
    $canviewothers = $vbulletin->userinfo['forumpermissions']["{$forumid}"] & $vbulletin->bf_ugp_forumpermissions['canviewothers'];
    $canviewthreads = $vbulletin->userinfo['forumpermissions']["{$forumid}"] & $vbulletin->bf_ugp_forumpermissions['canviewthreads'];
    $postuserid = $wol_thread["{$threadid}"]['postuserid'];
    $forumtitle = $vbulletin->forumcache["{$forumid}"]['title'];
    $threadpreview = $wol_thread["{$threadid}"]['preview'];
    if (!$calendarid and isset($wol_event["{$eventid}"]['calendarid'])) {
        $calendarid = $wol_event["{$eventid}"]['calendarid'];
    }
    $eventtitle = htmlspecialchars_uni($wol_event["{$eventid}"]['title']);
    $eventpostuserid = $wol_event["{$eventid}"]['postuserid'];
    $calendartitle = $wol_calendar["{$calendarid}"];
    $canviewcalendar = $vbulletin->userinfo['calendarpermissions']["{$calendarid}"] & $vbulletin->bf_ugp_calendarpermissions['canviewcalendar'];
    $canviewothersevent = $vbulletin->userinfo['calendarpermissions']["{$calendarid}"] & $vbulletin->bf_ugp_calendarpermissions['canviewothersevent'];
    if (($wol_thread["{$threadid}"]['isdeleted'] or !$wol_thread["{$threadid}"]['visible']) and !can_moderate($forumid)) {
        $threadviewable = 0;
    } else {
        $threadviewable = 1;
    }
    if ($threadviewable and $threadtitle and $canview and ($canviewothers or $postuserid == $vbulletin->userinfo['userid']) and verify_forum_password($forumid, $vbulletin->forumcache["{$forumid}"]['password'], false)) {
        $seetitle = 1;
    }
    if ($forumtitle and ($canview or $vbulletin->forumcache["{$forumid}"]['showprivate'] > 1 or !$vbulletin->forumcache["{$forumid}"]['showprivate'] and $vbulletin->options['showprivateforums'])) {
        $seeforum = 1;
    }
    if ($eventtitle and $canviewcalendar and ($canviewothersevent or $eventpostuserid == $vbulletin->userinfo['userid'])) {
        $seeevent = 1;
    }
    if ($calendartitle and $canviewcalendar) {
        $seecalendar = 1;
    }
    if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull']) {
        if ($userinfo['pmid']) {
            $seeuserid = $wol_pm["{$userinfo['pmid']}"];
        } else {
            if ($userinfo['searchid']) {
                $seeuserid = $wol_search["{$searchid}"]['targetuserid'];
            } else {
                if ($userinfo['infractionid']) {
                    $seeuserid = $wol_inf["{$userinfo['infractionid']}"]['userid'];
                } else {
                    $seeuserid = $userinfo['targetuserid'];
                }
            }
        }
    }
    switch ($userinfo['activity']) {
        case 'visitormessage_posting':
            $userinfo['action'] = $vbphrase['posting_visitor_message'];
            break;
        case 'visitormessage_delete':
            $userinfo['action'] = $vbphrase['deleting_visitor_message'];
            break;
        case 'viewingipaddress':
            $userinfo['action'] = '<b><i>' . $vbphrase['moderating'] . '</b></i>';
            if (can_moderate()) {
                $userinfo['action'] = $vbphrase['viewing_ip_address'];
            }
            break;
        case 'visitormessage_reporting':
            $userinfo['action'] = $vbphrase['reporting_visitor_message'];
            break;
        case 'posthistory':
            $userinfo['action'] = $vbphrase['viewing_post_history'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p={$postid}#post{$postid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            break;
        case 'tags':
            $userinfo['action'] = $vbphrase['managing_tags'];
            break;
        case 'tag_list':
            $userinfo['action'] = $vbphrase['viewing_tag_list'];
            break;
        case 'socialgroups_join':
            $userinfo['action'] = $vbphrase['joining_social_group'];
            if ($canviewgroup) {
                $userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid={$groupid}\">{$groupname}</a>";
            }
            break;
        case 'socialgroups_leave':
            $userinfo['action'] = $vbphrase['leaving_social_group'];
            if ($canviewgroup) {
                $userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid={$groupid}\">{$groupname}</a>";
            }
            break;
        case 'socialgroups_edit':
            $userinfo['action'] = $vbphrase['editing_social_group'];
            if ($canviewgroup) {
                $userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid={$groupid}\">{$groupname}</a>";
            }
            break;
        case 'socialgroups_view':
            $userinfo['action'] = $vbphrase['viewing_social_group'];
            if ($canviewgroup) {
                $userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid={$groupid}\">{$groupname}</a>";
            }
            break;
        case 'socialgroups_memberlist':
            $userinfo['action'] = $vbphrase['viewing_social_group_memberlist'];
            if ($canviewgroup) {
                $userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=viewmembers&amp;groupid={$groupid}\">{$groupname}</a>";
            }
            break;
        case 'socialgroups_delete':
            $userinfo['action'] = $vbphrase['deleting_social_group'];
            if ($canviewgroup) {
                $userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=viewmembers&amp;groupid={$groupid}\">{$groupname}</a>";
            }
            break;
        case 'socialgroups_create':
            $userinfo['action'] = $vbphrase['creating_social_group'];
            break;
        case 'socialgroups_list':
            $userinfo['action'] = $vbphrase['viewing_social_group_list'];
            if ($canviewgroup) {
                $userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid={$groupid}\">{$groupname}</a>";
            }
            break;
        case 'group_inlinemod':
            $userinfo['action'] = '<b><i>' . $vbphrase['moderating'] . '</i></b>';
            break;
        case 'showthread':
            $userinfo['action'] = $vbphrase['viewing_thread'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            break;
        case 'showpost':
            $userinfo['action'] = $vbphrase['viewing_thread'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p={$postid}#post{$postid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            break;
        case 'forumdisplay':
            $userinfo['action'] = $vbphrase['viewing_forum'];
            if ($seeforum) {
                if ($vbulletin->forumcache["{$forumid}"]['link']) {
                    $userinfo['action'] = $vbphrase['followed_forum_link'];
                }
                $userinfo['where'] = '<a href="forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f={$forumid}\">{$forumtitle}</a>";
            }
            break;
        case 'newthread':
            $userinfo['action'] = $vbphrase['creating_thread'];
            if ($seeforum) {
                $userinfo['where'] = '<a href="forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f={$forumid}\">{$forumtitle}</a>";
            }
            break;
        case 'newreply':
            $userinfo['action'] = $vbphrase['replying_to_thread'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            break;
        case 'attachments':
            $userinfo['action'] = $vbphrase['viewing_attachments'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="misc.php?' . $vbulletin->session->vars['sessionurl'] . "do=attachments&amp;u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'manageattachment':
            $userinfo['action'] = $vbphrase['managing_attachments'];
            break;
        case 'attachment':
            $userinfo['action'] = $vbphrase['viewing_attachment'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p={$postid}#post{$postid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            break;
        case 'index':
            $userinfo['action'] = $vbphrase['viewing_index'];
            $userinfo['where'] = '<a href="' . $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'] . '">' . $vbulletin->options['bbtitle'] . '</a>';
            break;
        case 'online':
            $userinfo['action'] = $vbphrase['viewing_whos_online'];
            break;
        case 'searchnew':
            $userinfo['action'] = $vbphrase['viewing_new_posts'];
            $userinfo['where'] = '<a href="search.php?' . $vbulletin->session->vars['sessionurl'] . "do=getnew\">{$vbphrase['new_posts']}</a>";
            break;
        case 'search':
            $userinfo['action'] = $vbphrase['searching_forums'];
            if ($searchid and $vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull']) {
                if ($searchquery) {
                    $userinfo['where'] = construct_phrase($vbphrase['query_x'], htmlspecialchars_uni($searchquery));
                }
                if ($searchuser and $wol_search["{$searchid}"]['targetuserid']) {
                    if ($searchquery) {
                        $userinfo['where'] .= '<br />';
                    }
                    $userinfo['where'] .= construct_phrase($vbphrase['user_x'], '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>");
                }
            }
            break;
        case 'mail':
            $userinfo['action'] = $vbphrase['emailing'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'getinfo':
            $userinfo['action'] = $vbphrase['viewing_user_profile'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'converse':
            $userinfo['action'] = $vbphrase['viewing_conversation'];
            if ($seeuserid and $wol_user["{$userinfo['guestuserid']}"]) {
                $userinfo['where'] = construct_phrase($vbphrase['x_and_y_converse'], '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>", '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$userinfo['guestuserid']}\">" . $wol_user["{$userinfo['guestuserid']}"] . "</a>");
            }
            break;
        case 'editprofile':
            $userinfo['action'] = $vbphrase['modifying_profile'];
            break;
        case 'editoptions':
            $userinfo['action'] = $vbphrase['modifying_options'];
            break;
        case 'lostpw':
        case 'editpassword':
            $userinfo['action'] = $vbphrase['modifying_password'];
            break;
        case 'editavatar':
            $userinfo['action'] = $vbphrase['modifying_avatar'];
            break;
        case 'editprofilepic':
            $userinfo['action'] = $vbphrase['modifying_profilepic'];
            break;
        case 'editsignature':
            $userinfo['action'] = $vbphrase['modifying_signature'];
            break;
        case 'markread':
            $userinfo['where'] = $vbphrase['marking_forums_read'];
            break;
        case 'whoposted':
            if ($seetitle) {
                $userinfo['action'] = $vbphrase['viewing_who_posted'];
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            } else {
                $userinfo['action'] = $vbphrase['viewing_thread'];
            }
            break;
        case 'showattachments':
            if ($seetitle) {
                $userinfo['action'] = $vbphrase['viewing_attachment_list'];
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            } else {
                $userinfo['action'] = $vbphrase['viewing_thread'];
            }
            break;
        case 'showgroups':
            $userinfo['action'] = $vbphrase['viewing_forum_leaders'];
            break;
        case 'login':
            $userinfo['action'] = $vbphrase['logging_in'];
            break;
        case 'logout':
            if ($userinfo['badlocation']) {
                $userinfo['action'] = $vbphrase['logging_out'];
            }
            break;
        case 'archive':
            $userinfo['action'] = $vbphrase['viewing_archives'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . "<a href=\"archive/index.php/t-{$threadid}.html\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            } else {
                if ($seeforum) {
                    $userinfo['where'] = "<a href=\"archive/index.php/f-{$forumid}.html\">{$forumtitle}</a>";
                }
            }
            break;
        case 'pm':
            $userinfo['action'] = $vbphrase['private_messaging'];
            if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull']) {
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
                }
                if ($userinfo['values']['do'] == 'newpm' or $userinfo['values']['do'] == 'insertpm' or $userinfo['values']['do'] == 'newmessage') {
                    $userinfo['action'] = $vbphrase['creating_private_message'];
                } else {
                    if ($userinfo['values']['do'] == 'editfolders' or $userinfo['action']['do'] == 'updatefolders') {
                        $userinfo['action'] = $vbphrase['modifying_private_message_folders'];
                    } else {
                        if ($userinfo['values']['do'] == 'trackpm' or $userinfo['values']['do'] == 'deletepmreceipt') {
                            $userinfo['action'] = $vbphrase['tracking_private_messages'];
                        } else {
                            if ($userinfo['values']['do'] == 'showpm') {
                                $userinfo['action'] = $vbphrase['viewing_private_message'];
                            } else {
                                if ($userinfo['values']['do'] == 'downloadpm') {
                                    $userinfo['action'] = $vbphrase['downloading_private_messages'];
                                }
                            }
                        }
                    }
                }
            }
            break;
        case 'addbuddy':
        case 'addignore':
        case 'buddyignore':
            $userinfo['action'] = $vbphrase['modifying_contact_ignore_list'];
            break;
        case 'subfolders':
            $userinfo['action'] = $vbphrase['modifying_subscription_folders'];
            break;
        case 'subscription':
            $userinfo['action'] = $vbphrase['viewing_subscribed_threads'];
            break;
        case 'addsubforum':
            $userinfo['action'] = $vbphrase['subscribing_to_forum'];
            if ($seeforum) {
                $userinfo['where'] = '<a href="forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f={$forumid}\">{$forumtitle}</a>";
            }
            break;
        case 'addsubthread':
            $userinfo['action'] = $vbphrase['subscribing_to_thread'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            break;
        case 'remsubthread':
            $userinfo['action'] = $vbphrase['deleting_subscribed_threads'];
            break;
        case 'remsubforum':
            $userinfo['action'] = $vbphrase['deleting_subscribed_forums'];
            break;
        case 'usercp':
            $userinfo['action'] = $vbphrase['viewing_user_control_panel'];
            break;
        case 'memberlistsearch':
            $userinfo['action'] = $vbphrase['searching_member_list'];
            break;
        case 'memberlist':
            $userinfo['action'] = $vbphrase['viewing_member_list'];
            break;
        case 'member_inlinemod':
            $userinfo['action'] = '<b><i>' . $vbphrase['moderating'] . '</i></b>';
            if (can_moderate()) {
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
                }
            }
            break;
        case 'inlinemod':
            $userinfo['action'] = '<b><i>' . $vbphrase['moderating'] . '</i></b>';
            if (can_moderate()) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                switch ($userinfo['values']['do']) {
                    case 'open':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_opening_threads'] . '</i>';
                        break;
                    case 'close':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_closing_threads'] . '</i>';
                        break;
                    case 'stick':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_sticking_threads'] . '</i>';
                        break;
                    case 'unstick':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_unsticking_threads'] . '</i>';
                        break;
                    case 'deletethread':
                    case 'dodeletethreads':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_deleting_threads'] . '</i>';
                        break;
                    case 'undeletethread':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_undeleting_threads'] . '</i>';
                        break;
                    case 'approvethread':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_approving_threads'] . '</i>';
                        break;
                    case 'unapprovethread':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_unapproving_threads'] . '</i>';
                        break;
                    case 'movethread':
                    case 'domovethreads':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_moving_threads'] . '</i>';
                        break;
                    case 'mergethread':
                    case 'domergethreads':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_merging_threads'] . '</i>';
                        break;
                    case 'deleteposts':
                    case 'dodeleteposts':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_deleting_posts'] . '</i>';
                        break;
                    case 'undeleteposts':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_undeleting_posts'] . '</i>';
                        break;
                    case 'approveposts':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_approving_posts'] . '</i>';
                        break;
                    case 'unapproveposts':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_unapproving_posts'] . '</i>';
                        break;
                    case 'mergeposts':
                    case 'domergeposts':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_merging_posts'] . '</i>';
                        break;
                    case 'moveposts':
                    case 'domoveposts':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_moving_posts'] . '</i>';
                        break;
                    case 'clearthread':
                    case 'clearpost':
                        $userinfo['action'] = '<i>' . $vbphrase['inline_mod_clear'] . '</i>';
                        break;
                    case 'spampost':
                    case 'dodeletespam':
                    case 'spamconfirm':
                        $userinfo['action'] = '<i>' . $vbphrase['managing_spam'] . '</i>';
                        break;
                }
            }
            break;
        case 'postings':
            $userinfo['action'] = '<b><i>' . $vbphrase['moderating'] . '</b></i>';
            if (can_moderate($forumid) and $threadtitle and $canview and ($canviewothers or $postuserid == $vbulletin->userinfo['userid'])) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                switch ($userinfo['values']['do']) {
                    case 'editthread':
                    case 'updatethread':
                        $userinfo['action'] = '<i>' . $vbphrase['modifying_thread'] . '</i>';
                        break;
                    case 'openclosethread':
                        $userinfo['action'] = '<i>' . $vbphrase['open_close_thread'] . '</i>';
                        break;
                    case 'movethread':
                        $userinfo['action'] = '<i>' . $vbphrase['choosing_forum_to_move_thread_to'] . '</i>';
                        break;
                    case 'domovethread':
                        switch ($userinfo['values']['method']) {
                            case 'copy':
                                $userinfo['action'] = '<i>' . $vbphrase['copying_thread_to_forum'] . '</i>';
                                break;
                            case 'move':
                                $userinfo['action'] = '<i>' . $vbphrase['moving_thread_to_forum'] . '</i>';
                                break;
                            case 'movered':
                                $userinfo['action'] = '<i>' . $vbphrase['moving_thread_with_redirect_to_forum'] . '</i>';
                                break;
                        }
                        $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a><br />" . '<a href="forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f={$forumid}\">{$forumtitle}</a>";
                        break;
                    case 'deletethread':
                    case 'dodeletethread':
                        $userinfo['action'] = '<i>' . $vbphrase['deleting_thread'] . '</i>';
                        break;
                    case 'deleteposts':
                    case 'dodeleteposts':
                        $userinfo['where'] = '<i>' . $vbphrase['deleting_posts'] . '</i>';
                        break;
                    case 'merge':
                    case 'domergethread':
                        $userinfo['where'] = '<i>' . $vbphrase['merging_threads'] . '</i>';
                        break;
                    case 'stick':
                        $userinfo['where'] = '<i>' . $vbphrase['stick_unstick_thread'] . '</i>';
                        break;
                    case 'getip':
                        $userinfo['where'] = '<i>' . $vbphrase['viewing_ip_address'] . '</i>';
                        break;
                    case 'removeredirect':
                        $userinfo['where'] = '<i>' . $vbphrase['deleting_redirect'] . '</i>';
                        break;
                }
            }
            break;
        case 'register':
            $userinfo['action'] = $vbphrase['registering'];
            break;
        case 'requestemail':
            $userinfo['action'] = $vbphrase['request_activation_code'];
            break;
        case 'activate':
            $userinfo['action'] = $vbphrase['activating_registration'];
            break;
        case 'announcement':
            $userinfo['action'] = $vbphrase['viewing_announcement'];
            if ($seeforum) {
                $userinfo['where'] = '<a href="announcement.php?' . $vbulletin->session->vars['sessionurl'] . "f={$forumid}\">{$forumtitle}</a>";
            }
            break;
        case 'usergroup':
            $userinfo['action'] = $vbphrase['modifying_usergroups'];
            break;
        case 'polls':
            switch ($userinfo['values']['do']) {
                case 'showresults':
                    $userinfo['action'] = $vbphrase['viewing_poll'];
                    break;
                case '':
                case 'newpoll':
                case 'postpoll':
                    $userinfo['action'] = $vbphrase['creating_poll'];
                    if ($seeforum) {
                        $userinfo['where'] = '<a href="forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f={$forumid}\">{$forumtitle}</a>";
                    }
                    break;
                case 'polledit':
                case 'updatepoll':
                    $userinfo['action'] = $vbphrase['modifying_poll'];
                    break;
                case 'pollvote':
                    $userinfo['action'] = $vbphrase['voting'];
                    break;
            }
            break;
        case 'showsmilies':
            $userinfo['action'] = $vbphrase['viewing_smilies'];
            break;
        case 'showavatars':
            $userinfo['action'] = $vbphrase['viewing_avatars'];
            break;
        case 'bbcode':
            $userinfo['action'] = $vbphrase['viewing_bb_code'];
            break;
        case 'faq':
            $userinfo['action'] = $vbphrase['viewing_faq'];
            break;
        case 'edit':
            $userinfo['action'] = $vbphrase['modifying_post'];
            if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull'] and $seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p={$postid}#post{$postid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            break;
        case 'sendto':
            $userinfo['action'] = $vbphrase['sending_thread_to_friend'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="printthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            break;
        case 'contactus':
            $userinfo['action'] = $vbphrase['sending_forum_feedback'];
            break;
        case 'aim':
            $userinfo['action'] = $vbphrase['sending_aim_message'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'msn':
            $userinfo['action'] = $vbphrase['sending_msn_message'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'yahoo':
            $userinfo['action'] = $vbphrase['sending_yahoo_message'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'icq':
            $userinfo['action'] = $vbphrase['sending_icq_message'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'skype':
            $userinfo['action'] = $vbphrase['sending_skype_message'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'report':
            if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull'] and $seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p={$postid}#post{$postid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            $userinfo['action'] = $vbphrase['reporting_post'];
            break;
        case 'printthread':
            $userinfo['action'] = $vbphrase['viewing_printable_version'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="printthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            break;
        case 'calendarweek':
            $userinfo['action'] = $vbphrase['viewing_calendar'];
            if ($seecalendar) {
                if ($userinfo['week']) {
                    $week = "&amp;week={$userinfo['week']}";
                }
                $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=displayweek&amp;c={$calendarid}{$week}\">{$calendartitle}</a>";
            }
            break;
        case 'calendarmonth':
            $userinfo['action'] = $vbphrase['viewing_calendar'];
            if ($seecalendar) {
                $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=displaymonth&amp;c={$calendarid}&amp;month={$userinfo['month']}&amp;year={$userinfo['year']}\">{$calendartitle}</a>";
            }
            break;
        case 'calendaryear':
            $userinfo['action'] = $vbphrase['viewing_calendar'];
            if ($seecalendar) {
                if ($userinfo['year']) {
                    $year = "&amp;year={$userinfo['year']}";
                }
                $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=displayyear&amp;c={$calendarid}{$year}\">{$calendartitle}</a>";
            }
            break;
        case 'calendarday':
            $userinfo['action'] = $vbphrase['viewing_calendar'];
            if ($seecalendar) {
                $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=getday&amp;c={$calendarid}&amp;day={$userinfo['day']}\">{$calendartitle}</a>";
            }
            break;
        case 'calendarevent':
            $userinfo['action'] = $vbphrase['viewing_event'];
            if ($seeevent) {
                $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=getinfo&amp;e={$eventid}\">{$eventtitle}</a>";
            }
            break;
        case 'calendaradd':
        case 'calendaraddrecur':
            $userinfo['action'] = $vbphrase['creating_event'];
            if ($seecalendar) {
                $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "c={$calendarid}\">{$calendartitle}</a>";
            }
            break;
        case 'calendaredit':
            $userinfo['action'] = $vbphrase['modifying_event'];
            if ($seeevent) {
                $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=getinfo&amp;e={$eventid}\">{$eventtitle}</a>";
            }
            break;
        case 'calreminder':
            $userinfo['action'] = $vbphrase['managing_reminder'];
            if ($seeevent) {
                $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=getinfo&amp;e={$eventid}\">{$eventtitle}</a>";
            }
            break;
        case 'newusernote':
            $userinfo['action'] = $vbphrase['creating_user_note'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="usernote.php?' . $vbulletin->session->vars['sessionurl'] . "do=viewuser&amp;u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'usernote':
            $userinfo['action'] = $vbphrase['viewing_user_note'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="usernote.php?' . $vbulletin->session->vars['sessionurl'] . "do=viewuser&amp;u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'reputation':
            $userinfo['action'] = $vbphrase['giving_reputation'];
            if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull'] and $seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            break;
        case 'joinrequests':
            $userinfo['action'] = $vbphrase['processing_joinrequests'];
            if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull'] and $vbulletin->usergroupcache["{$userinfo['usergroupid']}"]['title']) {
                $userinfo['where'] = construct_phrase($vbphrase['viewing_x'], $vbulletin->usergroupcache["{$userinfo['usergroupid']}"]['title']);
            }
            break;
        case 'threadrate':
            $userinfo['action'] = $vbphrase['rating_thread'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            break;
        case 'infractionreport':
            if ($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cangiveinfraction'] or $vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_wolpermissions['canreverseinfraction']) {
                $userinfo['action'] = $vbphrase['giving_infraction'];
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
                } else {
                    if ($seetitle) {
                        $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p={$postid}#post{$postid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                    }
                }
            } else {
                $userinfo['action'] = $vbphrase['viewing_index'];
            }
            break;
        case 'infractionreverse':
            if ($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cangiveinfraction'] or $vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_wolpermissions['canreverseinfraction']) {
                $userinfo['action'] = $vbphrase['reversing_infraction'];
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="infraction.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;infractionid={$userinfo['infractionid']}\">{$wol_user[$seeuserid]}</a>";
                }
            } else {
                $userinfo['action'] = $vbphrase['viewing_index'];
            }
            break;
        case 'infractionview':
            if ($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cangiveinfraction'] or $vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_wolpermissions['canreverseinfraction']) {
                $userinfo['action'] = $vbphrase['viewing_infraction'];
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="infraction.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;infractionid={$userinfo['infractionid']}\">{$wol_user[$seeuserid]}</a>";
                }
            } else {
                $userinfo['action'] = $vbphrase['viewing_index'];
            }
            break;
        case 'modcp_deletedthreads':
            if (can_moderate()) {
                $userinfo['action'] = $vbphrase['viewing_deleted_threads'];
            } else {
                $userinfo['action'] = $vbphrase['viewing_index'];
            }
            break;
        case 'modcp_deletedposts':
            if (can_moderate()) {
                $userinfo['action'] = $vbphrase['viewing_deleted_posts'];
            } else {
                $userinfo['action'] = $vbphrase['viewing_index'];
            }
            break;
        case 'modcp_deletedvms':
            if (can_moderate(0, 'canmoderatevisitormessages')) {
                $userinfo['action'] = $vbphrase['viewing_deleted_visitor_messages'];
            } else {
                $userinfo['action'] = $vbphrase['viewing_index'];
            }
            break;
        case 'modcp_deletedgms':
            if (can_moderate(0, 'canmoderategroupmessages')) {
                $userinfo['action'] = $vbphrase['viewing_deleted_social_group_messages'];
            } else {
                $userinfo['action'] = $vbphrase['viewing_index'];
            }
            break;
        case 'modcp_deletedpcs':
            if (can_moderate(0, 'canmoderatepicturecomments')) {
                $userinfo['action'] = $vbphrase['viewing_deleted_picture_comments'];
            } else {
                $userinfo['action'] = $vbphrase['viewing_index'];
            }
            break;
        case 'modcp_moderatedthreads':
            if (can_moderate(0, 'canmoderateposts')) {
                $userinfo['action'] = $vbphrase['viewing_moderated_threads'];
            } else {
                $userinfo['action'] = $vbphrase['viewing_index'];
            }
            break;
        case 'modcp_moderatedposts':
            if (can_moderate(0, 'canmoderateposts')) {
                $userinfo['action'] = $vbphrase['viewing_moderated_posts'];
            } else {
                $userinfo['action'] = $vbphrase['viewing_index'];
            }
            break;
        case 'modcp_moderatedvms':
            if (can_moderate(0, 'canmoderatevisitormessages')) {
                $userinfo['action'] = $vbphrase['viewing_moderated_visitor_messages'];
            } else {
                $userinfo['action'] = $vbphrase['viewing_index'];
            }
            break;
        case 'modcp_moderatedgms':
            if (can_moderate(0, 'canmoderategroupmessages')) {
                $userinfo['action'] = $vbphrase['viewing_moderated_social_group_messages'];
            } else {
                $userinfo['action'] = $vbphrase['viewing_index'];
            }
            break;
        case 'modcp_moderatedpcs':
            if (can_moderate(0, 'canmoderatepicturecomments')) {
                $userinfo['action'] = $vbphrase['viewing_moderated_picture_comments'];
            } else {
                $userinfo['action'] = $vbphrase['viewing_index'];
            }
            break;
        case 'modcp_moderatedpictures':
            if (can_moderate(0, 'canmoderatepictures')) {
                $userinfo['action'] = $vbphrase['viewing_moderated_pictures'];
            } else {
                $userinfo['action'] = $vbphrase['viewing_index'];
            }
            break;
        case 'payments':
            $userinfo['action'] = $vbphrase['viewing_paid_subscriptions'];
            break;
        case 'spider':
            $userinfo['action'] = $vbphrase['search_engine_spider'];
            break;
        case 'admincp':
            $userinfo['action'] = $vbphrase['admin_control_panel'];
            break;
        case 'admincplogin':
            $userinfo['action'] = $vbphrase['admin_control_panel_login'];
            break;
        case 'modcp':
            $userinfo['action'] = $vbphrase['moderator_control_panel'];
            break;
        case 'modcplogin':
            $userinfo['action'] = $vbphrase['moderator_control_panel_login'];
            break;
        case 'album_delete':
            $userinfo['action'] = $vbphrase['deleting_album'];
            break;
        case 'album_edit_album':
            $userinfo['action'] = $vbphrase['editing_album'];
            if ($canviewalbum) {
                $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}\">{$albumname}</a>";
            }
            break;
        case 'album_new_album':
            $userinfo['action'] = $vbphrase['creating_album'];
            break;
        case 'album_edit_picture':
            $userinfo['action'] = $vbphrase['editing_pictures'];
            if ($canviewalbum) {
                if (!empty($userinfo['pictureid'])) {
                    $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}&amp;pictureid=" . $userinfo['pictureid'] . "\">{$albumname}</a>";
                } else {
                    $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}\">{$albumname}</a>";
                }
            }
            break;
        case 'album_upload':
            $userinfo['action'] = $vbphrase['uploading_pictures'];
            if ($canviewalbum) {
                $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}\">{$albumname}</a>";
            }
            break;
        case 'album_picture':
            $userinfo['action'] = $vbphrase['viewing_picture'];
            if ($canviewalbum) {
                if (!empty($userinfo['pictureid'])) {
                    $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}&amp;pictureid=" . $userinfo['pictureid'] . "\">{$albumname}</a>";
                } else {
                    $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}\">{$albumname}</a>";
                }
            }
            break;
        case 'album_album':
            $userinfo['action'] = $vbphrase['viewing_album'];
            if ($canviewalbum) {
                $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}\">{$albumname}</a>";
            }
            break;
        case 'album_user':
            $userinfo['action'] = $vbphrase['viewing_users_album'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "userid={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'album_unread_comments':
            $userinfo['action'] = $vbphrase['viewing_unread_picture_comments'];
            break;
        case 'album_moderated_comments':
            $userinfo['action'] = $vbphrase['viewing_picture_comments_awaiting_approval'];
            break;
        case 'picturecomment_posting':
            $userinfo['action'] = $vbphrase['posting_picture_comment'];
            break;
        case 'picturecomment_delete':
            $userinfo['action'] = $vbphrase['deleting_picture_comment'];
            break;
        case 'picturecomment_reporting':
            $userinfo['action'] = $vbphrase['reporting_picture_comment'];
            break;
        case 'picture_inlinemod':
            $userinfo['action'] = '<b><i>' . $vbphrase['moderating'] . '</i></b>';
            break;
        default:
            $handled = false;
            ($hook = vBulletinHook::fetch_hook('online_location_unknown')) ? eval($hook) : false;
            if ($handled == false) {
                if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinebad']) {
                    require_once DIR . '/includes/functions_login.php';
                    $userinfo['location'] = fetch_replaced_session_url(stripslashes($userinfo['location']));
                    $userinfo['where'] = "<a href=\"{$userinfo['location']}\">{$userinfo['location']}</a>";
                    $userinfo['action'] = '<b>' . $vbphrase['unknown_location'] . '</b>';
                } else {
                    // We were unable to parse the location
                    $userinfo['action'] = $vbphrase['viewing_index'];
                    $userinfo['where'] = '<a href="' . $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'] . '">' . $vbulletin->options['bbtitle'] . "</a>";
                }
            }
    }
    if ($userinfo['badlocation'] == 1) {
        // User received 'no permissions screen'
        if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinebad'] or $userinfo['userid'] == $vbulletin->userinfo['userid']) {
            $show['nopermission'] = true;
        } else {
            $userinfo['action'] = $vbphrase['viewing_index'];
            $userinfo['where'] = '<a href="' . $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'] . '">' . $vbulletin->options['bbtitle'] . "</a>";
        }
    } else {
        if ($userinfo['badlocation'] == 2) {
            // Forum is locked
            $show['lockedout'] = true;
        } else {
            if ($userinfo['badlocation'] == 3) {
                // User received error screen
                if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinebad'] or $userinfo['userid'] == $vbulletin->userinfo['userid']) {
                    $show['errormessage'] = true;
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                    $userinfo['where'] = '<a href="' . $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'] . '">' . $vbulletin->options['bbtitle'] . "</a>";
                }
            }
        }
    }
    if (!($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinelocation'])) {
        unset($userinfo['location']);
    }
    $userinfo['host_encoded'] = urlencode($userinfo['host']);
    if ($vbulletin->options['yestoday'] == 2) {
        $userinfo['time'] = vbdate($vbulletin->options['dateformat'], $userinfo['lastactivity'], 1);
    } else {
        $userinfo['time'] = vbdate($vbulletin->options['timeformat'], $userinfo['lastactivity']);
    }
    $wol_post['userid'] = $userinfo['userid'];
    $wol_post['username'] = $userinfo['realname'];
    ($hook = vBulletinHook::fetch_hook('online_bit_complete')) ? eval($hook) : false;
    if ($doall) {
        $show['loggedinuser'] = iif($userinfo['userid'], true, false);
        $show['buddy'] = iif($userinfo['buddy'], true, false);
        if ($userinfo['spider']) {
            $show['spider'] = true;
            if (!$userinfo['spidertype'] or !($spidertype = construct_phrase($vbphrase["x_spider_{$userinfo['spidertype']}"], $userinfo['spider']))) {
                $spidertype = construct_phrase($vbphrase['x_spider_searchspider'], $userinfo['spider']);
            }
        } else {
            $show['spider'] = false;
        }
        $show['reallocation'] = iif($userinfo['location'], true, false);
        $show['subscribed'] = iif($wol_thread["{$threadid}"]['issubscribed'] and $seetitle, true, false);
        $show['where'] = iif($userinfo['where'], true, false);
        eval('$onlinebits = "' . fetch_template('whosonlinebit') . '";');
        return $onlinebits;
    } else {
        return $userinfo;
    }
}
Example #28
0
                }
            }
        }
        if ($count) {
            $wrtlist[$count]['comma'] = '';
        }
        ($hook = vBulletinHook::fetch_hook('showthread_whoread_list')) ? eval($hook) : false;
    } else {
        $readers = $vbulletin->db->query_first_slave("\n\t\tSELECT COUNT(userid) AS whoread\n\t\t\tFROM " . TABLE_PREFIX . "contentread as whoread\n\t\t\tWHERE whoread.readtype = 'view'\n\t\t\tAND whoread.contentid = {$threadid}\n\t\t\tAND whoread.contenttypeid = {$contenttypeid}\n\t\t\tAND whoread.dateline > {$cutoff}\n\t\t");
        ($hook = vBulletinHook::fetch_hook('showthread_whoread_nonames')) ? eval($hook) : false;
        $wrt['trtotal'] = $readers['whoread'];
    }
    if (!$vbulletin->options['wrtlimit']) {
        $wrt['trtitle'] = construct_phrase($vbphrase['who_read_thread'], $wrt['trtotal']);
    } else {
        $wrt['trtitle'] = construct_phrase($vbphrase['who_read_thread_days'], $vbulletin->options['wrtlimit'], $wrt['trtotal']);
    }
    if ($vbulletin->options['wrtcollapse']) {
        $keys = explode(chr(10), $_COOKIE['vbulletin_collapse']);
        $collapse = array_fill_keys($keys, true);
        $wrt['style'] = 'style="display: none"';
        if (!array_key_exists('wrt_list', $collapse)) {
            $wrt['collapse'] = '_collapsed';
        }
    } else {
        $wrt['style'] = $wrt['collapse'] = '';
    }
    ($hook = vBulletinHook::fetch_hook('showthread_whoread_postlist')) ? eval($hook) : false;
}
// #############################################################################
// draw navbar
Example #29
0
            $totalattachments = vb_number_format($totalattachments);
            $show['attachlimit'] = $permissions['attachlimit'];
            $show['currentattachsize'] = $attachsize;
            $show['totalattachsize'] = $totalsize;
            $show['thumbnails'] = $showthumbs;
        }
    }
    $show['lightbox'] = ($vbulletin->options['lightboxenabled'] and $vbulletin->options['usepopups'] and $showthumbs);
    ($hook = vBulletinHook::fetch_hook('profile_editattachments_complete')) ? eval($hook) : false;
    if ($userid == $vbulletin->userinfo['userid']) {
        // show $vbulletin->userinfo's attachments in usercp
        construct_usercp_nav('attachments');
        $navbits[''] = construct_phrase($vbphrase['attachments_posted_by_x'], $vbulletin->userinfo['username']);
    } else {
        // show some other user's attachments
        $pagetitle = construct_phrase($vbphrase['attachments_posted_by_x'], $username);
        $navbits = array('member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$userid}" => $vbphrase['view_profile'], '' => $pagetitle);
        $shelltemplatename = 'GENERIC_SHELL';
    }
}
// #######################################################################
if ($_REQUEST['do'] == 'customize' or $_POST['do'] == 'docustomize') {
    if (!($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_profile_styling'])) {
        print_no_permission();
    }
    require_once DIR . '/includes/class_usercss.php';
    $selector_base = array('font_family' => '', 'font_size' => '', 'color' => '', 'background_color' => '', 'background_image' => '', 'border_style' => '', 'border_color' => '', 'border_width' => '', 'linkcolor' => '', 'shadecolor' => '', 'padding' => '', 'background_repeat' => '');
    $usercsspermissions = array('caneditfontfamily' => $vbulletin->userinfo['permissions']['usercsspermissions'] & $vbulletin->bf_ugp_usercsspermissions['caneditfontfamily'] ? true : false, 'caneditfontsize' => $vbulletin->userinfo['permissions']['usercsspermissions'] & $vbulletin->bf_ugp_usercsspermissions['caneditfontsize'] ? true : false, 'caneditcolors' => $vbulletin->userinfo['permissions']['usercsspermissions'] & $vbulletin->bf_ugp_usercsspermissions['caneditcolors'] ? true : false, 'caneditbgimage' => ($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_albums'] and $vbulletin->userinfo['permissions']['usercsspermissions'] & $vbulletin->bf_ugp_usercsspermissions['caneditbgimage']) ? true : false, 'caneditborders' => $vbulletin->userinfo['permissions']['usercsspermissions'] & $vbulletin->bf_ugp_usercsspermissions['caneditborders'] ? true : false);
    $usercss = new vB_UserCSS($vbulletin, $vbulletin->userinfo['userid']);
    $allowedfonts = $usercss->build_select_option($vbulletin->options['usercss_allowed_fonts']);
    $allowedfontsizes = $usercss->build_select_option($vbulletin->options['usercss_allowed_font_sizes']);
Example #30
0
// ###################### Start Show moderator list per forum #######################
if ($_REQUEST['do'] == 'showmods') {
    $forums = $db->query_read("\n\t\tSELECT moderator.moderatorid, user.userid, user.username, user.lastactivity, forum.forumid, forum.title\n\t\tFROM " . TABLE_PREFIX . "moderator AS moderator\n\t\tINNER JOIN " . TABLE_PREFIX . "forum AS forum ON (moderator.forumid = forum.forumid)\n\t\tINNER JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = moderator.userid)\n\t\t" . iif($vbulletin->GPC['forumid'], "WHERE moderator.forumid = " . $vbulletin->GPC['forumid']) . "\n\t\tORDER BY forum.title, user.username\n\t");
    if (!$db->num_rows($forums)) {
        define('CP_BACKURL', '');
        print_stop_message('this_forum_does_not_have_any_moderators');
    }
    print_form_header('', '');
    print_table_header($vbphrase['last_online'] . ' - ' . $vbphrase['color_key']);
    print_description_row('
		<div class="darkbg" style="border: 2px inset"><ul class="darkbg">
		<li class="modtoday">' . $vbphrase['today'] . '</li>
		<li class="modyesterday">' . $vbphrase['yesterday'] . '</li>
		<li class="modlasttendays">' . construct_phrase($vbphrase['within_the_last_x_days'], '10') . '</li>
		<li class="modsincetendays">' . construct_phrase($vbphrase['more_than_x_days_ago'], '10') . '</li>
		<li class="modsincethirtydays"> ' . construct_phrase($vbphrase['more_than_x_days_ago'], '30') . '</li>
		</ul></div>
	');
    print_table_footer();
    print_form_header('', '');
    print_table_header($vbphrase['moderators']);
    echo "<tr valign=\"top\">\n\t<td class=\"" . fetch_row_bgclass() . "\" colspan=\"2\">";
    echo "<div class=\"darkbg\" style=\"padding: 4px; border: 2px inset; text-align: {$stylevar['left']}\">";
    // get the timestamp for the beginning of today, according to bbuserinfo's timezone
    require_once DIR . '/includes/functions_misc.php';
    $unixtoday = vbmktime(0, 0, 0, vbdate('m', TIMENOW, false, false), vbdate('d', TIMENOW, false, false), vbdate('Y', TIMENOW, false, false));
    $list = array();
    $curforum = -1;
    if ($db->num_rows($forums)) {
        while ($forum = $db->fetch_array($forums)) {
            $modlist["{$forum['userid']}"]++;