1

بابه‌ت: چۆن گه‌رانی بنه‌ره‌تی له‌ ناو index دانێم ؟

ئه‌مه‌ویت كاتێك كلیك له‌ گه‌ران بكرێت هه‌مان رووكاره‌كه‌م بێت و له‌و شوێنه‌ی ئه‌مه‌ویت گه‌ران نیشان بدات ده‌ر كه‌وێت .
ئه‌و په‌رگه‌یه‌ی كه‌ بۆ گه‌رانم داناوه‌ ئه‌مه‌ویت له‌ شوێن نویسنی webchin گه‌ران دانیم دێری 52

<?php
include 'cn/head.php';
?>
<html>
<head>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml" dir="rtl"><HEAD><META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="shakawan.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="coin-slider.min.js"></script>
<link rel="stylesheet" href="coin-slider-styles.css" type="text/css" />
<script type="text/javascript">
    $(document).ready(function() {
        $('#coin-slider').coinslider({width: 490, height: 310,});
    });
</script>
<title>shaxawan</title>
</head>

<body>
<TABLE align="center" style="width: 898px" height="460" id="table1">
    <TBODY><TR>
        <TD class="container" width="892" height="37">
<div id="men" style="width: 893px; height: 35px; background-color:#0979F7">
<ul>
<a href="#"><li>سەرەتا</li></a>
<a href="#"><li>هه‌مه‌ره‌نگ</li></a>
<a href="#"><li>كۆمپیوته‌ر</li></a>
<a href="#"><li>ئاینی</li></a>
<a href="#"><li>ئینته‌رنێت</li></a>
<a href="#"><li>جوانكاری</li></a>
<a href="#"><li>وه‌رزش</li></a>
<a href="#"><li>ته‌كنه‌لۆجیا</li></a>
<a href="http://localhost/ku/hewall-nardin.php"><li>هه‌واڵ/بابه‌تمان بۆ بنێرن</li></a>
<a href="#"><li>ShoP</li></a>
<a href="#"><li>په‌یوه‌ندی</li></a>
<a href="#"><li>گه‌ران</li></a>

</ul>
</TR>
        <tr>
        <TD class="container" width="892" bgcolor="#FFFFFF">
<div id="banar" style="width: 893px; height: 152px"></div><!--header-->
</TR>
        </tr>
        <tr>
        <TD class="container" height="42" width="892" bgcolor="#FFFFFF">

<table cellpadding="0" cellspacing="0" width="892" height="273">
    <!-- MSTableType="layout" -->
    <tr>
        <td height="273" valign="top">  webchin </td>
        
    </tr>
</table>

</TR>
        </tr>
        <tr>
        <TD class="container" height="10" width="892" bgcolor="#FFFFFF">
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script><div class="fb-like-box" data-href="http://www.facebook.com/AweZaa" data-width="890" data-height="290" data-show-faces="true" data-stream="false" data-header="true"></div>    </TR>
        </tr>
        <tr>
        <TD class="container" height="9" width="892" bgcolor="#FFFFFF">
    &nbsp;</TR>
        </tr>
</TBODY></TABLE>
<body bgcolor="#84BCFB">
</body>

كۆده‌كانی په‌رگه‌ی گه‌رانی بنه‌ره‌تی

<?
include_once 'head.php';

$sday[] = '';

for ($i = 1; $i < 32; $i++){
    $sday[$i] = $i;
}

$smonth[] = '';

for ($i = 1; $i < 13; $i++){
    $smonth[$i] = $i;
}

$syear[] = '';

for ($i = 1999; $i < (date('Y') + 1); $i++){
    $syear[$i] = $i;
}

function search_this_cat($id){
global $category;

return ($id == $category ? ' selected' : '');
}
?>

<!-- ÊÎÄ ÏÎÈÑÊÀ / ÍÀ×ÀËÎ / ÌÎÆÍÎ ÍÀ×ÀÒÜ ÂÛÄÅËÅÍÈÅ ÄËß ÊÎÏÈÐÎÂÀÍÈß -->
<form method="get" action="<?=$_SERVER['PHP_SELF']; ?>">
<input name="do" type="hidden" value="search">
<table width="400" border="0" cellspacing="0" cellpadding="0">
 <tr>
  <td width="1">Search
  <td width="99%"><input type="text" name="search" size="20" value="<?=$search; ?>">
 <tr>
  <td>In category
  <td><select size="1" name="category"><option value="">All</option><?=category_get_tree('&nbsp;', '<option value="{id}"[php]search_this_cat({id})[/php]>{prefix}{name}</option>'); ?></select>
 <tr>
  <td><nobr>Date (year/month/date)</nobr>&nbsp;
  <td><?=makeDropDown($syear, 'year', $year); ?>/<?=makeDropDown($smonth, 'month', $month); ?>/<?=makeDropDown($sday, 'day', $day); ?>
 <tr>
  <td colspan="2"><input type="submit" value=" Search ">
</table>
</form>
<!-- ÊÎÄ ÏÎÈÑÊÀ / ÊÎÍÅÖ / ÌÎÆÍÎ ÇÀÊÎÍ×ÈÒÜ ÂÛÄÅËÅÍÈÅ È ÊÎÏÈÐÎÂÀÒÜ -->

<?
add_filter('also-allow', 'search');

function search($where){
global $search, $sql;

    $search = strtolower($search);
    $search = htmlspecialchars($search);

    foreach ($sql->select(array('table' => 'story', 'where' => array("short =~ %$search%", 'or', "full =~ %$search%"))) as $row){
        $select[] = $row['post_id'];
    }

    foreach ($sql->select(array('table' => 'news', 'where' => array("title =~ %$search%"))) as $row){
        $select[] = $row['id'];
    }

    if ($select){
        $where[] = 'id = '.(count($select) > 1 ? '['.join('|', $select).']' : join('', $select));
        $where[] = 'and';
    } else {
        $where = array('id = 0', 'and');
    }

return $where;
}


add_filter('news-entry-content', 'Highlight_Search', 999);

function Highlight_Search($output){
global $search;

    $output = formattext($search, $output);

return $output;
}

////////////////////////////////////////////////////////
// Function:    formattext
// Description: Âûäåëåíèå ðåçóëüòàòà â íàéäåíîì êóñêå òåêñòà
// Original:    http://forum.dklab.ru/php/heap/AllocationOfResultInNaydenomAPieceOfTheText.html

function formattext($whatfind, $text){

    $pos    = @strpos(strtoupper($text), strtoupper($whatfind));
    $otstup = 200; // êîë-âî ñèìâîëîâ ïðè âûâîäå ðåçóëüòàòà
    $result = '';

    if ($pos !== false){ //åñëè íàéäåíà ïîäñòðîêà
        if ($pos < $otstup){ //åñëè âñòðå÷àåòñÿ ðàíüøå ÷åì ïåðâûå N ñèìâîëîâ
            $result = substr($text, 0, $otstup * 2); //òî ðåçóëüòàò ïîäñòðîêà îò íà÷àëà è äî N-ãî ñèìâîëà
            $result = eregi_replace($whatfind, '<span class="hilite">'.$whatfind.'</span>', $result);
        } else {
            $start = $pos-$otstup;
            //òî ðåçóëüòàò N ñèìâîëîâ  îò ñîâïàäåíèÿ è N ñèìâîëîâ âïåð¸ä
            $result = '...'.substr($text, $pos-$otstup, $otstup * 2).'...';
            // âûäåëÿåì
            $result = eregi_replace($whatfind, '<span class="hilite">'.$whatfind.'</span>', $result);
        }
    } else {
        $result = substr($text, 0, $otstup * 2);
    }

return $result;
}

function category_selected($id){
global $category;

    if ($category == $id){
        return ' selected';
    }
}

if ($search){
    $template = 'Search';
    include $cutepath.'/show_news.php';
}
?>

2

وه‌ڵام: چۆن گه‌رانی بنه‌ره‌تی له‌ ناو index دانێم ؟

هه‌رچه‌نده‌ له‌ یاسا لا ئه‌ده‌م به‌س مه‌جبورم بلیم كاك ئاسۆ چاوه‌ری وه‌ڵامی به‌ڕێزتم ؟