Back to vBulletin 3.0 Add-Ons

[ADDON] cinq's vbArticles Latest 3 Articles VBIndex Block
Mod Version: 1.0, by cinq

This modification is in the archives.
vB Version: 3.0.7 Rating: (0 vote - 0 average) Installs: 1
Released: 25 Feb 2005 Last Update: Never Downloads: 0
Not Supported  

A small addon to show the latest 3 articles on your VBIndex page.
This add on vbIndex module is for cinq's vbArticles Hack v2.0

Hack version 1.0
Based on Creed's posted addon here

Spoiler (click to open)



Close
, but amended slightly.

Install instructions
===========================================

1. Create a new template:

vbArticles_vbindex
Code:
<tr>
	<td class="$bgclass"><a href="articles.php?action=viewarticle&artid=$latestarticleid"><font size=2><b>$title</b></font></a> <br> <span class="smallfont"><b>Author:</b> <i>$author</i> <br> <b>Date: </b><i>$date</i></span>
	</td>
</tr>
2. Insert this code into one of your VBindex Custom Block Templates

adv_portal_articles
Code:
<table cellpadding="0" cellspacing="0" border="0" class="tborder" width="100%">
	<tr>
		<td>
			<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
				<thead>
				<tr>
					<td class="tcat" style="text-align: center">
						<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('vbindex_customblock$box')"><img id="collapseimg_vbindex_customblock$box" src="$stylevar[imgdir_button]/collapse_tcat$collapseimg_vbindex_customblock.gif" alt="" border="0" /></a>
						<strong><a href="articles.php">Latest Articles</a></strong>
					</td>
				</tr>
				</thead>
				<tbody id="collapseobj_vbindex_customblock$box" style="$collapseobj_vbindex_customblock">
				<tr>
					<td class="alt1">
						<div class="smallfont">$recentbit</div>
					</td>
				</tr>
				</tbody>
			</table>
		</td>
	</tr>
</table>
<br />
3. Next, perform the following file edit.
In your VBIndex.php file

FIND
PHP Code:
// ######################## CREATE WELCOME BOX ########################### 
ADD ABOVE
PHP Code:
# Latest articles block on VbIndex
$latestarticlesquery $DB_site->query("
        SELECT a.title, a.articles_articleid, a.publishdate, a.author
        FROM " 
TABLE_PREFIX "articles_article a
        LEFT JOIN " 
TABLE_PREFIX "articles_category c
        ON a.categoryid = c.articles_categoryid
        WHERE a.categoryid != '0' AND a.draft !='1'
        ORDER BY a.publishdate DESC
        LIMIT 3"
);

if(
$DB_site->num_rows($latestarticlesquery))
{
    while(
$latestarticlerow=$DB_site->fetch_array($latestarticlesquery))
    {
        
$latestarticleid=$latestarticlerow['articles_articleid'];
        
$title=$latestarticlerow['title'];
        
$date vbdate($vboptions['dateformat'],$latestarticlerow['publishdate'],true);
        
$author=$latestarticlerow['author'];
        
exec_switch_bg();
        eval(
'$recentbit .= "' fetch_template('vbArticles_vbindex') . '";');
      }

Save and upload VBINDEX.php, overwriting the old file.

4. Done !

===========================================

Enjoy
- cinq

Download

No files for download.

Similar Mods

[ADDON] cinq's vbArticles Latest 3 Featured Articles CMPS Module vBulletin 3.0 Full Releases
[ADDON] cinq's vbArticles Latest Featured Articles on ForumHome vBulletin 3.0 Full Releases
[Addon] cinq's vbArticles Hack v2.0 - Show number of articles per category vBulletin 3.0 Full Releases

vblts.ru supports vBulletin®, 2022-2024