Quote:
Originally Posted by Ophelia
Hi Andrew.
We would like to add to Joomla the function of showing the most recently added thing to a category.
I have a module installed now that allows you to just copy/paste PHP, HTML, JS, CSS into it and it will show the code in that module. Is there specific code that I can use that will grab either the text link or the image from the most recently added item to a category?
Thank you Andrew!
|
If I understand correctly, a php file in your main forums directory (let's call it ldmgrabber.php) with this content:
PHP Code:
<?php
require_once('./global.php');
require_once(DIR . '/includes/local_links_init.php');
require_once(DIR . '/includes/local_links_include.php');
require_once(DIR . '/includes/local_links_vbafunc.php');
$pagenumber = max(intval($_REQUEST['ldmnew']), 1);
$filter = array("link.linkmoderate = 0");
$order = "linkdate DESC ";
$show_catname = 1;
list ($links, $nhits, $q) =
ldm_vba_links($filter, 0, $order, "adv_portal_custom_ldm_new_one",
"",
10, // number of entries to show
1, // entries per line
0,
1);
$collapseobj_custom_ldm_hot = $vbcollapse['collapseobj_custom_ldm_new'];
$collapseimg_custom_ldm_hot = $vbcollapse['collapseimg_custom_ldm_new'];
eval('$content .= "' . fetch_template('adv_portal_custom_ldm_new') . '";');
unset($filter, $order, $links, $nhits, $q, $collapseobj_custom_ldm_hot, $collapseimg_custom_ldm_hot);
echo "<table>$content</table>";
?>
then do a call to yourforum/ldmgrabber.php
This will deliver a table set out rather like the block in vbadvanced (actually, this is pretty well the code for the vbadvanced module).