PDA


View Full Version : Latest Links on CMPS homepage?


ncangler
11-10-2005, 09:40 AM
This worked prior to vb 3.5. Brian do you have the setup changes to enable a "Latest Links" module to show up on a CMPS page in 3.5? Any help would be most appreciated. :)

Ramses
11-10-2005, 11:00 AM
http://www.vbadvanced.com/forum/showthread.php?t=10840

ncangler
11-10-2005, 04:14 PM
Doesn't work. I'll try to track it down later. I keep getting an Unexpected T-Variable error on the first line of the new code. BTW my /links directory is in the site root not the forum root. Here is what I have for latestlinks.php if anyone would be so kind as to take a look. :)

<?php
// ++=========================================================================++
// || vBadvanced CMPS 1.0.0 - Latest Links for vBa Links Directory ||
// || © 2003-2004 vBadvanced.com & PlurPlanet, LLC - All Rights Reserved ||
// || This file may not be redistributed in whole or significant part. ||
// || http://vbadvanced.com ||
// ++ ========================================================================++

// The order you would like to pull the links in.
// Enter 1 for newest, 2 for most viewed, 3 for most comments, 4 for highest rated
$order = 1;

// Enter the number of links you would like to display here
$limit = 4;

// The URL to your links directory with NO trailing slash '/'
$linkurl = 'http://www.triumphowners.net/links';

// Maximum characters of the links name before the rest will be replaced with '...'
// Set this to 0 to disable it.
$maxnamechars = 0;

// No further editing necessary


switch($order)
{
case 2:
$orderby = 'views DESC';
break;
case 3:
$orderby = 'posts DESC';
break;
case 4:
$votequery = 'IF(votenum >= ' . $vboptions['showvotes'] . ', votenum, 0) AS votenum, IF(votenum >= ' . $vboptions['showvotes'] . ' AND votenum> 0, votetotal / votenum, 0) AS voteavg,';
$orderby = 'voteavg DESC, votenum DESC';
break;
default:
$orderby = 'dateline DESC';
}

// Get private directories
if ($catinfo = unserialize($datastore['links_d_cache']))
{
$privcatids = array();
foreach ($catinfo as $cats)
{
if ($cats['private'])
{
$privcatids[] = $cats['catid'];
}
}
$privcats = 'AND links.catid NOT IN (' . implode(',', $privcatids) . ')';
}

$getlinks*=*$vbulletin->db->query("
********SELECT*$votequery*links.*,*links_categories.title*FROM*"*.*TABLE_PREFIX*.*"links*AS*links
********LEFT*JOIN*"*.*TABLE_PREFIX*.*"links_categories*AS*links_categories*ON*(links.catid*=*links_categories.catid)
********WHERE*valid*=*1*AND*suspended*=*0*$privcats
********ORDER*BY*$orderby
********LIMIT*$limit
");
while*($link*=*$vbulletin->db->fetch_array($getlinks))*
{
$link['catname'] = stripslashes($link['title']);
$link['name'] = fetch_trimmed_title(stripslashes($link['name']), $maxnamechars);
$link['username'] = stripslashes($link['username']);
$link['date'] = vbdate($vboptions['dateformat'], $link['dateline']);
$link['time'] = vbdate($vboptions['timeformat'], $link['dateline']);
$link['posts'] = number_format($link['posts']);
$link['replies'] = number_format($link['replies']);

$getbgrow = exec_switch_bg();
eval('$linkbits .= "' . fetch_template('adv_portal_linkbits') . '";');
}

$collapseobj_latestlinks = $vbcollapse['collapseobj_latestlinks'];
$collapseimg_latestlinks = $vbcollapse['collapseimg_latestlinks'];

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

?>

ncangler
11-10-2005, 04:15 PM
Well after posting that I can see the problem, but I'm not sure why my BBedit program has added those ****. I'll see if I can cut it out.

Randy

ncangler
11-10-2005, 04:36 PM
Fixed it. Apparently in copying the code change provided some garbage was added that I couldn't see in BBedit until saving as a text file and reopening.

trackpads
11-11-2005, 11:54 PM
Thanks for this! Works great!

ryans
12-27-2005, 08:02 PM
I get the same error message as he got. What's the identifier?

interfx
01-03-2006, 06:46 PM
I also can't make this work... Any other ideas? (VB3.5, VBa 2.0, VBlinks 1.01)

drewbe121212
10-23-2006, 12:42 PM
Here is a 3.6 Version for Links 2.0

http://www.vbadvanced.com/forum/showthread.php?t=18416