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
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 06:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy