• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Znote AAC] Guilcera Layout

Last Question, how I can post news?
You need to set admin account at config.php, when you log with it a "Admin News" link will appear at left menu, there you manage news.
Code:
// WARNING! Account names written here will have admin access to web page!
$config['page_admin_access'] = array(
//'otland0',
//'otland1',
'znote'
);

And a website character, that is in admin account
Code:
// IMPORTANT! Write a character name(that exist) that will represent website bans!
// Or remember to create character "God Website" character exist.
// If you don't do this, bann from admin panel won't work properly.
$config['website_char'] = 'Luxitur';
 
when i write one news
Fatal error: Unsupported operand types in C:\xampp\htdocs\layout\sub\index.php on line 32
 
when i write one news
Fatal error: Unsupported operand types in C:\xampp\htdocs\layout\sub\index.php on line 32

The error is just with Feedback forum? Forum has nothing to do with the layout, I don't know what may have caused it. News page indeed is bugged. Use this one: /layout/sub/index.php

Code:
<img src="layout/images/titles/t_news.png"/>

<?php
$title = explode(" ", $config['site_title']);
?>

<table class="newstable">
    <tr>
        <td width="80%">
        Welcome, wanderer, to the fascinating world of <?php echo $title[0]; ?>, a massive multiplayer online role playing game. Take the role of a valorous adventurer, explore a huge realm of magic and mystery and make friends with people from all over the world! To learn more about <?php echo $title[0]; ?> take a look at the our <a href="gallery.php">gallery page</a>. To start playing <a href="register.php">sign up</a> for a free account and <a href="downloads.php">download your client</a>. See you in <?php echo $title[0]; ?>!</td>
        <td width="20%" align="center"><a href="register.php"><img src="layout/images/signup.gif"/></a></td>
    </tr>
</table>
<br>

<?php
$cache = new Cache('engine/cache/news');
        if ($cache->hasExpired()) {
            $news = fetchAllNews();
           
            $cache->setContent($news);
            $cache->save();
        } else {
            $news = $cache->load();
        }
       
        if (!isset($_GET['page'])) {
            $page = 0;
        } else {
            $page = (int)$_GET['page'];
        }

        if ($news) {
           
            $total_news = count($news);
            $row_news = $total_news / $config['news_per_page'];
            $page_amount = ceil($total_news / $config['news_per_page']);
            $current = $config['news_per_page'] * $page;

            function TransformToBBCode($string) {
                $tags = array(
                    '[center]{$1}[/center]' => '<center>$1</center>',
                    '[b]{$1}[/b]' => '<b>$1</b>',
                    '[size={$1}]{$2}[/size]' => '<font size="$1">$2</font>',
                    '[img]{$1}[/img]'    => '<a href="$1" target="_BLANK"><img src="$1" alt="image" style="width: 100%"></a>',
                    '[link]{$1}[/link]'    => '<a href="$1">$1</a>',
                    '[link={$1}]{$2}[/link]'   => '<a href="$1" target="_BLANK">$2</a>',
                    '[color={$1}]{$2}[/color]' => '<font color="$1">$2</font>',
                    '[*]{$1}[/*]' => '<li>$1</li>',
                );
                foreach ($tags as $tag => $value) {
                    $code = preg_replace('/placeholder([0-9]+)/', '(.*?)', preg_quote(preg_replace('/\{\$([0-9]+)\}/', 'placeholder$1', $tag), '/'));
                    $string = preg_replace('/'.$code.'/i', $value, $string);
                }
                return $string;
            }
           
            echo '<table><div id="news">';
            for ($i = $current; $i < $current + $config['news_per_page']; $i++) {
                if (isset($news[$i])) {
                    ?>
                    <tr><td class="zheadline" colspan="2">&nbsp;&nbsp;<span class="znewsdate"><?php echo date('l, d M Y', $news[$i]['date']); ?> - </span><b><?php echo TransformToBBCode($news[$i]['title']); ?></td></tr>
                    <tr><td class="znewsbody" colspan="2"><?php echo TransformToBBCode(nl2br($news[$i]['text'])); ?></td></tr>
                    <tr><td class="znewsdate"><span style="color:#5a2800;font-weight: normal;">&nbsp;&nbsp;by </span><a href="characterprofile.php?name=<?php echo $news[$i]['name']; ?>"><?php echo $news[$i]['name']; ?></a></td><td class="znewsdate"></td></tr>
                    <tr><td class="znewsdate" colspan="2"></td></tr>
                    <?php
                } 
            }
            echo '</div></table>';
           
            echo '<select name="newspage" onchange="location = this.options[this.selectedIndex].value;">';
            for ($i = 0; $i < $page_amount; $i++) {

                if ($i == $page) {

                    echo '<option value="index.php?page='.$i.'" selected>Page '.$i.'</option>';

                } else {

                    echo '<option value="index.php?page='.$i.'">Page '.$i.'</option>';
                }
            }
            echo '</select>';
           
        } else {
            echo '<p>No news exist.</p>';
        }
?>
 
The error is just with Feedback forum? Forum has nothing to do with the layout, I don't know what may have caused it. News page indeed is bugged. Use this one: /layout/sub/index.php

Code:
<img src="layout/images/titles/t_news.png"/>

<?php
$title = explode(" ", $config['site_title']);
?>

<table class="newstable">
    <tr>
        <td width="80%">
        Welcome, wanderer, to the fascinating world of <?php echo $title[0]; ?>, a massive multiplayer online role playing game. Take the role of a valorous adventurer, explore a huge realm of magic and mystery and make friends with people from all over the world! To learn more about <?php echo $title[0]; ?> take a look at the our <a href="gallery.php">gallery page</a>. To start playing <a href="register.php">sign up</a> for a free account and <a href="downloads.php">download your client</a>. See you in <?php echo $title[0]; ?>!</td>
        <td width="20%" align="center"><a href="register.php"><img src="layout/images/signup.gif"/></a></td>
    </tr>
</table>
<br>

<?php
$cache = new Cache('engine/cache/news');
        if ($cache->hasExpired()) {
            $news = fetchAllNews();
          
            $cache->setContent($news);
            $cache->save();
        } else {
            $news = $cache->load();
        }
      
        if (!isset($_GET['page'])) {
            $page = 0;
        } else {
            $page = (int)$_GET['page'];
        }

        if ($news) {
          
            $total_news = count($news);
            $row_news = $total_news / $config['news_per_page'];
            $page_amount = ceil($total_news / $config['news_per_page']);
            $current = $config['news_per_page'] * $page;

            function TransformToBBCode($string) {
                $tags = array(
                    '[center]{$1}[/center]' => '<center>$1</center>',
                    '[b]{$1}[/b]' => '<b>$1</b>',
                    '[size={$1}]{$2}[/size]' => '<font size="$1">$2</font>',
                    '[img]{$1}[/img]'    => '<a href="$1" target="_BLANK"><img src="$1" alt="image" style="width: 100%"></a>',
                    '[link]{$1}[/link]'    => '<a href="$1">$1</a>',
                    '[link={$1}]{$2}[/link]'   => '<a href="$1" target="_BLANK">$2</a>',
                    '[color={$1}]{$2}[/color]' => '<font color="$1">$2</font>',
                    '[*]{$1}[/*]' => '<li>$1</li>',
                );
                foreach ($tags as $tag => $value) {
                    $code = preg_replace('/placeholder([0-9]+)/', '(.*?)', preg_quote(preg_replace('/\{\$([0-9]+)\}/', 'placeholder$1', $tag), '/'));
                    $string = preg_replace('/'.$code.'/i', $value, $string);
                }
                return $string;
            }
          
            echo '<table><div id="news">';
            for ($i = $current; $i < $current + $config['news_per_page']; $i++) {
                if (isset($news[$i])) {
                    ?>
                    <tr><td class="zheadline" colspan="2">&nbsp;&nbsp;<span class="znewsdate"><?php echo date('l, d M Y', $news[$i]['date']); ?> - </span><b><?php echo TransformToBBCode($news[$i]['title']); ?></td></tr>
                    <tr><td class="znewsbody" colspan="2"><?php echo TransformToBBCode(nl2br($news[$i]['text'])); ?></td></tr>
                    <tr><td class="znewsdate"><span style="color:#5a2800;font-weight: normal;">&nbsp;&nbsp;by </span><a href="characterprofile.php?name=<?php echo $news[$i]['name']; ?>"><?php echo $news[$i]['name']; ?></a></td><td class="znewsdate"></td></tr>
                    <tr><td class="znewsdate" colspan="2"></td></tr>
                    <?php
                }
            }
            echo '</div></table>';
          
            echo '<select name="newspage" onchange="location = this.options[this.selectedIndex].value;">';
            for ($i = 0; $i < $page_amount; $i++) {

                if ($i == $page) {

                    echo '<option value="index.php?page='.$i.'" selected>Page '.$i.'</option>';

                } else {

                    echo '<option value="index.php?page='.$i.'">Page '.$i.'</option>';
                }
            }
            echo '</select>';
          
        } else {
            echo '<p>No news exist.</p>';
        }
?>
works now
thanks :3
 
on show character i get this error:

Code:
string(73) "SELECT `id`, `owner`, `name`, `town_id` FROM `houses` WHERE `owner` = 1 ;"
(query - SQL error)
Type: select_multi (select multiple rows from database)

Unknown column 'town_id' in 'field list'
 
Hi, no show me Online or Offline i don§t know why :) Can u help me :) I have only :

Status : and clean ...
 
And i have new problems.
2cdzyiv.png
 
A new mirror: http://www.4shared.com/zip/35kjGErBba/guilcera_layout.html?

Any one can help ??
Dude, try to download it again from the link above and see if the same error occurs.
on show character i get this error:

Code:
string(73) "SELECT `id`, `owner`, `name`, `town_id` FROM `houses` WHERE `owner` = 1 ;"
(query - SQL error)
Type: select_multi (select multiple rows from database)

Unknown column 'town_id' in 'field list'
Open your characterprofile.php file search for "town_id" and replate each one for "town".
 
I download and is cool all but still Status is clean no show me Online players and Is serwr online or offline.
Can you test with normal Znote (without my layout) to see if works? Are you using Windows or Linux?
 
Has this layout been tested with tfs 1.1? getting all kids of errors.. :'(
 
Sorry for double post. can someone please post what my sub.php should look like? running tfs 1.1 with znote 1,5
 
Alright last post before i'm sorry i cant edit! :'(

Adding this has fixed most of my pages
Code:
),
'charactersearch' => array(
'file' => 'charactersearch.php',
'override' => true
),

Except when i try to load "myaccount.php" i am getting this.
TYXoRH8.png
 
Sorry for double post. can someone please post what my sub.php should look like? running tfs 1.1 with znote 1,5
Dude, I didn't tested it with 1.1, but I guess it should work if you get last Znote 1.5. There are 2 sub.php, the one inside layout folder should look something like this. About the myaccount.php, try to load it with default znote to see if it works, it can't be a problem with the layout I think.
 
Back
Top