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 );