Any idea on when the updated version will be out with the ability to exclude forums from this hack? I may take a stab at editing my forums to do this but if the update will be released soon I will just wait on that.
Quote:
Originally Posted by lnxtr
hi
i want to my user kontrol panel wiev
|
If you're asking to put this in your User Control Panel, I did this for my forums. (Hopefully Mistah Roth doesn't mind me posting this variation in here for people. If you do, feel free to have one of the staff delete this post.)
Create a plug in called:
Recent Posts in User CP
Hook Location:
usercp_complete
Plug in PHP Code:
PHP Code:
if ($vbulletin->userinfo['userid']) {
global $vbulletin;
$getposts = $db->query_read("SELECT distinct b.threadid FROM ". TABLE_PREFIX . "post a, ". TABLE_PREFIX . "thread b WHERE a.userid = " . $vbulletin->userinfo['userid'] . " AND b.visible = 1 AND a.threadid = b.threadid ORDER BY a.postid DESC LIMIT 5");
while($recentpost = $db->fetch_array($getposts)) {
$tid = $recentpost['threadid'];
$getthreadid = $db->query_read("SELECT * FROM ". TABLE_PREFIX . "thread WHERE threadid = $tid");
$rpthread = $db->fetch_array($getthreadid);
$rpthread['date'] = vbdate($vbulletin->options['dateformat'], $rpthread['lastpost'], 1);
$rpthread['time'] = vbdate($vbulletin->options['timeformat'], $rpthread['lastpost']);
$icon = fetch_iconinfo($rpthread['iconid']);
$rpthread['threadiconpath'] = $icon['iconpath'];
$rpthread['threadicontitle'] = $icon['title'];
$fid = $rpthread['forumid'];
$getforums = $db->query_read("SELECT title FROM ". TABLE_PREFIX . "forum WHERE forumid = $fid");
$rpforum = $db->fetch_array($getforums);
eval("\$recentpostbits .= \"".fetch_template('forumhome_recentpostbits')."\";");
}
if ($tid) $show['recentposts'] = 1;
}
In template
USERCP find:
Code:
<!-- ############## SUBSCRIBED THREADS ############## -->
Add
Above:
Code:
<!-- recent posts -->
<if condition="$show['recentposts']">
<p>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"><tbody>
<tr>
<td class="tcat" colspan="6">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_recentposts')"><img id="collapseimg_forumhome_recentposts" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_recentposts].gif" alt="" border="0" /></a>
My Recent Forums Posts
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_recentposts" style="$vbcollapse[collapseobj_forumhome_recentposts]">
<tr class="thead">
<td width="20"></td>
<td class="thead" width="40%"><b>Thread</b></td>
<td class="thead"><b>Last Post</b></td>
<td class="thead" align="center"><b>Replies</b></td>
<td class="thead" align="center"><b>Views</b></td>
<td class="thead" align="right"><b>Forum</b></td>
</tr>
$recentpostbits
</tbody>
</table>
<!-- /recent posts-->
</if>