1. 程式人生 > >點選載入更多外掛

點選載入更多外掛

<?PHP

    要求( '../類/ connect.php');

    要求( '../類/ db_sql.php');

    要求( '../資料/ dbcache / class.php');

    if($ _ POST [action] =='getmorenews'){

    $表=用htmlspecialchars($ _ POST [表]);

    if(empty($ _ POST [orderby])){$ orderby ='newstime';} else {$ orderby = htmlspecialchars($ _ POST [orderby]);}

    if(empty($ _ POST [myorder])){$ myorder ='desc';} else {$ myorder ='asc';}

    if(empty($ _ POST [limit])){$ limit = 6;} else {$ limit =(int)$ _ POST [limit];}

    if(empty($ _ POST [classid])){$ where = null;} else {$ where ='where'classid in('。$ _ POST [classid]。')';}

    if(empty($ _ POST [length])){$ length = 50;} else {$ length =(int)$ _ POST [length];}

    if(empty($ _ POST [small_length])){$ small_length = 500;} else {$ small_length =(int)$ _ POST [small_length];}

    //下一頁:第幾頁

    // table :呼叫資料表

    //限制:每次呼叫數量

    // small_length :簡介擷取字元數

    // length :標題擷取字元數

    // classid :呼叫欄目,允許多個,如1,2,3,4   特別注意,必須是呼叫同一資料表的欄目

    // orderby :排序,預設是newstime ,傳什麼就按什麼來排序,如id

    // myorder :正反序,預設是asc ,傳值怎麼desc

    $連結= db_connect();

    $ empire = new mysqlquery();

    $ num =(int)$ _ POST ['next'] * $ limit;

      如果($表){

            $ sql = $ empire-> query(“SELECT * FROM`”。$ dbtbpre。“ecms _”。$ table。“`$ $ order by $ orderby $ myorder limit $ num,$ limit”);

        而($ R = $ empire->取($ SQL)){

            如果($ R [mtitlepic] == ''){

                。$ R [mtitlepic] = $ public_r [news.url] “E /資料/影象/ notimg.gif”;

            }

        $ oldtitle =的stripslashes($ R [標題]);

        $標題=子($ oldtitle, '',$長度);

        $ smalltext =的stripslashes($ R [smalltext]);

        $ smalltext =子($ smalltext, '',$ small_length);

        $類名= $ class_r [$ R [CLASSID] [類名];

        $ newsurl = $ public_r [newsurl];

        。$ classurl = $ $ newsurl class_r [$ R [CLASSID] [類路徑];

        $ urls = sys_ReturnBqTitleLink($ r);

    ?>

    <! - 以下程式碼是顯示列表的標籤模板- >

    <li class ='news-list'>

        <a href='<?=$urls?>'title ='<?= $ r [title]?>'class ='date-link'>

            <img src ='<?= $ r [mtitlepic]?>'alt ='<?= $ r [title]?>'class ='date-img-url'/>

            <h4 class ='date-title'> <?= $ r [title]?> </ h4> <span class ='act-datetime'> <?= date(“Ymd”,$ r [newstime])? > </跨度>

        </A>

    </ LI>

    <?PHP

        }

       }

    }

    db_close();

    $帝國= NULL;

?>