Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/19/2022 in all areas

  1. You need to use beginPath() before you start to draw something. Add a call to beginPath after you save the context.
    1 point
  2. PS If you really want to do it in PHP then you can apply the same method to an array $thresholds = array( '-' => [0, 100], 'contributor' => [101, 1000], 'author' => [1001, 10000], 'editor' => [10001, 100000], 'administrator' => [100001, 999999999] ); echo getUserRole(50000, $thresholds); //--> editor function getUserRole($current_balance, $thresholds) { foreach ( $thresholds as $role => $range ) { if ( $range[0] <= $current_balance && $current_balance <= $range[1] ) { return $role; } } return false; }
    1 point
  3. With a couple of db tables like this Table: user Table: role +---------+----------+--------+ +---------+---------------+-----------+------------+ | user_id | username | points | | role_id | role_name | point_min | points_max | +---------+----------+--------+ +---------+---------------+-----------+------------+ | 1 | John | 66 | | 5 | - | 0 | 100 | | 2 | Paul | 101 | | 6 | Contributor | 101 | 1000 | | 3 | George | 3000 | | 7 | Author | 1001 | 10000 | | 4 | Ringo | 200000 | | 8 | Editor | 10001 | 100000 | +---------+----------+--------+ | 9 | Administrator | 100001 | 999999999 | +---------+---------------+-----------+------------+ Then a simple query SELECT username , rolename FROM user u JOIN role r ON u.points BETWEEN r.points_min AND r.points_max; does the job for you +----------+---------------+ | username | rolename | +----------+---------------+ | John | - | | Paul | Contributor | | George | Author | | Ringo | Administrator | +----------+---------------+
    1 point
  4. Looking for an affordable US-based PHP programmer to help finish a Membership Website: Expertise needed in: PHP, WordPress, Memberships, Ultimate Membership Pro Plugin (important) It's a smaller-sized project - the website is built, only needs Member Registration and Forms sequence built and straightened out. It's quite urgent, so attending to the project is important. Email to developer @ thedigitalmotion dot com
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • 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.