بابه‌ت: گۆڕینی readmore بۆ babat=1 ، babat=2

پێشتر كاك گه‌یلان باسی كردوه‌ به‌ڵام بۆ ئاخیر وه‌شان نابیت واته‌ وه‌شانی 7.02.01 ، حه‌زم كرد بۆ ئه‌م وه‌شانه‌ی بلاو بكه‌مه‌وه‌ .
نمونه‌كه‌ی وه‌ك ئه‌مه‌یه‌  news.php?babat=1
په‌ڕگه‌ی news بكه‌وه‌ ئه‌م كۆدانه‌ی بۆ دابنێ‌

<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: news.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";

// Predefined variables, do not edit these values
$i = 0;

// Number of news displayed
$items_per_page = $settings['newsperpage'];

add_to_title($locale['global_200'].$locale['global_077']);

if (!isset($_GET['babat']) || !isnum($_GET['babat'])) {
    $rows = dbcount(
        "(news_id)",
        DB_NEWS,
        groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().")
                                        AND (news_end='0'||news_end>=".time().")
                                        AND news_draft='0'"
    );
    if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
    if ($rows) {
        $result = dbquery(
            "SELECT tn.*, tc.*, tu.user_id, tu.user_name, tu.user_status
            FROM ".DB_NEWS." tn
            LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
            LEFT JOIN ".DB_NEWS_CATS." tc ON tn.news_cat=tc.news_cat_id
            WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().")
                AND (news_end='0'||news_end>=".time().") AND news_draft='0'
            GROUP BY news_id
            ORDER BY news_sticky DESC, news_datestamp DESC LIMIT ".$_GET['rowstart'].",".$items_per_page
        );
        $numrows = dbrows($result);
        while ($data = dbarray($result)) {
            $i++;
            $comments = dbcount("(comment_id)", DB_COMMENTS." WHERE comment_type='N' AND comment_hidden='0' AND comment_item_id='".$data['news_id']."'");
            $news_cat_image = "";
            $news_subject = "<a name='news_".$data['news_id']."' id='news_".$data['news_id']."'></a>".stripslashes($data['news_subject']);
            $news_cat_image = "<a href='".($settings['news_image_link'] == 0 ? "news_cats.php?cat_id=".$data['news_cat']
                                                                                : FUSION_SELF."?babat=".$data['news_id'] )."'>";
            if ($data['news_image_t2'] && $settings['news_image_frontpage'] == 0) {
                $news_cat_image .= "<img src='".IMAGES_N_T.$data['news_image_t2']."' alt='".$data['news_subject']."' class='news-category' /></a>";
            } elseif ($data['news_cat_image']) {
                $news_cat_image .= "<img src='".get_image("nc_".$data['news_cat_name'])."' alt='".$data['news_cat_name']."' class='news-category' /></a>";
            } else {
                $news_cat_image = "";
            }
            $news_news = $data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_news'])) : stripslashes($data['news_news']);

            $news_info = array(
                "news_id" => $data['news_id'],
                "user_id" => $data['user_id'],
                "user_name" => $data['user_name'],
                "user_status" => $data['user_status'],
                "news_date" => $data['news_datestamp'],
                "cat_id" => $data['news_cat'],
                "cat_name" => $data['news_cat_name'],
                "cat_image" => $news_cat_image,
                "news_subject" => $data['news_subject'],
                "news_ext" => $data['news_extended'] ? "y" : "n",
                "news_reads" => $data['news_reads'],
                "news_comments" => $comments,
                "news_allow_comments" => $data['news_allow_comments'],
                "news_sticky" => $data['news_sticky']
            );

            echo "<!--news_prepost_".$i."-->\n";
            render_news($news_subject, $news_news, $news_info);
        }
        echo "<!--sub_news_idx-->\n";
        if ($rows > $items_per_page) echo "<div align='center' style=';margin-top:5px;'>\n".makepagenav($_GET['rowstart'],$items_per_page,$rows,3)."\n</div>\n";
    } else {
        opentable($locale['global_077']);
        echo "<div style='text-align:center'><br />\n".$locale['global_078']."<br /><br />\n</div>\n";
        closetable();
    }
} else {
    $result = dbquery(
        "SELECT tn.*, tc.*, tu.user_id, tu.user_name, tu.user_status FROM ".DB_NEWS." tn
        LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
        LEFT JOIN ".DB_NEWS_CATS." tc ON tn.news_cat=tc.news_cat_id
        WHERE ".groupaccess('news_visibility')." AND news_id='".$_GET['babat']."' AND news_draft='0'
        LIMIT 1"
    );
    if (dbrows($result)) {
        include INCLUDES."comments_include.php";
        include INCLUDES."ratings_include.php";
        $data = dbarray($result);
        if (!isset($_POST['post_comment']) && !isset($_POST['post_rating'])) {
            $result2 = dbquery("UPDATE ".DB_NEWS." SET news_reads=news_reads+1 WHERE news_id='".$_GET['babat']."'");
            $data['news_reads']++;
        }
        $news_cat_image = "";
        $news_subject = $data['news_subject'];
        if ($data['news_image_t1'] && $settings['news_image_babat'] == "0") {
            $img_size = @getimagesize(IMAGES_N.$data['news_image']);
            $news_cat_image = "<a href=\"javascript:;\" onclick=\"window.open('".IMAGES_N.$data['news_image']."','','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=".($img_size[0]+20).",height=".($img_size[1]+20)."')\"><img src='".IMAGES_N_T.$data['news_image_t1']."' alt='".$data['news_subject']."' class='news-category' /></a>";
        } elseif ($data['news_cat_image']) {
            $news_cat_image = "<a href='news_cats.php?cat_id=".$data['news_cat']."'><img src='".get_image("nc_".$data['news_cat_name'])."' alt='".$data['news_cat_name']."' class='news-category' /></a>";
        }
        $news_news = stripslashes($data['news_extended'] ? $data['news_extended'] : $data['news_news']);
        if ($data['news_breaks'] == "y") { $news_news = nl2br($news_news); }
        $news_info = array(
            "news_id" => $data['news_id'],
            "user_id" => $data['user_id'],
            "user_name" => $data['user_name'],
            "user_status" => $data['user_status'],
            "news_date" => $data['news_datestamp'],
            "cat_id" => $data['news_cat'],
            "cat_name" => $data['news_cat_name'],
            "cat_image" => $news_cat_image,
            "news_subject" => $data['news_subject'],
            "news_ext" => "n",
            "news_reads" => $data['news_reads'],
            "news_comments" => dbcount("(comment_id)", DB_COMMENTS, "comment_type='N' AND comment_item_id='".$data['news_id']."' AND comment_hidden='0'"),
            "news_allow_comments" => $data['news_allow_comments'],
            "news_sticky" => $data['news_sticky']
        );
        add_to_title($locale['global_201'].$news_subject);
        echo "<!--news_pre_babat-->";
        render_news($news_subject, $news_news, $news_info);
        echo "<!--news_sub_babat-->";
        if ($data['news_allow_comments']) { showcomments("N", DB_NEWS, "news_id", $_GET['babat'], FUSION_SELF."?babat=".$_GET['babat']); }
        if ($data['news_allow_ratings']) { showratings("N", $_GET['babat'], FUSION_SELF."?babat=".$_GET['babat']); }
    } else {
        redirect(FUSION_SELF);
    }
}

require_once THEMES."templates/footer.php";
?>

په‌ڕگه‌یnews_cats بكه‌وه‌ ئه‌م كۆدانه‌ی بۆ دابنێ‌

<p><?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: news_cats.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."news_cats.php";

add_to_title($locale['global_200'].$locale['400']);

opentable($locale['400']);
if (isset($_GET['cat_id']) && isnum($_GET['cat_id'])) {
    $res = 0;
    $result = dbquery("SELECT news_cat_name FROM ".DB_NEWS_CATS." WHERE news_cat_id='".$_GET['cat_id']."'");
    if (dbrows($result) || $_GET['cat_id'] == 0) {
        $data = dbarray($result);
        $rows = dbcount("(news_id)", DB_NEWS, "news_cat='".$_GET['cat_id']."' AND ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().") AND news_draft='0'");
        if ($rows) {
            $res = 1;
            echo "<!--pre_news_cat--><table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
            if ($_GET['cat_id'] != 0) {
                echo "<tr>\n<td width='150' class='tbl1' style='vertical-align:top'><!--news_cat_image--><img src='".get_image("nc_".$data['news_cat_name'])."' alt='".$data['news_cat_name']."' /><br /><br />\n";
                echo "<strong>".$locale['401']."</strong> ".$data['news_cat_name']."<br />\n<strong>".$locale['402']."</strong> $rows</td>\n";
                echo "<td class='tbl1' style='vertical-align:top'>\n";
            } else {
                echo "<tr>\n<td width='150' class='tbl1' style='vertical-align:top'>".$locale['403']."<br />\n";
                echo "<strong>".$locale['401']."</strong> $rows</td>\n<td class='tbl1' style='vertical-align:top'><!--news_cat_news-->\n";
            }
            $result2 = dbquery("SELECT news_id, news_subject FROM ".DB_NEWS." WHERE news_cat='".$_GET['cat_id']."' AND ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().") AND news_draft='0' ORDER BY news_datestamp DESC");
            while ($data2 = dbarray($result2)) {
                echo THEME_BULLET." <a href='news.php?babat=".$data2['news_id']."'>".$data2['news_subject']."</a><br />\n";
            }
            echo "</td>\n</tr>\n<tr>\n<td colspan='2' class='tbl1' style='text-align:center'>".THEME_BULLET." <a href='".FUSION_SELF."'>".$locale['406']."</a>";
            echo "</td>\n</tr>\n</table><!--sub_news_cat-->\n";
        }
    }
    if (!$res) { redirect(FUSION_SELF); }
} else {
    $res = 0;
    $result = dbquery("SELECT news_cat_id, news_cat_name FROM ".DB_NEWS_CATS." ORDER BY news_cat_id");
    if (dbrows($result)) {
        echo "<!--pre_news_cat_idx--><table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
        while ($data = dbarray($result)) {
            $rows = dbcount("(news_id)", DB_NEWS, "news_cat='".$data['news_cat_id']."' AND ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().") AND news_draft='0'");
            echo "<tr>\n<td width='150' class='tbl1' style='vertical-align:top'><!--news_cat_image--><img src='".get_image("nc_".$data['news_cat_name'])."' alt='".$data['news_cat_name']."' /><br /><br />\n";
            echo "<strong>".$locale['401']."</strong> ".$data['news_cat_name']."<br />\n<strong>".$locale['402']."</strong> $rows</td>\n";
            echo "<td class='tbl1' style='vertical-align:top'><!--news_cat_news-->\n";
            if ($rows) {
                $result2 = dbquery("SELECT news_id, news_subject FROM ".DB_NEWS." WHERE news_cat='".$data['news_cat_id']."' AND ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().") AND news_draft='0' ORDER BY news_datestamp DESC LIMIT 10");
                while ($data2 = dbarray($result2)) {
                    echo THEME_BULLET." <a href='news.php?babat=".$data2['news_id']."'>".$data2['news_subject']."</a><br />\n";
                }
                if ($rows > 10) { echo "<div style='text-align:right'>".THEME_BULLET." <a href='".FUSION_SELF."?cat_id=".$data['news_cat_id']."'>".$locale['405']."</a></div>\n"; }
            } else {
                echo THEME_BULLET." ".$locale['404']."\n";
            }
            echo "</td>\n</tr>\n";
        }
        $res = 1;
    }
    $result = dbquery("SELECT * FROM ".DB_NEWS." WHERE news_cat='0' AND ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().") AND news_draft='0' ORDER BY news_datestamp DESC LIMIT 10");
    if (dbrows($result)) {
        if ($res == 0) { echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n"; }
        $nrows = dbcount("(news_id)", DB_NEWS, "news_cat='0' AND ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().") AND news_draft='0'");
        echo "<tr>\n<td width='150' class='tbl1' style='vertical-align:top'>".$locale['403']."<br />\n";
        echo "<strong>".$locale['402']."</strong> $nrows</td>\n<td class='tbl1' style='vertical-align:top'>\n";
        while ($data = dbarray($result)) {
            echo THEME_BULLET." <a href='news.php?babat=".$data['news_id']."'>".$data['news_subject']."</a><br />\n";
        }
        $res = 1;
        if ($nrows > 10) { echo "<div style='text-align:right'>".THEME_BULLET." <a href='".FUSION_SELF."?cat_id=0'>".$locale['405']."</a></div>\n"; }
        echo "</td>\n</tr>\n";
    }
    if ($res == 1) {
        echo "</table><!--sub_news_cat_idx-->\n";
    } else {
        echo "<div style='text-align:center'><br />\n".$locale['407']."<br /><br />\n</div>\n";
    }
}
closetable();

require_once THEMES."templates/footer.php";
?></p>

theme_functions_include<<includes بكه‌وه‌

<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: theme_functions_include.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

function check_panel_status($side) {

    global $settings;

    $exclude_list = "";

    if ($side == "left") {
        if ($settings['exclude_left'] != "") {
            $exclude_list = explode("\r\n", $settings['exclude_left']);
        }
    } elseif ($side == "upper") {
        if ($settings['exclude_upper'] != "") {
            $exclude_list = explode("\r\n", $settings['exclude_upper']);
        }
    } elseif ($side == "lower") {
        if ($settings['exclude_lower'] != "") {
            $exclude_list = explode("\r\n", $settings['exclude_lower']);
        }
    } elseif ($side == "right") {
        if ($settings['exclude_right'] != "") {
            $exclude_list = explode("\r\n", $settings['exclude_right']);
        }
    }

    if (is_array($exclude_list)) {
        $script_url = explode("/", $_SERVER['PHP_SELF']);
        $url_count = count($script_url);
        $base_url_count = substr_count(BASEDIR, "/")+1;
        $match_url = "";
        while ($base_url_count != 0) {
            $current = $url_count - $base_url_count;
            $match_url .= "/".$script_url[$current];
            $base_url_count--;
        }
        if (!in_array($match_url, $exclude_list) && !in_array($match_url.(FUSION_QUERY ? "?".FUSION_QUERY : ""), $exclude_list)) {
            return true;
        } else {
            return false;
        }
    } else {
        return true;
    }
}

function showbanners($display = "") {
    global $settings;
    ob_start();
    if ($display == 2) {
        if ($settings['sitebanner2']) {
            eval("?>".stripslashes($settings['sitebanner2'])."<?php ");
        }
    } else {
        if ($display == "" && $settings['sitebanner2']) {
            eval("?><div style='float: right;'>".stripslashes($settings['sitebanner2'])."</div>\n<?php ");
        }
        if ($settings['sitebanner1']) {
            eval("?>".stripslashes($settings['sitebanner1'])."\n<?php ");
        } elseif ($settings['sitebanner']) {
            echo "<a href='".$settings['siteurl']."'><img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."' style='border: 0;' /></a>\n";
        } else {
            echo "<a href='".$settings['siteurl']."'>".$settings['sitename']."</a>\n";
        }
    }
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}

function showsublinks($sep = "&middot;", $class = "") {
    $sres = dbquery(
        "SELECT link_name, link_url, link_window, link_visibility FROM ".DB_SITE_LINKS."
        WHERE link_position='2' OR link_position='3' ORDER BY link_order"
    );
    if (dbrows($sres)) {
        $i = 0;
        $res = "<ul>\n";
        while ($sdata = dbarray($sres)) {
            $li_class = $class; $i++;
            if ($sdata['link_url'] != "---" && checkgroup($sdata['link_visibility'])) {
                $link_target = ($sdata['link_window'] == "1" ? " target='_blank'" : "");
                if ($i == 1) { $li_class .= ($li_class ? " " : "")."first-link"; }
                if (START_PAGE == $sdata['link_url']) { $li_class .= ($li_class ? " " : "")."current-link"; }
                if (preg_match("!^(ht|f)tp(s)?://!i", $sdata['link_url'])) {
                    $res .= "<li".($li_class ? " class='".$li_class."'" : "").">".$sep."<a href='".$sdata['link_url']."'".$link_target.">\n";
                    $res .= "<span>".parseubb($sdata['link_name'], "b|i|u|color|img")."</span></a></li>\n";
                } else {
                    $res .= "<li".($li_class ? " class='".$li_class."'" : "").">".$sep."<a href='".BASEDIR.$sdata['link_url']."'".$link_target.">\n";
                    $res .= "<span>".parseubb($sdata['link_name'], "b|i|u|color|img")."</span></a></li>\n";
                }
            }
        }
        $res .= "</ul>\n";
        return $res;
    }
}

function showsubdate() {
    global $settings;
    return ucwords(showdate($settings['subheaderdate'], time()));
}

function newsposter($info, $sep = "", $class = "") {
    global $locale; $res = "";
    $link_class = $class ? " class='$class' " : "";
    $res = THEME_BULLET." <span ".$link_class.">".profile_link($info['user_id'], $info['user_name'], $info['user_status'])."</span> ";
    $res .= $locale['global_071'].showdate("newsdate", $info['news_date']);
    $res .= $info['news_ext'] == "y" || $info['news_allow_comments'] ? $sep."\n" : "\n";
    return "<!--news_poster-->".$res;
}

function newsopts($info, $sep, $class = "") {
    global $locale, $settings; $res = "";
    $link_class = $class ? " class='$class' " : "";
    if (!isset($_GET['babat']) && $info['news_ext'] == "y") $res = "<a href='news.php?babat=".$info['news_id']."'".$link_class.">".$locale['global_072']."</a> ".$sep." ";
    if ($info['news_allow_comments'] && $settings['comments_enabled'] == "1") { $res .= "<a href='news.php?babat=".$info['news_id']."#comments'".$link_class.">".$info['news_comments'].($info['news_comments'] == 1 ? $locale['global_073b'] : $locale['global_073'])."</a> ".$sep." "; }
    if ($info['news_ext'] == "y" || ($info['news_allow_comments'] && $settings['comments_enabled'] == "1")) { $res .= $info['news_reads'].$locale['global_074']."\n ".$sep; }
    $res .= "<a href='print.php?type=N&amp;item_id=".$info['news_id']."'><img src='".get_image("printer")."' alt='".$locale['global_075']."' style='vertical-align:middle;border:0;' /></a>\n";
    return "<!--news_opts-->".$res;
}

function newscat($info, $sep = "", $class = "") {
    global $locale; $res = "";
    $link_class = $class ? " class='$class' " : "";
    $res .= $locale['global_079'];
    if ($info['cat_id']) {
        $res .= "<a href='news_cats.php?cat_id=".$info['cat_id']."'$link_class>".$info['cat_name']."</a>";
    } else {
        $res .= "<a href='news_cats.php?cat_id=0'$link_class>".$locale['global_080']."</a>";
    }
    return "<!--news_cat-->".$res." $sep ";
}

function articleposter($info, $sep = "", $class = "") {
    global $locale, $settings; $res = "";
    $link_class = $class ? " class='$class' " : "";
    $res = THEME_BULLET." ".$locale['global_070']."<span ".$link_class.">".profile_link($info['user_id'], $info['user_name'], $info['user_status'])."</span>\n";
    $res .= $locale['global_071'].showdate("newsdate", $info['article_date']);
    $res .= ($info['article_allow_comments'] && $settings['comments_enabled'] == "1" ? $sep."\n" : "\n");
    return "<!--article_poster-->".$res;
}

function articleopts($info, $sep) {
    global $locale, $settings; $res = "";
    if ($info['article_allow_comments'] && $settings['comments_enabled'] == "1") { $res = "<a href='articles.php?article_id=".$info['article_id']."#comments'>".$info['article_comments'].($info['article_comments'] == 1 ? $locale['global_073b'] : $locale['global_073'])."</a> ".$sep."\n"; }
    $res .= $info['article_reads'].$locale['global_074']." ".$sep."\n";
    $res .= "<a href='print.php?type=A&amp;item_id=".$info['article_id']."'><img src='".get_image("printer")."' alt='".$locale['global_075']."' style='vertical-align:middle;border:0;' /></a>\n";
    return "<!--article_opts-->".$res;
}

function articlecat($info, $sep = "", $class = "") {
    global $locale; $res = "";
    $link_class = $class ? " class='$class' " : "";
    $res .= $locale['global_079'];
    if ($info['cat_id']) {
        $res .= "<a href='articles.php?cat_id=".$info['cat_id']."'$link_class>".$info['cat_name']."</a>";
    } else {
        $res .= "<a href='articles.php?cat_id=0'$link_class>".$locale['global_080']."</a>";
    }
    return "<!--article_cat-->".$res." $sep ";
}

function itemoptions($item_type, $item_id) {
    global $locale, $aidlink; $res = "";
    if ($item_type == "N") {
        if (iADMIN && checkrights($item_type)) { $res .= "<!--article_news_opts--> &middot; <a href='".ADMIN."news.php".$aidlink."&amp;action=edit&amp;news_id=".$item_id."'><img src='".get_image("edit")."' alt='".$locale['global_076']."' title='".$locale['global_076']."' style='vertical-align:middle;border:0;' /></a>\n"; }
    } elseif ($item_type == "A") {
    if (iADMIN && checkrights($item_type)) { $res .= "<!--article_admin_opts--> &middot; <a href='".ADMIN."articles.php".$aidlink."&amp;action=edit&amp;article_id=".$item_id."'><img src='".get_image("edit")."' alt='".$locale['global_076']."' title='".$locale['global_076']."' style='vertical-align:middle;border:0;' /></a>\n"; }
    }
    return $res;
}

function showrendertime($queries = true) {
    global $locale, $mysql_queries_count, $settings;

    if ($settings['rendertime_enabled'] == 1 || ($settings['rendertime_enabled'] == 2 && iADMIN)) {
        $res = sprintf($locale['global_172'], substr((get_microtime() - START_TIME),0,4));
        $res .= ($queries ? " - $mysql_queries_count ".$locale['global_173'] : "");
        return $res;
    } else {
        return "";
    }
}

function showcopyright($class = "", $nobreak = false) {
    $link_class = $class ? " class='$class' " : "";
    $res = "Powered by <a href='http://www.php-fusion.co.uk'".$link_class.">PHP-Fusion</a> copyright &copy; 2002 - ".date("Y")." by Nick Jones.";
    $res .= ($nobreak ? "&nbsp;" : "<br />\n");
    $res .= "Released as free software without warranties under <a href='http://www.fsf.org/licensing/licenses/agpl-3.0.html'".$link_class.">GNU Affero GPL</a> v3.\n";
    return $res;
}

function showcounter() {
    global $locale, $settings;
    if ($settings['visitorcounter_enabled']) {
        return "<!--counter-->".number_format($settings['counter'])." ".($settings['counter'] == 1 ? $locale['global_170'] : $locale['global_171']);
    } else {
        return "";
    }
}

function panelbutton($state, $bname) {
    $bname = preg_replace("/[^a-zA-Z0-9\s]/", "_", $bname);
    if (isset($_COOKIE["fusion_box_".$bname])) {
        if ($_COOKIE["fusion_box_".$bname] == "none") {
            $state = "off";
        } else {
            $state = "on";
        }
    }
    return "<img src='".get_image("panel_".($state == "on" ? "off" : "on"))."' id='b_".$bname."' class='panelbutton' alt='' onclick=\"javascript:flipBox('".$bname."')\" />";
}

function panelstate($state, $bname) {
    $bname = preg_replace("/[^a-zA-Z0-9\s]/", "_", $bname);
    if (isset($_COOKIE["fusion_box_".$bname])) {
        if ($_COOKIE["fusion_box_".$bname] == "none") {
            $state = "off";
        } else {
            $state = "on";
        }
    }
    return "<div id='box_".$bname."'".($state == "off" ? " style='display:none'" : "").">\n";
}

// v6 compatibility
function opensidex($title, $state = "on") {

    openside($title, true, $state);

}

function closesidex() {

    closeside();

}

function tablebreak() {
    return true;
}
?>