<?php

/*****
 * Setup
 */
require_once 'panl.init.php';
$fileops = new GrlxFileOps();
$link = new GrlxLinkStyle();
$view = new GrlxView();
$message = new GrlxAlert();
$list = new GrlxList();
$list->draggable(false);
$image_obj = new GrlxImage();
// Default value
$page_title = 'Ad editor';
$var_list = array('title', 'ad_id', 'tap_url', 'small_image_url', 'medium_image_url', 'large_image_url', 'msg');
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(
Пример #2
0
<?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);
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;">&nbsp;</span><br/><strong>{$short} bytes / pixel</strong> <small>({$image_bytes} b / {$image_info['0']} &times; {$image_info['1']} px)</small> {$this_link}
</p>

EOL;
                    }
                }
            }
        }
    }
    return array($output, $overall_status);
}
Пример #4
0
    }
    function importFolders()
    {
        if (is_array($this->fileList)) {
            foreach ($this->fileList as $item) {
            }
        }
    }
}
$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'];
<?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']);
Пример #6
0
<?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);
Пример #7
0
<?php

/* Artists use this script to create and edit text pages.
 */
/*****
 * Setup
 */
require_once 'panl.init.php';
require_once 'lib/htmLawed.php';
$link = new GrlxLinkStyle();
$view = new GrlxView();
$message = new GrlxAlert();
$fileops = new GrlxFileOps();
$view->yah = 5;
// Offer these to the artist.
$page_type_list[1] = array('layout_type' => 'ht', 'label' => 'About the artist', 'image' => '../' . DIR_PATTERNS . 'ht.default.svg', 'description' => 'Your bio, artist’s statement, or just who you want people to know you as.', 'url' => '/about-artist');
$page_type_list[2] = array('layout_type' => 'ht', 'function' => 'about-comic', 'label' => 'About the comic', 'image' => '../' . DIR_PATTERNS . 'ht.default.svg', 'description' => 'What you want new readers to know about your comic.', 'url' => '/about-comic');
$page_type_list[3] = array('layout_type' => 'hit', 'function' => 'cast', 'label' => 'Cast', 'image' => '../' . DIR_PATTERNS . 'hit.default.svg', 'description' => 'Name, quick bio and picture of each character.', 'url' => '/comic-characters');
$page_type_list[4] = array('layout_type' => 'hl', 'function' => 'links', 'label' => 'Links', 'image' => '../' . DIR_PATTERNS . 'hl.default.svg', 'description' => 'Simple title, optional descriptive text and URL.', 'url' => '/favorite-links');
$page_type_list[5] = array('layout_type' => 'ht', 'function' => 'faq', 'label' => 'FAQ', 'image' => '../' . DIR_PATTERNS . 'ht.default.svg', 'description' => 'Answers to questions you get asked often it’s worth a page.', 'url' => '/frequently-asked-questions');
$page_type_list[6] = array('layout_type' => 'free', 'function' => 'freeform', 'label' => 'Freeform', 'image' => '../' . DIR_PATTERNS . 'free.svg', 'description' => 'Add your own HTML. Anything goes.', 'url' => '/new-page');
$page_type_list[7] = array('layout_type' => 'ht', 'function' => 'welcome', 'label' => 'Welcome new readers', 'image' => '../' . DIR_PATTERNS . 'ht.default.svg', 'description' => 'Introduction to your comic.', 'url' => '/new-readers-begin-here');
$page_type_list[8] = array('layout_type' => 'hilt', 'function' => 'store', 'label' => 'Store', 'image' => '../' . DIR_PATTERNS . 'hit.default.svg', 'description' => 'Quick product teasers that you link to your ecommerce package.', 'url' => '/store');
/*****
 * Updates
 */
if ($_GET['id']) {
    $id = $_GET['id'];
    $layout_type_id = $page_type_list[$id]['layout_type'];
    $xml_source = '../' . DIR_PATTERNS . '' . $layout_type_id . '.xml';
    if (is_file($xml_source)) {
<?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;
Пример #9
0
<?php

/*****
 * Setup
 */
require_once 'panl.init.php';
$view = new GrlxView();
//$modal = new GrlxForm_Modal;
$message = new GrlxAlert();
$link = new GrlxLinkStyle();
$list = new GrlxList();
$form = new GrlxForm();
$fileops = new GrlxFileOps();
$fileops->db = $db;
$comic_image = new GrlxComicImage();
$sl = new GrlxSelectList();
$form->send_to($_SERVER['SCRIPT_NAME']);
$var_list = array('marker_id', 'book_id', 'new_order');
if ($var_list) {
    foreach ($var_list as $key => $val) {
        ${$val} = register_variable($val);
    }
}
if (!$marker_id) {
    header('location:book.view.php');
    die;
}
$marker = new GrlxMarker($marker_id);
$new_order ? $new_order : ($new_order = 1);
/*****
 * Updates
Пример #10
0
$variable_list = array('page_id', 'new_title', 'new_description', 'old_title', 'xml_format', 'function', 'raw_content', 'msg', 'pattern_id', 'url', 'layout_id');
if ($variable_list) {
    foreach ($variable_list as $val) {
        ${$val} = register_variable($val);
    }
}
// Hold it — no ID, no entrance.
if (!$page_id) {
    header('location:sttc.page-list.php');
    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>');
}