Zblogphp obtains articles of multiple categories and sorts them according to the specified requirements (the latest hot reviews)
function Nobird_GetArticleCategorys($Rows,$CategoryID,$hassubcate){ global $zbp; $ids = strpos($CategoryID,',') ! == false ? explode(',',$CategoryID) : array($CategoryID); $wherearray=array(); foreach ($ids as $cateid){ if (!$hassubcate) { $wherearray[]=array('log_CateID',$cateid); }else{ $wherearray[] = array('log_CateID', $cateid); foreach ($zbp->categorys[$cateid]->SubCategorys as $subcate) { $wherearray[] = array('log_CateID', $subcate->ID); } } } $where=array( array('array',$wherearray), array('=','log_Status','0'), ); $order = array('log_PostTime'=>'DESC'); $articles= $zbp->GetArticleList(array('*'),$where,$order,array($Rows),''); return $articles; }
usage method:
{foreach $array=Nobird_GetArticleCategorys(10,'1,2,3',true) as $related} <li><a href="{$related.Url}" target="_blank">{$related.Title}</a></li> {/foreach}
instructions:
Can't find a tutorial that can solve your problem?
-
Charging zblogphp template The 9th zblog enterprise theme of Tianxing Studio is submitted with its own form, adding multilingual function suitable for foreign trade zero 2019-12-11 nineteen thousand nine hundred and ninety-two Price: four hundred and sixty-eight Online purchase -
Charging zblogphp template Tianxing Studio ppt download template is suitable for sites with resources to sell vips one 2019-10-03 fifteen thousand two hundred and forty-five Price: one hundred and ninety-nine Online purchase -
Wordpress template Tianxing Studio wordpress download station theme is applicable to software/app/game and other download stations zero 2022-05-06 sixteen thousand six hundred and seventy-two Price: three hundred and fifty-five Online purchase -
Charging zblogphp template Tianxing Studio zblogphp enterprise theme 6 Self configurable atmosphere zblog enterprise theme two 2018-06-26 fifty-one thousand seven hundred and forty-seven Price: two hundred and fifty-eight Online purchase
Related recommendations
-
Zblogphp comes with a complete set of js framework comment interfaces 12-04 -
The zblogphp hook interface inserts the specified content into the article body 07-14 -
In 2020, version 1.6 of zblog will finally go online 03-26 -
The call tags of the total number of articles and comments called by zblogphp 03-16 -
How to control the number of calls to the latest articles in the right column of zblog? 03-11 -
Discussion on setting tags for zblogphp comments 08-04 -
Zblog 1.5 officially released: Z-BlogPHP 1.5 Zero Released! 10-31 -
Zblogphp determines whether the user logs in 10-21 -
Can ZBLOG PHP use PHP 7? 01-19 -
The method of adding hot articles, latest articles and other blocks to the right column of zblogphp 11-05
yes two Comments from netizens:
-
dafuli Nine years ago (January 13, 2017) reply Foreach ($zbp - ˃ categories [$cateid] - ˃ SubCategories as $subcate) This code is reported by my website. How can I break it? One of the two stations of the same host is normal, and one is wrong! Normal station: system environment Linux; Apache; PHP 5.6.29 x64; mysqli; Curl error reporting station: system environment Linux; Apache; PHP 5.6.29 x64; pdo_mysql; curl
-
Drizzle Nine years ago (2016-04-18) reply Thanks for Tianxing's further detailed introduction. I can't use what Brother Bird wrote. All the tutorials you introduced are easy for us novices to learn!
welcome you Comment: Cancel Reply
-
Zblog enterprise theme -
Zblog image theme -
Zblog resource topic -
Zblog CMS topic -
Wordpress template -
Zblog video theme -
Zblog Taobao guest theme -
Zblog navigation topic
Select a theme?
-
Latest articles -
Hot article ranking -
Most Comments
-
one Tianxing Studio multilingual translation plug-in can automatically translate up to 12 languages for foreign trade sites 06-23 -
two Detailed steps and screenshots of Youdao Cloud Translation to obtain appid and seckey 06-22 -
three The asynchronous notification page after Alipay payment prompts "Payment signature verification failed, please contact the administrator! "Causes and solutions 05-08 -
four Screenshot of AliCloud OSS configuration item acquisition steps, including ID and Secret, regional node endpoint, storage space bucket and resource access domain name 04-14 -
five The cause and solution of verification code error is always prompted in the background of zblog login 03-01 -
six Zblog uses api to submit post data, prompting the reason and solution of 419 error 02-23 -
seven Tianxing Studio 2025 Spring Festival Holiday Announcement 01-25 -
eight Tutorial of setting "WeChat notification" function of Tianxing user center plug-in 11-09 -
nine Alibaba Cloud 2024 Double 11 Event is recommended to participate through the website link and give away vouchers on the website 11-05
-
Label aggregation -
×1 Three dimensional theme ×1 Ytcms for zblogasp ×2 Article List ×2 Alipay interface ×1 Trojans ×1 Swaper Document ×2 Happy Spring Festival ×1 Back home ×1 Zblogphp pseudo static ×2 Emlog call ×1 Domain name discount ×1 Developer Mode ×1 Quick Flipping ×1 Articles in the same column ×2 Wordpress Next ×3 Zblog adaptive enterprise theme ×1 Background color matching ×1 Invalid zblog modification subject ×1 strive ×1 Latest comments
Latest comments
-
Visitors 111 07-06 In short, it is not a free lunch. It is difficult to develop without taking the Z mode Commented on: Notes on zblog copyright -
Tianxing Studio 02-08 No restrictions Commented on: Tianxing Studio zblog Taoke theme is suitable for promoting websites with content -
visitor 02-08 Do you think the users of zblog Taoke must be enterprises? Commented on: Tianxing Studio zblog Taoke theme is suitable for promoting websites with content -
kevel 11-09 Guys, throw away some demo stations other than the authors. I want to see your layout settings Commented on: Template of zblog navigation station of Tianxing Studio with news, pictures and Taoke module -
Interesting life 10-22 I have always wanted to develop the functions of zblog. I don't know whether the application of zblog is enough Commented on: Code of zblog calling the latest comment (the latest message)