Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[ADDON] cinq's vbArticles Latest 3 Articles VBIndex Block Details »»
[ADDON] cinq's vbArticles Latest 3 Articles VBIndex Block
Version: 1.0, by cinq cinq is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 02-24-2005 Last Update: Never Installs: 1
 
No support by the author.

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, 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

Show Your Support

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

Comments
  #2  
Old 02-25-2005, 06:01 AM
Creed's Avatar
Creed Creed is offline
 
Join Date: May 2002
Location: The Matrix
Posts: 281
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works like an absolute charm, sad thing is I made the same I just forgot after a fresh install of my board that the vbArticles_vbindex template didn't exist lol THX!!
Reply With Quote
  #3  
Old 03-23-2005, 06:00 PM
Moncal Moncal is offline
 
Join Date: Mar 2005
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great job thanks!
Reply With Quote
  #4  
Old 05-04-2005, 06:01 PM
flaregun flaregun is offline
 
Join Date: Aug 2004
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anyone help me out of modifing this code to show a small icon (50x50 or so) of the article's image left of the title?
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 03:13 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.03748 seconds
  • Memory Usage 2,242KB
  • Queries Executed 17 (?)
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
  • (2)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete