Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=117)
-   -   [TSSE 5.x] Recent Threads (http://www.bvlist.com/showthread.php?t=2312)

Keiichi 30th March 2009 00:59

[TSSE 5.x] Recent Threads
 
1 Attachment(s)
upgrade new version plugin Recent Threads

latestthreads.php
PHP Code:

<?php
// Dont change for future reference.
if (!defined('TS_P_VERSION'))
{
    
define('TS_P_VERSION''1.2.0 by Keiichi');
}
// Security Check.
if (!defined('IN_PLUGIN_SYSTEM'))
{
    die(
"<font face='verdana' size='2' color='darkred'><b>Error!</b> Direct initialization of this file is not allowed.</font>");
}

// BEGIN Plugin: lastXforumposts
include_once(INC_PATH.'/readconfig_forumcp.php');
$_res_lt_query sql_query("SELECT fp.fid,f.fid FROM ".TSF_PREFIX."forumpermissions fp LEFT JOIN ".TSF_PREFIX."forums f ON (fp.fid=f.pid) WHERE (fp.canview = 'no' OR fp.cansearch = 'no') AND fp.gid = ".sqlesc(($CURUSER $CURUSER['usergroup'] : UC_USER)));
if (
mysql_num_rows($_res_lt_query) > 0)
{
    while (
$notin mysql_fetch_assoc($_res_lt_query))
        
$uf[] = 0+$notin['fid'];
    
$unsearchforums implode(','$uf);
}

        
$_res_lt_query sql_query("SELECT fid,password FROM ".TSF_PREFIX."forums WHERE password != ''");
if (
mysql_num_rows($_res_lt_query) > 0)
{
    while (
$notin mysql_fetch_assoc($_res_lt_query))
    {
        if (
ts_get_array_cookie("forumpass"$notin['fid']) != md5($CURUSER['id'].$notin['password']))
        {
            
$uf2[] = 0+$notin['fid'];
        }
    }
    if (
count($uf2) > 0)
    {
        if (
$unsearchforums)
            
$unsearchforums .= ','.implode(','$uf2);
        else
            
$unsearchforums implode(','$uf2);
    }
}
if(
$unsearchforums$where_sql " AND t.fid NOT IN ($unsearchforums)";        
$_res_lt_query sql_query("SELECT t.tid, t.iconid, t.subject, t.dateline, t.uid, t.username, t.replies, t.lastpost, t.lastposter, t.lastposteruid, t.views FROM ".TSF_PREFIX."threads t WHERE 1=1 {$where_sql} ORDER BY t.lastpost DESC LIMIT 0, ".$i_post_limit);
    {    
        
$latestthreads '

        <!-- begin lastXforumposts -->
    <table width="100%" border="0" cellspacing="0" cellpadding="5">                
                    <tr>
                        <td class="subheader" width="1%"></td>
                        <td class="subheader" align="left" width="50%">'
.$lang->index['topictitle'].'</td>
                        <td class="subheader" align="center" width="30%">'
.$lang->index['lastposter'].'</td>
                        <td class="subheader" align="center" width="5%">'
.$lang->index['replies'].'</td>
                        <td class="subheader" align="center" width="5%">'
.$lang->index['views'].'</td>
                    </tr>'
;        
        while(
$thread mysql_fetch_assoc($_res_lt_query))
        {

            
$latestthreads .= '
            <tr>
                <td align="left"><img src="./tsf_forums/images/icons/icon'
.$thread['iconid'].'.gif" border="0" class="inlineimg">
                <td align="left"><strong><style="padding-top: 6px;"><a href="'
.$BASEURL.'/tsf_forums/showthread.php?tid='.$thread['tid'].'" alt="'.htmlspecialchars_uni($thread['subject']).'" title="'.htmlspecialchars_uni($thread['subject']).'">'.cutename(htmlspecialchars_uni($thread['subject']), 50).'</a></strong> '.sprintf($lang->index['by'], '<a href="'.$BASEURL.'/userdetails.php?id='.$thread['uid'].'">'.$thread['username'].'</a>' ).''.my_datee($dateformat$thread['dateline']).' '.my_datee($timeformat$thread['dateline']).'</td>
                
                <td align="right">'
.my_datee($dateformat$thread['lastpost']).' '.my_datee($timeformat$thread['lastpost']).'&nbsp;'.sprintf($lang->index['by'], '<a href="'.$BASEURL.'/userdetails.php?id='.$thread['lastposteruid'].'">'.$thread['lastposter'].'</a>' ).'&nbsp;<a href="./tsf_forums/showthread.php?tid='.$thread['tid'].'&page=last"><img src="./tsf_forums/images/lastpost.gif" class="inlineimg" border="0" alt="'.$lang->index['last'].'" title="'.$lang->index['last'].'"></a></td>
                <td align="center"><strong>'
.ts_nf($thread['replies']).'</strong></td>
                <td align="center"><strong>'
.ts_nf($thread['views']).'</strong></td>
            </tr>'
;
        }
        
$latestthreads .= '</table><!-- end lastXforumposts -->';
    }
// END Plugin: lastXforumposts
?>


DrNet 30th March 2009 04:49

1 Attachment(s)
thanks Keiichi , i have updated it to work with TS v5.4 , If any1 need it, You can download it From Attachments

Note , Edit the number of threads in lastXforumposts_config.php ,



Best Regards

DrNet

Keiichi 6th April 2009 12:35

upgrade new version plugin Recent Threads

Keiichi

DrNet 6th April 2009 23:41

1 Attachment(s)
thanks m8 , i have updated it to work with v5.4

mcryow 28th October 2009 20:45

looks good just cant find the files 2 edit or should i say were bouts i upload them 2 :)

DAKz 9th January 2010 12:06

Nice mod this works great as a middle plugin. Thanks


All times are GMT +2. The time now is 14:52.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.