WebsiteBaker Support (2.13.x) > General Help & Support

most recent downloads and FAQ status

<< < (2/3) > >>

bupaje:

--- Quote from: dbs on August 13, 2021, 09:20:02 AM ---Hi, for latest Downloads you can use this attached droplet.
Instal it via Admin-Tools > Droplets > Import Selected Drolet
and use then this call in html: [[latest-downloads?limit=5]]

or try the droplet code in a code or code2 section.
--- Code: ---<?php //not this first line. only for colored code here

global $wb, $database;
$header = "<h3>Last Downloads</h3>";
$limit = ($limit)?:'3';  
$sort = isset($sort) ? $sort :'DESC'; // DESC = Newest first

$sqlFiles = 'SELECT * FROM `'.TABLE_PREFIX.'mod_download_galler y_files` WHERE `active` = 1 ORDER BY `modified_when` '.$sort.' LIMIT ' . $limit;
$oRes = $database->query($sqlFiles);

$html = '<div id="last-downloads">' . $header;

if ($oFiles = $database->query($sqlFiles)) {

$html .= '<ul>';
    while ($aFiles = $oRes->fetchRow(MYSQLI_ASSOC)) {
        $changedate= date("d.m.y ", $aFiles['modified_when']) . '<br />';
        $title = $aFiles['title'];
        $desc = "<br /><small>".$aFiles['description']."</small>";
        //$root = $aFiles['root_parent'];
        $weblink = $aFiles['link'];
    
        $html .=  "<li>"
              .   $changedate
              .   "<span><a title=\"Download: ".$title."\" href=\"".$weblink."\"> " . $title . " </a></span>"
              . $desc 
              . "</li>";
    }
$html .= '</ul>';
} else {
    $html .= 'No results';
}
$html .= "</div>";

echo $html;

--- End code ---

--- End quote ---

Can I ask for a little more help? The download page is elsewhere. The latest news is on the home page. I guess I need to modify the code to ask for the id for the downloads page? I was getting some results as I placed another download in the sidebar of the home page initially but when I remove that one then the code you gave I guess is unaware of the location of the other download page. Thank you.

bupaje:
Arggghh. I goofed but found another error - I failed to remove a space when I tried to fix the following error. Now the news title and link shows but the link goes to a wrong page

https://www.mytestsite.com/download_gallery/5%20Gallon%20Door%20Restore%20Express%20-%20Square%20V3%20(Cardinal).pdf but the link on the downloads page that does work is

https://www.mytestsite.com/modules/download_gallery/dlc.php?id=0811A32

Thanks for any help.

Burt

hgs:
Unfortunately, we can't do anything with the linked pages.

Can you send us the correct links, gladly also as pm. Then we can possibly look a little more closely.

bupaje:
Thank you. I have PM'd you.

dbs:
Hello, i saw the link from your pn.

Your download links contains white spaces. This is not the way how DownloadGallery save new files.
What is your version of Download Gallery?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version