Back to vBulletin 3.0 Add-Ons

vB Journal | vba CMPS module: latest entries
Mod Version: 1.00, by Bolas

This modification is in the archives.
vB Version: 3.0.3 Rating: (0 vote - 0 average) Installs: 40
Released: 25 Sep 2004 Last Update: Never Downloads: 7
Not Supported  

This hack is for [vB 3.0.3] - vB Journal for vBulletin 3.0.3(v1.0.0) and [vB 3.0.3]

Hi,
this is the Brahm's vbindex conversion for vba CMPS: this module will show latest journal entries in a box in your CMPS system.

demo:
http://www.wellage.net

Here we go:

touch /path_to_your_forum_dir/modules/journalentries.php
-----------------------------------------
PHP Code:
<?php
// ######################### Latest Forum Topics #########################
$getlateste$DB_site->query("
            SELECT journal_entries.entrytitle,journal_entries.entrydate,
            journal_entries.entry_id,journal_entries.entrytext,
            journal_entries.journal_id,journals.journalist,journals.journalist_id
            FROM "
.TABLE_PREFIX."journal_entries AS journal_entries
            LEFT JOIN "
.TABLE_PREFIX."journals AS journals ON (journal_entries.journal_id=journals.journal_id)
            WHERE journal_entries.entry_active=1 AND journal_entries.private!=1 AND journals.private!=1
            ORDER BY journal_entries.entrydate DESC
            LIMIT 5
            "
);
            
$countlatest$DB_site->num_rows($getlateste);
            
$latestentrybits "";
            if(
$countlatest>0)
            {
                while(
$latest$DB_site->fetch_array($getlateste))
                {
                    
$latestentrydatevbdate($vboptions['dateformat'], $latest['entrydate'], 1);
                    
$latestentrytimevbdate($vboptions['timeformat'], $latest['entrydate']);
                    
exec_switch_bg();
                    if(
strlen($latest[entrytitle])>20)
                    {
                        
$latest[entrytitle]= "".substr($latest[entrytitle],0,20)."...";
                    }
                    if(
strlen($latest[entrytext])>150)
                    {
                        
$latest[entrytext]= "".substr($latest[entrytext],0,150)."...";
                    }
                    eval(
'$latestentrybits .= "' fetch_template('journal_latestentrybits') . '";');
                }
                
$DB_site->free_result($lastest);
            }
            else
            {
                
$latestentrybits=$vbphrase['adv_no_entries'];
            }


    eval(
'$home[$mods[\'modid\']][\'content\'] = "' fetch_template('adv_portal_latestjournalentry') . '";');

    
$DB_site->free_result($getlateste);
    unset(
$latestentrybits,$latest,$latestentrytime,$latestentrydate,$countlatest);

?>


then create template 'adv_portal_latestjournalentry'
-----------------------------------------
Code:
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<thead>
 <tr>
  <td class="tcat">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('cmps_pagesmenu')"><img id="collapseimg_cmps_pagesjournal" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_cmps_pagesjournal].gif" alt="" border="0" /></a>
    <span class="smallfont"><strong>$vbphrase[adv_latest_journalentries]</strong></span>
  </td>
 </tr>
</thead>
<tbody id="collapseobj_cmps_pagesjournal" style="$vbcollapse[collapseobj_cmps_pagesjournal];text-align:$stylevar[left]">
$latestentrybits
</tbody>
</table>
<br />


Now add 2 GLOBAL phrases:
$vbphrase[adv_latest_journalentries] = "Latest Journal Entries"
$vbphrase[adv_no_entries] = "No Journal Entries"

Then create a new module:
Module Title: Journal Latest Entries
File to include: journalentries.php
Active: yes... -.-'
Column: right|left
Templates Used: adv_portal_latestjournalentry, journal_latestentrybits

Have fun and don't forget to :-)

UPDATE (10/17/2004):
- added 2 modified version of 'journal_latestentrybits' for right|left or center block (thanx to Billbensen for center version) - see attachments [ billbensen__centered_block.txt]
- Valentino Rossi Wins! :devious:

UPDATE (10/20/2004):
- patched template collapse id, please change your old template with new version. (thx to memobug for debugging)


thx to
AN-net for his Journal hack
Brahm for the vBindex version of this module.
Billbensen for modified version of journal_latestentrybits template

Download

This modification is archived and cannot be downloaded.

Screenshots

 

Similar Mods

vBadvanced CMPS module: Random Journal vBulletin 3.5 Add-ons
Show latest journal entries on forum home vBulletin 3.5 Add-ons

vblts.ru supports vBulletin®, 2022-2024