• Welcome to Simple Machines Community Forum. Please login or sign up.
December 08, 2021, 09:04:07 AM

News:

SMF 2.1 RC4 has been released! Try it out and help us test! :) Read more.


Download System

Started by SMFHacks.com Team, October 31, 2007, 06:55:37 PM

Previous topic - Next topic

@rjen

Quote from: vbgamer45 on January 10, 2021, 08:52:10 PM
Quote from: @rjen on January 10, 2021, 01:49:50 PM
There is not file in the downloads with ID447 (not anymore).

It seems someone is visiting an old link to a file that has been removed. That's when the errors are logded.
The existing downloads work fine, no issues there...

Posted an update 3.0.8a  which should help try it out!

Thanks, that has fixed the errors.
Running SMF 2.0 with Tinyportal 2.1.0 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

vbgamer45

Glad that helped fix the issue!
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

@rjen

Here is the next error: when acessing a non-existing category the same thing happens...

https://www.my-forum.com/index.php?action=downloads;cat=31
8: Trying to access array offset on value of type null
File: /home/deb77453/domains/my-forum.com/public_html/Sources/Downloads2.php
Line: 5020


5011: $dbresult = $smcFunc['db_query']('', "
5012: SELECT
5013: total
5014: FROM {db_prefix}down_cat
5015: WHERE ID_CAT = $ID_CAT");
5016: $row = $smcFunc['db_fetch_assoc']($dbresult);
5017: $smcFunc['db_free_result']($dbresult);
5018:
5019: if ($row['total'] != -1)
==>5020: return $row['total'];
5021: else
Running SMF 2.0 with Tinyportal 2.1.0 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

vbgamer45

@rjen - did another update which added a check for categories that don't' exist.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

@rjen

That's fixed.

The error is not 100% accurate: "You need to select a category", maybe "Category does not exist" would be nicer, but this will do preventing the errors... thanks again...
Running SMF 2.0 with Tinyportal 2.1.0 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

vbgamer45

Yeah, just a quick fix you shouldn't ever see that unless. You delete a category and it was indexed by a search engine.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

vbgamer45

Update!
3.0.9
!Remove create_function for PHP 7.4+ support
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

gevv

Hi,

error message appears when adding new files and comments

New download:  Notice: Undefined index: show_bbc in /Themes/default/Downloads2.1.template.php on line 907

Comments:  Notice: Undefined index: show_bbc in /Themes/default/Downloads2.1.template.php on line 1738

smf 2.1 rc3  php 5.6
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

gevv

yes i said the latest version  (3.0.9) line number wrong

New download:  line 901
if ($context['show_bbc'])

Comments:   line 1732
if ($context['show_bbc'])
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

gevv

Also the category permissions section appears blank .  There are 5 categories. there are 2 files in one category
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

vbgamer45

3.0.9a
!Fixed $context['show_bbc'] error log for SMF 2.1.x



Also, did you setup custom category level permissions? If not it would be blank. You do that by clicking permissions link next to category
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

gevv

ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

gevv

Hello,

There is a problem with keywords. Link is added when leaving a blank space





ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

@rjen

Just installed the Mod version 3.0.9a on 2.1 RC4 and I got some SQL errors.

As it turns out there are a number of queries in the Downloads2.php file where this statement is used:

c.view IS NULL || c.view =1

This is giving the errors below:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '|| c.view =1)) AND p.views > 0 GROUP by p.ID_FILE
ORDER BY p.views DESC LIM...' at line 5

To fix, update all statements to:
c.view IS NULL OR c.view =1
Running SMF 2.0 with Tinyportal 2.1.0 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

vbgamer45

Ah, might be a MariaDB should change || to OR get confused between php/mysql sometimes it seems!!
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

shawnb61

I'd be curious if you have PIPES_AS_CONCAT set in your sql_mode for MariaDB...  If so, || is a string operator, not a logical OR...

If this is the case, this isn't unique to MariaDB, as any MySQL engine can have that flag set...
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

vbgamer45

Update!

3.0.10
!Removed || changed to OR in SQL statements for MariaDB
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

@rjen

When previous and next links are visited and the Id does not exist anymore I am getting some nasty errors in the logs...

Getting these errors:

https://xxx.xx/index.php?action=downloads;sa=next&id=3270
8: Trying to access array offset on value of type null
File: /home/deb77453/domains/xxx.xx/public_html/test/Sources/Downloads2.php
Line: 4574

https://xx.xx/index.php?action=downloads;sa=next&id=3270
Databasefout: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND approved = 1 AND ID_FILE > 3270
ORDER BY ID_FILE ASC LIMIT 1' at line 4
File: /home/deb77453/domains/xx.xx/public_html/test/Sources/Downloads2.php
Line: 4583

Cause seems to be that a non-existing id is called (most likely by a search engine revisiting an old link)
The functions PrevDownload and NextDownload do not like this...

I fixed it by inserting below fix in both functions in Downloads2.php file..


function Downloads_NextDownload()
{
global $txt, $smcFunc;

$id = (int) $_REQUEST['id'];
if (empty($id))
fatal_error($txt['downloads_error_no_file_selected']);

// Get the category
$dbresult = $smcFunc['db_query']('', "
SELECT
ID_FILE, ID_CAT
FROM {db_prefix}down_file
WHERE ID_FILE = $id  LIMIT 1");
$row = $smcFunc['db_fetch_assoc']($dbresult);

// Fix AW
if (empty($row['ID_CAT']))
fatal_error($txt['downloads_error_no_file_selected'], false);

$ID_CAT = $row['ID_CAT'];

$smcFunc['db_free_result']($dbresult);

// Get next download


Any chance to fix this in the core package?
Running SMF 2.0 with Tinyportal 2.1.0 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

vbgamer45

Fixed posted update

3.0.11
!Fixed bug previous/next links logging errors for downloads that were removed.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: