Jump to content


[Olate Download Bug]Child Category counts disabled files


2 replies to this topic

#1 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 02 February 2006 - 01:24 PM

There is a bug in Olate Download 3.4.0 in which disabled files are counted in the Child Category file count.


Here is the fix I came up with:


FIND in files.php:
				$count_query = $dbim->query('SELECT c.name, COUNT( * ) AS download_count
												FROM '.DB_PREFIX.'files AS f, '.DB_PREFIX.'categories AS c
												WHERE f.category_id = c.id AND c.id = '.$child['id'].'
												GROUP BY f.category_id');
REPLACE WITH:
				//Hide disabled files hack by visiblesoul
				$count_query = $dbim->query('SELECT c.name, COUNT( * ) AS download_count
												FROM '.DB_PREFIX.'files AS f, '.DB_PREFIX.'categories AS c
												WHERE f.category_id = c.id AND c.id = '.$child['id'].'
												AND f.status = 1
												
												GROUP BY f.category_id');
Notice that all I added to the query was "AND f.status = 1" which checks to see if the file is active.

-=DKC=-


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#2 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 02 February 2006 - 01:30 PM

The same thing happens with the left category navigation. I'll work on that later...


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#3 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 15 July 2006 - 02:45 PM

A fix has been posted by the developer of the Olate Downloads system. It is much better than mine...

http://www.olate.co.uk/forums/index.php?sh...findpost&p=9118


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users