$sql = "select nKBID,vKBTitle,tKBDesc from sptbl_kb where (vKBTitle like  '%{$my_data}%') AND   vStatus ='A'";
        $result_kbtitle = executeSelect($sql, $conn);
        if (mysql_num_rows($result_kbtitle) > 0) {
            ?>
<table cellpadding="0" cellspacing="0" border="0" class="">
<?php 
            while ($row = mysql_fetch_array($result_kbtitle)) {
                $viewkbentry_seo_link = "viewuserkbsearchresult/" . stripslashes($row['vKBTitle']) . "/" . $row["nKBID"] . "/KNOWLEDGEBASE/threeminus/threeplus";
                ?>
    <tr>
        <td align="left">
            <a href="<?php 
                echo $viewkbentry_seo_link;
                ?>
" class="listing"><?php 
                echo trimString(htmlentities($row["vKBTitle"]), 80);
                ?>
</a>
        </td>
    </tr>

                <?php 
            }
        }
    }
    //}
}
?>
</table>
            </div>
        </td></tr>
        $rs = executeSelect($sql, $conn);
        //Pagination
        if (mysql_num_rows($rs) > 0) {
            ?>
                                <table cellpadding="5" cellspacing="1" border="0" class="" style="background-color:#cfcfcf;" width="100%">
                                <?php 
            while ($row = mysql_fetch_array($rs)) {
                $viewkbentry_seo_link = SITE_URL . "viewuserkbsearchresult/" . str_replace(" ", "_", str_replace("?", "", stripslashes($row['vKBTitle']))) . "/" . $row["nKBID"] . "/KNOWLEDGEBASE/threeminus/threeplus";
                ?>
                                        <tr>
                                            <td align="left" style="background-color:#ffffff;">
                                            <a href="<?php 
                echo $viewkbentry_seo_link;
                ?>
" class="listing"><?php 
                echo $row["vCatDesc"] . ' - ' . trimString(htmlentities($row["vKBTitle"]), 140);
                ?>
</a>
                                            </td>
                                        </tr>
                                <?php 
            }
            ?>
                                    <tr align="left">
                                        <td colspan="6">
                                            <div class="pagination_container">
                                                <div class="pagination_info">
                                                    <?php 
            echo $navigate[1] . "&nbsp;" . TEXT_OF . "&nbsp;" . $totalrows . "&nbsp;" . TEXT_RESULTS;
            ?>
                                                </div>
function getReleatedResults($title, $kbid)
{
    $kbkey = explode(' ', $title);
    $keyCondition = "WHERE vStatus ='A' AND nKBID != '" . $kbid . "' ";
    $ketCount1 = count($kbkey);
    if ($ketCount1 > 0) {
        $keyCondition .= " AND (vKBTitle like  '%" . mysql_real_escape_string($kbkey[0]) . "%' ";
        for ($kbc = 1; $kbc < $ketCount1; $kbc++) {
            $keyCondition .= " OR vKBTitle like  '%" . mysql_real_escape_string($kbkey[$kbc]) . "%'";
        }
        $keyCondition .= ")";
    }
    $sql = "SELECT DISTINCT kb.nKBID,kb.vKBTitle,kb.tKBDesc,c.vCatDesc from sptbl_kb kb\r\n            INNER JOIN sptbl_categories c ON kb.nCatId = c.nCatId " . $keyCondition . " LIMIT 0, 10";
    //    $result_kbtitle =  executeSelect($sql,$conn);
    $result_kbtitle = mysql_query($sql);
    $kbCount = mysql_num_rows($result_kbtitle);
    if (mysql_num_rows($result_kbtitle) > 0) {
        ?>
    <div class="content_section_title">
    <h3><?php 
        echo TEXT_RELATED_RESULTS;
        ?>
</h3></div>
    <table cellpadding="5" cellspacing="1" border="0" class="" style="background-color:#cfcfcf;" width="100%">
		<div class="popular_kbs1">
		<ul>
        <?php 
        while ($row = mysql_fetch_array($result_kbtitle)) {
            //echo '<pre>';print_r($row);echo '</pre>';
            $seolink = str_replace(" ", "-", stripslashes($row['vKBTitle']));
            $seolink = preg_replace('/[^a-zA-Z0-9__.-]/s', '', $seolink);
            $seolink = strtolower($seolink);
            $seolink = substr($seolink, 0, 100);
            $viewkbentry_seo_link = SITE_URL . "kb/" . str_replace("?", "", $seolink) . "/" . $row["nKBID"];
            ?>
				
				<li>
					<a href="<?php 
            echo $viewkbentry_seo_link;
            ?>
" class="listing"><span><?php 
            echo $row["vCatDesc"];
            ?>
</span> - <?php 
            echo trimString(htmlentities($row["vKBTitle"]), 140);
            ?>
</a> 
				</li>
					
            <?php 
        }
    }
    if ($kbCount > 10) {
        ?>
        <tr>
            <td align="left" style="background-color:#ffffff;">
                <a href="<?php 
        echo $viewkbentry_seo_link;
        ?>
" class="listing"><?php 
        echo trimString(htmlentities($row["vKBTitle"]), 140);
        ?>
</a>
            </td>
        </tr>
        <?php 
    }
    ?>
	</ul>
	</div>
    </table>
    <?php 
}
Esempio n. 4
0
if ($pagesnext < $pageend) {
    echo "<a class='link' style='padding-right:5px' href='{$linktmp}/{$pageend}'>... {$pageend}</a>";
}
?>
			</td>
		</tr>
	</thead>
	<tfoot>
		<tr id="tfoot_paging"></tr>
	</tfoot>
	<tbody>		
		<?php 
foreach ($lstRaovat as $raovat) {
    $alink = BASE_PATH . "/raovat/view/" . $raovat["raovat"]["id"] . "/" . $raovat["raovat"]["alias"];
    $atitle = $raovat["raovat"]["tieude"];
    $aintro = trimString(HTML2Text($raovat["raovat"]["noidung"]), 200);
    ?>
			<tr>
				<td align="left">
					<a href="<?php 
    echo $alink;
    ?>
">
						<div class="first_text" style="min-height: 60px;">
							<span class="avata"><?php 
    echo $atitle;
    ?>
</span>
							<div class="cat_intro" style="padding-left: 10px;color: gray;"><?php 
    echo $aintro;
    ?>
function getMagic($s, $length)
{
    return trimString(strtolower(str_replace(" ", "_", trim($s))), $length);
}
Esempio n. 6
0
    if (mysql_num_rows($rs) > 0) {
        while ($row = mysql_fetch_array($rs)) {
            //echo '<pre>'; print_r($row); echo '</pre>';
            $seolink = str_replace(" ", "-", stripslashes($row['vKBTitle']));
            $seolink = preg_replace('/[^a-zA-Z0-9__.-]/s', '', $seolink);
            $seolink = strtolower($seolink);
            $seolink = substr($seolink, 0, 100);
            $viewkbentry_seo_link = SITE_URL . "kb/" . str_replace("?", "", $seolink) . "/" . $row["nKBID"];
            ?>
                                <tr>
                                    <td align="left">
                                        <a href="<?php 
            echo $viewkbentry_seo_link;
            ?>
" class="listing"><?php 
            echo $row["vCatDesc"] . ' - ' . trimString($row["vKBTitle"], 80);
            ?>
</a>
                                    </td>
                                </tr>
                                            <?php 
        }
        ?>
                                <tr align="left">
                                    <td colspan="6">

                                        <div class="pagination_container">
                                            <div class="pagination_info">
                                                        <?php 
        echo $navigate[1] . "&nbsp;" . TEXT_OF . "&nbsp;" . $totalrows . "&nbsp;" . TEXT_RESULTS;
        ?>