Sponsored Content
The Lounge What is on Your Mind? Current Array of Badges (Beta 1) Post 303029087 by Neo on Monday 21st of January 2019 06:51:22 AM
Old 01-21-2019
Update to two badges (infractions and thanks given to others). This only effect members with less than 5 posts.

In a nutshell these two badges will remain lightgray as default until the user has 5+ posts:

Code:
$queryi = "SELECT ipoints AS infractions FROM user WHERE userid =" . $uid;
    $resultsi = $db->query_first_slave($queryi);
    if ($resultsi['infractions'] >= 30 || $modaluser['usergroupid'] == 11) {
        $color['fainfraction'] = 'red';
    } elseif ($resultsi['infractions'] >= 10) {
        $color['fainfraction'] = 'orangered';
    } elseif ($resultsi['infractions'] >= 7) {
        $color['fainfraction'] = 'limegreen';
    } elseif ($resultsi['infractions'] >= 5) {
        $color['fainfraction'] = 'blue';
    } elseif ($resultsi['infractions'] > 0) {
        $color['fainfraction'] = 'indigo';
    } else if($modaluser['posts'] > 4) {
         $color['fainfraction'] = 'black';
    } else  {
         $color['fainfraction'] = 'lightgray';
    }

Code:
$queryTG = "SELECT post_thanks_user_amount AS thanks_given FROM user WHERE userid =" . $uid;
    $resultsTG = $db->query_first_slave($queryTG);
    if ($resultsTG['thanks_given'] >= 1000) {
        $color['fathanks_given'] = 'black';
    } elseif ($resultsTG['thanks_given'] >= 500) {
        $color['fathanks_given'] = 'indigo';
    } elseif ($resultsTG['thanks_given'] >= 50) {
        $color['fathanks_given'] = 'blue';
    } elseif ($resultsTG['thanks_given'] > 0) {
        $color['fathanks_given'] = 'limegreen';
    } elseif ($modaluser['posts'] > 4) {
        $color['fathanks_given'] = 'red';
    } else {
        $color['fathanks_given'] = 'lightgray';
    }

This User Gave Thanks to Neo For This Post:
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to compare current record,with next and previous record in awk without using array?

Hi! all can any one tell me how to compare current record of column with next and previous record in awk without using array my case is like this input.txt 0 32 1 26 2 27 3 34 4 26 5 25 6 24 9 23 0 32 1 28 2 15 3 26 4 24 (7 Replies)
Discussion started by: Dona Clara
7 Replies

2. Hardware

Stack Overflow Questions Tags Users Badges Unanswered Ask Question Ask for the explanation of types

I have read a document which tells me the following 4 things are done by the RAM embedded on disk driver controller. But I don't know what's difference between buffer and cache. Thanks! RAM on disk drive controllers 1 firmware 2 speed matching buffer 3 prefetching buffer 4 cache (1 Reply)
Discussion started by: 915086731
1 Replies

3. 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

4. What is on Your Mind?

Four More UNIX.COM Achievement Award Badges to Award

Happy New Year! There are currently four UNIX.COM achievement awards up for grabs, as the say. Here they are, in no particular order: The Order of the Raven The Order of the Hippo The Order of the Spider The Order of the Dragon Don't ask me what they mean, or who who will get those... (0 Replies)
Discussion started by: Neo
0 Replies

5. Web Development

Current New Badge Alert Script (Beta 1)

Here is the JS I wrote and am now testing live for alerting a member when they have received a new badge (seems to be working OK so far, still testing live): var badgeChange = readCookie("badgestatechange"); $(function() { if (badgeChange == "1") { if (vbuserId > 0) { var... (0 Replies)
Discussion started by: Neo
0 Replies

6. What is on Your Mind?

Patreon Badges Now Available as BBCODE at UNIX.COM

Dear All, We have a lot of amazing moderators and other very talented unix.com members who provide tireless top quality free technical support assistance to others. As a service to those long term unix.com members, I am making a new Patreon BBCODE badge available which can be posted in forum... (8 Replies)
Discussion started by: Neo
8 Replies

7. What is on Your Mind?

My Badges Page - A Major UserCP Update (v0.661):

Another major upgrade on the new UserCP today. I have created the "My Badges" page in the new control panel, and it's looking very cool :) If you have visited the new UserCP recently, you will more-than-likely need to close your browser (completely) and then restart it to clear out the old... (2 Replies)
Discussion started by: Neo
2 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 03:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy