James Goddard
03-10-2005, 01:51 PM
This is a "fixed" version of dnoyeb2002's hack that removes the article image thumnail resize code.
The original hack hard coded the image paths and did not include category icons. This hack fixes that.
There are two reasons for removing this code: 1. It does not support GIF files. 2. Since the code uses the articles.php file to display the images it messes with the Who's online reporting whenever an article image is displayed in another script (eg CMPS).
In forums/articles.php:
Find:
$articon = ereg_replace($vbart_options['vbartartimgpathab'].$featuredid.'/',"",$articon);
$articonimg = "<img title=\"".$title."\" src=\"articles.php?action=thumb&artid=".$featuredid."&id=".$articon."\" border=\"0\" width=".$vbart_options['vbartssthumbwidth'].">";
Replace with:
$articonimg = '<img title="' . $title . '" src="' . $articon . '" border=0>';
Find:
$articon = ereg_replace($vbart_options['vbartartimgpathab'].$latestarticleid.'/',"",$articon);
$articonimg = "<img title=\"".$title."\" src=\"articles.php?action=thumb&artid=".$latestarticleid."&id=".$articon."\" border=\"0\" width=".$vbart_options['vbartssthumbwidth'].">";
Replace with:
$articonimg = '<img title="' . $title . '" src="' . $articon . '" border=0>';
Find:
$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'].">";
Replace with:
$articonimg = '<img title="' . $title . '" src="' . $articon . '" border=0>';
Find:
$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'].">";
Replace with:
$articonimg = '<img title="' . $title . '" src="' . $articon . '" border=0>';
Find:
$subcaticon = ereg_replace($vbart_options['vbartcatimgpathab'],"",$subcaticon);
$subcaticonimg = "<img title=\"".$subcatname."\" src=\"articles.php?action=thumbcat&id=".$subcaticon."\" border=\"0\" width=".$vbart_options['vbartssthumbwidth'].">";
Replace with:
$subcaticonimg = '<img title="' . $subcatname . '" src="' . $subcaticon . '" border=0>';
Find:
$caticonc = ereg_replace($vbart_options['vbartcatimgpathab'],"",$caticonc);
$caticonimgc = "<img title=\"".$catnamec."\" src=\"articles.php?action=thumbcat&id=".$caticonc."\" border=\"0\" width=".$vbart_options['vbartssthumbwidth'].">";
Replace with:
$caticonimgc = '<img title="' . $catname . '" src="' . $caticonc . '" border=0>';
If you are using the CMPS featured article hack make the following change to /forums/modules/cmps-articles.php:
Find:
$articon = ereg_replace($vbart_options['vbartartimgpathab'].$articleid.'/',"",$articon);
$articonimg = "<a href=\"$vboptions[bburl]/articles.php?action=viewarticle&artid=".$articleid."\"><img title=\"".$title."\" src=\"$vboptions[bburl]/articles.php?action=thumb&artid=".$articleid."&id=".$articon."\" border=\"0\" width=".$vbart_options['vbartssthumbwidth']."></a>";
Replace with:
$articonimg = '<a href="' . $vboptions[bburl] . '/articles.php?action=viewarticle&artid=' . $articleid . '"><img title="' . $title . '" src="' . $articon . '" border=0>';
James
The original hack hard coded the image paths and did not include category icons. This hack fixes that.
There are two reasons for removing this code: 1. It does not support GIF files. 2. Since the code uses the articles.php file to display the images it messes with the Who's online reporting whenever an article image is displayed in another script (eg CMPS).
In forums/articles.php:
Find:
$articon = ereg_replace($vbart_options['vbartartimgpathab'].$featuredid.'/',"",$articon);
$articonimg = "<img title=\"".$title."\" src=\"articles.php?action=thumb&artid=".$featuredid."&id=".$articon."\" border=\"0\" width=".$vbart_options['vbartssthumbwidth'].">";
Replace with:
$articonimg = '<img title="' . $title . '" src="' . $articon . '" border=0>';
Find:
$articon = ereg_replace($vbart_options['vbartartimgpathab'].$latestarticleid.'/',"",$articon);
$articonimg = "<img title=\"".$title."\" src=\"articles.php?action=thumb&artid=".$latestarticleid."&id=".$articon."\" border=\"0\" width=".$vbart_options['vbartssthumbwidth'].">";
Replace with:
$articonimg = '<img title="' . $title . '" src="' . $articon . '" border=0>';
Find:
$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'].">";
Replace with:
$articonimg = '<img title="' . $title . '" src="' . $articon . '" border=0>';
Find:
$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'].">";
Replace with:
$articonimg = '<img title="' . $title . '" src="' . $articon . '" border=0>';
Find:
$subcaticon = ereg_replace($vbart_options['vbartcatimgpathab'],"",$subcaticon);
$subcaticonimg = "<img title=\"".$subcatname."\" src=\"articles.php?action=thumbcat&id=".$subcaticon."\" border=\"0\" width=".$vbart_options['vbartssthumbwidth'].">";
Replace with:
$subcaticonimg = '<img title="' . $subcatname . '" src="' . $subcaticon . '" border=0>';
Find:
$caticonc = ereg_replace($vbart_options['vbartcatimgpathab'],"",$caticonc);
$caticonimgc = "<img title=\"".$catnamec."\" src=\"articles.php?action=thumbcat&id=".$caticonc."\" border=\"0\" width=".$vbart_options['vbartssthumbwidth'].">";
Replace with:
$caticonimgc = '<img title="' . $catname . '" src="' . $caticonc . '" border=0>';
If you are using the CMPS featured article hack make the following change to /forums/modules/cmps-articles.php:
Find:
$articon = ereg_replace($vbart_options['vbartartimgpathab'].$articleid.'/',"",$articon);
$articonimg = "<a href=\"$vboptions[bburl]/articles.php?action=viewarticle&artid=".$articleid."\"><img title=\"".$title."\" src=\"$vboptions[bburl]/articles.php?action=thumb&artid=".$articleid."&id=".$articon."\" border=\"0\" width=".$vbart_options['vbartssthumbwidth']."></a>";
Replace with:
$articonimg = '<a href="' . $vboptions[bburl] . '/articles.php?action=viewarticle&artid=' . $articleid . '"><img title="' . $title . '" src="' . $articon . '" border=0>';
James