Вход Регистрация
Файл: admin/bans_words.php
Строк: 155
<?php
/**************************************************************************************************
| Scritter Script
| http://www.scritterscript.com
| webmaster@scritterscript.com
|
|**************************************************************************************************
|
| By using this software you agree that you have read and acknowledged our End-User License 
| Agreement available at http://www.scritterscript.com/eula.html and to be bound by it.
|
| Copyright (c) ScritterScript.com. All rights reserved.
|**************************************************************************************************/

include("../include/config.php");
include_once(
"../include/functions/import.php");
verify_login_admin();
$adminurl $config['adminurl'];

// DELETE 
if($_REQUEST[delete]=="1")
{
    
$DPID $_REQUEST['DW'];
    if(
$DPID != "")
    {
        
$deleteme $DPID;
        
$query "DELETE FROM bans_words WHERE word='".mysql_real_escape_string($deleteme)."'";
        
$conn->Execute($query);
        
        
$message "Word Successfully Deleted.";
        
Stemplate::assign('message',$message);
    }
}
// DELETE 

$sortby "word";
$sort =" order by word";
$add1 "&sortby=word";

if(
$_REQUEST['sorthow']=="desc")
{
    
$sorthow ="desc";
    
$add1 .= "&sorthow=desc";
}
else
{
    
$sorthow ="asc";
    
$add1 .= "&sorthow=asc";
}

//Search
$word htmlentities(strip_tags($_REQUEST['word']), ENT_COMPAT"UTF-8");
$add1 .= "&word=$word";
if(
$word!="")
{
    
$addtosql .= "WHERE word like'%".mysql_real_escape_string($word)."%'";
    
Stemplate::assign('word',$word);
    
Stemplate::assign('search',"1");
}
//Search End

$page intval($_REQUEST['page']);
if(
$page=="")
{
    
$page "1";
}
$currentpage $page;

if (
$page >=2)
{
    
$pagingstart = ($page-1)*$config['items_per_page'];
}
else
{
    
$pagingstart "0";
}

$queryselected "select count(*) as total from bans_words $addtosql $sort $sorthow limit $config[maximum_results]";
$query2 "select * from bans_words $addtosql $sort $sorthow limit $pagingstart$config[items_per_page]";
$executequeryselected $conn->Execute($queryselected);
$totalposts $executequeryselected->fields['total'];    
if (
$totalposts 0)
{
    if(
$totalposts<=$config[maximum_results])
    {
        
$total $totalposts;
    }
    else
    {
        
$total $config[maximum_results];
    }
    
$toppage ceil($total/$config[items_per_page]);
    if(
$toppage==0)
    {
        
$xpage=$toppage+1;
    }
    else
    {
        
$xpage $toppage;
    }
    
$executequery2 $conn->Execute($query2);    
    
$results $executequery2->getrows();
    
$beginning=$pagingstart+1;
    
$ending=$pagingstart+$executequery2->recordcount();
    
$pagelinks="";
    
$k=1;
    
$theprevpage=$currentpage-1;
    
$thenextpage=$currentpage+1;
    if (
$currentpage 0)
    {    
        if(
$currentpage 1
        {
            
$pagelinks.="<a href='$adminurl/bans_words.php?page=1$add1' title='first page'>First</a>&nbsp;";
            
$pagelinks.="<a href='$adminurl/bans_words.php?page=$theprevpage$add1'>Previous</a>&nbsp;";
        };
        
$counter=0;
        
$lowercount $currentpage-5;
        if (
$lowercount <= 0$lowercount 1;
        while (
$lowercount $currentpage)
        {
            
$pagelinks.="<a href='$adminurl/bans_words.php?page=$lowercount$add1'>$lowercount</a>&nbsp;";
            
$lowercount++;
            
$counter++;
        }
        
$pagelinks.=$currentpage."&nbsp;";
        
$uppercounter $currentpage+1;
        while ((
$uppercounter $currentpage+10-$counter) && ($uppercounter<=$toppage))
        {
            
$pagelinks.="<a href='$adminurl/bans_words.php?page=$uppercounter$add1'>$uppercounter</a>&nbsp;";
            
$uppercounter++;
        }
        if(
$currentpage $toppage
        {
            
$pagelinks.="<a href='$adminurl/bans_words.php?page=$thenextpage$add1'>Next</a>&nbsp;";
            
$pagelinks.="<a href='$adminurl/bans_words.php?page=$toppage$add1' title='last page'>Last</a>&nbsp;";
        };
    }
}
else
{
    
$error "Sorry, no banned words were found.";
}

$mainmenu "5";
$submenu "1";
Stemplate::assign('mainmenu',$mainmenu);
Stemplate::assign('submenu',$submenu);
Stemplate::assign('sorthow',$sorthow);
Stemplate::assign('sortby',$sortby);
Stemplate::assign('currentpage',$currentpage);
STemplate::display("administrator/global_header.tpl");
STemplate::assign('beginning',$beginning);
STemplate::assign('ending',$ending);
STemplate::assign('pagelinks',$pagelinks);
STemplate::assign('total',$total+0);
STemplate::assign('results',$results);
Stemplate::assign('error',$error);
STemplate::display("administrator/bans_words.tpl");
STemplate::display("administrator/global_footer.tpl");
?>
Онлайн: 1
Реклама