This is to help others that might want to use LDM to post on the portal like vbportal as a center block. It will display the latest uploads/links submitted. The code is 100% by Nitro at vbportal; I'm just copying it here so others might be able to use it as well.
Add a new php Center block in portalCP
Uses templates: Yes
Name: what you like
PHP Code:
global $db, $vboptions, $vbulletin, $vbphrase, $vbpoptions;
$link_query = $db->query_read("SELECT *
FROM " . TABLE_PREFIX . "local_linkslink
WHERE linkmoderate = 0
ORDER BY linkdate DESC LIMIT 20");
while ($linkinfo = $db->fetch_array($link_query))
{
$linkname = $linkinfo['linkname'];
$linkdate = date("d-m-y", $linkinfo['linkdate']);
$linkuser = $linkinfo['linkusername'];
$linksize = $linkinfo['linksize']/1000/1000;
$linkid = $linkinfo['linkid'];
{
if ($link_cats = $db->query_read("SELECT local_linkscat.catid, local_linkscat.catname FROM " . TABLE_PREFIX . "local_linkscat
LEFT JOIN " . TABLE_PREFIX . "local_linksltoc AS local_linksltoc ON local_linksltoc.catid = local_linkscat.catid
WHERE local_linksltoc.linkid = " . $linkid . ""));
{
while ($catinfo = $db->fetch_array($link_cats))
{
$linkcatid = $catinfo['catid'];
$linkcatname = $catinfo['catname'];
eval('$latestldm_new .= "' . fetch_template('P_ldm_new') . '";');
}
}
}
}
return <<<EOT
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr align="center">
<td class="thead"> </td><td class="thead">Name</td><td class="thead">Date</td><td class="thead">Submitter</td><td class="thead">Filesize</td><td class="thead">Categroy</td></tr>
<tr align="center">
$latestldm_new
</tr>
</table>
EOT;
$db->free_result($link_query, $link_cats);
PS ignore the "<?php BEGIN__VBULLETIN__CODE__SNIPPET " portion at the begining theres a bug in vb's php bbcode wrapper which does this its not supposed to be visible
Add a new template P_ldm_new
Code:
<tr><td width="20" class="alt1"><img src="$stylevar[imgdir_attach]/attach.gif" alt=""></td><td class="alt1">$linkname<br /><smallfont>Hits: $linkinfo[linkhits] Rating: $linkinfo[totrate]</smallfont></td><td class="alt2">$linkdate</td><td class="alt1">$linkuser</td><td class="alt2">$linksize MB</td><td class="alt1"><a href="$vbpoptions[bbdir]/local_links.php?catid=$linkcatid">$linkcatname</a></td></tr>
To change the amount listed first query "LIMIT 20" change the 20 to what you want
If you want to order by rating or hits first query again the "ORDER BY linkdate" change linkdate to linkhits for hit count or totrate for top rated.
I use it on my site and it works great. Thanks for working on that for me Nitro.