Sponsored Content
Top Forums Web Development Notes with Ravinder on Badging System Development Part II Post 303028197 by Neo on Tuesday 1st of January 2019 11:20:42 PM
Old 01-02-2019
Hi Ravinder,

Please keep in mind that this also will work, is easier to read, and it a lot shorter:

Code:
$time_join = time() - $modaluser['joindate'];
$years_a_member = $time_join / $year;

if ($time_inactive < $year) { 
    if ($years_a_member >= 10) { 
        $color['fajoin_time'] = 'black'; 
    } 
    elseif ($years_a_member >= 5) { 
        $color['fajoin_time'] = 'indigo'; 
    }
    elseif ($years_a_member  >= 4) { 
        $color['fajoin_time'] = 'blue'; 
    }
    elseif ($years_a_member  >= 3) { 
        $color['fajoin_time'] = 'limegreen'; 
    }
    elseif ($years_a_member  >= 2) { 
        $color['fajoin_time'] = 'lightgray'; 
    }
    elseif ($years_a_member  >= 1) { 
        $color['fajoin_time'] = 'darkorange'; 
    } 
     else { 
        $color['fajoin_time'] = 'red'; 
    } 
} else { 
    $color['fajoin_time'] = 'red'; 
} 

$badgejs .= 'badge["fajoin_time"] = "' . $color['fajoin_time'] . '";';   
$badgejs .= 'badge["fajoin_timeval"] = "' . number_format($years_a_member) . '";';

At this point, I am thinking that soon we should move to a new phase of rapid prototype development if we cannot easily think of new badges. No need to waste time on the final 20% when when are 80% there, more-or-less.

So, if we do not have any ideas for additional badges now, we can just leave the as-is (reserved) and move on.

Or maybe you have some more badge ideas?

So far, it is only you and me with badge ideas, so no need to wait for other UG members to come up with badge logic Smilie
 

3 More Discussions You Might Find Interesting

1. What is on Your Mind?

New Badging System - Badges Prototype Beta 1 (Badges Only)

Today I mapped out the new badging system using FA icons, Beta 1 in no particular order except a 6 x 8 grid: https://www.unix.com/members/1-albums215-picture991.png The prototype HTML code for this layout: <style> .fa-badge-grid { font-size: 1.5em; } .row { ... (38 Replies)
Discussion started by: Neo
38 Replies

2. What is on Your Mind?

Status of Badging System - Beta 1

Dear All, Here is the current status of the badging system: The Beta 1 phase of the new badging system is close to completion. 42 prototype badges have been "allocated" 6 prototype badge slots are held in reserve The "alert you have new badges" prototype is running and is currently... (4 Replies)
Discussion started by: Neo
4 Replies

3. What is on Your Mind?

Badging System: UNIX.COM Bug Hunter Badge (New)

I have moved the bug badge out of reserve and into the main stream. Basically, I will assign a color level like the others, based on who has made a good actionable bug report for UNIX.COM. "Good" means screenshots, links, and even details from web dev tools our the HTML source code. So far,... (0 Replies)
Discussion started by: Neo
0 Replies
setcolor(1F)							   FMLI Commands						      setcolor(1F)

NAME
setcolor - redefine or create a color SYNOPSIS
setcolor color red_level green_level blue_level DESCRIPTION
The setcolor command takes four arguments: color, which must be a string naming the color; and the arguments red_level, green_level, and blue_level, which must be integer values defining, respectively, the intensity of the red, green, and blue components of color. Intensities must be in the range of 0 to 1000. If you are redefining an existing color, you must use its current name (default color names are: black, blue, green, cyan, red, magenta, yellow, and white). setcolor returns the color's name string. EXAMPLES
Example 1 A sample output of setcolor command. The following is an example of the arguments that setcolor takes: `setcolor blue 100 24 300` BUILT-IN FMLI ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) SunOS 5.11 5 Jul 1990 setcolor(1F)
All times are GMT -4. The time now is 10:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy