Sponsored Content
Top Forums Web Development Notes with Ravinder on Badging System Development Part II Post 303028210 by Neo on Wednesday 2nd of January 2019 06:33:13 AM
Old 01-02-2019
Another one bites the dust.... prototype badge "discussions started in the last month" ...

Code:
<?php
$monthtq = "SELECT COUNT(threadid) AS threadcount from thread where firstpostid=" . $uid . " and  dateline > " . $one_month_ago;
$monththreads = $vbulletin->db->query_first($monthtq);
if ($monththreads['threadcount'] >= 4) {
    $color['faterminal'] = 'black';
} elseif ($monththreads['threadcount'] >= 5) {
    $color['faterminal'] = 'indigo';
} elseif ($monththreads['threadcount'] >= 2) {
    $color['faterminal'] = 'blue';
} elseif ($monththreads['threadcount'] >= 1) {
    $color['faterminal'] = 'limegreen';
} else {
    $color['faterminal'] = 'lightgray';
}

$badgejs .= 'badge["faterminal"] = "' . $color['faterminal'] . '";';
$badgejs .= 'badge["faterminalval"] = "' . number_format($monththreads['threadcount']) . '";';

jQuery:

Code:
$('.fa-terminal').css("color",badge["faterminal"]);
$('.fa-terminal').css("cursor","pointer").attr("title",  badge["faterminalval"] + " Discussions Started in the Last Month");
$('.fa-terminal').closest('div').find('.fa-circle').css("color",badge["faterminal"]);

9 out of 48 protos left .. 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
cal(1)								   User Commands							    cal(1)

NAME
cal - display a calendar SYNOPSIS
cal [ [month] year] DESCRIPTION
The cal utility writes a Gregorian calendar to standard output. If the year operand is specified, a calendar for that year is written. If no operands are specified, a calendar for the current month is written. OPERANDS
The following operands are supported: month Specify the month to be displayed, represented as a decimal integer from 1 (January) to 12 (December). The default is the current month. year Specify the year for which the calendar is displayed, represented as a decimal integer from 1 to 9999. The default is the current year. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of cal: LANG, LC_ALL, LC_CTYPE, LC_TIME, LC_MESSAGES, and NLSPATH. TZ Determine the timezone used to calculate the value of the current month. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWesu | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
calendar(1), attributes(5), environ(5), standards(5) NOTES
An unusual calendar is printed for September 1752. That is the month 11 days were skipped to make up for lack of leap year adjustments. To see this calendar, type: cal 9 1752 The command cal 83 refers to the year 83, not 1983. The year is always considered to start in January. SunOS 5.10 1 Feb 1995 cal(1)
All times are GMT -4. The time now is 05:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy