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

most recent downloads and FAQ status

(1/3) > >>

bupaje:
Hi again. A couple quick questions.

1 - Does anyone have a snippet of code they use to grab most recent items added to the download folder? I want to list 5 or so most recent downloads to the sidebar of the home page.


2 - I did a search in the modules section and didn't see the FAQ module - is that one dead?

Thanks very much.

dbs:
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 ---

hgs:

--- Quote from: bupaje on August 12, 2021, 11:44:17 PM ---
2 - I did a search in the modules section and didn't see the FAQ module - is that one dead?


--- End quote ---
To 2

The module in version 2.0.0 is unfortunately no longer executable. (php8)
It throws the following error on a white page.
Therefore it is not released for download.

--- Code: ---There was an uncatched exception
Call to a member function numRows() on null
in line (89) of (/modules/faqbaker/view.php)
--- End code ---
php8 is written in the ErrorLog

--- Code: ---Fri, 13 Aug 2021 05:37:38 +0000 [E_WARNING] /modules/faqbaker/view.php:[30]  from /framework/frontend.functions.php:[273] require "Undefined array key "header""
Fri, 13 Aug 2021 05:37:38 +0000 [E_WARNING] /modules/faqbaker/view.php:[31]  from /framework/frontend.functions.php:[273] require "Undefined array key "footer""
Fri, 13 Aug 2021 05:37:38 +0000 [E_WARNING] /modules/faqbaker/view.php:[32]  from /framework/frontend.functions.php:[273] require "Undefined array key "template_summary""
Fri, 13 Aug 2021 05:37:38 +0000 [E_WARNING] /modules/faqbaker/view.php:[33]  from /framework/frontend.functions.php:[273] require "Undefined array key "template_details""
Fri, 13 Aug 2021 05:37:38 +0000 [E_WARNING] /modules/faqbaker/view.php:[36]  from /framework/frontend.functions.php:[273] require "Undefined array key 1"
--- End code ---


php7.4 is written in the ErrorLog

--- Code: ---Fri, 13 Aug 2021 09:40:43 +0000 [E_WARNING] /modules/faqbaker/addon.php:[22]  from /modules/faqbaker/addon.php:[22] include "include(/www/htdocs/w01be3f2/WB_Testbereich/php7.4/WB_aktuell/modules/SimpleCommandDispatcher.inc): failed to open stream: No such file or directory"
Fri, 13 Aug 2021 09:40:43 +0000 [E_WARNING] /modules/faqbaker/addon.php:[22]  from /modules/faqbaker/addon.php:[22] include "include(): Failed opening '/www/htdocs/w01be3f2/WB_Testbereich/php7.4/WB_aktuell/modules/SimpleCommandDispatcher.inc' for inclusion (include_path='.:/usr/share/php:..')"
--- End code ---



If someone can be found who wants to fix it, I can attach it here as zip.

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 ...

--- End quote ---

Thank you dbs. The droplet returned nothing for me but the code in the code section works perfectly. I appreciate this very much.

bupaje:

--- Quote from: hgs on August 13, 2021, 11:46:38 AM ---
--- Quote from: bupaje on August 12, 2021, 11:44:17 PM ---
2 - I did a search in the modules section and didn't see the FAQ module - is that one dead?


--- End quote ---
To 2

The module in version 2.0.0 is unfortunately no longer executable. (php8)
It throws the following error ...

--- End quote ---


--- Quote from: hgs on August 13, 2021, 11:46:38 AM ---
--- Quote from: bupaje on August 12, 2021, 11:44:17 PM ---
2 - I did a search in the modules section and didn't see the FAQ module - is that one dead?


--- End quote ---
To 2

The module in version 2.0.0 is unfortunately no longer executable. (php8)...

--- End quote ---

Thank you very much hgs.

Navigation

[0] Message Index

[#] Next page

Go to full version