Ejemplo n.º 1
0
 /**
  * Get complete permalink for the user (not including the domain and directory).
  * @param  {string} $urlBase URL base of the link. (Optional, defaults to constant "URL".)
  * @return {string}          Complete permalink.
  */
 public function getLink($urlBase = URL)
 {
     if (ae_Settings::isModRewriteEnabled()) {
         $link = $urlBase . PERMALINK_BASE_USER . $this->getPermalink();
     } else {
         $urlBase .= $urlBase[mb_strlen($urlBase) - 1] == '?' ? '&' : '?';
         $link = $urlBase . PERMALINK_GET_USER . '=' . $this->getId();
     }
     return $link;
 }
Ejemplo n.º 2
0
 public function testGetLink()
 {
     $p = new ae_PostModel();
     $p->setId(4);
     $p->setPermalink('a-post');
     if (ae_Settings::isModRewriteEnabled()) {
         $this->assertEquals($p->getLink('http://example.com/'), 'http://example.com/' . PERMALINK_BASE_POST . 'a-post');
     } else {
         $this->assertEquals($p->getLink('http://example.com/'), 'http://example.com/?' . PERMALINK_GET_POST . '=4');
     }
 }
Ejemplo n.º 3
0
 public function testGetLink()
 {
     $c = new ae_CategoryModel();
     $c->setId(4);
     $c->setPermalink('a-category');
     if (ae_Settings::isModRewriteEnabled()) {
         $this->assertEquals($c->getLink('http://example.com/'), 'http://example.com/' . PERMALINK_BASE_CATEGORY . 'a-category');
     } else {
         $this->assertEquals($c->getLink('http://example.com/'), 'http://example.com/?' . PERMALINK_GET_CATEGORY . '=4');
     }
 }
Ejemplo n.º 4
0
 public function testGetLink()
 {
     $u = new ae_UserModel();
     $u->setId(2);
     $u->setPermalink('the-user');
     if (ae_Settings::isModRewriteEnabled()) {
         $this->assertEquals($u->getLink('http://example.com/'), 'http://example.com/' . PERMALINK_BASE_USER . 'the-user');
     } else {
         $this->assertEquals($u->getLink('http://example.com/'), 'http://example.com/?' . PERMALINK_GET_USER . '=2');
     }
 }
Ejemplo n.º 5
0
?>
</title>
		<description><?php 
echo ae_Settings::get('blog_description');
?>
</description>
	<?php 
if ($image !== FALSE) {
    ?>
		<image>
			<url><?php 
    echo $image;
    ?>
</url>
			<title><?php 
    echo ae_Settings::get('blog_title');
    ?>
</title>
			<link><?php 
    echo URL;
    ?>
</link>
		</image>
	<?php 
}
?>
		<pubDate><?php 
echo date('D, d M Y H:i:s O');
?>
</pubDate>
		<link><?php 
Ejemplo n.º 6
0
<?php

$data = array('aestas' => '<td>' . AE_VERSION . '</td>', 'PHP' => '<td>' . phpversion() . '</td>', 'MySQL' => '<td>' . ae_Database::serverVersion() . '</td>', 'Memory limit' => '<td>' . ini_get('memory_limit') . '</td>', 'mod_rewrite' => ae_Settings::isModRewriteEnabled() ? '<td class="cell-okay">enabled</td>' : '<td class="cell-warning">disabled</td>', 'Max filesize for uploads' => '<td>' . ini_get('upload_max_filesize') . '</td>');
$phpVersion = explode('.', phpversion());
// Evil features, that have been removed since PHP 5.4
if ($phpVersion[0] <= 5 && $phpVersion[1] <= 3) {
    $data['Magic Quotes'] = get_magic_quotes_runtime() ? '<td class="cell-danger">enabled</td>' : '<td class="cell-okay">disabled</td>';
    $data['register_globals'] = ini_get('register_globals') ? '<td class="cell-danger">enabled</td>' : '<td class="cell-okay">disabled</td>';
}
?>
<h1>Dashboard</h1>

<table class="table-system">
	<?php 
foreach ($data as $key => $value) {
    ?>
	<tr>
		<th><?php 
    echo $key;
    ?>
</th>
		<?php 
    echo $value;
    ?>
	</tr>
	<?php 
}
?>
</table>
Ejemplo n.º 7
0
	<?php 
    $themes = ae_Settings::getListOfThemes('../themes/');
    ?>

	<div class="setting">
		<label for="set-blog-title">Blog title</label>
		<input type="text" name="blog-title" id="set-blog-title" placeholder="Blog title" value="<?php 
    echo ae_Settings::get('blog_title');
    ?>
" />
	</div>

	<div class="setting">
		<label for="set-blog-description">Blog description</label>
		<input type="text" name="blog-description" id="set-blog-description" placeholder="Blog description" value="<?php 
    echo ae_Settings::get('blog_description');
    ?>
" />
	</div>

	<div class="setting">
		<label for="set-theme">Blog theme</label>
		<select name="theme">
		<?php 
    foreach ($themes as $t) {
        ?>
			<?php 
        $t = htmlspecialchars($t);
        ?>
			<option value="<?php 
        echo $t;
Ejemplo n.º 8
0
if (ini_get('register_globals')) {
    ini_set('register_globals', 0);
}
// URL constant
$protocol = 'http://';
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) {
    $protocol = 'https://';
}
$url = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$url = explode('/', $url);
array_pop($url);
if (defined('IS_RSS')) {
    array_pop($url);
}
$url = $protocol . implode('/', $url) . '/';
define('URL', $url);
unset($url);
// Initialize some needed classes
ae_Timer::start('total');
ae_Log::init($logSettings);
if (ae_Database::connect($dbSettings) === FALSE) {
    $path = 'themes/error-msg-db.php';
    $path = file_exists($path) ? $path : '../' . $path;
    include $path;
    exit;
}
ae_Security::init($securitySettings);
ae_Settings::load();
// Constants used in themes and the RSS feed
define('THEME', ae_Settings::get('theme'));
define('THEME_PATH', URL . 'themes/' . THEME . '/');
Ejemplo n.º 9
0
<?php

$title = ae_Settings::get('blog_title');
if (ae_Permalink::isPost()) {
    $post = ae_Permalink::getPostModel();
    if ($post === FALSE) {
        $content = '404';
        $title = '404 | ' . $title;
    } else {
        $content = 'single-post';
        $title = htmlspecialchars($post->getTitle()) . ' | ' . $title;
    }
} else {
    if (ae_Permalink::isPage()) {
        $page = ae_Permalink::getPageModel();
        if ($page === FALSE) {
            $content = '404';
            $title = '404 | ' . $title;
        } else {
            $content = 'single-page';
            $title = htmlspecialchars($page->getTitle()) . ' | ' . $title;
        }
    } else {
        if (isset($_GET[PERMALINK_GET_SEARCH])) {
            $content = 'search';
        } else {
            $content = 'all-posts';
        }
    }
}
// HTTP 404: Not found