silveralol
Advanced OT User
- Joined
- Mar 16, 2010
- Messages
- 1,480
- Solutions
- 9
- Reaction score
- 211
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.Last Question, how I can post news?
// WARNING! Account names written here will have admin access to web page!
$config['page_admin_access'] = array(
//'otland0',
//'otland1',
'znote'
);
// 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
<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"> <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;"> 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>';
}
?>
<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"> <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;"> 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>';
}
?>
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'
Dude, try to download it again from the link above and see if the same error occurs.Any one can help ??
Open your characterprofile.php file search for "town_id" and replate each one for "town".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'
A new mirror: http://www.4shared.com/zip/35kjGErBba/guilcera_layout.html?
Dude, try to download it again from the link above and see if the same error occurs.
Open your characterprofile.php file search for "town_id" and replate each one for "town".
Can you test with normal Znote (without my layout) to see if works? Are you using Windows or Linux?I download and is cool all but still Status is clean no show me Online players and Is serwr online or offline.
Linux UbuntuCan you test with normal Znote (without my layout) to see if works? Are you using Windows or Linux?
Ok its works. I no change config.phpCan you test with normal Znote (without my layout) to see if works? Are you using Windows or Linux?
),
'charactersearch' => array(
'file' => 'charactersearch.php',
'override' => true
),
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.Sorry for double post. can someone please post what my sub.php should look like? running tfs 1.1 with znote 1,5