vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   [ADDON] cinq's vbArticles Latest 3 Articles VBIndex Block (https://vborg.vbsupport.ru/showthread.php?t=77006)

cinq 02-24-2005 10:00 PM

[ADDON] cinq's vbArticles Latest 3 Articles VBIndex Block
 
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

Creed 02-25-2005 06:01 AM

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

Moncal 03-23-2005 06:00 PM

Great job thanks!

flaregun 05-04-2005 06:01 PM

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?


All times are GMT. The time now is 08:40 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01094 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete