Find Jobs
Hire Freelancers

Write some Software

$10-30 USD

Terminado
Publicado hace más de 7 años

$10-30 USD

Pagado a la entrega
I am working on a site that uses s2member pro. When a users membership expires the user is demoted to user level0. I need to know what level they were at prior to being demoted. s2member has a built in function which keeps track of all the user capabilities/roles which is stored in user_meta as an array: $accessCaps = get_user_option('s2member_access_cap_times', $user_id); The array is composed of a timestamp key and a value which contains the last level a user had prior to being demoted to level 0. The problem is that the value in each key is stored as a natural number so level1 and level10 are sequential. (see output below) Below is an example of the user meta from a user who was demoted to level 0: foreach($accessCaps as $key => $value) { echo "$key is at $value<br>"; } output: (note:The user is created and assigned to level2) 1473730737.0001 is at level0 1473730737.0002 is at level1 1473730737.0003 is at level2 <--note: the user was added at this level and has access/capabilities of all lower levels (note:The user is promoted to level5) 1473730847.0001 is at level3 1473730847.0002 is at level4 1473730847.0003 is at level5 <-- note: the user was promoted to this level and gets all lower levels as well (note:The user is promoted to level11) 1473730986.0001 is at level10 1473730986.0002 is at level11 <-- note: The user was promoted to this level (you can see the sequential problem now because 10,11 are before 6,7,8,9) 1473730986.0003 is at level6 1473730986.0004 is at level7 1473730986.0005 is at level8 1473730986.0006 is at level9 (note:The user is demoted to level1) 1473731072.0001 is at -level1 1473731072.0002 is at -level10 1473731072.0003 is at -level11 <-- note: This is the last highest level, I need to get this value 1473731072.0004 is at -level2 1473731072.0005 is at -level3 1473731072.0006 is at -level4 1473731072.0007 is at -level5 1473731072.0008 is at -level6 1473731072.0009 is at -level7 1473731072.0010 is at -level8 1473731072.0011 is at -level9 What I need to do is this, get the last highest level that the user achieved, here's how I think it could be done: Sort each key/value pair by time (as float point values), find the sub-array with the same integer part like the bigger timestamp in this case: 1473731072. Then sort this new array by values (levels) as natural numbers, to get the biggest level. (L11 in this case). Please ask questions if you need clarification. Thanks.
ID del proyecto: 11512580

Información sobre el proyecto

3 propuestas
Proyecto remoto
Activo hace 8 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Hi. I have read your project description and this seems to be an easy task which can be done in hours. Ready to start. Thanks
$30 USD en 1 día
0,0 (1 comentario)
0,0
0,0
3 freelancers están ofertando un promedio de $52 USD por este trabajo
Avatar del usuario
Hello Client, I read your post regarding create logic for regex, I have great experience working with PHP technology it's CMS & Frameworks like YII, Laravel, Codeigniter, CakePHP, OpenCart, WordPress, Prestashop, Sugar CRM & API Integration also having knowledge of Jquery, Node.js, Angular JS. I have experience to deal with big projects like ERP, CRM, HRMS, Payroll Management. Also i have team of qualified web developers and designers, Me & my team is ready to assist you in given assignment. Looking for a positive response from you. Thanks
$30 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
A proposal has not yet been provided
$25 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Before awarding this to someone else contact me i have more than 8 year experience. Thanks
$30 USD en 3 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
Hotchkiss, United States
5,0
8
Forma de pago verificada
Miembro desde ene 14, 2015

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.