How can I write the title and content in the content template?

Source: Internet
Author: User
How can I write the title and content in the content template? this is a PHP file. how can I write the title and content in the content template? Please write a single content template. Thanks. because the code is too long, I have deleted a part and I am eager to use it. thank you! & lt ;? Phpclass & nbsp; blog & nbsp; extends & how can I write the title and content in the content template?
This is a PHP file. how can I write the title and content in the content template? Please write a single content template. Thanks. because the code is too long, I have deleted a part and I am eager to use it. thank you!



Class blog extends top
{

Function _ construct (){
Parent: :__ construct ();
}


// Obtain feeds
Function feeds (){
If ($ this-> spArgs ('uid ')){
$ Uid = (int) $ this-> spArgs ('uid ');
$ Cond = "and B. uid = '$ uid '";
}
If ($ this-> spArgs ('pagelimmit ')){
$ PageLimit = ($ this-> spArgs ('pagelimmit ') <30 )? $ This-> spArgs ('pagelimmit '): 30; // custom page
} Else {
$ PageLimit = $ this-> yb ['show _ page_num '];
}


// Left join '". DBPRE." follow' AS f ON (B. uid = f. touid and f. uid = '$ uid ')
$ SQL = "SELECT B. *, k. id AS likeid, m. username, m. domain
FROM '". DBPRE. "blog 'as B LEFT join '". DBPRE. "likes 'as k ON (B. bid = k. bid AND k. uid = '$ this-> uid ')
Left join '". DBPRE." member' as m on B. uid = m. uid where B. open = 1 $ cond order by B. time desc ";

$ Data ['blog '] = spClass ('Db _ blog')-> spPager ($ this-> spArgs ('page', 1), $ pageLimit) -> findSql ($ SQL );
$ Data ['Page'] = spClass ('Db _ blog')-> spPager ()-> getPager ();
Unset ($ data ['Page'] ['all _ page']);
If (! Empty ($ data ['blog ']) {
Foreach ($ data ['blog '] as & $ d ){
$ This-> foramt_feeds ($ d );
}
$ This-> api_success ($ data );
} Else {
$ This-> api_success ("");
}
}


// Obtain a single blog
Function getOneBlog (){
$ Bid = (int) $ this-> spArgs ('bid ');
$ SQL = "SELECT B. *, k. id AS likeid, m. username, m. domain
FROM '". DBPRE. "blog 'as B LEFT join '". DBPRE. "likes 'as k ON (B. bid = k. bid AND k. uid = '$ this-> uid ')
LEFT join '". DBPRE. "member 'as m on B. uid = m. uid where B. open in (1,-2) and B. bid = '$ bid '";
$ Data ['blog '] = spClass ('Db _ blog')-> findSql ($ SQL );
Foreach ($ data ['blog '] as & $ d ){
$ This-> foramt_feeds ($ d, 0 );
}
$ This-> api_success ($ data );
}



// Get the feeds of my followers
Function followfeeds (){
$ Followuid = spClass ('Db _ follow')-> getFollowUid ($ this-> uid );
If ($ followuid ){
$ SQL = "SELECT B. *, k. id AS likeid, m. username, m. domain
FROM '". DBPRE. "blog 'as B LEFT join '". DBPRE. "likes 'as k ON (B. bid = k. bid AND k. uid = '$ this-> uid ')
Left join '". DBPRE." member' as m on B. uid = m. uid where B. open = 1 ";
$ SQL. = "and B. uid in ($ followuid) and B. open = 1 order by B. time desc ";
$ Data ['blog '] = spClass ('Db _ blog')-> spPager ($ this-> spArgs ('page', 1), 10) -> findSql ($ SQL );
$ Data ['Page'] = spClass ('Db _ blog')-> spPager ()-> getPager ();

Foreach ($ data ['blog '] as & $ d ){
$ This-> foramt_feeds ($ d );
}
}
$ This-> api_success ($ data );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.