<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[مەکۆکانی وێبچن - گۆڕینی readmore بۆ babat=1 ، babat=2]]></title>
	<link rel="self" href="https://www.webchin.org/Meko/extern.php?action=feed&amp;tid=23165&amp;type=atom" />
	<updated>2011-05-18T16:08:22Z</updated>
	<generator>PunBB</generator>
	<id>https://www.webchin.org/Meko/viewtopic.php?id=23165</id>
		<entry>
			<title type="html"><![CDATA[گۆڕینی readmore بۆ babat=1 ، babat=2]]></title>
			<link rel="alternate" href="https://www.webchin.org/Meko/viewtopic.php?pid=188380#p188380" />
			<content type="html"><![CDATA[<p>پێشتر كاك گه‌یلان باسی كردوه‌ به‌ڵام بۆ ئاخیر وه‌شان نابیت واته‌ وه‌شانی 7.02.01 ، حه‌زم كرد بۆ ئه‌م وه‌شانه‌ی بلاو بكه‌مه‌وه‌ .<br />نمونه‌كه‌ی وه‌ك ئه‌مه‌یه‌&nbsp; news.php?babat=1<br />په‌ڕگه‌ی <strong>news </strong>بكه‌وه‌ ئه‌م كۆدانه‌ی بۆ دابنێ‌<br /></p><div class="codebox"><pre><code data-language=php>&lt;?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 &quot;maincore.php&quot;;
require_once THEMES.&quot;templates/header.php&quot;;

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

// Number of news displayed
$items_per_page = $settings[&#039;newsperpage&#039;];

add_to_title($locale[&#039;global_200&#039;].$locale[&#039;global_077&#039;]);

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

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

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

require_once THEMES.&quot;templates/footer.php&quot;;
?&gt;</code></pre></div><p>په‌ڕگه‌ی<strong>news_cats ب</strong>كه‌وه‌ ئه‌م كۆدانه‌ی بۆ دابنێ‌<br /></p><div class="codebox"><pre><code data-language=php>&lt;p&gt;&lt;?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 &quot;maincore.php&quot;;
require_once THEMES.&quot;templates/header.php&quot;;
include LOCALE.LOCALESET.&quot;news_cats.php&quot;;

add_to_title($locale[&#039;global_200&#039;].$locale[&#039;400&#039;]);

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

require_once THEMES.&quot;templates/footer.php&quot;;
?&gt;&lt;/p&gt;</code></pre></div><p><strong>theme_functions_include&lt;&lt;includes بكه‌وه‌</strong><br /></p><div class="codebox"><pre><code data-language=php>&lt;?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(&quot;IN_FUSION&quot;)) { die(&quot;Access Denied&quot;); }

function check_panel_status($side) {

    global $settings;

    $exclude_list = &quot;&quot;;

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

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

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

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

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

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

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

function newscat($info, $sep = &quot;&quot;, $class = &quot;&quot;) {
    global $locale; $res = &quot;&quot;;
    $link_class = $class ? &quot; class=&#039;$class&#039; &quot; : &quot;&quot;;
    $res .= $locale[&#039;global_079&#039;];
    if ($info[&#039;cat_id&#039;]) {
        $res .= &quot;&lt;a href=&#039;news_cats.php?cat_id=&quot;.$info[&#039;cat_id&#039;].&quot;&#039;$link_class&gt;&quot;.$info[&#039;cat_name&#039;].&quot;&lt;/a&gt;&quot;;
    } else {
        $res .= &quot;&lt;a href=&#039;news_cats.php?cat_id=0&#039;$link_class&gt;&quot;.$locale[&#039;global_080&#039;].&quot;&lt;/a&gt;&quot;;
    }
    return &quot;&lt;!--news_cat--&gt;&quot;.$res.&quot; $sep &quot;;
}

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

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

function articlecat($info, $sep = &quot;&quot;, $class = &quot;&quot;) {
    global $locale; $res = &quot;&quot;;
    $link_class = $class ? &quot; class=&#039;$class&#039; &quot; : &quot;&quot;;
    $res .= $locale[&#039;global_079&#039;];
    if ($info[&#039;cat_id&#039;]) {
        $res .= &quot;&lt;a href=&#039;articles.php?cat_id=&quot;.$info[&#039;cat_id&#039;].&quot;&#039;$link_class&gt;&quot;.$info[&#039;cat_name&#039;].&quot;&lt;/a&gt;&quot;;
    } else {
        $res .= &quot;&lt;a href=&#039;articles.php?cat_id=0&#039;$link_class&gt;&quot;.$locale[&#039;global_080&#039;].&quot;&lt;/a&gt;&quot;;
    }
    return &quot;&lt;!--article_cat--&gt;&quot;.$res.&quot; $sep &quot;;
}

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

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

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

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

function showcounter() {
    global $locale, $settings;
    if ($settings[&#039;visitorcounter_enabled&#039;]) {
        return &quot;&lt;!--counter--&gt;&quot;.number_format($settings[&#039;counter&#039;]).&quot; &quot;.($settings[&#039;counter&#039;] == 1 ? $locale[&#039;global_170&#039;] : $locale[&#039;global_171&#039;]);
    } else {
        return &quot;&quot;;
    }
}

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

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

// v6 compatibility
function opensidex($title, $state = &quot;on&quot;) {

    openside($title, true, $state);

}

function closesidex() {

    closeside();

}

function tablebreak() {
    return true;
}
?&gt;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[هێدی سه‌رمۆردی]]></name>
				<uri>https://www.webchin.org/Meko/profile.php?id=4009</uri>
			</author>
			<updated>2011-05-18T16:08:22Z</updated>
			<id>https://www.webchin.org/Meko/viewtopic.php?pid=188380#p188380</id>
		</entry>
</feed>
