/** * 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; }
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'); } }
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'); } }
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'); } }
<?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>