define('ACR_CEL_MAX', 6291456); define('ACR_CEL_LIMITE_IP', 5); function acr_cel_eventos() { return array( 'celebracao-2026' => 'celebracao-2026', 'convencao-2026' => 'convencao-2026', ); } function acr_cel_evento($valor) { $lista = acr_cel_eventos(); if (isset($lista[$valor])) { return $lista[$valor]; } return 'celebracao-2026'; } add_action('rest_api_init', function () { register_rest_route('acr/v1', '/celebracao/lista', array( 'methods' => 'GET', 'permission_callback' => '__return_true', 'callback' => 'acr_cel_lista', )); register_rest_route('acr/v1', '/celebracao/upload', array( 'methods' => 'POST', 'permission_callback' => '__return_true', 'callback' => 'acr_cel_upload', )); }); function acr_cel_lista(WP_REST_Request $req) { $evento = acr_cel_evento(sanitize_text_field($req->get_param('evento'))); $filtro_evento = array( 'relation' => 'OR', array( 'key' => '_acr_cel_evento', 'value' => $evento, ), ); if ($evento === 'celebracao-2026') { $filtro_evento[] = array( 'key' => '_acr_cel_evento', 'compare' => 'NOT EXISTS', ); } $itens = get_posts(array( 'post_type' => 'attachment', 'post_status' => 'inherit', 'posts_per_page' => 120, 'orderby' => 'date', 'order' => 'DESC', 'meta_query' => array( 'relation' => 'AND', array( 'key' => '_acr_cel_ok', 'value' => '1', ), $filtro_evento, ), )); $saida = array(); foreach ($itens as $item) { $saida[] = array( 'url' => wp_get_attachment_image_url($item->ID, 'large'), 'nome' => get_post_meta($item->ID, '_acr_cel_nome', true), ); } return rest_ensure_response($saida); } function acr_cel_upload(WP_REST_Request $req) { $ip = sanitize_text_field($_SERVER['REMOTE_ADDR']); $chave = 'acr_cel_' . md5($ip); $conta = intval(get_transient($chave)); if ($conta >= ACR_CEL_LIMITE_IP) { return new WP_Error('acr_cel_limite', 'Limite de envios atingido.', array('status' => 429)); } $arquivos = $req->get_file_params(); if (empty($arquivos['foto'])) { return new WP_Error('acr_cel_vazio', 'Nenhum arquivo recebido.', array('status' => 400)); } $foto = $arquivos['foto']; if ($foto['size'] > ACR_CEL_MAX) { return new WP_Error('acr_cel_tamanho', 'Arquivo acima do limite.', array('status' => 413)); } $tipo = wp_check_filetype($foto['name']); if (!in_array($tipo['type'], array('image/jpeg', 'image/png'), true)) { return new WP_Error('acr_cel_tipo', 'Formato nao permitido.', array('status' => 415)); } $checa = getimagesize($foto['tmp_name']); if ($checa === false) { return new WP_Error('acr_cel_invalido', 'Arquivo invalido.', array('status' => 415)); } $evento = acr_cel_evento(sanitize_text_field($req->get_param('evento'))); require_once ABSPATH . 'wp-admin/includes/file.php'; require_once ABSPATH . 'wp-admin/includes/image.php'; require_once ABSPATH . 'wp-admin/includes/media.php'; $GLOBALS['acr_cel_pasta'] = $evento; add_filter('upload_dir', 'acr_cel_destino'); $envio = wp_handle_upload($foto, array('test_form' => false)); remove_filter('upload_dir', 'acr_cel_destino'); if (isset($envio['error'])) { return new WP_Error('acr_cel_envio', 'Falha ao salvar o arquivo.', array('status' => 500)); } $nome = sanitize_text_field($req->get_param('nome')); $nome = mb_substr($nome, 0, 60); $id = wp_insert_attachment(array( 'post_mime_type' => $envio['type'], 'post_title' => 'ACR ' . $evento, 'post_content' => '', 'post_status' => 'inherit', ), $envio['file']); if (is_wp_error($id)) { return new WP_Error('acr_cel_anexo', 'Falha ao registrar o arquivo.', array('status' => 500)); } wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $envio['file'])); update_post_meta($id, '_acr_cel_nome', $nome); update_post_meta($id, '_acr_cel_evento', $evento); update_post_meta($id, '_acr_cel_ok', '1'); set_transient($chave, $conta + 1, HOUR_IN_SECONDS); return rest_ensure_response(array( 'url' => wp_get_attachment_image_url($id, 'large'), 'nome' => $nome, )); } function acr_cel_destino($dirs) { $pasta = $GLOBALS['acr_cel_pasta']; $dirs['subdir'] = '/' . $pasta; $dirs['path'] = $dirs['basedir'] . '/' . $pasta; $dirs['url'] = $dirs['baseurl'] . '/' . $pasta; return $dirs; } add_action('wp_enqueue_scripts', function () { $rel = '/js/acr-celebracao-galeria.js'; $abs = get_stylesheet_directory() . $rel; if (!file_exists($abs)) { return; } wp_enqueue_script( 'acr-celebracao-galeria', get_stylesheet_directory_uri() . $rel, array(), filemtime($abs), true ); }, 99); add_action('wp_enqueue_scripts', function () { $rel = '/js/acr-convencao-galeria.js'; $abs = get_stylesheet_directory() . $rel; if (!file_exists($abs)) { return; } wp_enqueue_script( 'acr-convencao-galeria', get_stylesheet_directory_uri() . $rel, array(), filemtime($abs), true ); }, 99); require_once get_stylesheet_directory() . '/acr-qr-functions.php';
O endereço que você acessou não existe ou foi movido. Use a busca abaixo ou siga por uma das rotas para encontrar o que procura.
Rotas rápidas
Os destinos mais acessados do site, organizados por tipo de necessidade.
Segurança e controle para pontes rolantes, gruas, RTG e elevadores de cremalheira.
Ver a linha Linha HandlingSegurança e controle para empilhadeiras, escavadeiras, caminhões e locomotivas.
Ver a linha Perguntas frequentesRespostas técnicas sobre normas, instalação, configuração e limites de operação.
Ver as respostas ConteúdosAnálises técnicas, normas aplicáveis e casos de aplicação em operações reais.
Ler os conteúdos Pós-vendaAssistência técnica, peças originais, reparo e calibração em todo o território nacional.
Conhecer o pós-venda A empresaQuem é a ACR, onde atua e a estrutura de engenharia por trás de cada projeto.
Conhecer a ACRSe você chegou aqui procurando uma solução para a sua operação ou suporte para um equipamento já instalado, fale direto com a equipe. A engenharia da ACR responde a dúvidas de aplicação, e o chamado técnico aciona a assistência 24 horas.