How to calculate the average ratings for the post when the user submits 3 field ratings?

I need to implement ratings in my site. I have user five star rating and voting API module, I created a content_type with “beach”, and created some field in the manage field settings, name, id, etc. And also I configured the five star module with tags like location ratings, beachratings, facilites ratings and overall (average ratings) ratings. I display all the rating stars in the page by using the code.

$  bid=explode("/",$  _GET['q']); $  node = node_load($  bid['1']);// we get the node id here// $  fivestar = field_view_field('node', $  node, 'field_overall_ratings'); echo render($  fivestar); $  beachrating=field_view_field('node', $  node, 'field_beaches_ratings'); echo render($  beachrating); $  locationrating=field_view_field('node', $  node, 'field_location_ratings'); echo render($  locationrating); $  easyrating=field_view_field('node', $  node, 'field_easy_to_get'); echo render($  easyrating); 

When I submit the ratings, they are stored in the database but the average is not updating. But I need to calculate the overall ratings when the user votes for the three section. Can anyone help me how can we implement this in my site?

Form submits before File Upload completes

I have a form. It works… but the user must wait for the large file to upload first or they won’t be processed by the form. The upload form will change from the Upload button to the name of the file with a Remove button.

    $  validators = [       'file_validate_extensions' => ['zip'],     ];      $  form['static_archive'] = [       '#type' => 'managed_file',       '#name' => 'static_archive',       '#title' => t('Static archive'),       '#size' => 200,       '#description' => t('ZIP format only'),       '#upload_validators' => $  validators,       '#upload_location' => 'private://imports/uploads/',     ];      ...     other fields here     ...      $  form['actions']['#type'] = 'actions';     $  form['actions']['submit'] = [       '#type' => 'submit',       '#value' => $  this->t('Import Archive'),       '#button_type' => 'primary',     ]; 

This form is outputted on a route like I want, file is processed, etc. The only catch is the user having to wait.

I’m hoping there is some JS method for disabling the Submit button while the file is uploading. Bonus if there’s a way to show upload progress or has a message explaining why it’s disabled. The file upload is not a required field, so when the uses the form and the file doesn’t upload before they hit submit, it’s lost in the wind and the user doesn’t even get an error.

This isn’t webforms, so this doesn’t solve it.

This isn’t solve via this patch:

I also tried clientside_validation: b/c of this: How to prevent an Ajax form from submitting

But I am having no luck solving this. Hoping someone has ideas to share.

Does *nix* utility exist which collectsand submits host info via curl to exploit db and returns list of potential vulns?

I am looking for a client side utility which collects data locally (versions, services, etc) and then submits the data to an exploit database. This should return a list of potential vulnerabilities. Ideally very current. I know there are services which you can do this with but thinking something very simple, open, and free here in terms of a shell script ideally.

Almacenar y mostrar submits de Contact Form 7 WordPress

Soy usuario de un sitio de WordPress y quiero replicar la funcionalidad que tienen en ese sitio en uno mío.

1- Tienen varios usuarios con el rol autor (incluyéndome) y cada uno de ellos puede agregar y editar sus propios posts, pero no pueden editar o ver los posts de otros.Resolví esto modificando el archivo functions.php file de mi theme y agregando esto al final:

function mypo_parse_query_useronly( $ wp_query ) { if ( strpos( $ _SERVER[ ‘REQUEST_URI’ ], ‘/wp-admin/edit.php’ ) !== false ) { if ( !current_user_can( ‘level_10’ ) ) { global $ current_user; $ wp_query->set( ‘author’, $ current_user->id ); } } }

add_filter(‘parse_query’, ‘mypo_parse_query_useronly’ );

2- Cada usuario tiene su propio formulario de contacto (hecho con Contact Form 7) que ponen al final de sus posts. Esto también lo tengo hecho.

3- Cada vez que un usuario llena el formulario y hace submit se almacenan todos los datos en el sitio. Igual que los posts, estos pueden ser vistos sólo por el propietario del formulario de contacto (ver imagen).

introducir la descripción de la imagen aquí

Instalé el plugin Contact Form CFDB7 para guardar los datos del Contact Form 7, pero sólo puedo verlos como administrador y no como autor. Necesito que los submit de Contact Form 7 se puedan ver por los respectivos usuarios autores.

¿Cómo lo puedo hacer?