Sponsored Content
Top Forums Web Development Notes with Ravinder on Badging System Development Part II Post 303028400 by Neo on Monday 7th of January 2019 07:46:49 AM
Old 01-07-2019
Update:

While on vacation, had some free time and have written the core code to show a Bootstrap alert when a member badge changes. Also, have the basic code in place to determine exactly which badge changes, so that can be added to the message; but have not written the function to change the array keys to text.

Currently testing via PHP logging. Seems to work fine.

When I am back at my desk, will write a function to change array keys to user friendly text and continue testing.
 

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
ARRAY_SEARCH(3) 							 1							   ARRAY_SEARCH(3)

array_search - Searches the array for a given value and returns the corresponding key if successful

SYNOPSIS
mixed array_search (mixed $needle, array $haystack, [bool $strict = false]) DESCRIPTION
Searches $haystack for $needle. PARAMETERS
o $needle - The searched value. Note If $needle is a string, the comparison is done in a case-sensitive manner. o $haystack - The array. o $strict - If the third parameter $strict is set to TRUE then the array_search(3) function will search for identical elements in the $haystack. This means it will also check the types of the $needle in the $haystack, and objects must be the same instance. RETURN VALUES
Returns the key for $needle if it is found in the array, FALSE otherwise. If $needle is found in $haystack more than once, the first matching key is returned. To return the keys for all matching values, use array_keys(3) with the optional $search_value parameter instead. Warning This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.0 | | | | | | | As with all internal PHP functions as of 5.3.0, | | | array_search(3) returns NULL if invalid parame- | | | ters are passed to it. | | | | | 4.2.0 | | | | | | | Prior to PHP 4.2.0, array_search(3) returns NULL | | | on failure instead of FALSE. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 array_search(3) example <?php $array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red'); $key = array_search('green', $array); // $key = 2; $key = array_search('red', $array); // $key = 1; ?> SEE ALSO
array_keys(3), array_values(3), array_key_exists(3), in_array(3). PHP Documentation Group ARRAY_SEARCH(3)
All times are GMT -4. The time now is 10:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy