Sponsored Content
Top Forums Web Development Notes with Ravinder on Badging System Development Part II Post 303028206 by Neo on Wednesday 2nd of January 2019 04:48:09 AM
Old 01-02-2019
Hey Ravinder, we can do your badge about monthly thanks based on this query!!

No need to add more backend PHP code or DB fields!

Examples:

Code:
mysql> select SUM(post_thanks_amount) from post where userid=1 and dateline > (UNIX_TIMESTAMP() -3600*24*30);
+-------------------------+
| SUM(post_thanks_amount) |
+-------------------------+
|                     128 |
+-------------------------+
1 row in set (0.01 sec)

Code:
mysql> select SUM(post_thanks_amount) from post where userid=302122727 and dateline > (UNIX_TIMESTAMP() -3600*24*30);
+-------------------------+
| SUM(post_thanks_amount) |
+-------------------------+
|                      29 |
+-------------------------+
1 row in set (0.00 sec)

You did not have this table:

Code:
mysql> describe post;
+--------------------+----------------------+------+-----+---------+----------------+
| Field              | Type                 | Null | Key | Default | Extra          |
+--------------------+----------------------+------+-----+---------+----------------+
| postid             | int(10) unsigned     | NO   | PRI | NULL    | auto_increment |
| threadid           | int(10) unsigned     | NO   | MUL | 0       |                |
| username           | varchar(100)         | NO   |     |         |                |
| userid             | int(10) unsigned     | NO   | MUL | 0       |                |
| title              | varchar(250)         | NO   | MUL |         |                |
| dateline           | int(11)              | NO   | MUL | 0       |                |
| pagetext           | mediumtext           | YES  |     | NULL    |                |
| allowsmilie        | smallint(6)          | NO   |     | 0       |                |
| showsignature      | smallint(6)          | NO   |     | 0       |                |
| ipaddress          | varchar(45)          | NO   | MUL | NULL    |                |
| iconid             | smallint(5) unsigned | NO   |     | 0       |                |
| visible            | smallint(6)          | NO   | MUL | 0       |                |
| topic              | int(3)               | NO   |     | 0       |                |
| parentid           | int(10) unsigned     | NO   |     | 0       |                |
| attach             | smallint(5) unsigned | NO   |     | 0       |                |
| infraction         | smallint(5) unsigned | NO   |     | 0       |                |
| reportthreadid     | int(10) unsigned     | NO   |     | 0       |                |
| post_thanks_amount | int(10) unsigned     | NO   |     | 0       |                |
| b8rating           | float                | YES  |     | NULL    |                |
| postkeywords       | varchar(128)         | YES  |     | NULL    |                |
| description        | varchar(256)         | YES  |     | NULL    |                |
| googlebotlastvisit | int(11)              | NO   |     | 0       |                |
| bingbotlastvisit   | int(11)              | NO   |     | 0       |                |
+--------------------+----------------------+------+-----+---------+----------------+
23 rows in set (0.00 sec)

 

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
PAPI_component_info_t(3)					       PAPI						  PAPI_component_info_t(3)

NAME
PAPI_component_info_t - SYNOPSIS
Data Fields char name [128] char short_name [64] char description [128] char version [64] char support_version [64] char kernel_version [64] char disabled_reason [128] int disabled int CmpIdx int num_cntrs int num_mpx_cntrs int num_preset_events int num_native_events int default_domain int available_domains int default_granularity int available_granularities int hardware_intr_sig int component_type int reserved [8] unsigned int hardware_intr:1 unsigned int precise_intr:1 unsigned int posix1b_timers:1 unsigned int kernel_profile:1 unsigned int kernel_multiplex:1 unsigned int fast_counter_read:1 unsigned int fast_real_timer:1 unsigned int fast_virtual_timer:1 unsigned int attach:1 unsigned int attach_must_ptrace:1 unsigned int cntr_umasks:1 unsigned int cpu:1 unsigned int inherit:1 unsigned int reserved_bits:12 Detailed Description Field Documentation unsigned int PAPI_component_info_t::attach Supports attach unsigned int PAPI_component_info_t::attach_must_ptrace Attach must first ptrace and stop the thread/process int PAPI_component_info_t::available_domains Available domains int PAPI_component_info_t::available_granularities Available granularities int PAPI_component_info_t::CmpIdx Index into the vector array for this component; set at init time unsigned int PAPI_component_info_t::cntr_umasks counters have unit masks int PAPI_component_info_t::component_type Type of component unsigned int PAPI_component_info_t::cpu Supports specifying cpu number to use with event set int PAPI_component_info_t::default_domain The default domain when this component is used int PAPI_component_info_t::default_granularity The default granularity when this component is used char PAPI_component_info_t::description[128] Description of the component int PAPI_component_info_t::disabled 0 if enabled, otherwise error code from initialization char PAPI_component_info_t::disabled_reason[128] Reason for failure of initialization unsigned int PAPI_component_info_t::fast_counter_read Supports a user level PMC read instruction unsigned int PAPI_component_info_t::fast_real_timer Supports a fast real timer unsigned int PAPI_component_info_t::fast_virtual_timer Supports a fast virtual timer unsigned int PAPI_component_info_t::hardware_intr hw overflow intr, does not need to be emulated in software int PAPI_component_info_t::hardware_intr_sig Signal used by hardware to deliver PMC events unsigned int PAPI_component_info_t::inherit Supports child processes inheriting parents counters unsigned int PAPI_component_info_t::kernel_multiplex In kernel multiplexing unsigned int PAPI_component_info_t::kernel_profile Has kernel profiling support (buffered interrupts or sprofil-like) char PAPI_component_info_t::kernel_version[64] Version of the kernel PMC support driver char PAPI_component_info_t::name[128] Name of the component we're using int PAPI_component_info_t::num_cntrs Number of hardware counters the component supports int PAPI_component_info_t::num_mpx_cntrs Number of hardware counters the component or PAPI can multiplex supports int PAPI_component_info_t::num_native_events Number of native events the component supports int PAPI_component_info_t::num_preset_events Number of preset events the component supports unsigned int PAPI_component_info_t::posix1b_timers Using POSIX 1b interval timers (timer_create) instead of setitimer unsigned int PAPI_component_info_t::precise_intr Performance interrupts happen precisely char PAPI_component_info_t::short_name[64] Short name of component, to be prepended to event names char PAPI_component_info_t::support_version[64] Version of the support library char PAPI_component_info_t::version[64] Version of this component Author Generated automatically by Doxygen for PAPI from the source code. Version 5.2.0.0 Tue Jun 17 2014 PAPI_component_info_t(3)
All times are GMT -4. The time now is 10:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy