Пример #1
0
function halcyonic_favicon()
{
    $settings = theme_settings();
    if (strstr("http", $settings['favicon'])) {
        ?>
	<link rel="shortcut icon" href="<?php 
        echo $settings['favicon'];
        ?>
" />
	<?php 
    } else {
        ?>
	<link rel="shortcut icon" href="<?php 
        qoolinfo('home');
        ?>
/<?php 
        template_path();
        ?>
/<?php 
        echo $settings['favicon'];
        ?>
" />
	<?php 
    }
}
Пример #2
0
function theme_dir()
{
    $current_theme = get_current_theme_name();
    if (empty($current_theme) || !file_exists(template_path($current_theme) . DIRECTORY_SEPARATOR)) {
        $current_theme = 'default';
    }
    return template_path($current_theme) . DIRECTORY_SEPARATOR;
}
Пример #3
0
function hold_template()
{
    ob_start();
    include template_path();
    $contents = ob_get_contents();
    ob_end_clean();
    return $contents;
}
Пример #4
0
function template_path($filename, $template_dir = false, $allow_fallback = true)
{
    global $template_fallbacks;
    if (!$template_dir) {
        $template_dir = config('template');
    }
    $template = "template/{$template_dir}/{$filename}";
    if (file_exists(BASEDIR . "/" . $template)) {
        return $template;
    } elseif (isset($template_fallbacks[$filename]) && ($template = template_path($template_fallbacks[$filename], $template_dir, false))) {
        return $template;
    } elseif ($template_dir != 'default') {
        return template_path($filename, 'default');
    }
    return false;
}
Пример #5
0
 function get_all_reviews($limit, $offset = 0)
 {
     // return all reviews
     // if a limit more than zero is provided, limit the results
     if ($limit > 0) {
         $this->db->limit($limit, $offset);
     }
     $this->db->order_by('id', 'DESC');
     $query = $this->db->get('review');
     if ($query->num_rows() > 0) {
         $result = $query->result();
         // set the image paths for each result
         foreach ($result as $key => $item) {
             if ($result[$key]->image_name === '') {
                 $result[$key]->image_url = template_path() . 'design/images/default_image.jpg';
                 $result[$key]->review_thumb_url = template_path() . 'design/images/default_image_thumb.jpg';
                 $result[$key]->list_thumb_url = template_path() . 'design/images/default_image_thumb.jpg';
             } else {
                 $result[$key]->image_url = base_url() . 'uploads/images/' . $result[$key]->image_name . '.' . $result[$key]->image_extension;
                 $result[$key]->review_thumb_url = base_url() . 'uploads/images/' . $result[$key]->image_name . '_review_thumb.' . $result[$key]->image_extension;
                 $result[$key]->list_thumb_url = base_url() . 'uploads/images/' . $result[$key]->image_name . '_list_thumb.' . $result[$key]->image_extension;
             }
         }
         // return the reviews
         return $result;
     }
     // no result
     return FALSE;
 }
function dynamic_css_path()
{
    if (!is_multisite()) {
        return template_path() . 'assets/css/';
    }
    $upload_info = wp_upload_dir();
    return trailingslashit($upload_info['basedir']) . 'css/';
}
 function settings_presentation()
 {
     if (!current_user_can('manage_options')) {
         wp_die(__('You do not have sufficient permissions to access this page.'));
     }
     if (isset($_POST['settings']['theme_templates']) && $_POST['settings']['theme_templates'] == "on") {
         $_POST['settings']['theme_templates'] = addslashes(template_path(STYLESHEETPATH . DIRECTORY_SEPARATOR . "shopp"));
     }
     if (!empty($_POST['save'])) {
         check_admin_referer('shopp-settings-presentation');
         if (empty($_POST['settings']['catalog_pagination'])) {
             $_POST['settings']['catalog_pagination'] = 0;
         }
         $this->settings_save();
         $updated = __('Shopp presentation settings saved.');
     }
     $builtin_path = $this->basepath . DIRECTORY_SEPARATOR . "templates";
     $theme_path = template_path(STYLESHEETPATH . DIRECTORY_SEPARATOR . "shopp");
     // Copy templates to the current WordPress theme
     if (!empty($_POST['install'])) {
         check_admin_referer('shopp-settings-presentation');
         copy_shopp_templates($builtin_path, $theme_path);
     }
     $status = "available";
     if (!is_dir($theme_path)) {
         $status = "directory";
     } else {
         if (!is_writable($theme_path)) {
             $status = "permissions";
         } else {
             $builtin = array_filter(scandir($builtin_path), "filter_dotfiles");
             $theme = array_filter(scandir($theme_path), "filter_dotfiles");
             if (empty($theme)) {
                 $status = "ready";
             } else {
                 if (array_diff($builtin, $theme)) {
                     $status = "incomplete";
                 }
             }
         }
     }
     $category_views = array("grid" => __('Grid', 'Shopp'), "list" => __('List', 'Shopp'));
     $row_products = array(2, 3, 4, 5, 6, 7);
     $productOrderOptions = Category::sortoptions();
     $orderOptions = array("ASC" => __('Order', 'Shopp'), "DESC" => __('Reverse Order', 'Shopp'), "RAND" => __('Shuffle', 'Shopp'));
     $orderBy = array("sortorder" => __('Custom arrangement', 'Shopp'), "name" => __('File name', 'Shopp'), "created" => __('Upload date', 'Shopp'));
     $sizingOptions = array(__('Scale to fit', 'Shopp'), __('Scale &amp; crop', 'Shopp'));
     $qualityOptions = array(__('Highest quality, largest file size', 'Shopp'), __('Higher quality, larger file size', 'Shopp'), __('Balanced quality &amp; file size', 'Shopp'), __('Lower quality, smaller file size', 'Shopp'), __('Lowest quality, smallest file size', 'Shopp'));
     include SHOPP_ADMINPATH . "/settings/presentation.php";
 }
Пример #8
0
function spyropress_skin_remove()
{
    // Security
    check_ajax_referer('skin_generator_form', 'skin_generator_nonce');
    $filename = $_POST['skin_name'];
    if (empty($filename)) {
        die;
    }
    // generate filename
    $css = template_path() . 'assets/css/skins/' . $filename . '.css';
    // Delte previous file
    unlink($css);
    $skins = get_option('_spyropress_porto_skins');
    unset($skins[$filename]);
    update_option('_spyropress_porto_skins', $skins);
    // Refresh page
    echo 'window.location = "' . $_SERVER['HTTP_REFERER'] . '";';
    // Exit
    die;
}
Пример #9
0
function get_the_include()
{
    global $tpl;
    $dirs = Zend_Registry::get('dirs');
    $controller = Zend_Registry::get('controller');
    if ($controller == 'index') {
        if (file_exists(APPL_PATH . template_path(0) . DIR_SEP . $tpl->tpl->tplObject['theInclude'] . "." . Zend_Registry::get('tplExt'))) {
            return APPL_PATH . template_path(0) . DIR_SEP . $tpl->tpl->tplObject['theInclude'] . "." . Zend_Registry::get('tplExt');
        }
        return $tpl->tpl->tplObject['theInclude'] . "." . Zend_Registry::get('tplExt');
    }
    return APPL_PATH . $dirs['structure']['addons'] . DIR_SEP . $controller . DIR_SEP . "templates/" . $tpl->tpl->tplObject['theInclude'] . "." . Zend_Registry::get('tplExt');
}
Пример #10
0
<?php

/**
 * Layout Loader
 *
 * Loads the right layout with the right content inside it
 */
ob_start();
include template_path();
$content = ob_get_contents();
ob_end_clean();
$layout = isset($layout) ? $layout : 'default';
the_component('layouts/' . $layout, array('content' => $content));
Пример #11
0
<script>(function(d, s, id) {
	var js, fjs = d.getElementsByTagName(s)[0];
	if (d.getElementById(id)) return;
	js = d.createElement(s); js.id = id;
	js.src = "//connect.facebook.net/el_GR/all.js#xfbml=1&appId=230562596993743";
	fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<?php 
qool_footer();
?>
<script type="text/javascript" src="<?php 
qoolinfo('home');
?>
/<?php 
template_path();
?>
/jquery.nivo.slider.pack.js"></script>
    <script type="text/javascript">
    $(window).load(function() {
    	$('#banner').nivoSlider({
    		effect: 'random', // Specify sets like: 'fold,fade,sliceDown'
    		slices: 15, // For slice animations
    		boxCols: 8, // For box animations
    		boxRows: 4, // For box animations
    		animSpeed: 1000, // Slide transition speed
    		pauseTime: 8000, // How long each slide will show
    		startSlide: 0, // Set starting Slide (0 index)
    		directionNav: true, // Next & Prev navigation
    		controlNav: false, // 1,2,3... navigation
    		controlNavThumbs: false, // Use thumbnails for Control Nav
Пример #12
0
<?php

if ($_POST && (!isset($_POST['authtoken']) || $_POST['authtoken'] != authtoken())) {
    die_error("Post authentication failed.");
}
$page->add_js('https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js');
$page->add_js(template_path('admin.js'));
$page->add_css(template_path('cal.css'));
$page->add_breadcrumb("Admin", "admin/");
$valid_auth = sha1(config('adminuser') . config('adminpass'));
if (config('adminuser') && (empty($_COOKIE['admin']) || $_COOKIE['admin'] !== $valid_auth)) {
    if (isset($_POST['adminuser'], $_POST['adminpass']) && sha1($_POST['adminuser'] . $_POST['adminpass']) == $valid_auth) {
        setcookie('admin', $valid_auth);
        redirect("admin/", "Welcome");
    } else {
        header('HTTP/1.0 401 Unauthorized');
        ?>
No access for you.<br><br>

        <form method="POST">
            <?php 
        echo authtoken_input();
        ?>
            Username: <input name="adminuser"><br>
            Password: <input name="adminpass" type="password"><br>
            <input type="submit" value="Login">
        </form>
        <?php 
    }
    exit;
}
Пример #13
0
require_once 'include/common.php';
require_once 'include/config.php';
if (DEBUG) {
    ini_set('display_errors', 1);
    error_reporting(E_ALL);
}
define('STATUS_CLOSED', 1);
$template_fallbacks = array('admin_head.php' => 'head.php', 'admin_foot.php' => 'foot.php', 'archive_head.php' => 'head.php', 'archive_foot.php' => 'foot.php', 'comic_head.php' => 'head.php', 'comic_foot.php' => 'foot.php', 'chapter_head.php' => 'head.php', 'chapter_foot.php' => 'foot.php', 'rant_head.php' => 'head.php', 'rant_foot.php' => 'foot.php');
$request = isset($_REQUEST['q']) && $_REQUEST['q'] && $_REQUEST['q'] != '/' ? $_REQUEST['q'] : 'index';
$request = array_values(array_filter(explode('/', $request)));
$page = new Page();
$page->title = config('title');
// $page->add_css("template/{config('template')}/style.css");
$page->add_css(template_path('style.css'));
// $page->add_js('https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js');
$page->add_js(template_path('nav.js'));
$page->set_start_time($start_time);
switch ($request[0]) {
    case 'index':
        // frontpage
        $selection_style = config('frontpage_comic', 'latest');
        $page->debug('selection_style', $selection_style);
        switch ($selection_style) {
            case 'first':
                $comic = $db->fetch_first("SELECT * FROM comics WHERE pub_date <= UNIX_TIMESTAMP() ORDER BY pub_date ASC LIMIT 1");
                break;
            case 'first-of-latest-day':
                $latest = $db->quick("SELECT pub_date FROM comics WHERE pub_date <= UNIX_TIMESTAMP() ORDER BY pub_date DESC LIMIT 1");
                $midnight = strtotime(date('Y-m-d', $latest));
                $comic = $db->fetch_first("SELECT * FROM comics WHERE pub_date >= %d AND pub_date <= UNIX_TIMESTAMP() ORDER BY pub_date ASC LIMIT 1", $midnight);
                break;
Пример #14
0
function comments_template($file = 'comments.php', $separate_comments = false)
{
    include APPL_PATH . template_path(0) . "/" . $file;
}
Пример #15
0
</h3>
<br />
<div class="row-fluid">
    <div class="span2"><strong><?php 
_e('Framework Directory:', 'spyropress');
?>
</strong></div>
    <div class="span6"><?php 
echo framework_path();
?>
</div>
    <div class="span2"><?php 
echo $framework ? $writable_msg : $not_writable_msg;
?>
</div>
</div>
<div class="row-fluid">
    <div class="span2"><strong><?php 
_e('CSS Directory:', 'spyropress');
?>
</strong></div>
    <div class="span6"><?php 
echo template_path() . 'assets/css/';
?>
</div>
    <div class="span2"><?php 
echo $assets ? $writable_msg : $not_writable_msg;
?>
</div>
</div>
<br />