PDA

View Full Version : [ADDON] cinq's vbArticles Latest Featured Articles on ForumHome


cinq
02-27-2005, 10:00 PM
A small addon to show the latest featured articles on your Forum Home page.
This add on is for cinq's vbArticles Hack v2.0 (https://vborg.vbsupport.ru/showthread.php?t=74189)

Hack version 1.0


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

1. In your 'FORUMHOME' template

FIND :

<!-- main -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">


ADD BELOW :

<!-- vbArticles Featured Articles -->
<thead>
<tr>
<td class="thead" colspan="5">
<span style="float:$stylevar[right]"><a href="articles.php">More articles here</a></span>
Featured Articles in the $vbphrase[vbarticles]
</td></tr>

<tr>
<td class="alt1" colspan="5">
<table cellpadding="$stylevar[cellpadding]" cellspacing="1" border="0" width="100%">
<tr>
$featuredbitonforumhome
</tr>
</table>
</td></tr>
</thead>
<!-- /vbArticles Featured Articles -->



2. Create a new template : 'vbArticles_featuredbitonforumhome'

<td valign="top" align="center" class="alt2" width="33%">
<br>$articonimg<br>
<a href="articles.php?action=viewarticle&artid=$artid">
<span class="smallfont"><b>$title</b></span></a>
<br>$starrating<br><br></td>



3. Make the following code changes to your forum index.php

FIND:

$specialtemplates = array(
'userstats',
'birthdaycache',
'maxloggedin',
'iconcache',
'eventcache',
'mailqueue'
);


REPLACE WITH:

$specialtemplates = array(
'userstats',
'birthdaycache',
'maxloggedin',
'iconcache',
'eventcache',
'mailqueue',
'vbart_options'
);


FIND:

require_once('./includes/functions_forumlist.php');


ADD BELOW:

$vbart_options = unserialize($datastore['vbart_options']);
unset($datastore['vbart_options']);



FIND :

// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###


ADD ABOVE :

########################### vbArticles Hack by cinq ##############################
$artquery = $DB_site->query("
SELECT a.title, a.articles_articleid, a.icon, SUM(r.rating) / COUNT(r.rating) avg
FROM " . TABLE_PREFIX . "articles_article a
LEFT JOIN " . TABLE_PREFIX . "articles_rating r
ON a.articles_articleid = r.articleid
WHERE a.featured=1
GROUP BY a.articles_articleid
ORDER BY RAND()
LIMIT ".$vbart_options['numfeaturedarticlehome']."
");

if($DB_site->num_rows($artquery)>0)
{
while($artlisting=$DB_site->fetch_array($artquery))
{
$artid=$artlisting['articles_articleid'];
$title=$artlisting['title'];
$articon=$artlisting["icon"];
$rated = round($artlisting['avg']);
$starrating ="<img src=\"$stylevar[imgdir_rating]/rating_".$rated.".gif\" alt=\"Rating: $rated/5\" border=\"0\">";
$articon = ereg_replace($vbart_options['vbartartimgpathab'].$artid.'/',"",$articon);
$articonimg = "<img title=\"".$title."\" src=\"articles.php?action=thumb&artid=".$artid."&id=".$articon."\" border=\"0\" width=".$vbart_options['vbartssthumbwidth'].">";
eval('$featuredbitonforumhome .= "' . fetch_template('vbArticles_featuredbitonforumhome' ) . '";');
}
}
########################### vbArticles Hack by cinq ##############################


Save and upload index.php


4. Done :)

- cinq

Deviant++
02-28-2005, 11:42 AM
yep worked :D ty

Creed
02-28-2005, 01:24 PM
Great, got my images back :) Although there is a typo in your info ;)

In the FORUMHOME template edit:

change this:Featured Articles in the $vbphrase[vbarticles]
to this:
Featured Articles in the $vbphrase[vbart_vbarticles]

kall
02-28-2005, 07:13 PM
Would be good .. but ..

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /usr/home/********/public_html/retreat/index.php on line 33
At a guess, you made an error in the edit of the specialtemplates bit.

Make sure it looks exactly like the example above.

TTG
02-28-2005, 07:16 PM
At a guess, you made an error in the edit of the specialtemplates bit.

Make sure it looks exactly like the example above.

sorry .. deleted my post at the same time as you posted .. found the error.

I have a few more items listed under "$specialtemplates = array(" and forgot to add "," :ermm:

shadiguy1
02-28-2005, 09:54 PM
installed perfectly. no problems.

i-Symbian.Com
03-01-2005, 12:32 AM
I have installed this perfectly but there is something I need your guys' assistance. I have included the screenshot in the attachment.

The Featured articles list is not displayed properly I think. It doesnt stretch like the forum. I marked the part with blue for your guys' reference.

Any assistance would be very appreciated. :-)

Cheers!

Creed
03-01-2005, 12:42 AM
in the FORUMHOME template edit find and change: colspan="5">
to:colspan="6">

There are two instances of this!

i-Symbian.Com
03-01-2005, 07:10 AM
@Creed,

Thanks for your instruction! It is displayed properly now :-) Thanks a million!!!

Creed
03-01-2005, 04:47 PM
No problem, glad I could help.

shadiguy1
03-05-2005, 01:06 PM
i noticed sinse installing this it always says alot of people are viewing aticles section even if there not . Any suggestions.

Paul M
03-05-2005, 03:38 PM
Curious, why have you released an addon to your own hack as a seperate hack in the addons section.

cinq
03-06-2005, 12:15 AM
I think this is the only way the addon gets linked to the main hack in the main hack thread's add-ons side bar ?

Correct me if I'm wrong ( i did ask this in the Site feedback section a while back ).

Creed
03-06-2005, 07:16 AM
Yup, that is correct :)

subnet_rx
04-01-2005, 05:44 PM
anyone want to post a demo of this?

RichieBoy67
04-05-2005, 07:23 PM
Yeah, screenshot please or demo??? I am waiting to install until I can see it...

Thanks

She Unlimited
04-12-2005, 09:51 AM
Would someone help me install this? Paid

mike.fro
06-01-2005, 03:12 AM
http://www.discusspromotion.com has it up (my site).

link:
http://www.discusspromotion.com/articles.php? is the hack.

She Unlimited
06-27-2005, 11:52 PM
index.php Which template do I go into to make these changes...(sorry a bit new to doing hacks myself).

Thank you

Also, how do I change the width to reflect the width of my Featured Articles now?

:nervous:

Marco van Herwaarden
06-28-2005, 07:15 AM
index.php is not a template but a file in either your forumhome, or your ./admincp directory (read hack instructions carefull to find out which to edit).