function showGravatarImage($commentID, $class = 'guest')
{
    global $app;
    // SETTING BEGIN
    // Image size
    $size = 32;
    // Gravatar rating
    $rating = 'g';
    // Images altanative text
    $alt = 'His or Her gravatar';
    // SETTING END
    // No object when call from 'recent-comments-text'.
    if (!is_object($app)) {
        $app = new Loggix_Application();
    }
    // Get E-Mail
    $sql = 'SELECT ' . ' user_mail ' . 'FROM ' . COMMENT_TABLE . ' ' . 'WHERE ' . "id = '" . $commentID . "'";
    $res = $app->db->query($sql);
    $userMail = $res->fetchColumn();
    // Default image
    $defaultUrl = preg_match('/admin/', $class) ? $app->getRootUri() . 'theme/css/default/images/icon-admin.png' : $app->getRootUri() . 'theme/css/default/images/icon-guest.png';
    // Make Gravatar URL
    if ($userMail) {
        $imageUrl = 'http://www.gravatar.com/avatar/' . md5(strtolower($userMail)) . '?default=' . urlencode($defaultUrl) . '&size=' . $size . '&rating=' . $rating;
    } else {
        $imageUrl = $defaultUrl;
    }
    return '<img src="' . $imageUrl . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" />';
}
Example #2
0
<?php

/**
 * @since   5.5.26
 * @version 8.2.25 
 */
$pathToIndex = '..';
require_once $pathToIndex . '/lib/Loggix/Application.php';
$app = new Loggix_Application();
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
$item = $app->setMenuItems($sessionState);
// Logout
if (isset($_REQUEST['status']) == 'logout') {
    $sessionState = $app->getOutOfSession();
    if ($sessionState == 'off') {
        header('Location: ' . $pathToIndex . '/index.php');
    }
}
// Session
if ($sessionState == 'on') {
    header('Location: ' . $pathToIndex . '/index.php');
} else {
    // When session is off...
    $contents = new Loggix_View($pathToIndex . '/theme/admin/login.html');
    $contents->assign('lang', $lang);
    $item['contents'] = $contents->render();
}
// Pager
//--------------------------
$item['pager'] = '';
Example #3
0
<?php

/**
 * LOGGiX Expander Module
 *
 * @package LOGGiX
 * @author  LOGGiX Project
 * @since   5.5.16
 * @version 8.1.6 
 */
// =============== (( SETTINGS BEGIN )) ===============
$pathToIndex = '../../..';
$title = 'マニュアル';
$cascadeRootTheme = 'No';
// =============== (( SETTINGS   END )) ===============
set_include_path($pathToIndex . '/lib/Loggix/');
require_once 'Application.php';
require_once 'Expander.php';
$app = new Loggix_Application();
$exp = new Loggix_Expander();
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
$exp->getModuleLanguage();
// Title & Contents
$item = array('title' => $app->setTitle($title), 'contents' => $exp->getContent(), 'pager' => '', 'result' => '');
if ($cascadeRootTheme == 'Yes') {
    $app->display($item, $sessionState);
} else {
    $exp->display($item, $sessionState);
}
Example #4
0
 /**
  * @uses   Loggix_Application
  * @uses   Loggix_View
  * @return array $item
  */
 public function getFileNotFoundMessage()
 {
     global $pathToIndex;
     $errorView = new Loggix_View($pathToIndex . Loggix_Core::LOGGIX_THEME_DIR . 'errors/file-not-found.html');
     return array('contents' => $errorView->render(), 'pager' => '', 'result' => '', 'title' => Loggix_Application::setTitle('404 Not Found'));
 }
Example #5
0
<?php

/**
 * Display Drafts
 *
 * @since   5.5.16
 * @version 9.2.14
 */
$pathToIndex = '..';
require_once $pathToIndex . '/lib/Loggix/Application.php';
$app = new Loggix_Application();
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
if ($sessionState == 'on') {
    if (!empty($_REQUEST['id'])) {
        //  Publish or draft
        $id = intval($_REQUEST['id']);
        $app->db->beginTransaction();
        // Prepare update query
        $sql = 'UPDATE ' . LOG_TABLE . ' ' . 'SET ' . 'draft = :draft ' . 'WHERE ' . 'id = :id';
        $stmt = $app->db->prepare($sql);
        if (empty($_REQUEST['publish'])) {
            // Save as draft
            $res = $stmt->execute(array(':draft' => 1, ':id' => $id));
            if ($res) {
                $app->db->commit();
                header('Location: ' . $pathToIndex . '/index.php');
            }
        } elseif ($_REQUEST['publish'] == '1') {
            // Publish
            $res = $stmt->execute(array(':draft' => 0, ':id' => $id));
Example #6
0
<?php

/**
 * @since   8.3.2
 * @version 10.4.9
 */
$pathToIndex = '..';
require_once $pathToIndex . '/lib/Loggix/Application.php';
$app = new Loggix_Application();
$sessionState = $app->getSessionState();
$item = $app->setMenuItems($sessionState);
// Session
if ($sessionState == 'on') {
    $app->insertTagSafe();
    // Save Changes
    if (isset($_POST['root_dir'], $_POST['loggix_title'], $_POST['page_max'], $_POST['language'], $_POST['xml_version'], $_POST['tz'], $_POST['show_date_title'], $_POST['title_date_format'], $_POST['post_date_format'], $_POST['upload_file_max'], $_POST['menu_list'], $_POST['css_cookie_name'], $_POST['css_cookie_time'], $_POST['css_list'], $_POST['recent_comment_max'], $_POST['recent_trackback_max'], $_POST['block_tags'], $_POST['block_keywords'], $_POST['block_ascii_only_text'], $_POST['save_settings'])) {
        if ($_POST['save_settings'] == 'save') {
            // Set new value
            $root_dir = $_POST['root_dir'];
            $loggix_title = $_POST['loggix_title'];
            $page_max = $_POST['page_max'];
            $language = $_POST['language'];
            $xml_version = $_POST['xml_version'];
            $tz = $_POST['tz'];
            $maxlifetime = '60';
            //$_POST['maxlifetime'];
            $show_date_title = $_POST['show_date_title'];
            $title_date_format = $_POST['title_date_format'];
            $post_date_format = $_POST['post_date_format'];
            $upload_file_max = $_POST['upload_file_max'];
            $menu_list = str_replace('\\r', PHP_EOL, str_replace("\n", PHP_EOL, $_POST['menu_list']));
Example #7
0
<?php

/**
 * LOGGiX Index
 *
 * @package Loggix
 * @author  Loggix Project
 * @since   5.5.16
 * @version 8.3.23
 */
$pathToIndex = '../..';
require_once $pathToIndex . '/lib/Loggix/Application.php';
require_once $pathToIndex . '/lib/Loggix/Expander.php';
$app = new Loggix_Application();
$exp = new Loggix_Expander();
$sessionState = $app->getSessionState();
header('Location: ./' . $app->setXmlLanguage() . '/');
Example #8
0
<?php

/**
 * Delete Item
 *
 * @since   5.5.12
 * @version 9.2.8
 */
$pathToIndex = '..';
require_once $pathToIndex . '/lib/Loggix/Application.php';
$app = new Loggix_Application();
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
//=============================================
// INSTALL SQLs
//=============================================
$installQueries = array('CREATE TABLE ' . LOG_TABLE . ' (
  id INTEGER PRIMARY KEY,
  title,
  href,
  comment,
  text_mode INTEGER DEFAULT 0,
  excerpt,
  date,
  mod,
  draft INTEGER DEFAULT 0,
  ping_uri,
  allow_comments INTEGER DEFAULT 1,
  allow_pings INTEGER DEFAULT 1,
  author
)', 'CREATE TABLE ' . LOG_TAG_TABLE . ' (
Example #9
0
<?php

/**
 * @since   5.5.15
 * @version 9.3.24
 */
$pathToIndex = '..';
require_once $pathToIndex . '/lib/Loggix/Application.php';
$app = new Loggix_Application();
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
if ($sessionState == 'on') {
    if (isset($_POST['title'], $_POST['comment'], $_POST['draft'])) {
        $app->insertTagSafe();
        $title = $_POST['title'];
        $comment = $_POST['comment'];
        $draftStatus = $_POST['draft'];
        $excerpt = isset($_POST['excerpt']) ? $_POST['excerpt'] : '';
        $parent_key = isset($_POST['parent_key']) ? $_POST['parent_key'] : '';
        if (isset($_POST['y'], $_POST['m'], $_POST['d'], $_POST['h'], $_POST['i'], $_POST['s'])) {
            $Y = $_POST['y'];
            $m = $_POST['m'];
            $d = $_POST['d'];
            $H = $_POST['h'];
            $i = $_POST['i'];
            $s = $_POST['s'];
            $postDate = $Y . '-' . $m . '-' . $d . ' ' . $H . ':' . $i . ':' . $s;
            $modDate = $Y . '-' . $m . '-' . $d . ' ' . $H . ':' . $i . ':' . $s;
        } else {
            $postDate = gmdate('Y-m-d H:i:s', time() + $config['tz'] * 3600);
            $modDate = gmdate('Y-m-d H:i:s', time() + $config['tz'] * 3600);
Example #10
0
<?php

/**
 * Resources directory index
 * 
 * @since   5.6.29
 * @version 8.2.25
 */
$pathToIndex = '..';
require_once $pathToIndex . '/lib/Loggix/Application.php';
$app = new Loggix_Application();
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
$app->insertSafe();
if ($sessionState == 'on') {
    if (isset($_POST['del'])) {
        $del = $_POST['del'];
        unlink($del);
    }
    $dir = '../data/resources/';
    if ($handle = opendir($dir)) {
        while (false !== ($file = readdir($handle))) {
            if ($file != '.' && $file != '..' && $file != 'index.php' && $file != '.DS_Store') {
                $filePath = $dir . $file;
                $item['file'] = $filePath;
                $item['file_name'] = substr($file, 0, 30) . (strlen($file) >= 30 ? '...' : '');
                $item['file_date'] = date('Y-m-d G:i:s', filectime($filePath));
                $item['file_type'] = filetype($filePath);
                $item['file_size'] = $app->toMegaByte(filesize($filePath));
                $size = getimagesize($filePath);
                $item['width_height'] = $size != null ? $size[0] . '&#215;' . $size[1] : '-';
Example #11
0
<?php

/**
 * Loggix CMS index.php
 *
 * Loggix Controller
 *
 * @package   Loggix
 * @copyright Copyright (C) Loggix Project
 * @link      http://loggix.gotdns.org/
 * @since     5.5.16
 * @version   9.8.19
 */
$pathToIndex = '.';
require_once $pathToIndex . '/lib/Loggix/Application.php';
$app = new Loggix_Application();
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
try {
    $_SERVER['QUERY_STRING'] = htmlentities($_SERVER['QUERY_STRING']);
    // Cleanup the request array.
    $app->insertSafe();
    // (1) Search by Tag, by Keyword, and by Date
    if (!empty($_GET['t']) || !empty($_GET['k']) || !empty($_GET['d'])) {
        $previousItemNumber = empty($_GET['p']) ? '0' : $_GET['p'];
        $date = empty($_GET['d']) ? '' : $_GET['d'];
        $expand = empty($_GET['ex']) ? '0' : $_GET['ex'];
        $pageNumberToShow = empty($_GET['pn']) ? '1' : $_GET['pn'];
        // Tag Search
        if (!empty($_GET['t'])) {
            $key = $_GET['t'];
Example #12
0
<?php

/**
 * @since   5.5.26
 * @version 9.2.6
 */
$pathToIndex = '..';
require_once $pathToIndex . '/lib/Loggix/Application.php';
$app = new Loggix_Application();
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
if ($sessionState == 'on') {
    $app->insertSafe();
    // Add New User
    if (isset($_POST['action']) == 'add' && !empty($_POST['new_user_name']) && !empty($_POST['new_user_pass']) && !empty($_POST['new_user_nickname'])) {
        $aNewUserName = $_POST['new_user_name'];
        $aNewUserPass = sha1($_POST['new_user_pass']);
        $aNewUserNickname = $_POST['new_user_nickname'];
        // Check if the posted user name exists
        $checkSql = 'SELECT ' . 'COUNT(user_id) ' . 'FROM ' . USER_TABLE . ' ' . 'WHERE ' . "user_name = '" . $aNewUserName . "'";
        $countRes = $app->db->query($checkSql);
        $countId = $countRes->fetchColumn();
        // If there's no posted user name, then add new user.
        if ($countId == '0') {
            $sql = 'INSERT INTO ' . USER_TABLE . '(' . 'user_name, ' . 'user_pass, ' . 'user_nickname' . ') ' . 'VALUES' . "('" . $aNewUserName . "', '" . $aNewUserPass . "', '" . $aNewUserNickname . "')";
            $res = $app->db->query($sql);
            if ($res) {
                header('Location : ' . $_SERVER['PHP_SELF']);
            }
        }
        // Delete User
Example #13
0
<?php

/**
 * Display New Log Entry Form
 *
 * @since   5.5.26
 * @version 9.1.31
 */
$pathToIndex = '..';
require_once $pathToIndex . '/lib/Loggix/Application.php';
$app = new Loggix_Application();
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
if ($sessionState == 'on') {
    // Contents
    $item['time'] = $app->getDateArray();
    $item['attachments'] = $app->setAttachments();
    $item['tag_cloud'] = $app->getTagCloudArray();
    $smileyButton = new Loggix_View($pathToIndex . '/theme/smiley-button.html');
    $item['smiley_button'] = $smileyButton->render();
    $contents = new Loggix_View($pathToIndex . '/theme/admin/write.html');
    $contents->assign('item', $item);
    $contents->assign('lang', $lang);
    $contents->assign('config', $config);
    $item['contents'] = $contents->render();
    // Pager
    $item['pager'] = '';
    $item['result'] = '';
    $item['title'] = $app->setTitle($lang['new_log']);
    $app->display($item, $sessionState);
} else {