Пример #1
0
 public static function select($name, $list = array(), $selected = null, $title = "", $show_key_name = 'name', $show_pk_name = 'id')
 {
     $default[] = "<option value='0' selected>-请选择{$title}-</option>";
     if ($selected === null) {
         if (isset($_REQUEST[$name]) && $_REQUEST[$name]) {
             $selected = RequestParam::Request($name);
         } elseif (Session::Exists(SESSION_LAST_POST)) {
             $last_post = Session::Get(SESSION_LAST_POST);
             $selected = array_get($last_post, $name);
         }
     }
     if (!empty($list)) {
         foreach ($list as $one) {
             $selectedStyle = $one[$show_pk_name] == $selected ? 'selected' : '';
             $default[] = sprintf('<option value="%s" %s>%s</option>', $one[$show_pk_name], $selectedStyle, $one[$show_key_name]);
         }
     }
     return join('', $default);
 }
Пример #2
0
<?php

if (!defined('LOGIN_PAGE')) {
    if (!(Session::Exists('username') && Session::Exists('id'))) {
        Response::Redirect(ADMIN_ROOT . 'login.php');
    }
}
Пример #3
0
<?php

if (!defined('ABSPATH')) {
    exit('No direct script access allowed');
}
if (!Session::Exists('scheduleInProcess')) {
    // Set a session to prevent multi proccess at once
    Session::Put('scheduleInProcess', true);
    // Get posts that have status 0 (not completed) and pause = 0 and date <= current date
    $scheduledposts = new scheduledposts();
    $fb = new Facebook();
    $posts = new Posts();
    $spintax = new Spintax();
    foreach ($scheduledposts->post() as $scheduled) {
        $user = new User($scheduled->userid);
        // Set user timezone if the user defined the timezone
        if (isset($user->Options()->timezone)) {
            if ($user->Options()->timezone) {
                date_default_timezone_set($user->Options()->timezone);
            }
        }
        // Check if the post date <= current datetime of the user
        // Get current time
        $currentDateTime = new DateTime();
        $next_post_time = new DateTime($scheduled->next_post_time);
        if (strtotime($currentDateTime->format("Y-m-d H:i")) >= strtotime($next_post_time->format("Y-m-d H:i"))) {
            // get the post
            $post = $posts->GetPost($scheduled->post_id);
            // Post is ready
            if (count($post) == 0) {
                logs::Save($scheduled->id, lang('POST_NOT_FOUND'));
Пример #4
0
<?php

session_start();
ob_start();
require_once "../core/autoload.php";
require_once "../core/language/language.php";
if (!Session::Exists("setup")) {
    Redirect::To("../index.php");
    die;
}
?>
<html>
<head>
	<title>The kingposter setup</title>
	<meta charset="UTF-8" />
	<meta name="description" content="">
	<meta name="author" content="Abdellah Gounane - Icodix.com">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
  	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link href="../theme/default/css/custom.css" rel="stylesheet" />
  	<link href="../theme/default/bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<script src="../theme/default/js/jquery.js"></script>
	<script src="../theme/default/js/jsui.js"></script>
	<script src="../theme/default/bootstrap/js/bootstrap.min.js"></script>
	<style>
		/* --- Install page ---*/
		form.form-install .form-control { margin-bottom: 10px;}
		.form-install .panel-heading {
		    background: #3a5795 !important;
		}
		.form-install {