Thread: Show Thread Enhancements - Latest x Threads by User
View Single Post
  #56  
Old 08-17-2009, 04:16 AM
Capt.Jack Capt.Jack is offline
 
Join Date: Feb 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice mod. Thank you.

I have set the result # to 0 to disable the display on showthread.
I have also excluded all but forumid #39 so that only results from it are displayed. I know there is a way to change the code to include only #39, but this was easy and will do for now.

Now, I would like to set the number of results for the members page to a very high number and paginate the results. Unfortunately, I've worked on this for hours and can't figure it out. Is there someone out there that can help me?

Here is an unedited copy of the plugin which controls the members block:

Code:
$blocklist = array_merge($blocklist, array(
		'lxt_memberinfo' => array(
		'class' => 'lxt_memberinfo',
		'title' => $vbphrase['lxt_threads_member'],
		'hook_location' => 'profile_left_middle_one'
	)
));

class vB_ProfileBlock_lxt_memberinfo extends vB_ProfileBlock
{
	var $template_name = 'memberinfo_block_lxt_memberinfo';

	function confirm_empty_wrap()
	{
		return false;
	}

	function confirm_display()
	{
		return ($this->block_data['lxt_memberinfo'] != '');
	}

	function prepare_output($id = '', $options = array())
	{
		global $stylevar, $db, $vbulletin, $vbphrase;

		$lxt_limit_member = $vbulletin->options['lxt_limit_number_member'];
		$trimthreadtitle = $vbulletin->options['lxt_trimthreadtitles'];
		$excludedforums = '';
		if ($vbulletin->options['lxt_exclude_forums'] !== '') {
			$excludedforums = ',' . $vbulletin->options['lxt_exclude_forums'];
		} 

		$excludedforums = substr($excludedforums, 1);

		if ($excludedforums != "") {
			$excludedforums = "AND thread.forumid NOT IN ($excludedforums)";
		}
        
		$get_lxts = $db->query_read_slave("
			SELECT
				thread.threadid, thread.title, thread.lastpost, thread.forumid, 
				thread.replycount, thread.lastposter, thread.dateline, thread.prefixid,
                IF(thread.views<=thread.replycount, thread.replycount+1, thread.views) AS views, 
				thread.visible, user.username, user.userid, user.usergroupid, 
				IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, 
				forum.title_clean as forum_title, post.pagetext AS preview, post.allowsmilie, post.postid 
				FROM " . TABLE_PREFIX . "thread AS thread
				LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.username = thread.lastposter)
				LEFT JOIN " . TABLE_PREFIX . "forum as forum ON (thread.forumid = forum.forumid)
				LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = thread.firstpostid)
				WHERE thread.visible = '1' AND post.visible = '1' AND thread.open!='10'
				AND thread.postuserid = " . intval ($vbulletin->GPC['userid']) . "
				$excludedforums 
				ORDER BY thread.dateline DESC 
				LIMIT $lxt_limit_member");

				if ($db->num_rows($get_lxts))
				{
				while ($get_lxt = $db->fetch_array($get_lxts))	{

				$fperms = fetch_permissions($get_lxt['forumid']);
				if (($fperms & $vbulletin->bf_ugp_forumpermissions['canview']) AND
					(($fperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) OR ($vbulletin->userinfo['userid'] != 0 AND $simthread['postuserid'] == $vbulletin->userinfo['userid']))
				)
					{
					if (isset($get_lxt['preview']) AND $vbulletin->options['ltx_threadpreview'] > 0)
					{
					$get_lxt['preview'] = strip_quotes($get_lxt['preview']);
					$get_lxt['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode($get_lxt['preview'], false, true), $vbulletin->options['ltx_threadpreview']));
					}
					if ($get_lxt['prefixid'])
					{
						$get_lxt['prefix_plain_html'] = htmlspecialchars_uni($vbphrase["prefix_$get_lxt[prefixid]_title_plain"]);
						$get_lxt['prefix_rich'] = $vbphrase["prefix_$get_lxt[prefixid]_title_rich"];
					}
					else
					{
						$get_lxt['prefix_plain_html'] = '';
						$get_lxt['prefix_rich'] = '';
					}
					$get_lxt[musername] = fetch_musername($get_lxt);
					$get_lxt[fullthreadtitle] = strip_tags($get_lxt[title]);
					if ($trimthreadtitle > 0)	{
						$get_lxt[titletrimmed] = fetch_trimmed_title($get_lxt[fullthreadtitle], $trimthreadtitle);
					}
					else	{
						$get_lxt[titletrimmed] = $get_lxt[fullthreadtitle];
					}
					$get_lxt[newpost] = ($get_lxt[lastpost] > $vbulletin->userinfo['lastvisit'])? 'new' : 'old';
					$get_lxt_forumtitle = strip_tags($vbulletin->forumcache["$get_lxt[forumid]"]['title_clean']);	
					$get_lxt_startdate = vbdate($vbulletin->options['dateformat'], $get_lxt[dateline]);
					$get_lxt_time = vbdate($vbulletin->options['timeformat'], $get_lxt[dateline]);
					eval('$lxt_memberinfo_bits .= "' . $vbulletin->templatecache['memberinfo_lxt_bits'] . '";');
					}
				}
				eval('$lxt_memberinfo_out .= "' . fetch_template('memberinfo_lxt') . '";');
				}	
				$db->free_result($get_lxts);

		$this->block_data['lxt_memberinfo'] = $lxt_memberinfo_out;
	}
}
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01050 seconds
  • Memory Usage 1,799KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete