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 has its own form to submit email reminders, etc zero 2019-12-11 eleven thousand two hundred and seventy-one 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 nine thousand eight hundred and thirty-three 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 five thousand four hundred and eighty 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 forty-four thousand nine hundred and nine 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 -
Zblogphp's Pits: Why are sub classified articles not displayed under the parent category? 06-15 -
Precautions for the use of Z-BlogPHP on HiChina free virtual host 06-12 -
Zblogphp image immobilizer code Other files are also available 05-20 -
Advanced Tutorial zblogphp Add jq Color Palette in the Background 02-28 -
Zblogphp calls the method with the most comments for the latest and hottest articles 02-03 -
Zblogphp pseudo static rule (URL configuration) case description 01-07
yes two Comments from netizens:
-
dafuli Seven years ago (January 13, 2017) reply foreach ($zbp- ˃ categorys[$cateid]- ˃ SubCategories as $subcate)? One of the two stations of the same host is normal and the other 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 8 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 Shopping activity on the official website of Tianxing Studio: unlimited number of times and amount of 20% discount coupons 04-17 -
two Tianxing Studio zblog pure blog theme vue3+applet dual version 03-19 -
three Error causes and solutions of introducing vant into vue3 project 03-12 -
four Tianxing Studio zblog encyclopedia theme can be matched with member plug-ins to realize knowledge payment profitability 03-06 -
five How does zblog intercept a summary with a specified number of words? Introduction to the custom interception method of zblog summary 02-29 -
six Tianxing Studio 2023 Double 11 Event: 50% discount coupons 11-05 -
seven Tencent Cloud 2023 Double 11 Activity: 2H2G3M lightweight server 88 new users for one year 11-05 -
eight AliCloud 2023 Double 11 Activity: 2-core 2G3M bandwidth ECS 99 yuan/year! 10-31 -
nine Tianxing Studio zblog free login paid reading plug-in supports Alipay WeChat payment Hupi Pepper payment 10-09
-
Label aggregation -
×1 Zblog back to the top ×1 Zblog charging template ×1 a298t ×1 Article collection ×1 Publish video ×5 Zblog navigation bar ×1 Zblog likes ×8 key word ×3 Zblog Theme Installation ×1 Back to top ×1 style ×1 Thematic presentation ×1 Wang domain name ×7 Zblog applet ×1 Static url ×3 zblogphp1.4 ×1 Promotion share ×1 Technology Blog ×1 Host service provider ×1 Fixed domain name
Latest comments
-
Tianxing Studio 03-21 Yes, it will be repaired in the next version Commented on: Tianxing Studio zblog pure blog theme vue3+applet dual version -
visitor 03-20 This template has multiple side-by-side pictures. No matter which picture you click, the first picture will be displayed. There is no carousel button, and you can only manually close it. System: win7+Firefox Commented on: Tianxing Studio zblog pure blog theme vue3+applet dual version -
Tianxing Studio 01-19 I don't understand. Do you want to create categories in batches? This is not considered by the theme of plug-ins Commented on: Tianxing Studio zblog cms theme charging version supports extreme personalized configuration -
visitor 01-18 It is too troublesome to classify and set one by one. Can you add classification settings in the theme settings. Commented on: Tianxing Studio zblog cms theme charging version supports extreme personalized configuration -
Tianxing Studio 01-16 I don't quite understand your requirements. Please contact our online qq2076496616 to provide the order number to specify your requirements Commented on: Tianxing Studio zblog cms theme charging version supports extreme personalized configuration