Jump to content

keldek

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Everything posted by keldek

  1. Hello, I'm working on creating a gallery for my site, and have run into a small issue that I cannot seem to resolve. First, my code: <?php if ($this->displayimagecategories == 1) { echo '<table border="0">'; echo '<tr>'; foreach ( $this->categories as $category ) { echo '<td width="20%" align="center"><a href="'.$category->link.'">'.JHTML::_( 'image.site', $category->linkthumbnailpath, '', '', '', $category->title, 'style="border:0"' ).'</a>'; echo '<br><a href="'.$category->link.'" class="category'.$this->params->get( 'pageclass_sfx' ).'">'.$category->title.'</a> '; echo '<br><span class="small">('.$category->numlinks.')</span></td>'; echo '</tr>'; } echo '</table>'; } else { ?> This works perfect for what I need it to do, except that I need to add some form of if statement that will count how many <td> tags there are, and if the <td> tag count = 5, it'll close the open <tr> and create a new <tr>. If anyone could provide some insight on this issue, I would greatly appreciate the help. Thanks in advance for your help and time.
  2. Our downloads are handled via php, when a user goes to download a file, it calls the download.php, which calls the file and begins the download. The files themselves are not directly accessible via the web and can only be downloaded using this page. I figured I could build on this script itself, and will probably be the path I take. Only problem is, php isn't exactly my strong suit hehe. I'll begin the search, trial, and error process and see what I can come up with
  3. Our site is based on subscriptions, which means that using the <CBandUser> directive is very unrealistic for my needs. It would be impossible to keep the v-host config updated with the ever changing user base we have. If mod_cband had an option to use say "CBandRemoteLimit 10M" then I could flow with that. But after reading through all of their documentation, this is not an option. The only directives for a "remote" client (which bases the directive on a per IP address basis) are for speed, connections, and max requests. I *could* however use the CBandClassLimit directive, but I'd have to list every IP address range on the internet in order for this to actually work, which would also undoubtedly cause a server crash less than 10 seconds after restarting apache with that form of directive in place. When I created this thread, I was hoping there was some way to log (via maybe .htaccess or php/database perhaps) when a user logs in to the members area, keep track of how much was downloaded per day, redirect if the maximum has been reached, and reset the quota every 24 hours. I've read everything I possibly can on mod_cband and it doesn't do what I need
  4. I don't want to set a bandwidth quota though. Name CBandLimit Description Specifies bandwidth limit for virtualhost Context <Virtualhost> Syntax CBandLimit limit limit - bandwidth quota size, available units: K (kilo), M (mega), G (giga), Ki (kibi), Mi (mebi), Gi (gibi) Example CBandLimit 10M Specifies 10 * 1000 * 1000 bytes bandwidth quota CBandLimit 10Mi Specifies 10 * 1024 * 1024 bytes bandwidth quota This only sets a limit for the Server or VirtualHost as a whole, meaning that once your Server/VHost reaches this limit then all users will recieve an error, be redirected, or speeds decreased. This directive does not work on a per user basis. While mod_cband does include directives on a per user basis, those directives are still for bandwidth quotas, not max download size quotas. The other 2 samples of code do what I want (redirect), but I need to accomplish Step 1 (file size limit) before worrying about Step 2 (redirecting those who have exceeded their limit). I've done several hours reading up on mod_cband, and I have it incorporated in my VHosts, but it does not provide a solution for what I want to do. To clarify. I do not care about how fast a user downloads, this is NOT my goal. My goal is to set a maximum limit on total SIZE that a user can download per day (for specific file types), NOT throttling or limiting their bandwidth.
  5. I don't know if the VirtualHost method will work as we have 500+ users and get new users daily, users cancel daily, etc. And yes, "Max file Size" Quota per user is exactly what I'm looking for Say user John downloads 19 files that are ~100mb in size, once John downloads ~100mb file #20 (which would put him at 2gb total), he'd get redirected to a specified page when he attempts to download another file that day. The limit would be reset every 24 hours.
  6. I have mod_cband installed already and it doesn't seem to be what I need. From the documentation I've read, I can set a max transfer quota (bandwidth), but not a max file size type quote. I don't want to limit traffic really in any way, but once a user downloads a maximum of 2gb worth of files (.zip, .rar, .mp3, wmv, etc), they'd be redirected to a page saying they've exceeded their allowed limit for the day. The hope is to prevent password sharing and maintain some integrity with our members
  7. Hello, I'm not sure if this is the appropriate place for my question, but I think this would be an apache solved issue so here goes: I'm using apache 2.2.4 and would like to set a limit on how much a user can download per day. I'm using .htaccess/.htpasswd for user management (as my payment processor doesn't seem to support a db driven method of user management), which I'm sure could still work for what I need to do, considering every time a user logs in and downloads a file it also places their username in the access logs An example of what I'd like to do is: User "John" logs in to the members area. John can download an unlimited amount of files up to 2gb total. Once John has reached a total 2GB worth of downloads, he gets redirected to a specified page. Any help, or ideas on this would be greatly appreciated and thank you in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.