Search results

  1. E

    how do you host your website ?

    Always use dedicated servers. Vps and shared hosting are very limited. The "cloud" that many hosts offer are the same as vps. It's also not a good idea to use your main site as a file server.
  2. E

    newsletter plugin error when encountering null email addresses

    You can use "IS NOT NULL" to select emails that are not null. public function getRecipients($userGroup, $includeUnsubs = false) { // setup database $db = Database::getDatabase(); switch($userGroup) { case 'free only': $clause = 1; break; case 'premium only': $clause = 2; break; case 'moderator...
  3. E

    Difficult to add theme

    Check the table "theme" in your database. It should have the correct folder path and the field "is_installed" should be 1.
  4. E

    BUG : Blank contextmenu for Recent Upload + All files

    I will use this solution. Thanks for sharing.
  5. E

    Use the field paidExpiryDate to check if the user is premium

    This would work. But the php time and the mysql time must be the same. The Auth class can do this verification and set $this->level_id = 1 internally.
  6. E

    Use the field paidExpiryDate to check if the user is premium

    The performance impact on a live website will be different. There are issues with table locks, cache, other threads doing other queries and so on. Just testing a single query on a test db will just point obvious mistakes such as not using indexes. And 5k isn't much. I have sites with 40k users...
  7. E

    Use the field paidExpiryDate to check if the user is premium

    Currently the script uses the field level_id to check if the user is premium and the background task downgrade_account.cron.php is supposed to run every day at midnight downgrading accounts. The problem is that if the user account expires at 0:10 he will have 1 day free because the task will...
  8. E

    Page reloading when removing background task

    In the remote upload after downloading a file and click on "remove" to remove the file from the list, the entire page reloads. This applies only when remote uploads are done in background. To fix it, add return false; after each function in...
  9. E

    Replace rand() with mt_rand()

    I notice the rand() function in several parts in the core and in some plugins. rand() does not produce good random numbers. It's easy to see the difference between rand and mt_rand by creating an image with random values on each pixel: http://i.stack.imgur.com/YctNG.png
  10. E

    Better way to track PPS in the rewards plugin

    In the files I've also changed the affiliate link to ?ref=. To work with current installations just change it back to aff.
  11. E

    Better way to track PPS in the rewards plugin

    I'm attaching some files to improve the tracking on PPS. With this new method is super easy to give rewards for renewals as well. Here are some comments to whoever wants to use them userPeer.class.php will add the affiliate id in a new field "affId" in the user's table. Don't forget to create...
  12. E

    Wrong upload_source value for remote uploads

    I understand that different environments will have different values for php_sapi_name(). But the global $_SERVER['argc'] only exists if the script is executed in cli. The minimum value for argc is 1: http://php.net/manual/en/reserved.variables.argc.php About the filesize, I think you didn't...
  13. E

    Wrong upload_source value for remote uploads

    Thats why the function also checks for $_SERVER['argc'], which only exists if the script is executed in cli. The script checks if the user hasn't reached the maximum storage on their account when accepting the ajax request and sending the file to the queue. It doesn't check if the file size is...
  14. E

    Wrong upload_source value for remote uploads

    I just find out that running fcgi will return cgi-fcgi in both CLI and web. This function should work: function is_cli() { return (!isset($_SERVER['SERVER_SOFTWARE']) && (php_sapi_name() == 'cli' || (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0))); } Also, the script doesn't seem to...