Example #1
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 #2
0
	public static function create_array($ids)
	{
		global $vbulletin;

		$set = $vbulletin->db->query_read_slave("
			SELECT announcementid, startdate, title, announcement.views, forumid,
				user.username, user.userid, user.usertitle, user.customtitle, user.usergroupid,
				IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
			FROM " . TABLE_PREFIX . "announcement AS announcement
			LEFT JOIN " . TABLE_PREFIX . "user AS user USING (userid)
			WHERE announcementid IN (" . implode(',', array_map('intval', $ids)) . ")
		");

		$items = array();
		while ($record = $vbulletin->db->fetch_array($set))
		{
			fetch_musername($record);
			$record['title'] = fetch_censored_text($record['title']);
			$record['postdate'] = vbdate($vbulletin->options['dateformat'], $record['startdate']);
			$record['statusicon'] = 'new';
			$record['views'] = vb_number_format($record['views']);
			$record['forumtitle'] = $vbulletin->forumcache["$record[forumid]"]['title'];
			$show['forumtitle'] = ($record['forumid'] == -1) ? false : true;

			$announcement = new vBForum_Search_Result_Announcement();
			$announcement->record = $record;
			$items[$record['announcementid']] = $announcement;
		}
		return $items;
	}
Example #3
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();
     }
 }
 /**
  * Verifies the title is valid and sets up the title for saving (wordwrap, censor, etc).
  *
  * @param	string	Title text
  *
  * @param	bool	Whether the title is valid
  */
 function verify_title(&$title)
 {
     // replace html-encoded spaces with actual spaces
     $title = preg_replace('/&#(0*32|x0*20);/', ' ', $title);
     $title = trim($title);
     if ($this->registry->options['titlemaxchars'] and $title != $this->existing['title']) {
         if (!empty($this->info['show_title_error'])) {
             if (($titlelen = vbstrlen($title)) > $this->registry->options['titlemaxchars']) {
                 // title too long
                 $this->error('title_toolong', $titlelen, $this->registry->options['titlemaxchars']);
                 return false;
             }
         } else {
             if (empty($this->info['is_automated'])) {
                 // not showing the title length error, just chop it
                 $title = vbchop($title, $this->registry->options['titlemaxchars']);
             }
         }
     }
     require_once DIR . '/includes/functions_newpost.php';
     // censor, remove all caps subjects, and htmlspecialchars title
     $title = fetch_no_shouting_text(fetch_censored_text($title));
     // do word wrapping
     $title = fetch_word_wrapped_string($title);
     return true;
 }
Example #5
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();
     }
 }
/**
* Prepares a picture array for thumbnail display.
*
* @param	array	Array of picture info
*
* @return	array	Array of picture info modified
*/
function prepare_pictureinfo_thumb($pictureinfo)
{
    global $vbulletin;
    $pictureinfo['caption_preview'] = fetch_censored_text(fetch_trimmed_title($pictureinfo['caption'], $vbulletin->options['album_captionpreviewlen']));
    $pictureinfo['dimensions'] = $pictureinfo['thumbnail_width'] ? "width=\"{$pictureinfo['thumbnail_width']}\" height=\"{$pictureinfo['thumbnail_height']}\"" : '';
    $pictureinfo['date'] = vbdate($vbulletin->options['dateformat'], $pictureinfo['dateline'], true);
    $pictureinfo['time'] = vbdate($vbulletin->options['timeformat'], $pictureinfo['dateline']);
    return $pictureinfo;
}
function mobiquo_chop($string)
{
    global $stylevar, $vbulletin;
    $string = preg_replace('/<br \\/\\>/', '', $string);
    $string = preg_replace('/(^\\s+)|(\\s+$)/', '', $string);
    $string = preg_replace('/\\n/', '', $string);
    $string = preg_replace('/\\r/', '', $string);
    $string = strip_quotes($string);
    $string = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($string, false, true), 200)));
    return $string;
}
Example #8
0
/**
* Prepares a picture array for thumbnail display.
*
* @param	array	Array of picture info
* @param	array	Container info (either for a group or album); changes thumbnail URL
*
* @return	array	Array of picture info modified
*/
function prepare_pictureinfo_thumb($pictureinfo, $displaytypeinfo)
{
    global $vbulletin;
    $pictureinfo['caption_preview'] = fetch_censored_text(fetch_trimmed_title($pictureinfo['caption'], $vbulletin->options['album_captionpreviewlen']));
    $pictureinfo['thumburl'] = $pictureinfo['thumbnail_filesize'] ? fetch_picture_url($pictureinfo, $displaytypeinfo, true) : '';
    $pictureinfo['dimensions'] = $pictureinfo['thumbnail_width'] ? "width=\"{$pictureinfo['thumbnail_width']}\" height=\"{$pictureinfo['thumbnail_height']}\"" : '';
    $pictureinfo['date'] = vbdate($vbulletin->options['dateformat'], $pictureinfo['dateline'], true);
    $pictureinfo['time'] = vbdate($vbulletin->options['dateformat'], $pictureinfo['dateline']);
    ($hook = vBulletinHook::fetch_hook('album_prepare_thumb')) ? eval($hook) : false;
    return $pictureinfo;
}
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
 /**
  * Verifies that the title is valid
  *
  * @param	String	Title
  *
  * @return 	boolean	Returns true if title is valid
  */
 function verify_title(&$title)
 {
     $title = fetch_censored_text($title);
     // replace html-encoded spaces with actual spaces
     $title = preg_replace('/&#(0*32|x0*20);/', ' ', $title);
     // do word wrapping
     if ($this->registry->options['wordwrap'] != 0) {
         $title = fetch_word_wrapped_string($title);
     }
     // remove all caps subjects
     require_once DIR . '/includes/functions_newpost.php';
     $title = fetch_no_shouting_text($title);
     $title = trim($title);
     if (empty($title)) {
         $this->error('invalid_title_specified');
         return false;
     }
     return true;
 }
Example #11
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 #12
0
 if (!$pages) {
     $pages = 1;
 }
 print_form_header('attachment', 'search', 0, 1);
 construct_hidden_code('prevsearch', $vbulletin->GPC['prevsearch']);
 construct_hidden_code('prunedate', $vbulletin->GPC['prunedate']);
 construct_hidden_code('pagenum', $vbulletin->GPC['pagenum']);
 print_table_header(construct_phrase($vbphrase['showing_attachments_x_to_y_of_z'], ($vbulletin->GPC['pagenum'] - 1) * $vbulletin->GPC['search']['results'] + 1, iif($vbulletin->GPC['search']['results'] * $vbulletin->GPC['pagenum'] > $attachments['count'], $attachments['count'], $vbulletin->GPC['search']['results'] * $vbulletin->GPC['pagenum']), $attachments['count']), 7);
 print_cells_row(array('<input type="checkbox" name="allbox" title="' . $vbphrase['check_all'] . '" onclick="js_check_all(this.form);" />', $vbphrase['filename'], $vbphrase['username'], $vbphrase['date'], $vbphrase['filesize'], $vbphrase['downloads'], $vbphrase['controls']), 1);
 $currentrow = 1;
 $attachmultiple = new vB_Attachment_Display_Multiple($vbulletin);
 $attachments = $attachmultiple->fetch_results(implode(" AND ", $query), false, ($vbulletin->GPC['pagenum'] - 1) * $vbulletin->GPC['search']['results'], $vbulletin->GPC['search']['results'], $vbulletin->GPC['search']['orderby'], $vbulletin->GPC['search']['ordering']);
 foreach ($attachments as $attachment) {
     $cell = array();
     $cell[] = "<input type=\"checkbox\" name=\"a_delete[]\" value=\"{$attachment['attachmentid']}\" tabindex=\"1\" />";
     $cell[] = "<p align=\"" . vB_Template_Runtime::fetchStyleVar('left') . "\"><a href=\"../attachment.php?" . $vbulletin->session->vars['sessionurl'] . "attachmentid={$attachment['attachmentid']}&amp;d={$attachment['dateline']}\">" . fetch_censored_text(htmlspecialchars_uni($attachment['filename'], false)) . '</a></p>';
     $cell[] = iif($attachment['userid'], "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;u={$attachment['userid']}\">{$attachment['username']}</a>", $attachment['username']);
     $cell[] = vbdate($vbulletin->options['dateformat'], $attachment['dateline']) . construct_link_code($vbphrase['view_content'], $attachmultiple->fetch_content_url($attachment, '../'), true);
     $cell[] = vb_number_format($attachment['filesize'], 1, true);
     $cell[] = $attachment['counter'];
     $cell[] = '<span class="smallfont">' . construct_link_code($vbphrase['edit'], "attachment.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;attachmentid={$attachment['attachmentid']}") . construct_link_code($vbphrase['delete'], "attachment.php?" . $vbulletin->session->vars['sessionurl'] . "do=delete&amp;attachmentid={$attachment['attachmentid']}") . '</span>';
     print_cells_row($cell);
     $currentrow++;
     if ($currentrow > $vbulletin->GPC['search']['results']) {
         break;
     }
 }
 print_description_row('<input type="submit" class="button" name="massdelete" value="' . $vbphrase['delete_selected_attachments'] . '" tabindex="1" />', 0, 7, '', 'center');
 $db->free_result($results);
 if ($pages > 1 and $vbulletin->GPC['pagenum'] < $pages) {
     print_table_footer(7, iif($vbulletin->GPC['pagenum'] > 1, "<input type=\"submit\" name=\"prev_page\" class=\"button\" tabindex=\"1\" value=\"{$vbphrase['prev_page']}\" accesskey=\"s\" />") . "\n<input type=\"submit\" name=\"next_page\" class=\"button\" tabindex=\"1\" value=\"{$vbphrase['next_page']}\" accesskey=\"s\" />");
Example #13
0
 // get highlight words
 $post['highlight'] =& $highlightwords;
 // get info from post
 $post = process_thread_array($post, $lastread["{$post['forumid']}"], $post['allowicons']);
 $show['disabled'] = ($managethread["{$post['postid']}"] or $managepost["{$post['postid']}"] or $approvepost["{$post['postid']}"] or $approveattachment["{$post['postid']}"]) ? false : true;
 $show['moderated'] = (!$post['visible'] or !$post['thread_visible'] and $post['postid'] == $post['firstpostid']) ? true : false;
 if ($post['pdel_userid']) {
     $post['del_username'] =& $post['pdel_username'];
     $post['del_userid'] =& $post['pdel_userid'];
     $post['del_reason'] = fetch_censored_text($post['pdel_reason']);
     $show['deleted'] = true;
 } else {
     if ($post['tdel_userid']) {
         $post['del_username'] =& $post['tdel_username'];
         $post['del_userid'] =& $post['tdel_userid'];
         $post['del_reason'] = fetch_censored_text($post['tdel_reason']);
         $show['deleted'] = true;
     } else {
         $show['deleted'] = false;
     }
 }
 if ($post['prefixid']) {
     $post['prefix_plain_html'] = htmlspecialchars_uni($vbphrase["prefix_{$post['prefixid']}_title_plain"]);
     $post['prefix_rich'] = $vbphrase["prefix_{$post['prefixid']}_title_rich"];
 } else {
     $post['prefix_plain_html'] = '';
     $post['prefix_rich'] = '';
 }
 $itemcount++;
 exec_switch_bg();
 ($hook = vBulletinHook::fetch_hook('search_results_postbit')) ? eval($hook) : false;
/**
 * Takes information regardign a group, and prepares the information within it
 * for display
 *
 * @param	array	Group Array
 * @param	bool	Whether to fetch group members and avatars
 *
 * @return	array	Group Array with prepared information
 *
 */
function prepare_socialgroup($group, $fetchmembers = false)
{
    global $vbulletin;
    if (!is_array($group)) {
        return array();
    }
    if ($fetchmembers) {
        $membersinfo = cache_group_members();
        $group['membersinfo'] = $membersinfo[$group['groupid']];
    }
    $group['joindate'] = !empty($group['joindate']) ? vbdate($vbulletin->options['dateformat'], $group['joindate'], true) : '';
    $group['createtime'] = !empty($group['createdate']) ? vbdate($vbulletin->options['timeformat'], $group['createdate'], true) : '';
    $group['createdate'] = !empty($group['createdate']) ? vbdate($vbulletin->options['dateformat'], $group['createdate'], true) : '';
    $group['lastupdatetime'] = !empty($group['lastupdate']) ? vbdate($vbulletin->options['timeformat'], $group['lastupdate'], true) : '';
    $group['lastupdatedate'] = !empty($group['lastupdate']) ? vbdate($vbulletin->options['dateformat'], $group['lastupdate'], true) : '';
    $group['visible'] = vb_number_format($group['visible']);
    $group['moderation'] = vb_number_format($group['moderation']);
    $group['members'] = vb_number_format($group['members']);
    $group['moderatedmembers'] = vb_number_format($group['moderatedmembers']);
    $group['categoryname'] = htmlspecialchars_uni($group['categoryname']);
    $group['discussions'] = vb_number_format($group['discussions']);
    $group['lastdiscussion'] = fetch_word_wrapped_string(fetch_censored_text($group['lastdiscussion']));
    $group['trimdiscussion'] = fetch_trimmed_title($group['lastdiscussion']);
    if (!($group['options'] & $vbulletin->bf_misc_socialgroupoptions['enable_group_albums'])) {
        // albums disabled in this group - force 0 pictures
        $group['picturecount'] = 0;
    }
    $group['rawpicturecount'] = $group['picturecount'];
    $group['picturecount'] = vb_number_format($group['picturecount']);
    $group['rawname'] = $group['name'];
    $group['rawdescription'] = $group['description'];
    $group['name'] = fetch_word_wrapped_string(fetch_censored_text($group['name']));
    if ($group['description']) {
        $group['shortdescription'] = fetch_word_wrapped_string(fetch_censored_text(fetch_trimmed_title($group['description'], 185)));
    } else {
        $group['shortdescription'] = $group['name'];
    }
    $group['mediumdescription'] = fetch_word_wrapped_string(fetch_censored_text(fetch_trimmed_title($group['description'], 1000)));
    $group['description'] = nl2br(fetch_word_wrapped_string(fetch_censored_text($group['description'])));
    $group['is_owner'] = $group['creatoruserid'] == $vbulletin->userinfo['userid'];
    $group['is_automoderated'] = ($group['options'] & $vbulletin->bf_misc_socialgroupoptions['owner_mod_queue'] and $vbulletin->options['sg_allow_owner_mod_queue'] and !$vbulletin->options['social_moderation']);
    $group['canviewcontent'] = (!($group['options'] & $vbulletin->bf_misc_socialgroupoptions['join_to_view']) or !$vbulletin->options['sg_allow_join_to_view'] or $group['membertype'] == 'member' or can_moderate(0, 'canmoderategroupmessages') or can_moderate(0, 'canremovegroupmessages') or can_moderate(0, 'candeletegroupmessages') or fetch_socialgroup_perm('canalwayspostmessage') or fetch_socialgroup_perm('canalwascreatediscussion'));
    $group['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $group['lastpost'], true);
    $group['lastposttime'] = vbdate($vbulletin->options['timeformat'], $group['lastpost']);
    $group['lastposterid'] = $group['canviewcontent'] ? $group['lastposterid'] : 0;
    $group['lastposter'] = $group['canviewcontent'] ? $group['lastposter'] : '';
    // check read marking
    //remove notice and make readtime determination a bit more clear
    if (!empty($group['readtime'])) {
        $readtime = $group['readtime'];
    } else {
        $readtime = fetch_bbarray_cookie('group_marking', $group['groupid']);
        if (!$readtime) {
            $readtime = $vbulletin->userinfo['lastvisit'];
        }
    }
    // get thumb url
    $group['iconurl'] = fetch_socialgroupicon_url($group, true);
    // check if social group is moderated to join
    $group['membermoderated'] = 'moderated' == $group['type'];
    // posts older than markinglimit days won't be highlighted as new
    $oldtime = TIMENOW - $vbulletin->options['markinglimit'] * 24 * 60 * 60;
    $readtime = max((int) $readtime, $oldtime);
    $group['readtime'] = $readtime;
    $group['is_read'] = $readtime >= $group['lastpost'];
    // Legacy Hook 'group_prepareinfo' Removed //
    return $group;
}
Example #15
0
			require_once(DIR . '/includes/class_floodcheck.php');
			$floodcheck = new vB_FloodCheck($vbulletin, 'user', 'emailstamp');
			$floodcheck->commit_key($vbulletin->userinfo['userid'], TIMENOW, TIMENOW - $vbulletin->options['emailfloodtime']);
			if ($floodcheck->is_flooding())
			{
				eval(standard_error(fetch_error('emailfloodcheck', $vbulletin->options['emailfloodtime'], $floodcheck->flood_wait())));
			}
		}

		($hook = vBulletinHook::fetch_hook('sendmessage_domailmember')) ? eval($hook) : false;

		$message = fetch_censored_text($vbulletin->GPC['message']);

		eval(fetch_email_phrases('usermessage', $userinfo['languageid']));

		vbmail($userinfo['email'], fetch_censored_text($vbulletin->GPC['emailsubject']), $message , false, $vbulletin->userinfo['email'], '', $vbulletin->userinfo['username']);

		// parse this next line with eval:
		$sendtoname = $userinfo['username'];

		eval(print_standard_redirect('redirect_sentemail'));
	}
}

/*======================================================================*\
|| ####################################################################
|| # 
|| # CVS: $RCSfile$ - $Revision: 35508 $
|| ####################################################################
\*======================================================================*/
?>
Example #16
0
 /**
  * Basic options to perform on all pagetext type fields
  *
  * @param	string	Page text
  *
  * @param	bool	Whether the text is valid
  * @param	bool	Whether to run the case stripper
  */
 function verify_pagetext(&$pagetext, $noshouting = true)
 {
     require_once DIR . '/includes/functions_newpost.php';
     $pagetext = preg_replace('/&#(0*32|x0*20);/', ' ', $pagetext);
     $pagetext = trim($pagetext);
     // remove empty bbcodes
     //$pagetext = $this->strip_empty_bbcode($pagetext);
     // add # to color tags using hex if it's not there
     $pagetext = preg_replace('#\\[color=(&quot;|"|\'|)([a-f0-9]{6})\\1]#i', '[color=\\1#\\2\\1]', $pagetext);
     // strip alignment codes that are closed and then immediately reopened
     $pagetext = preg_replace('#\\[/(left|center|right)\\]([\\r\\n]*)\\[\\1\\]#i', '\\2', $pagetext);
     // remove [/list=x remnants
     if (stristr($pagetext, '[/list=') != false) {
         $pagetext = preg_replace('#\\[/list=[a-z0-9]+\\]#siU', '[/list]', $pagetext);
     }
     // remove extra whitespace between [list] and first element
     // -- unnecessary now, bbcode parser handles leading spaces after a list tag
     //$pagetext = preg_replace('#(\[list(=(&quot;|"|\'|)([^\]]*)\\3)?\])\s+#i', "\\1\n", $pagetext);
     // censor main message text
     $pagetext = fetch_censored_text($pagetext);
     // parse URLs in message text
     if ($this->info['parseurl']) {
         $pagetext = convert_url_to_bbcode($pagetext);
     }
     // remove sessionhash from urls:
     require_once DIR . '/includes/functions_login.php';
     $pagetext = fetch_removed_sessionhash($pagetext);
     if ($noshouting) {
         $pagetext = fetch_no_shouting_text($pagetext);
     }
     require_once DIR . '/includes/functions_video.php';
     $pagetext = parse_video_bbcode($pagetext);
     return true;
 }
Example #17
0
/**
* Fetch the valid tags from a list. Filters are length, censorship, perms (if desired).
*
* @param	array			Array of existing thread info (including the existing tags)
* @param	string|array	List of tags to add (comma delimited, or an array as is). If array, ensure there are no commas.
* @param	array			(output) List of errors that happens
* @param	boolean		Whether to check the browsing user's create tag perms
* @param	boolean		Whether to expand the error phrase
*
* @return	array			List of valid tags
*/
function fetch_valid_tags($threadinfo, $taglist, &$errors, $check_browser_perms = true, $evalerrors = true)
{
    global $vbulletin;
    static $tagbadwords, $taggoodwords;
    $errors = array();
    if (!is_array($taglist)) {
        $taglist = split_tag_list($taglist);
    }
    if (!trim($threadinfo['taglist'])) {
        $existing_tags = array();
    } else {
        // this will always be delimited by a comma
        $existing_tags = explode(',', trim($threadinfo['taglist']));
    }
    if ($vbulletin->options['tagmaxthread'] and count($existing_tags) >= $vbulletin->options['tagmaxthread']) {
        $errors['threadmax'] = $evalerrors ? fetch_error('thread_has_max_allowed_tags') : 'thread_has_max_allowed_tags';
        return array();
    }
    if ($vbulletin->options['tagmaxlen'] <= 0 or $vbulletin->options['tagmaxlen'] >= 100) {
        $vbulletin->options['tagmaxlen'] = 100;
    }
    $valid_raw = array();
    // stop words: too common
    require DIR . '/includes/searchwords.php';
    // get the stop word list; allow multiple requires
    // filter the stop words by adding custom stop words (tagbadwords) and allowing through exceptions (taggoodwords)
    if (!is_array($tagbadwords)) {
        $tagbadwords = preg_split('/\\s+/s', vbstrtolower($vbulletin->options['tagbadwords']), -1, PREG_SPLIT_NO_EMPTY);
    }
    if (!is_array($taggoodwords)) {
        $taggoodwords = preg_split('/\\s+/s', vbstrtolower($vbulletin->options['taggoodwords']), -1, PREG_SPLIT_NO_EMPTY);
    }
    // merge hard-coded badwords and tag-specific badwords
    $badwords = array_merge($badwords, $tagbadwords);
    foreach ($taglist as $tagtext) {
        $tagtext = trim(preg_replace('#[ \\r\\n\\t]+#', ' ', $tagtext));
        if ($tagtext === '') {
            continue;
        }
        if (!in_array(vbstrtolower($tagtext), $taggoodwords)) {
            $char_strlen = vbstrlen($tagtext, true);
            if ($vbulletin->options['tagminlen'] and $char_strlen < $vbulletin->options['tagminlen']) {
                $errors['min_length'] = $evalerrors ? fetch_error('tag_too_short_min_x', $vbulletin->options['tagminlen']) : array('tag_too_short_min_x', $vbulletin->options['tagminlen']);
                continue;
            }
            if ($char_strlen > $vbulletin->options['tagmaxlen']) {
                $errors['max_length'] = $evalerrors ? fetch_error('tag_too_long_max_x', $vbulletin->options['tagmaxlen']) : array('tag_too_long_max_x', $vbulletin->options['tagmaxlen']);
                continue;
            }
            if (strlen($tagtext) > 100) {
                // only have 100 bytes to store a tag
                $errors['max_length'] = $evalerrors ? fetch_error('tag_too_long_max_x', $vbulletin->options['tagmaxlen']) : array('tag_too_long_max_x', $vbulletin->options['tagmaxlen']);
                continue;
            }
            $censored = fetch_censored_text($tagtext);
            if ($censored != $tagtext) {
                // can't have tags with censored text
                $errors['censor'] = $evalerrors ? fetch_error('tag_no_censored') : 'tag_no_censored';
                continue;
            }
            if (count(split_tag_list($tagtext)) > 1) {
                // contains a delimiter character
                $errors['comma'] = $evalerrors ? fetch_error('tag_no_comma') : 'tag_no_comma';
                continue;
            }
            if (in_array(strtolower($tagtext), $badwords)) {
                $errors['common'] = $evalerrors ? fetch_error('tag_x_not_be_common_words', $tagtext) : array('tag_x_not_be_common_words', $tagtext);
                continue;
            }
        }
        $valid_raw[] = $vbulletin->options['tagforcelower'] ? vbstrtolower($tagtext) : $tagtext;
    }
    // we need to essentially do a case-insensitive array_unique here
    $valid_unique = array_unique(array_map('vbstrtolower', $valid_raw));
    $valid = array();
    foreach (array_keys($valid_unique) as $key) {
        $valid[] = $valid_raw["{$key}"];
    }
    $valid_unique = array_values($valid_unique);
    // make the keys jive with $valid
    if ($valid) {
        $existing_sql = $vbulletin->db->query_read("\n\t\t\tSELECT tag.tagtext, IF(tagthread.tagid IS NULL, 0, 1) AS taginthread\n\t\t\tFROM " . TABLE_PREFIX . "tag AS tag\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "tagthread AS tagthread ON\n\t\t\t\t(tag.tagid = tagthread.tagid AND tagthread.threadid = " . intval($threadinfo['threadid']) . ")\n\t\t\tWHERE tag.tagtext IN ('" . implode("','", array_map(array(&$vbulletin->db, 'escape_string'), $valid)) . "')\n\t\t");
        if ($check_browser_perms and !($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cancreatetag'])) {
            // can't create tags, need to throw errors about bad ones
            $new_tags = array_flip($valid_unique);
            while ($tag = $vbulletin->db->fetch_array($existing_sql)) {
                unset($new_tags[vbstrtolower($tag['tagtext'])]);
            }
            if ($new_tags) {
                // trying to create tags without permissions. Remove and throw an error
                $errors['no_create'] = $evalerrors ? fetch_error('tag_no_create') : 'tag_no_create';
                foreach ($new_tags as $new_tag => $key) {
                    // remove those that we can't add from the list
                    unset($valid["{$key}"], $valid_unique["{$key}"]);
                }
            }
        }
        $vbulletin->db->data_seek($existing_sql, 0);
        // determine which tags are already in the thread and just ignore them
        while ($tag = $vbulletin->db->fetch_array($existing_sql)) {
            if ($tag['taginthread']) {
                // tag is in thread, find it and remove
                if (($key = array_search(vbstrtolower($tag['tagtext']), $valid_unique)) !== false) {
                    unset($valid["{$key}"], $valid_unique["{$key}"]);
                }
            }
        }
        $user_tags_remain = null;
        if ($vbulletin->options['tagmaxthread']) {
            // check global limit
            $user_tags_remain = $vbulletin->options['tagmaxthread'] - count($existing_tags) - count($valid);
        }
        if (!can_moderate($threadinfo['forumid'], 'caneditthreads')) {
            $my_tag_count_array = $vbulletin->db->query_first("\n\t\t\t\tSELECT COUNT(*) AS count\n\t\t\t\tFROM " . TABLE_PREFIX . "tagthread\n\t\t\t\tWHERE threadid = " . intval($threadinfo['threadid']) . "\n\t\t\t\t\tAND userid = " . $vbulletin->userinfo['userid']);
            $my_tag_count = $my_tag_count_array['count'] + count($valid);
            $tags_remain = null;
            if ($vbulletin->options['tagmaxstarter'] and $threadinfo['postuserid'] == $vbulletin->userinfo['userid']) {
                $tags_remain = $vbulletin->options['tagmaxstarter'] - $my_tag_count;
            } else {
                if ($vbulletin->options['tagmaxuser']) {
                    $tags_remain = $vbulletin->options['tagmaxuser'] - $my_tag_count;
                }
            }
            if ($tags_remain !== null) {
                $user_tags_remain = $user_tags_remain == null ? $tags_remain : min($tags_remain, $user_tags_remain);
            }
        }
        if ($user_tags_remain < 0) {
            $errors['threadmax'] = $evalerrors ? fetch_error('number_tags_add_exceeded_x', vb_number_format($user_tags_remain * -1)) : array('number_tags_add_exceeded_x', vb_number_format($user_tags_remain * -1));
            $allowed_tag_count = count($valid) + $user_tags_remain;
            if ($allowed_tag_count > 0) {
                $valid = array_slice($valid, 0, count($valid) + $user_tags_remain);
            } else {
                $valid = array();
            }
        }
    }
    return $valid;
}
Example #18
0
    if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) or !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads'])) {
        print_no_permission();
    }
    if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) and ($threadinfo['postuserid'] != $vbulletin->userinfo['userid'] or !$vbulletin->userinfo['userid'])) {
        print_no_permission();
    }
    $attachs = $db->query_read_slave("\n\t\tSELECT attachment.*\n\t\tFROM " . TABLE_PREFIX . "post AS post\n\t\tINNER JOIN " . TABLE_PREFIX . "attachment AS attachment ON (attachment.postid=post.postid AND attachment.visible=1)\n\t\tWHERE threadid = {$threadinfo['threadid']}\n\t\t\tAND post.visible = 1\n\t\tORDER BY filename DESC\n\t");
    if ($db->num_rows($attachs)) {
        require_once DIR . '/includes/functions_bigthree.php';
        while ($attachment = $db->fetch_array($attachs)) {
            // hide users in Coventry
            $ast = '';
            if (in_coventry($attachment['userid']) and !can_moderate($threadinfo['forumid'])) {
                continue;
            }
            $attachment['filename'] = fetch_censored_text(htmlspecialchars_uni($attachment['filename']));
            $attachment['attachmentextension'] = strtolower(file_extension($attachment['filename']));
            $attachment['filesize'] = vb_number_format($attachment['filesize'], 1, true);
            exec_switch_bg();
            eval('$attachments .= "' . fetch_template('attachmentbit') . '";');
        }
        ($hook = vBulletinHook::fetch_hook('misc_showattachments_complete')) ? eval($hook) : false;
        eval('print_output("' . fetch_template('ATTACHMENTS') . '");');
    } else {
        eval(standard_error(fetch_error('noattachments')));
    }
}
// ############################### start show avatars ###############################
if ($_REQUEST['do'] == 'showavatars') {
    $vbulletin->input->clean_array_gpc('r', array('pagenumber' => TYPE_UINT));
    ($hook = vBulletinHook::fetch_hook('misc_avatars_start')) ? eval($hook) : false;
Example #19
0
            } else {
                if (isset($simthread['preview']) and $vbulletin->options['threadpreview'] > 0) {
                    $simthread['preview'] = strip_quotes($simthread['preview']);
                    $simthread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode($simthread['preview'], false, true), $vbulletin->options['threadpreview']));
                }
            }
            $simthread['lastreplydate'] = vbdate($vbulletin->options['dateformat'], $simthread['lastpost'], true);
            $simthread['lastreplytime'] = vbdate($vbulletin->options['timeformat'], $simthread['lastpost']);
            if ($simthread['prefixid']) {
                $simthread['prefix_plain_html'] = htmlspecialchars_uni($vbphrase["prefix_{$simthread['prefixid']}_title_plain"]);
                $simthread['prefix_rich'] = $vbphrase["prefix_{$simthread['prefixid']}_title_rich"];
            } else {
                $simthread['prefix_plain_html'] = '';
                $simthread['prefix_rich'] = '';
            }
            $simthread['title'] = fetch_censored_text($simthread['title']);
            ($hook = vBulletinHook::fetch_hook('showthread_similarthreadbit')) ? eval($hook) : false;
            $templater = vB_Template::create('showthread_similarthreadbit');
            $templater->register('simthread', $simthread);
            $similarthreadbits .= $templater->render();
        }
    }
    if ($similarthreadbits) {
        $templater = vB_Template::create('showthread_similarthreads');
        $templater->register('similarthreadbits', $similarthreadbits);
        $similarthreads = $templater->render();
    } else {
        $similarthreads = '';
    }
    unset($similarthreadbits);
} else {
Example #20
0
 if (empty($vbulletin->GPC['message']) and $vbulletin->options['uimessage'] and !$nocontact) {
     $errors[] = 'nomessagetouser';
 }
 $pm['message'] =& $vbulletin->GPC['message'];
 $pm['parseurl'] =& $vbulletin->GPC['parseurl'];
 $pm['savecopy'] =& $vbulletin->GPC['savecopy'];
 $pm['signature'] =& $vbulletin->GPC['signature'];
 $pm['disablesmilies'] =& $vbulletin->GPC['disablesmilies'];
 $pm['receipt'] =& $vbulletin->GPC['receipt'];
 $pm['iconid'] =& $vbulletin->GPC['iconid'];
 // *************************************************************
 // PROCESS THE MESSAGE AND INSERT IT INTO THE DATABASE
 if ($vbulletin->userinfo['pmtotal'] >= $permissions['pmquota']) {
     $pm['savecopy'] = false;
 }
 $infraction = array('username' => unhtmlspecialchars($userinfo['username']), 'reason' => $infractionlevel['infractionlevelid'] ? fetch_phrase('infractionlevel' . $infractionlevel['infractionlevelid'] . '_title', 'infractionlevel', '', true, true, $userinfo['languageid']) : $vbulletin->GPC['customreason'], 'message' => fetch_censored_text($pm['message']), 'points' => $infdata->fetch_field('points'));
 $emailsubphrase = $infraction['points'] > 0 ? 'infraction_received' : 'warning_received';
 // if we have a specific post we can link to, link to it in the PM
 if (!empty($postinfo)) {
     if ($vbulletin->options['privallowbbcode']) {
         $infraction['post'] = '[post]' . $postinfo['postid'] . '[/post]';
     } else {
         $infraction['post'] = $vbulletin->options['bburl'] . "/showthread.php?p={$postinfo['postid']}#post{$postinfo['postid']}";
     }
     $emailphrase = $emailsubphrase . '_post';
     $infraction['pagetext'] =& $postinfo['pagetext'];
 } else {
     $infraction['post'] = '';
     $emailphrase = $emailsubphrase . '_profile';
 }
 eval(fetch_email_phrases($emailphrase, $userinfo['languageid'], $emailsubphrase));
Example #21
0
     if (!$pagenumber) {
         $pagenumber = 1;
     }
     $start = ($pagenumber - 1) * $perpage;
     $picturebits = '';
     $pictures = $vbulletin->db->query_read("\n\t\t\tSELECT SQL_CALC_FOUND_ROWS\n\t\t\t\tuser.*, albumpicture.dateline, albumpicture.albumid, album.title AS albumtitle\n\t\t\t\t" . ($vbulletin->options['avatarenabled'] ? ",avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,customavatar.width AS avwidth,customavatar.height AS avheight" : "") . "\n\t\t\t\t,picture.pictureid, picture.extension, picture.filesize, picture.idhash, picture.caption,\n\t\t\t\tpicture.thumbnail_filesize, picture.thumbnail_dateline, picture.thumbnail_width, picture.thumbnail_height\n\t\t\t\t{$hook_query_fields}\n\t\t\tFROM " . TABLE_PREFIX . "picture AS picture\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (picture.userid = user.userid)\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "albumpicture AS albumpicture ON (albumpicture.pictureid = picture.pictureid)\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "album AS album ON (album.albumid = albumpicture.albumid)\n\t\t\t" . ($vbulletin->options['avatarenabled'] ? "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)" : "") . "\n\t\t\t{$hook_query_joins}\n\t\t\tWHERE picture.state = 'moderation'\n\t\t\t\t{$datecut}\n\t\t\t\t{$hook_query_where}\n\t\t\tORDER BY {$sqlsortfield} {$sqlsortorder}\n\t\t\tLIMIT {$start}, {$perpage}\n\t\t");
     list($picturetotal) = $vbulletin->db->query_first("SELECT FOUND_ROWS()", DBARRAY_NUM);
     if ($start >= $picturetotal) {
         $pagenumber = ceil($picturetotal / $perpage);
     }
 } while ($start >= $picturetotal and $picturetotal);
 require_once DIR . '/includes/functions_album.php';
 $show['picture'] = true;
 while ($picture = $db->fetch_array($pictures)) {
     fetch_musername($picture);
     $picture['albumtitle'] = fetch_word_wrapped_string(fetch_censored_text($picture['albumtitle']));
     // $picture contains comment, picture, and album info
     $pictureinfo = prepare_pictureinfo_thumb($picture, $picture);
     eval('$picturebits .= "' . fetch_template('moderation_picturebit') . '";');
 }
 $pagenavbits = array("do=viewpics");
 if ($perpage != $vbulletin->options['vm_perpage']) {
     $pagenavbits[] = "pp={$perpage}";
 }
 if ($daysprune != ($vbulletin->userinfo['daysprune'] ? $vbulletin->userinfo['daysprune'] : 30)) {
     $pagenavbits[] = "daysprune={$daysprune}";
 }
 if ($sortfield != 'dateline') {
     $pagenavbits[] = "sortfield={$sortfield}";
 }
 if ($vbulletin->GPC['sortorder'] == 'asc') {
Example #22
0
 $perpage = $vbulletin->options['albums_perpage'];
 $total_pages = max(ceil($albumcount['total'] / $perpage), 1);
 // handle the case of 0 albums
 $pagenumber = $vbulletin->GPC['pagenumber'] > $total_pages ? $total_pages : $vbulletin->GPC['pagenumber'];
 $start = ($pagenumber - 1) * $perpage;
 $hook_query_fields = $hook_query_joins = $hook_query_where = '';
 ($hook = vBulletinHook::fetch_hook('album_user_query')) ? eval($hook) : false;
 // fetch data and prepare data
 $albums = $db->query_read("\n\t\tSELECT album.*,\n\t\t\tpicture.pictureid, picture.extension, picture.idhash,\n\t\t\tpicture.thumbnail_dateline, picture.thumbnail_width, picture.thumbnail_height\n\t\t\t{$hook_query_fields}\n\t\tFROM " . TABLE_PREFIX . "album AS album\n\t\tLEFT JOIN " . TABLE_PREFIX . "picture AS picture ON (album.coverpictureid = picture.pictureid AND picture.thumbnail_filesize > 0)\n\t\t{$hook_query_joins}\n\t\tWHERE album.userid = {$userinfo['userid']}\n\t\t\tAND album.state IN ('" . implode("', '", $state) . "')\n\t\t\t{$hook_query_where}\n\t\tORDER BY album.lastpicturedate DESC\n\t\tLIMIT {$start}, {$perpage}\n\t");
 $albumbits = '';
 while ($album = $db->fetch_array($albums)) {
     $album['picturecount'] = vb_number_format($album['visible']);
     $album['picturedate'] = vbdate($vbulletin->options['dateformat'], $album['lastpicturedate'], true);
     $album['picturetime'] = vbdate($vbulletin->options['timeformat'], $album['lastpicturedate']);
     $album['description_html'] = nl2br(fetch_word_wrapped_string(fetch_censored_text($album['description'])));
     $album['title_html'] = fetch_word_wrapped_string(fetch_censored_text($album['title']));
     $album['coverthumburl'] = $album['pictureid'] ? fetch_picture_url($album, $album, true) : '';
     $album['coverdimensions'] = $album['thumbnail_width'] ? "width=\"{$album['thumbnail_width']}\" height=\"{$album['thumbnail_height']}\"" : '';
     if ($album['state'] == 'private') {
         $show['personalalbum'] = true;
         $albumtype = $vbphrase['private_album_paren'];
     } else {
         if ($album['state'] == 'profile') {
             $show['personalalbum'] = true;
             $albumtype = $vbphrase['profile_album_paren'];
         } else {
             $show['personalalbum'] = false;
         }
     }
     if ($album['moderation'] and (can_moderate(0, 'canmoderatepictures') or $vbulletin->userinfo['userid'] == $album['userid'])) {
         $show['moderated'] = true;
Example #23
0
 /**
  *	Parses the appropriate template for contenttype that is to be updated on the calling window during an upload
  *
  * @param	array	Attachment information
  * @param	array	Values array pertaining to contenttype
  * @param	boolean	Disable template comments
  *
  * @return	string
  */
 public function process_display_template($attach, $values = array(), $disablecomment = true)
 {
     $attach['extension'] = strtolower(file_extension($attach['filename']));
     $attach['filename'] = fetch_censored_text(htmlspecialchars_uni($attach['filename'], false));
     $attach['filesize'] = vb_number_format($attach['filesize'], 1, true);
     $attach['imgpath'] = $this->fetch_imgpath($attach['extension']);
     $templater = vB_Template::create('newpost_attachmentbit');
     $templater->register('attach', $attach);
     return $templater->render($disablecomment);
 }
Example #24
0
 /**
  * Handles an [img] tag.
  *
  * @param	string	The text to search for an image in.
  * @param	string	Whether to parse matching images into pictures or just links.
  *
  * @return	string	HTML representation of the tag.
  */
 function handle_bbcode_img($bbcode, $do_imgcode, $has_img_code = false)
 {
     global $vbphrase;
     if ($has_img_code & BBCODE_HAS_ATTACH and preg_match_all('#\\[attach(?:=(right|left))?\\](\\d+)\\[/attach\\]#i', $bbcode, $matches)) {
         foreach ($matches[2] as $key => $attachmentid) {
             $align = $matches[1]["{$key}"];
             $search[] = '#\\[attach' . (!empty($align) ? '=' . $align : '') . '\\](' . $attachmentid . ')\\[/attach\\]#i';
             // attachment specified by [attach] tag belongs to this post
             if (!empty($this->attachments["{$attachmentid}"])) {
                 $attachment =& $this->attachments["{$attachmentid}"];
                 if (!$attachment['visible'] and $attachment['userid'] != $this->registry->userinfo['userid']) {
                     // Don't show inline unless the poster is viewing the post (post preview)
                     continue;
                 }
                 if ($attachment['thumbnail_filesize'] == $attachment['filesize'] and ($this->registry->options['viewattachedimages'] or $this->registry->options['attachthumbs'])) {
                     $attachment['hasthumbnail'] = false;
                     $forceimage = true;
                 }
                 $addtarget = $attachment['newwindow'] ? 'target="_blank"' : '';
                 /** doesn't need to be added to the link, should just be added to the image
                 				$addtarget .= !empty($align) ? " style=\"float: $align\" " : '';
                 				*/
                 $attachment['filename'] = fetch_censored_text(htmlspecialchars_uni($attachment['filename']));
                 $attachment['extension'] = strtolower(file_extension($attachment['filename']));
                 $attachment['filesize'] = vb_number_format($attachment['filesize'], 1, true);
                 $lightbox_extensions = array('gif', 'jpg', 'jpeg', 'jpe', 'png', 'bmp', 'tiff', 'tif');
                 switch ($attachment['extension']) {
                     case 'gif':
                     case 'jpg':
                     case 'jpeg':
                     case 'jpe':
                     case 'png':
                     case 'bmp':
                     case 'tiff':
                     case 'tif':
                     case 'psd':
                     case 'pdf':
                         if ($this->registry->options['attachthumbs'] and $attachment['hasthumbnail'] and $this->registry->userinfo['showimages'] and in_array($attachment['extension'], $lightbox_extensions)) {
                             // Display a thumbnail
                             $replace[] = "<a href=\"{$this->registry->options['bburl']}/attachment.php?{$this->registry->session->vars['sessionurl']}attachmentid=\\1&amp;d={$attachment['dateline']}\" rel=\"Lightbox\" id=\"attachment\\1\" {$addtarget}><img src=\"{$this->registry->options['bburl']}/attachment.php?{$this->registry->session->vars['sessionurl']}attachmentid=\\1&amp;thumb=1&amp;d={$attachment['thumbnail_dateline']}\" class=\"thumbnail\" border=\"0\" alt=\"" . construct_phrase($vbphrase['image_larger_version_x_y_z'], $attachment['filename'], $attachment['counter'], $attachment['filesize'], $attachment['attachmentid']) . "\" " . (!empty($align) ? " style=\"float: {$align}; margin: 2px\"" : 'style="margin: 2px"') . " /></a>";
                         } else {
                             if ($this->registry->userinfo['showimages'] and ($forceimage or $this->registry->options['viewattachedimages']) and !in_array($attachment['extension'], array('tiff', 'tif', 'psd', 'pdf'))) {
                                 // Display the attachment with no link to bigger image
                                 $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}; margin: 2px\"" : 'style="margin: 2px"') . " />";
                             } else {
                                 // Display a link
                                 $replace[] = "<a href=\"{$this->registry->options['bburl']}/attachment.php?{$this->registry->session->vars['sessionurl']}attachmentid=\\1&amp;d={$attachment['dateline']}\" {$addtarget}>{$attachment['filename']}</a>";
                             }
                         }
                         break;
                     default:
                         $replace[] = "<a href=\"{$this->registry->options['bburl']}/attachment.php?{$this->registry->session->vars['sessionurl']}attachmentid=\\1&amp;d={$attachment['dateline']}\" {$addtarget}>{$attachment['filename']}</a>";
                 }
             } else {
                 // Belongs to another post so we know nothing about it ... or we are not displying images so always show a link
                 $addtarget = (empty($this->attachments["{$attachmentid}"]) or $attachment['newwindow']) ? 'target="_blank"' : '';
                 /** doesn't need to be added to the link, should just be added to the image
                 				$addtarget .= !empty($align) ? " style=\"float: $align\" " : '';
                 				*/
                 $replace[] = "<a href=\"{$this->registry->options['bburl']}/attachment.php?{$this->registry->session->vars['sessionurl']}attachmentid=\\1" . (!empty($attachment['dateline']) ? "&amp;d={$attachment['dateline']}" : "") . "\" {$addtarget}>{$vbphrase['attachment']} \\1</a>";
             }
             // remove attachment from array
             if ($this->unsetattach) {
                 unset($this->attachments["{$attachmentid}"]);
             }
         }
         $bbcode = preg_replace($search, $replace, $bbcode);
     }
     // If you wanted to be able to edit [img] when editing a post instead of seeing the image, add the get_class() check from above
     if ($has_img_code & BBCODE_HAS_IMG) {
         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);
         } else {
             $bbcode = preg_replace('#\\[img\\]\\s*(https?://([^*\\r\\n]+|[a-z0-9/\\._\\- !]+))\\[/img\\]#iUe', "\$this->handle_bbcode_url(str_replace('\\\"', '\"', '\\1'), '')", $bbcode);
         }
     }
     if ($has_img_code & BBCODE_HAS_SIGPIC) {
         $bbcode = preg_replace('#\\[sigpic\\](.*)\\[/sigpic\\]#siUe', "\$this->handle_bbcode_sigpic('\\1')", $bbcode);
     }
     return $bbcode;
 }
Example #25
0
 while ($pm = $db->fetch_array($pms)) {
     $pmfolders["{$pm['folder']}"][] = $pm;
 }
 unset($pm);
 $db->free_result($pms);
 $txt = $vbulletin->options['bbtitle'] . ';' . $vbulletin->options['bburl'] . "\r\n";
 $txt .= construct_phrase($vbphrase['private_message_dump_for_user_x_y'], $vbulletin->userinfo['username'], vbdate($vbulletin->options['dateformat'] . ' ' . $vbulletin->options['timeformat'], TIMENOW)) . " -->\r\n\r\n";
 foreach ($pmfolders as $folder => $messages) {
     $foldername =& $foldernames["{$folder}"];
     $txt .= "################################################################################\r\n";
     $txt .= "{$vbphrase['folder']} :\t{$foldername}\r\n";
     $txt .= "################################################################################\r\n\r\n";
     foreach ($messages as $pm) {
         // turn all single \n into \r\n
         $pm['message'] = preg_replace("/(\r\n|\r|\n)/s", "\r\n", $pm['message']);
         $pm['message'] = fetch_censored_text($pm['message']);
         ($hook = vBulletinHook::fetch_hook('private_downloadpm_bit')) ? eval($hook) : false;
         $txt .= "================================================================================\r\n";
         $txt .= "{$vbphrase['dump_from']} :\t{$pm['fromuser']}\r\n";
         $txt .= "{$vbphrase['dump_to']} :\t" . fetch_touser_string($pm) . "\r\n";
         $txt .= "{$vbphrase['date']} :\t" . vbdate('Y-m-d H:i', $pm['datestamp'], false, false) . "\r\n";
         $txt .= "{$vbphrase['title']} :\t" . unhtmlspecialchars($pm['title']) . "\r\n";
         $txt .= "--------------------------------------------------------------------------------\r\n";
         $txt .= "{$pm['message']}\r\n\r\n";
     }
 }
 // download the file
 file_download($txt, str_replace(array('\\', '/'), '-', "{$vbphrase['dump_privatemessages']}-" . $vbulletin->userinfo['username'] . "-" . vbdate($vbulletin->options['dateformat'], TIMENOW) . '.txt'), 'text/plain');
 break;
 // *****************************
 // unknown download format
Example #26
0
 /**
  * Return title string for display
  *
  * If there is no title given, we'll construct one from the post text
  */
 public function get_display_title()
 {
     $title = $this->get_field('title');
     if ($title == '') {
         $title = fetch_trimmed_title(strip_bbcode($this->get_field('pagetext'), true, false, true), 50);
     } else {
         $title = fetch_censored_text($title);
     }
     return $title;
 }
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;
    }
}
 protected static function is_tag_valid($tagtext, &$errors)
 {
     $options = vB::getDatastore()->getValue('options');
     static $taggoodwords = null;
     static $tagbadwords = null;
     // construct stop words and exception lists (if not previously constructed)
     if (is_null($taggoodwords) or is_null($tagbadwords)) {
         // filter the stop words by adding custom stop words (tagbadwords) and allowing through exceptions (taggoodwords)
         if (!is_array($tagbadwords)) {
             $tagbadwords = preg_split('/\\s+/s', vbstrtolower($options['tagbadwords']), -1, PREG_SPLIT_NO_EMPTY);
         }
         if (!is_array($taggoodwords)) {
             $taggoodwords = preg_split('/\\s+/s', vbstrtolower($options['taggoodwords']), -1, PREG_SPLIT_NO_EMPTY);
         }
         // get the stop word list
         $badwords = vB_Api::instanceInternal("Search")->get_bad_words();
         // merge hard-coded badwords and tag-specific badwords
         $tagbadwords = array_merge($badwords, $tagbadwords);
     }
     if ($tagtext === '') {
         return false;
     }
     if (in_array(vbstrtolower($tagtext), $taggoodwords)) {
         return true;
     }
     $char_strlen = vbstrlen($tagtext, true);
     if ($options['tagminlen'] and $char_strlen < $options['tagminlen']) {
         $errors['min_length'] = array('tag_too_short_min_x', $options['tagminlen']);
         return false;
     }
     if ($char_strlen > $options['tagmaxlen']) {
         $errors['max_length'] = array('tag_too_long_max_x', $options['tagmaxlen']);
         return false;
     }
     if (strlen($tagtext) > 100) {
         // only have 100 bytes to store a tag
         $errors['max_length'] = array('tag_too_long_max_x', $options['tagmaxlen']);
         return false;
     }
     $censored = fetch_censored_text($tagtext);
     if ($censored != $tagtext) {
         // can't have tags with censored text
         $errors['censor'] = 'tag_no_censored';
         return false;
     }
     if (count(self::split_tag_list($tagtext)) > 1) {
         // contains a delimiter character
         $errors['comma'] = $evalerrors ? fetch_error('tag_no_comma') : 'tag_no_comma';
         return false;
     }
     if (in_array(strtolower($tagtext), $tagbadwords)) {
         $errors['common'] = array('tag_x_not_be_common_words', $tagtext);
         return false;
     }
     return true;
 }
Example #29
0
 while ($album = $db->fetch_array($profilealbums)) {
     $albums[$album['albumid']]['title'] = $album['title'];
     $albums[$album['albumid']]['pictures'][] = $album;
 }
 require_once DIR . '/includes/functions_album.php';
 foreach ($albums as $albumid => $info) {
     $picturebits = '';
     $show['backgroundpicker'] = true;
     $optionvalue = $albumid;
     // Need to shorten album titles here
     $optiontitle = "{$info['title']} (" . count($info['pictures']) . ")";
     $optionselected = empty($albumbits) ? 'selected="selected"' : '';
     eval('$albumbits .= "' . fetch_template('option') . '";');
     $show['hidediv'] = empty($picturerowbits) ? false : true;
     foreach ($info['pictures'] as $picture) {
         $picture['caption_preview'] = fetch_censored_text(fetch_trimmed_title($picture['caption'], $vbulletin->options['album_captionpreviewlen']));
         $picture['thumburl'] = $picture['thumbnail_filesize'] ? fetch_picture_url($picture, $picture, true) : '';
         $picture['dimensions'] = $picture['thumbnail_width'] ? "width=\"{$picture['thumbnail_width']}\" height=\"{$picture['thumbnail_height']}\"" : '';
         eval('$picturebits .= "' . fetch_template('modifyusercss_backgroundbit') . '";');
     }
     eval('$picturerowbits .= "' . fetch_template('modifyusercss_backgroundrow') . '";');
 }
 $show['albumselect'] = count($albums) == 1 ? false : true;
 $vbulletin->userinfo['cachedcss'] = $usercss->build_css($usercss->fetch_effective());
 $vbulletin->userinfo['cachedcss'] = str_replace('/*sessionurl*/', $vbulletin->session->vars['sessionurl_js'], $vbulletin->userinfo['cachedcss']);
 if ($vbulletin->userinfo['cachedcss']) {
     $userinfo = $vbulletin->userinfo;
     eval('$usercss_string = "' . fetch_template('memberinfo_usercss') . '";');
 } else {
     $usercss_string = '';
 }
Example #30
0
	/**
	* Prepare the text for display
	*/
	function process_text()
	{
		$this->message['message'] = $this->bbcode->parse(
			$this->message['pagetext'],
			'visitormessage',
			$this->message['allowsmilie']
		);
		$this->parsed_cache =& $this->bbcode->cached;

		if (!empty($this->message['del_reason']))
		{
			$this->message['del_reason'] = fetch_censored_text($this->message['del_reason']);
		}
	}