Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[HSVFORUM] My Thread Sidebar Block Details »»
[HSVFORUM] My Thread Sidebar Block
Version: 1.00, by achoo254 achoo254 is offline
Developer Last Online: Mar 2018 Show Printable Version Email this Page

Category: End-User Options - Version: 4.2.x Rating:
Released: 04-24-2013 Last Update: Never Installs: 9
Template Edits
Translations  
No support by the author.


This is tested and working

Step One: Create a Template
ACP > Style Manager > Add New Template
Title: block_mythread
Code:
<div class="widget_content blockbody floatcontainer">
		<ul id="block_newthreads_1" class="blockrow">
			<li class="avatarcontent floatcontainer widget_post_bit">
				<div class="widget_post_userinfo">
				
				<div class="cms_widget_post_useravatar widget_post_useravatar">
						<a class="smallavatar comments_member_avatar_link" href="member.php?7-tester3">
						<img width="30" title="" src="image.php?u={vb:raw userid}&type=thumb" alt="">
						</a>
				</div>
				
				</div>
				<div class="smallavatartext widget_post_comment">
					<h5 class="widget_post_header"><a href="showthread.php?{vb:raw threadid}" class="title">{vb:raw title}</a></h5>
					<div class="meta">
						
						 Posted By <a href="member.php?{vb:raw userid}">{vb:raw username}</a> ({vb:raw replycount} replies)
						<br><span class="time">{vb:raw dateline}</span> in <a href="forumdisplay.php?{vb:raw forumid}">{vb:raw forumtitle}</a>
						
					</div>
				</div>
			</li>
		</ul>
	</div>
Step Two: Create the Block
ACP > Forums & Moderators > Forum Blocks Manager > Add Block
Select Block Type: Custom HTML/PHP
Title: My Threads
Cache Time (in minutes): 1
Active: Yes
Content Type: PHP
Code:
global $vbulletin;
global $db;

	$sqlketnoi = $vbulletin->db->query_read("
	SELECT *
	FROM " . TABLE_PREFIX . "thread
	WHERE postuserid = ".$vbulletin->userinfo['userid']."
        ORDER BY threadid DESC 
        LIMIT 10 
	");	
while($thread = $vbulletin->db->fetch_array($sqlketnoi))
{
$threadid = $thread['threadid'];
$title = $thread['title'];
$userid = $thread['postuserid'];
$username = $thread['postusername'];
$replycount = $thread['replycount'];
$dateline = date("d/m/Y h:i:s",$thread['dateline']);

//forum name
	$sqlketnoi2 = $vbulletin->db->query_read("
	SELECT *
	FROM " . TABLE_PREFIX . "forum
	WHERE forumid = ".$thread['forumid']."
	");	
	while($forum = $vbulletin->db->fetch_array($sqlketnoi2))
	{
		$forumtitle = $forum['title'];
		$forumid = $forum['forumid'];
			
	}
	// print everything 
		$templater = vB_Template::create('block_mythread');
		$templater->register('threadid', $threadid);
		$templater->register('title', $title);
		$templater->register('userid', $userid);
		$templater->register('username', $username);
		$templater->register('replycount', $replycount);
		$templater->register('dateline', $dateline);
		$templater->register('forumid', $forumid);
		$templater->register('forumtitle', $forumtitle);	
		$content .= $templater->render();		
}
return $content;
Done !

Screenshots

File Type: jpg demo.jpg (67.7 KB, 0 views)
File Type: png demo2.png (47.7 KB, 0 views)

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-25-2013, 03:15 AM
hoangserip's Avatar
hoangserip hoangserip is offline
 
Join Date: Jun 2009
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks đang t?m c?i n?y, giống svit
Reply With Quote
  #3  
Old 04-25-2013, 03:42 AM
hoangserip's Avatar
hoangserip hoangserip is offline
 
Join Date: Jun 2009
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

b?c l?n giới hạn đề t?i nữa nh?

Code:
WHERE postuserid = ".$vbulletin->userinfo['userid']."
LIMIT 5
Change Limit

sorry, i'm bad english
Reply With Quote
  #4  
Old 04-25-2013, 04:38 AM
Thangvip9x Thangvip9x is offline
 
Join Date: Apr 2012
Location: Yen Bai, Vietnam
Posts: 106
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, but not use
Reply With Quote
  #5  
Old 04-29-2013, 05:06 PM
lazytown lazytown is offline
 
Join Date: Feb 2004
Posts: 503
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What exactly does this do?? List the last few threads a user created or posted in?
Reply With Quote
  #6  
Old 06-08-2013, 04:40 PM
matman67 matman67 is offline
 
Join Date: Jan 2011
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you please help me re-sort these so that the NEWEST are on TOP instead of at the bottom?

Thanks,
Reply With Quote
  #7  
Old 06-10-2013, 04:01 AM
achoo254's Avatar
achoo254 achoo254 is offline
 
Join Date: Mar 2012
Location: Vietnam
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Find:
Code:
	$sqlketnoi = $vbulletin->db->query_read("
	SELECT *
	FROM " . TABLE_PREFIX . "thread
	WHERE postuserid = ".$vbulletin->userinfo['userid']."
	");
Change to:
Code:
	$sqlketnoi = $vbulletin->db->query_read("
	SELECT *
	FROM " . TABLE_PREFIX . "thread
	WHERE postuserid = ".$vbulletin->userinfo['userid']."
        ORDER BY threadid DESC 
        LIMIT 10 
	");
Reply With Quote
  #8  
Old 06-12-2013, 09:36 AM
Yucar Yucar is offline
 
Join Date: Jun 2013
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not works for me
Reply With Quote
  #9  
Old 03-07-2014, 05:12 PM
mikez006 mikez006 is offline
 
Join Date: Mar 2008
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Avatars don't display, Im not sure why "member.php?7-tester3" is in the template code, but that doesn't seem right.

How can I include posts, not just threads?
Reply With Quote
  #10  
Old 05-14-2014, 01:22 PM
kushal kushal is offline
 
Join Date: May 2006
Posts: 106
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yea, avatar does not display
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:15 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05356 seconds
  • Memory Usage 2,317KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete