<?php /***** * ! Setup */ require_once 'panl.init.php'; $fileops = new GrlxFileOps(); $message = new GrlxAlert(); $image = new GrlxImage(); $link = new GrlxLinkStyle(); $edit_link = new GrlxLinkStyle(); $delete_link = new GrlxLinkStyle(); $view = new GrlxView(); $list = new GrlxList(); $list->draggable(false); $view->yah = 10; // Default value $page_title = 'Ad browser'; // URL to PW’s XML feed. ID not included at this point. $wonderful_file_path = 'http://projectwonderful.com/xmlpublisherdata.php?publisher='; // Folder in which we store ad pics. $image_path = $milieu_list['directory']['value'] . '/assets/images/ads'; // Get and sanitize every variable sent by _get, _post and _session. $var_list = array('ad_id', 'delete_ad_id', 'current_group', 'wonderful_id'); if ($var_list) { foreach ($var_list as $key => $val) { ${$val} = register_variable($val); } } // Does the ad image repository exist? If not, try to make it. $alert_output = $fileops->check_or_make_dir('..' . $image_path);
<?php /* Artists use this script to configure a theme tone. */ /***** * Setup */ require_once 'panl.init.php'; $view = new GrlxView(); $modal = new GrlxForm_Modal(); $link = new GrlxLinkStyle(); $message = new GrlxAlert(); $form = new GrlxForm(); $theme = new GrlxXML_Theme(); $img = new GrlxImage(); $img->db_new = $db; $theme_id = numfunc_register_var('theme_id'); $tone_id = numfunc_register_var('tone_id'); $theme->set_theme_id($theme_id); $theme->set_tone_id($tone_id); /***** * Updates */ // Delete a tone if (is_numeric($_GET['delete_id'])) { $delete_id = $_GET['delete_id']; $result = $db->where('id', $delete_id)->delete('theme_tone'); if ($result) { $match_list = $db->where('tone_id', $delete_id)->delete('image_tone_match'); } else { $alert_output .= $message->alert_dialog('Unable to delete tone from database.');
<?php // ! Setup require_once 'panl.init.php'; require_once 'lib/htmLawed.php'; $link = new GrlxLinkStyle(); $view = new GrlxView(); $message = new GrlxAlert(); $fileops = new GrlxFileOps(); $comic_image = new GrlxComicImage(); $sl = new GrlxSelectList(); $view->yah = 1; $var_list = array('page_id', 'new_page_name', 'blog_headline', 'book_id', 'beginning_end', 'into_marker_id'); if ($var_list) { foreach ($var_list as $key => $val) { ${$val} = register_variable($val); } } if (!$book_id) { $book = new GrlxComicBook(); $book_id = $book->bookID; } else { $book = new GrlxComicBook($book_id); } $book->getMarkers(); // register_variable strips needed whitespace from text blocks $transcript = $_POST['transcript']; $transcript ? $transcript : ($transcript = $_GET['transcript']); $transcript ? $transcript : ($transcript = $_SESSION['transcript']); $blog_post = $_POST['blog_post']; $blog_post ? $blog_post : ($blog_post = $_GET['blog_post']);
unset($heading_list); } // ! Comments // if ($function_id == 3) { $comment_link = new GrlxLinkStyle(); $comment_link->url('xtra.comments.ajax.php'); $comment_link->reveal(true); if (isset($comments_info)) { $heading_list[] = array('value' => 'Your chosen service', 'class' => 'nudge'); $heading_list[] = array('value' => 'Your ' . lcfirst($comments_info['label']), 'class' => 'nudge'); $heading_list[] = array('value' => 'Actions', 'class' => null); $list->row_class('follow'); $list->headings($heading_list); $comment_output = $list->format_headings(); $vis_link = new GrlxLinkStyle(); $vis_link->url($comments_info['url']); $vis_link->title('Go to ' . $comments_info['title']); $vis_link->action('extlink'); $comment_link->title('Edit your user info.'); $comment_link->action('edit'); $comment_link->query("service_id={$comments_info['service_id']}"); $action_output = $vis_link->icon_link() . $comment_link->icon_link(); $comment_list[$comments_info['service_id'] . '||1'] = array($comments_info['title'], $comments_info['value'], $action_output); $list->content($comment_list); $comment_output .= $list->format_content(); $comment_link->url('xtra.social.php'); $comment_link->tap('Reset service'); $comment_link->query("reset_comments={$comments_info['service_id']}"); $reset_output = $comment_link->button_tertiary('reset'); $comment_output .= '<div class="note reset">Do you need to switch to another comment service?' . $reset_output . '</div>';
<?php /***** * Setup */ require_once 'panl.init.php'; require_once 'lib/htmLawed.php'; $link1 = new GrlxLinkStyle(); $view = new GrlxView(); $message = new GrlxAlert(); $marker = new GrlxMarker(); $fileops = new GrlxFileOps(); $sl = new GrlxSelectList(); $view->yah = 3; $var_list = array('page_id', 'new_page_name', 'remove_id', 'blog_headline'); if ($var_list) { foreach ($var_list as $key => $val) { ${$val} = register_variable($val); } } for ($i = 1; $i < 32; $i++) { $i < 10 ? $i = '0' . $i : null; $day_list[$i] = array('title' => $i, 'id' => $i); } for ($i = 1; $i < 13; $i++) { $i < 10 ? $i = '0' . $i : null; $month_list[$i] = array('title' => date("F", mktime(0, 0, 0, $i, 1, 2015)), 'id' => $i); } for ($i = date('Y') - 10; $i < date('Y') + 2; $i++) { $year_list[$i] = array('title' => $i, 'id' => $i); }
<?php /* Artists use this script to manage their site themes. */ /* ! Setup * * * * * * * */ require_once 'panl.init.php'; $args['yah'] = 9; $view = new GrlxView($args); $form = new GrlxForm(); $button = new GrlxLinkStyle(); $sl = new GrlxSelectList(); /* ! Actions * * * * * * * */ // Change one or more tone_id records if (is_numeric($_POST['new_tone_id']) && $_POST['sel'] && $_POST['submit']) { unset($_GET); $new_id = $_POST['new_tone_id']; if (is_array($_POST['sel'])) { $sel = array_keys($_POST['sel']); foreach ($sel as $item) { $db_vars[] = strfunc_split_tablerow($item); } } else { $db_vars[] = strfunc_split_tablerow($_POST['sel']); } if ($db_vars) { foreach ($db_vars as $i => $row) { $row['table'] == 'milieu' ? $col = 'value' : ($col = 'tone_id'); $data = array($col => $new_id); if ($row['table'] == 'book_page') { $marker = new GrlxMarker($row['id']); $page_ids = array_keys($marker->pageList);
$link->tap('Do something about that'); $alert_output .= $message->info_dialog('Hmm, no pages here. ' . $link->text_link() . '.'); } ///// Display the list if ($book->pageList) { $edit_link = new GrlxLinkStyle(); $edit_link->url('book.page-edit.php'); $edit_link->title('Edit page info.'); $edit_link->reveal(false); $edit_link->action('edit'); $delete_link = new GrlxLinkStyle(); $delete_link->url('book.view.php'); $delete_link->title('Delete page.'); $delete_link->reveal(false); $delete_link->action('edit'); $marker_link = new GrlxLinkStyle(); $marker_link->url('book.view.php'); $marker_link->title('Remove this marker.'); $marker_link->reveal(false); $marker_link->action('edit'); // $marker_link->tap('Remove marker'); $heading_list[] = array('value' => 'Select', 'class' => null); $heading_list[] = array('value' => 'Title', 'class' => null); $heading_list[] = array('value' => 'Order', 'class' => null); if ($marker_type_list) { $heading_list[] = array('value' => 'Marker', 'class' => null); } $heading_list[] = array('value' => 'Actions', 'class' => null); $list->headings($heading_list); $list->draggable(false); $list->row_class('chapter');
<?php /***** * Setup */ require_once 'panl.init.php'; require_once 'lib/htmLawed.php'; $link = new GrlxLinkStyle(); $view = new GrlxView(); $message = new GrlxAlert(); $fileops = new GrlxFileOps(); $comic_image = new GrlxComicImage(); $sl = new GrlxSelectList(); $view->yah = 1; $var_list = array('page_id', 'new_page_name', 'blog_headline', 'book_id', 'beginning_end', 'into_marker_id'); if ($var_list) { foreach ($var_list as $key => $val) { ${$val} = register_variable($val); } } if (!$book_id) { $book = new GrlxComicBook(); $book_id = $book->bookID; } else { $book = new GrlxComicBook($book_id); } $book->getMarkers(); // register_variable strips needed whitespace from text blocks $transcript = $_POST['transcript']; $transcript ? $transcript : ($transcript = $_GET['transcript']); $transcript ? $transcript : ($transcript = $_SESSION['transcript']);
} } } $bimport = new bulkImport(); /***** * Setup */ require_once 'panl.init.php'; $view = new GrlxView(); $fileops = new GrlxFileOps(); $message = new GrlxAlert(); $book = new GrlxComicBook(1); $comic_image = new GrlxComicImage(); $marker = new GrlxMarker(); $link = new GrlxLinkStyle(); $link1 = new GrlxLinkStyle(); $list = new GrlxList(); // Yeeeeah, really should make this a constant. $import_path = '../import'; if ($book) { $book->getPages(); } if ($book->pageList) { $last_page = end($book->pageList); $last_page = $last_page['sort_order']; } else { $last_page = 0; } $book_id = $book->bookID; $marker_type_list = $db->get('marker_type', null, 'id,title'); $marker_type_list = rekey_array($marker_type_list, 'id');
<?php /***** * Setup */ require_once 'panl.init.php'; $link = new GrlxLinkStyle(); $view = new GrlxView(); $list = new GrlxList(); $list->draggable(false); $image = new GrlxImage(); $message = new GrlxAlert(); // Default value $page_title = 'Ad location editor'; $var_list = array('slot_id', 'change_to', 'change_from', 'label', 'title'); if ($var_list) { foreach ($var_list as $key => $val) { ${$val} = register_variable($val); } } // No ad selected? Send ’em back to the list. if (!$slot_id || !is_numeric($slot_id)) { header('location:ad.list.php'); } // List of status levels. $priority_list = array('1' => 'High', '0' => 'Normal', '-1' => 'Hidden'); /***** * Updates */ if ($label && $title && $slot_id) { $data = array('label' => $label, 'title' => $title);
$promo_content[] = array($large_image->paint(), $url, ' ', $delete_link->icon_link() . "\n" . $edit_link->icon_link()); } } } if ($promo_content) { $list->content($promo_content); $ad_list_output = '<form accept-charset="UTF-8" action="ad.list.php" method="get">' . "\n"; $ad_list_output .= $list->format_headings(); $ad_list_output .= $list->format_content(); $ad_list_output .= '</form>' . "\n"; } else { $link->url('ad.promo-create.php'); $link->tap('Create one now'); $ad_list_output = $message->info_dialog('Huh. Looks like you haven’t uploaded any ads. ' . $link->paint() . '.'); } $link = new GrlxLinkStyle(); $link->url = 'ad.promo-create.php'; $link->tap = 'Create a new house ad'; $link->title = 'Enter a new promo'; $ad_list_output .= $link->paint(); ///////// Display the slots. // Get all slots for this theme. $slot_list = get_slots(1, 'ad', $db); // No slots? Create one. if (!$slot_list) { $data = array(); // reset $data['title'] = 'Slot 1'; $data['label'] = 'default'; $data['theme_id'] = '1'; $data['max_width'] = '101';
<?php /***** * Setup */ include 'panl.init.php'; $link = new GrlxLinkStyle(); $view = new GrlxView(); $message = new GrlxAlert(); $form = new GrlxForm(); $fileops = new GrlxFileOps(); $fileops->db = $db; $book = new GrlxComicBook(); $marker = new GrlxMarker(); $comic_image = new GrlxComicImage(); $message = new GrlxAlert(); $sl = new GrlxSelectList(); $view->yah = 2; $book_id = $book->bookID; /***** * Updates */ if ($_FILES && $book_id) { if (is_writable('../' . DIR_COMICS_IMG)) { $which = 'file'; $fileops->up_set_destination_folder('../' . DIR_COMICS_IMG); $files_uploaded = $fileops->up_process($which); $new_order = $_POST['new_order']; $new_order ? $new_order : ($new_order = 1); if ($files_uploaded) { $i = -1;
$dupes[] = $key; } } } if (isset($dupes)) { $dupe_alert_output = $message->alert_dialog('Duplicates detected! You should create unique path names to avoid problems.'); } // Build output if ($nav_item) { $list->row_class('menu'); $list->sort_by('menu'); $list->draggable(true); $form->title('Show/hide this item in the site menu.'); $vis_link = new GrlxLinkStyle(); $vis_link->i_only(true); $edit_link = new GrlxLinkStyle(); $edit_link->url('site.nav-edit.ajax.php'); $edit_link->title('Change this item’s tappable text or destination URL.'); $edit_link->reveal(true); $edit_link->action('edit'); foreach ($nav_item as $item) { $edit_link->query("edit_id={$item['id']}"); if ($item['rel_type'] == 'external') { $vis_link->action('delete'); $vis_link->id("delete-{$item['id']}"); $vis_link->title('Delete this link from your site’s menu.'); $vis_output = $vis_link->icon_link(); } else { $form->id("id-{$item['id']}"); $vis_output = $form->checkbox_switch($item['in_menu']); }
if (!is_writable('../' . DIR_COMICS_IMG)) { $alert_output .= $message->alert_dialog('The comics images folder is not writable.'); } // Reset the marker info after making updates. if ($_POST) { $marker = new GrlxMarker($marker_id); } $marker_type_list = $db->get('marker_type', null, 'id,title'); $marker_type_list = rekey_array($marker_type_list, 'id'); if ($marker->pageList) { $edit_link = new GrlxLinkStyle(); $edit_link->url('book.page-edit.php'); $edit_link->title('Edit page meta.'); $edit_link->reveal(false); $edit_link->action('edit'); $delete_link = new GrlxLinkStyle(); $delete_link->i_only(true); $list->draggable(false); $list->row_class('chapter'); /* $heading_list[] = array( 'value' => 'Select', 'class' => null ); */ $heading_list[] = array('value' => ' ', 'class' => null); $heading_list[] = array('value' => 'Title', 'class' => null); $heading_list[] = array('value' => 'Page number', 'class' => null); $heading_list[] = array('value' => 'Date', 'class' => null); $heading_list[] = array('value' => 'Actions', 'class' => null); $list->headings($heading_list);
} } } if ($page_list) { $page_list_output = '<ul class="small-block-grid-2 medium-block-grid-3 large-block-grid-4">' . "\n"; foreach ($page_list as $key => $val) { if ($val['edit_path'] == 1) { $title = urlencode($val['title']); $delete_link = new GrlxLinkStyle(); $delete_link->url('sttc.page-delete.ajax.php'); $delete_link->title('Delete this page.'); $delete_link->reveal(true); $delete_link->query("id={$val['id']}&title={$title}"); $this_action = $delete_link->icon_link('delete'); } else { $delete_link = new GrlxLinkStyle(); $delete_link->i_only(true); $delete_link->id(); $this_action = $delete_link->icon_link('locked'); } $page_list_output .= <<<EOL \t\t<li id="page-{$val['id']}"> \t\t<div class="page sttc"> \t\t\t<a href="sttc.xml-edit.php?page_id={$val['id']}"> \t\t\t\t<h3>{$val['title']}</h3> \t\t\t\t<p>{$val['preview']}</p> \t\t\t</a> \t\t\t{$this_action} \t\t\t<a class="edit" href="sttc.xml-edit.php?page_id={$val['id']}"> \t\t\t\t<i class="edit"></i> \t\t\t</a>
<?php /* Artists use this script to control general site settings. */ /***** * Setup */ require_once 'panl.init.php'; require_once 'lib/htmLawed.php'; $view = new GrlxView(); $link = new GrlxLinkStyle(); $form = new GrlxForm(); $form->send_to($_SERVER['SCRIPT_NAME']); $form->row_class('config'); $sl = new GrlxSelectList(); $view->yah = 12; $date_list[] = array('id' => 'm/d/y', 'title' => '10/31/15'); $date_list[] = array('id' => 'm-d-Y', 'title' => '10-31-2015'); $date_list[] = array('id' => 'd-M-Y', 'title' => '31-Oct-2015'); $date_list[] = array('id' => 'F j, Y', 'title' => 'October 31, 2015'); $date_list[] = array('id' => 'j F Y', 'title' => '31 October 2015'); $timezone_master_list['America/Los_Angeles'] = array('id' => 'America/Los_Angeles', 'title' => 'UTC−08:00: San Francisco, Vancouver, Tijuana'); $timezone_master_list['America/Denver'] = array('id' => 'America/Denver', 'title' => 'UTC−07:00: Denver, Phoenix, Calgary, Ciudad Juárez'); $timezone_master_list['America/Chicago'] = array('id' => 'America/Chicago', 'title' => 'UTC−06:00: Chicago, Guatemala City, Mexico City, San José, San Salvador, Tegucigalpa, Winnipeg'); $timezone_master_list['America/New_York'] = array('id' => 'America/New_York', 'title' => 'UTC−05:00: New York, Lima, Toronto, Bogotá, Havana, Kingston'); $timezone_master_list['America/Caracas'] = array('id' => 'America/Caracas', 'title' => 'UTC−04:30: Caracas'); $timezone_master_list['America/Santiago'] = array('id' => 'America/Santiago', 'title' => 'UTC−04:00: Santiago, La Paz, San Juan de Puerto Rico, Manaus, Halifax'); $timezone_master_list['America/Argentina/Buenos_Aires'] = array('id' => 'America/Argentina/Buenos_Aires', 'title' => 'UTC−03:00: Buenos Aires, Montevideo, São Paulo'); $timezone_master_list['America/Canada/Newfoundland'] = array('id' => 'America/Canada/Newfoundland', 'title' => 'UTC−03:30: St. John’s'); $timezone_master_list['Europe/Lisbon'] = array('id' => 'Europe/Lisbon', 'title' => 'UTC±00:00: Accra, Abidjan, Casablanca, Dakar, Dublin, Lisbon, London'); $timezone_master_list['Europe/Berlin'] = array('id' => 'Europe/Berlin', 'title' => 'UTC+01:00: Belgrade, Berlin, Brussels, Lagos, Madrid, Paris, Rome, Tunis, Vienna, Warsaw');
function image_weight_test($root_folder, $root_list, $image_status_list) { $link = new GrlxLinkStyle(); $fileops = new GrlxFileOps(); $allowed_extension = array('gif', 'png', 'jpg', 'svg'); $overall_status = 0; if ($root_list) { foreach ($root_list as $key => $val) { $folder_list[$root_folder . '/' . $val] = $fileops->get_dir_list($root_folder . '/' . $val); } } if ($folder_list) { foreach ($folder_list as $folder => $set) { if ($set) { foreach ($set as $filename) { $ext = substr($filename, -3, 3); if (in_array($ext, $allowed_extension)) { $image_info = getimagesize($folder . '/' . $filename); $image_bytes = filesize($folder . '/' . $filename); $result = figure_pixel_weight($image_info[0], $image_info[1], $image_bytes); $short = round($result, 3); $status = interpret_image_weight($result); if ($status > $overall_status) { $overall_status = $status; } $pad = $result * 1000; $status = $image_status_list[$status]; if (strlen($filename) > 20) { $abbr = substr($filename, 0, 15) . '…'; } else { $abbr = $filename; } $image_bytes = number_format($image_bytes); $link->url = "{$folder}/{$filename}"; $link->tap = $abbr; $this_link = $link->paint(); $output .= <<<EOL <p> \t<span style="background:{$status['0']};padding-right:{$pad}px;"> </span><br/><strong>{$short} bytes / pixel</strong> <small>({$image_bytes} b / {$image_info['0']} × {$image_info['1']} px)</small> {$this_link} </p> EOL; } } } } } return array($output, $overall_status); }
<?php // ! Setup require_once 'panl.init.php'; $view = new GrlxView(); $modal = new GrlxForm_Modal(); $message = new GrlxAlert(); $link1 = new GrlxLinkStyle(); $link2 = new GrlxLinkStyle(); $list = new GrlxList(); $sl = new GrlxSelectList(); $var_list = array('marker_id', 'new_title', 'edit_marker_type'); if ($var_list) { foreach ($var_list as $key => $val) { ${$val} = register_variable($val); } } if ($marker_id) { $marker = new GrlxMarker($marker_id, true); } else { header('location:book.view.php'); die; } // ! Updates if ($marker_id && $new_title) { $success = $marker->saveMarker($marker_id, $new_title, $edit_marker_type); $marker = new GrlxMarker($marker_id); // reset } if ($success) { $link1->url('marker.view.php?marker_id=' . $marker_id);
<?php /***** * Setup */ require_once 'panl.init.php'; $view = new GrlxView(); $modal = new GrlxForm_Modal(); $message = new GrlxAlert(); $link = new GrlxLinkStyle(); $list = new GrlxList(); $var_list = array('marker_type_id', 'new_title'); if ($var_list) { foreach ($var_list as $key => $val) { ${$val} = register_variable($val); } } if ($marker_type_id) { $marker_type = new GrlxMarkerType($marker_type_id); } else { header('location:marker-type.list.php'); die; } /***** * Updates */ if ($marker_type_id && $new_title) { $success = $marker_type->saveMarkerType($marker_type_id, $new_title); $marker_type = new GrlxMarkerType($marker_type_id); } if ($success) {
} /***** * Display */ $marker_type_list = $marker_type->getMarkerTypeList(); if ($marker_type_list) { $heading_list[] = array('value' => 'Level', 'class' => null); $heading_list[] = array('value' => 'Title', 'class' => null); $heading_list[] = array('value' => 'Total markers', 'class' => null); $heading_list[] = array('value' => 'Actions', 'class' => null); $edit_link = new GrlxLinkStyle(); $edit_link->url('marker-type.edit.php'); $edit_link->title('Edit marker type meta.'); $edit_link->reveal(false); $edit_link->action('edit'); $delete_link = new GrlxLinkStyle(); $delete_link->url('marker-type.list.php'); $delete_link->title('Delete this marker type.'); $delete_link->reveal(false); $delete_link->action('delete'); foreach ($marker_type_list as $key => $val) { $edit_link->query("marker_type_id={$val['id']}"); $delete_link->query("delete_id={$val['id']}"); $action_output = $delete_link->icon_link(); $action_output .= $edit_link->icon_link(); $list_items[$key] = array('select' => $val['rank'], 'title' => $val['title'], 'tally' => $val['tally'], 'action' => $action_output); } $list->draggable(false); $list->row_class('chapter'); $list->headings($heading_list); $list->content($list_items);
if ($new_id <= 0) { $alert_output = $message->alert_dialog('Could not add new link.'); } } } } /***** * Display logic */ $list->row_class('link'); $list->sort_by('link'); $list->draggable(true); $delete_link = new GrlxLinkStyle(); $delete_link->i_only(true); $delete_link->action('delete'); $edit_link = new GrlxLinkStyle(); $edit_link->url('site.link-edit.ajax.php'); $edit_link->reveal(true); $edit_link->action('edit'); // Fetch the link list $cols = array('title', 'url', 'sort_order', 'img_path', 'id'); $result = $db->orderBy('sort_order', 'ASC')->get('link_list', NULL, $cols); if ($db->count > 0) { foreach ($result as $item) { if ($item['img_path']) { $icon = '<img src="' . $item['img_path'] . '" alt="icon" />'; } else { $icon = ''; } $delete_link->id("id-{$item['id']}"); $action_output = $delete_link->icon_link();
<?php /***** * Setup */ require_once 'panl.init.php'; $view = new GrlxView(); $modal = new GrlxForm_Modal(); $message = new GrlxAlert(); $link = new GrlxLinkStyle(); $list = new GrlxList(); $var_list = array('book_id', 'new_title', 'publish_frequency', 'start_month', 'start_day', 'start_year'); if ($var_list) { foreach ($var_list as $key => $val) { ${$val} = register_variable($val); } } if ($book_id) { $book = new GrlxComicBook($book_id); } else { $book = new GrlxComicBook(); $book_id = $book->bookID; } $month_list = array('01' => 'January', '02' => 'February', '03' => 'March', '04' => 'April', '05' => 'May', '06' => 'June', '07' => 'July', '08' => 'August', '09' => 'September', '10' => 'October', '11' => 'November', '12' => 'December'); $start_month_output = build_select_simple('start_month', $month_list, $date_start[1]); for ($i = 1; $i < 32; $i++) { $i < 10 ? $j = '0' . $i : ($j = $i); $day_list[$j] = $i; } $start_day_output = build_select_simple('start_day', $day_list, $date_start[2]); for ($y = date('Y') + 1; $y >= 1980; $y--) {
<?php /***** * Setup */ include 'panl.init.php'; $link = new GrlxLinkStyle(); $view = new GrlxView(); $message = new GrlxAlert(); $var_list = array('ad_id', 'title'); if ($var_list) { foreach ($var_list as $key => $val) { ${$val} = register_variable($val); } } $code = $_POST['code']; // No ad selected? Send ’em back to the list. if (!$ad_id || !is_numeric($ad_id)) { // header('location:ad.list.php'); } // Folder in which we keep ad images. $image_path = $milieu_list['directory']['value'] . '/assets/images/ads'; // List of status levels. $priority_list = array('1' => 'High', '0' => 'Normal', '-1' => 'Hidden'); /***** * Updates */ // Prepare to update the ad’s database record. if ($_POST && $ad_id) { $data = array('code' => $code, 'title' => $title); $db->where('id', $ad_id);
die; } $view = new GrlxView(); $link = new GrlxLinkStyle(); $message = new GrlxAlert(); $form = new GrlxForm(); $fileops = new GrlxFileOps(); $sl = new GrlxSelectList(); // Make sure the image folder exists and is accessible. $alert_output .= $fileops->check_or_make_dir('../' . DIR_STATIC_IMG); /***** * ! Updates */ // This comes from sttc.xml-new.php. if ($msg == 'created') { $link1 = new GrlxLinkStyle(); $link1->url('sttc.xml-new.php'); $link1->tap('Create another new page'); $link->url('site.nav.php'); $link->tap('Add this page to the site’s menu'); $alert_output .= $message->success_dialog('Page created. <ul><li>Make changes below</li><li>' . $link->paint() . '</li><li>' . $link1->paint() . '</li>'); } // ! Upload images // If the static images’ folder exists (that’s $folder_check), // then loop through the artist-submitted files (if any). if (!$alert_output && $_FILES && $_FILES['item']['name']) { foreach ($_FILES['item']['name'] as $key => $image_file_name) { // Get the image’s official filename. $image_file_name = $image_file_name['image']; // Get the image’s temporary serialized name. $tmp_name = $_FILES['item']['tmp_name'][$key]['image'];