function shortcode_ldjam($atts) { ld_get_vars(); // Populate the $ldvar global // global $ldvar; // Verify URL // if (isset($_GET['u'])) { $url = to_slug($_GET['u']); if ($url !== $_GET['u']) { $_GET['u'] = $url; $link = "//{$_SERVER['HTTP_HOST']}{$_SERVER['REDIRECT_URL']}"; $link = htmlspecialchars($link, ENT_QUOTES, 'UTF-8'); $link .= "?" . http_build_query($_GET); $link = str_replace('%2F', '/', $link); // Replace % code for / with an actual slash // ld_redirect($link); } } $id = null; // Verify ID // if (isset($_GET['i'])) { $id = base_decode(base_fix($_GET['i'])); } // ld_redirect // print_r($_GET); // echo( to_slug($_GET['u']) ); $shimmy = apcu_fetch('shimmy'); echo $_GET['u']; echo " | " . $id; echo " | " . base_encode($id); //print_r($_SERVER); return "<br />I am very important"; }
function createSlug($slug, $title) { if (!$slug) { return to_slug($title); } else { return to_slug($slug); } }
function section_id($s, $page_section) { $puzzle_options_data = $page_section['options']; $section_id = 'section-' . ($s + 1); if (!empty($puzzle_options_data['id'])) { $section_id = to_slug($puzzle_options_data['id']); } else { if (!empty($puzzle_options_data['headline'])) { $section_id = to_slug($puzzle_options_data['headline']); } } return $section_id; }
<?php // config vars $secrets_path = $_SERVER['DOCUMENT_ROOT'] . '/../config/secrets.php'; include $secrets_path; // form was submitted if (!empty($_POST) && !$_POST['password']) { if ($_POST['api-key'] !== $codame_api_key) { echo "Permission denied."; die; } $table = $_POST['table']; $name = $_POST['name']; $slug = to_slug($name); $now = time(); $original_pic = $_POST['pic']; // upload picture $pic = upload_image($_FILES['pic'], $slug); // echo $pic; // die; if (!$pic) { $pic = $original_pic; } // add a row if ($_POST['action'] == 'add') { // check if a post exists with this slug $existing_amount = get_amount_of_results($table, 'slug', $slug); if ($existing_amount == 0) { // event row if ($table == 'events') { $row_array = array('name' => $name, 'slug' => $slug, 'date' => $_POST['date'], 'pic' => $pic, 'description' => $_POST['description'], 'artists_array' => $_POST['artists-array'], 'projects_array' => $_POST['projects-array'], 'old_url' => $_POST['old-url']);
$ahorro_fiscal_iva = "-\$" . number_format(abs($ahorro_fiscal_iva), 2, ".", ","); $costo_real = "\$" . number_format($costo_real, 2, ".", ","); // Textos variables if ($tipo == 'vehiculo') { $titulo_informacion = 'del vehículo'; $titulo_beneficio = 'Beneficio Fiscal y Costo Real Estimado'; } if ($tipo == 'maquinaria') { $titulo_informacion = 'de la Maquinaria'; $titulo_beneficio = 'Beneficio Fiscal y Costo Real Estimado'; } if ($tipo == 'mobiliario') { $titulo_informacion = 'del Mobiliario / Equipo'; $titulo_beneficio = 'Ahorro Fiscal y Costo Real'; } $clave_referencia = time() . '-' . to_slug($cliente); // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Beta Leasing'); $pdf->SetTitle('Cotización de Arrendamiento Puro'); $pdf->SetSubject('Cotización'); $pdf->SetKeywords('PDF, Beta Leasing, cotizador'); // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH); // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);