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
DXmColorMixSetNewColor(3X)												DXmColorMixSetNewColor(3X)

NAME
DXmColorMixSetNewColor - Sets the new color red, green, and blue values in the color mixing widget. SYNOPSIS
void DXmColorMixSetNewColor( DXmColorMixWidget cmw, unsigned short red, unsigned short green, unsigned short blue ); PARAMETERS
The identifier (widget ID) of the color mixing widget. The new color red value. The value is expressed as an X color value (0 to 65535). The new color green value. The value is expressed as an X color value (0 to 65535). The new color blue value. The value is expressed as an X color value (0 to 65535). A complete list of all the X color values available to you is located on your system. To find it, type the following command: % find / -name '*rgb*' -print DESCRIPTION
The DXmColorMixSetNewColor routine allows the application or a user-supplied color mixer subwidget to pass the current color value to the color mixing widget. Note that your application will perform this operation faster if you call this routine instead of the Intrinsic rou- tine XtSetValues. SEE ALSO
DXmColorMixGetNewColor(3X), DXmCreateColorMix(3X), DXmCreateColorMixDialog(3X) DXmColorMixSetNewColor(3X)
All times are GMT -4. The time now is 07:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy