Sponsored Content
Top Forums Web Development Notes with Ravinder on Badging System Development Part II Post 303028193 by Neo on Tuesday 1st of January 2019 01:55:06 PM
Old 01-01-2019
Hey Ravinder,

I already fixed and rearranged your code and it is working now:

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

if ($time_inactive < $year) { 
    if ($years_a_member > 0 && $time_inactive < 1) { 
        $color['fajoin_time'] = 'orangered'; 
    } elseif ($years_a_member < 2 && $years_a_member  >= 1) { 
        $color['fajoin_time'] = 'darkorange'; 
    } elseif ($years_a_member < 3 && $years_a_member  >= 2) { 
        $color['fajoin_time'] = 'lightgray'; 
    } elseif ($years_a_member < 4 && $years_a_member  >= 3) { 
        $color['fajoin_time'] = 'limegreen'; 
    } elseif ($years_a_member < 5 && $years_a_member  >= 4) { 
        $color['fajoin_time'] = 'blue'; 
    } elseif ($years_a_member < 10 && $years_a_member >= 5) { 
        $color['fajoin_time'] = 'indigo'; 
    } elseif ($years_a_member >= 10) { 
        $color['fajoin_time'] = 'black'; 
    } 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) . '";';

jQuery:

Code:
$('.fa-clock').css("color",badge["fajoin_time"]);
$('.fa-clock').css("cursor","pointer").attr("title",  badge["fajoin_timeval"] + " Years Active at UNIX.COM");
$('.fa-clock').closest('div').find('.fa-circle').css("color",badge["fajoin_time"]);

This is a great badge you came up with. I really like it. Very useful too. Only 11 more to go for this phase of rapid prototype development!

Thanks for trying on this (you were close!) . ... I look forward to your next badge!

What is the next, great, Ravinder Singh idea for a badge?
This User Gave Thanks to Neo For This Post:
 

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
OCLOCK(1)						      General Commands Manual							 OCLOCK(1)

NAME
oclock - round X clock SYNOPSIS
oclock [-option ... ] DESCRIPTION
Oclock simply displays the current time on an analog display. OPTIONS
-fg color choose a different color for the both hands and the jewel of the clock -bg color choose a different color for the background. -jewel color choose a different color for the jewel on the clock. -minute color choose a different color for the minute hand of the clock. -hour color choose a different color for the hour hand of the clock. -backing { WhenMapped Always NotUseful } selects an appropriate level of backing store. -geometry geometry define the initial window geometry; see X(7). -display display specify the display to use; see X(7). -bd color choose a different color for the window border. -bw width choose a different width for the window border. As the Clock widget changes its border around quite a bit, this is most usefully set to zero. -shape causes the clock to use the Shape extension to create an oval window. This is the default unless the shapeWindow resource is set to false. -noshape causes the clock to not reshape itself and ancestors to exactly fit the outline of the clock. -transparent causes the clock to consist only of the jewel, the hands, and the border. COLORS
If you would like your clock to be viewable in color, include the following in the #ifdef COLOR section you read with xrdb: *customization: -color This will cause oclock to pick up the colors in the app-defaults color customization file: /usr/lib/X11/app-defaults/Clock-color. Below are the default colors: Clock*Background: grey Clock*BorderColor: light blue Clock*hour: yellow Clock*jewel: yellow Clock*minute: yellow SEE ALSO
X(7), X Toolkit documentation AUTHOR
Keith Packard, MIT X Consortium X Version 11 oclock 1.0.3 OCLOCK(1)
All times are GMT -4. The time now is 12:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy