// I made this optional so we don’t override a previously- // uploaded file’s record in the database. if ($check_these) { foreach ($check_these as $key => $val) { if ($upload_status[$key][0] == 'success') { $data[$key . '_image_url'] = $image_path . '/' . basename($_FILES[$key . '_image_url']['name']); } } } // Updates, ho! $db->where('id', $ad_id); $success = $db->update('ad_reference', $data); $link = new GrlxLink('grlx ad list'); if ($success == 1) { $alert = new GrlxAlert(); $alert_output = $alert->success_dialog('Ad info saved. Make changes below or ' . $link->paint() . '.'); } } /***** * Display logic */ if ($ad_id) { $promo_info = get_ad_info($ad_id, $db); } if ($ad_id && $msg == 'created') { $success_message = <<<EOL Ad created. <ul> \t<li>Make changes below</li> \t<li><a href="ad.list.php">Add this ad to a slot in your site’s template</a></li> \t<li><a href="ad.promo-create.php">Make another new ad</a></li>
$fileops->db = $db; $view->yah = 15; $view->page_title('Grawlix panel'); $view->tooltype('panl'); $view->headline('Grawlix panel'); $db->where('date_publish >= NOW()'); $db->orderBy('sort_order', 'ASC'); $id_info = $db->getOne('book_page', 'id'); if ($id_info) { $comic_page = new GrlxComicPage($id_info['id']); } if ($comic_page) { $image = reset($comic_page->imageList); $link->url('book.page-edit.php?page_id=' . $comic_page->pageID); $link->tap($comic_page->pageInfo['title']); $next_output = '<p>' . $link->paint() . '</p>' . "\n"; $link->tap('<img src="' . $image['url'] . '" alt="" />'); $next_output .= '<p>' . $link->paint() . '</p>' . "\n"; } else { $next_output = '<p><a href="book.view.php">Nothing’s coming up.</a></p>' . "\n"; } /* if ( $link_set ) { $link_set_output = '<ul>'."\n"; foreach ( $link_set as $key => $val ) { $link-> url($val['url']); $link-> tap($val['tap']); $link-> title($val['title']); $link_set_output .= '<li>'.$link-> paint().'</li>'."\n"; } $link_set_output .= '</ul>'."\n";
function check_comic_seo($db) { $errors = false; // Be optimistic $link = new GrlxLink(); $total_comic_pages = $db->get('book_page', null, 'COUNT(id) AS total'); $total_comic_pages = $total_comic_pages[0]; $db->orderBy('title', 'ASC'); $page_list = $db->get('book_page', null, 'id,title,sort_order'); $page_list = rekey_array($page_list, 'id'); if ($page_list) { foreach ($page_list as $key => $val) { if (trim($val['title']) == '') { $untitled_list[$key] = $val; $errors = true; } else { $title_count[$val['title']]++; } if ($val['title'] && strlen($val['title']) < 8) { $short_name_list[$key] = $val; $errors = true; } if ($val['title'] && strlen($val['title']) > 60) { $long_name_list[$key] = $val; $errors = true; } } } if ($title_count) { $duplicate_title_error = false; foreach ($title_count as $key => $val) { if ($val > 1) { $duplicate_title_error = true; } } } if ($short_name_list) { $output .= '<p>' . count($short_name_list) . ' comic pages have short titles.</p><ul>' . "\n"; $link->rel = null; foreach ($short_name_list as $key => $val) { $link->tap = $val['title']; $link->url = 'book.page-edit.php?page_id=' . $val['id']; $output .= '<li>' . $link->paint() . '</li>' . "\n"; } $output .= '</ul>' . "\n"; } else { // $output .= '<p>Good news: Every page has a title.</p>'."\n"; } if ($long_name_list) { $link->rel = null; $output .= '<p>' . count($long_name_list) . ' comic pages have overlong titles. ' . $link->paint() . ' titles no longer than about 60 characters.</p><ul>' . "\n"; foreach ($long_name_list as $key => $val) { $link->tap = $val['title']; $link->url = 'book.chapter-edit.php?chapter_id=' . $val['chapter_id']; $output .= '<li>' . $link->paint() . '</li>' . "\n"; } $output .= '</ul>' . "\n"; } if ($untitled_list) { $link->rel = null; $output .= '<p>' . count($untitled_list) . ' comic pages have no titles.</p><ul>' . "\n"; foreach ($untitled_list as $key => $val) { $link->tap = 'Untitled (ID ' . $key . ')'; $link->url = 'book.chapter-edit.php?chapter_id=' . $val['chapter_id']; $output .= '<li>' . $link->paint() . '</li>' . "\n"; } $output .= '</ul>' . "\n"; } else { $output .= '<p>Good news: Every page has a unique title.</p>' . "\n"; } if ($duplicate_title_error === true) { $output .= '<p>These titles are used more than once:</p><ul>' . "\n"; foreach ($title_count as $key => $val) { if ($val > 1) { $output .= '<li>“' . $key . '”</li>' . "\n"; } } $output .= '</ul>'; } return array($errors, $output); }
/** * Mobile panel menu * * @return string - html for small screens */ private function drop_menu() { $menu = $this->menu_list(); $link = new GrlxLink(); $output = '<button class="drop-menu" data-dropdown="drop-menu"><i></i></button>'; $output .= '<ul id="drop-menu" data-dropdown-content>'; foreach ($menu as $group => $array) { $output .= '<li><a class="parent">' . $group . '</a></li>'; foreach ($array as $item => $val) { $link->url($val['file']); $link->tap($val['name']); $link->icon('true'); $link->anchor_class($val['icon']); $output .= '<li>' . $link->paint() . '</li>'; } } $output .= '</ul>'; return $output; }
$list->headings($heading_list); $list->row_class('ad'); $final_adlist_content = array(); $final_adlist_content = array_merge($final_adlist_content, $adlist_content); $list->content($final_adlist_content); $adsense_list_output .= $list->format_headings(); $adsense_list_output .= $list->format_content(); } else { $adsense_list_output = $message->info_dialog('No Google Adsense ads found.'); } $adsense_new_link = new GrlxLink(); $adsense_new_link->url = 'ad.adsense-edit.php'; $adsense_new_link->class = 'main-button right'; $adsense_new_link->tap = '<i class="plus"></i>Create an AdSense ad'; $adsense_new_link->title = 'Enter new AdSense code'; $adsense_list_output .= $adsense_new_link->paint(); ///////// Build the promos panel. if ($ad_list) { $heading_list = array(); // reset /* $heading_list[] = array( 'value' => 'Mobile image', 'class' => null ); $heading_list[] = array( 'value' => 'Tablet image', 'class' => null ); */ $heading_list[] = array('value' => 'Image', 'class' => null);