WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.8 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.

Donate with PayPal buttonSpenden mit dem PayPal-Button

  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.13.x) »
  • General Help & Support »
  • most recent downloads and FAQ status
  • Print
Pages: [1]   Go Down

Author Topic: most recent downloads and FAQ status  (Read 16152 times)

Offline bupaje

  • Posts: 592
most recent downloads and FAQ status
« on: August 12, 2021, 11:44:17 PM »
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.
Logged

Offline dbs

  • Betatester
  • **
  • Posts: 8920
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: most recent downloads and FAQ status
« Reply #1 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: [Select]
<?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;
Logged
https://onkel-franky.de

Offline hgs

  • WebsiteBaker Org e.V.
  • **
  • Posts: 1892
    • EFG MG
Re: most recent downloads and FAQ status
« Reply #2 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?

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: [Select]
There was an uncatched exception
Call to a member function numRows() on null
in line (89) of (/modules/faqbaker/view.php)
php8 is written in the ErrorLog
Code: [Select]
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"


php7.4 is written in the ErrorLog
Code: [Select]
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:..')"



If someone can be found who wants to fix it, I can attach it here as zip.
« Last Edit: August 13, 2021, 11:56:48 AM by hgs »
Logged
LG Harald

"Fange nie an, aufzuhören - höre nie auf, anzufangen." Marcus Tullius Cicero (106-43 v.Chr.)

"Never begin to stop - never stop beginning." Marcus Tullius Cicero (106-43 BC)

Offline bupaje

  • Posts: 592
Re: most recent downloads and FAQ status
« Reply #3 on: August 13, 2021, 08:10:36 PM »
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 ...

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

Logged

Offline bupaje

  • Posts: 592
Re: most recent downloads and FAQ status
« Reply #4 on: August 13, 2021, 08:21:28 PM »
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?

To 2

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

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?

To 2

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

Thank you very much hgs.
Logged

Offline bupaje

  • Posts: 592
Re: most recent downloads and FAQ status
« Reply #5 on: August 17, 2021, 01:13:20 AM »
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: [Select]
<?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;

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.
« Last Edit: August 18, 2021, 09:53:49 AM by dbs »
Logged

Offline bupaje

  • Posts: 592
Re: most recent downloads and FAQ status
« Reply #6 on: August 17, 2021, 01:17:40 AM »
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
Logged

Offline hgs

  • WebsiteBaker Org e.V.
  • **
  • Posts: 1892
    • EFG MG
Re: most recent downloads and FAQ status
« Reply #7 on: August 17, 2021, 07:52:20 AM »
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.
Logged
LG Harald

"Fange nie an, aufzuhören - höre nie auf, anzufangen." Marcus Tullius Cicero (106-43 v.Chr.)

"Never begin to stop - never stop beginning." Marcus Tullius Cicero (106-43 BC)

Offline bupaje

  • Posts: 592
Re: most recent downloads and FAQ status
« Reply #8 on: August 17, 2021, 05:47:16 PM »
Thank you. I have PM'd you.
Logged

Offline dbs

  • Betatester
  • **
  • Posts: 8920
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: most recent downloads and FAQ status
« Reply #9 on: August 18, 2021, 09:51:48 AM »
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?
« Last Edit: August 18, 2021, 10:12:06 AM by dbs »
Logged
https://onkel-franky.de

Offline bupaje

  • Posts: 592
Re: most recent downloads and FAQ status
« Reply #10 on: August 18, 2021, 05:18:10 PM »
Quote from: dbs on August 18, 2021, 09:51:48 AM
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?

3.0.6 - thought that was latest?
Logged

Offline dbs

  • Betatester
  • **
  • Posts: 8920
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: most recent downloads and FAQ status
« Reply #11 on: August 18, 2021, 05:37:34 PM »
I don't know something about your installation.
Was the files added via DonwloadGallery or via Media or via FTP?
The wihite spaces are the problem.
Logged
https://onkel-franky.de

Offline bupaje

  • Posts: 592
Re: most recent downloads and FAQ status
« Reply #12 on: August 18, 2021, 09:10:30 PM »
Quote from: dbs on August 18, 2021, 05:37:34 PM
I don't know something about your installation.
Was the files added via DonwloadGallery or via Media or via FTP?
The white spaces are the problem.

Thanks I didn't realize. I think for now I will make slight modification to just list the files and put a link that takes people to download page to get file since that works. Once site is launched I will revisit this - the boss is in a hurry. I really appreciate your help. I will let you know when I start testing again.
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.13.x) »
  • General Help & Support »
  • most recent downloads and FAQ status
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2