home page Site building tutorial Zblog website establishment text

ZblogPHP article calls to specify custom multiple selection fields

In the ZblogPHP theme function design, some modules need to call the articles specified by the webmaster, such as CMS theme, theme sidebar module, recommended article module, etc. The common practice in the theme configuration is to set the article ID number to be displayed, and separate multiple articles with English commas. Although this method can achieve the effect, it is not flexible enough to operate, You need to query the article ID number. So today I wrote another method, which we can try if we think it is appropriate. 1. Mount the article editing page interface Add in include.php

stay zblogphp theme function Design Some modules need to call the articles specified by the webmaster, such as CMS topic, topic sidebar module, recommendation article module, etc. The common practice in topic configuration is to set the article ID number to be displayed, and separate multiple articles with small commas in English. Although this method can achieve the effect, it is still not flexible enough to operate, so you need to query the article ID number. So today I wrote another method, which we can try if we think it is appropriate.

 ZblogPHP article calls to specify custom multiple selection fields Figure 1

1. Mount the article editing page interface in include.php

 Add_Filter_Plugin('Filter_Plugin_Edit_Response5','umWm_postType');

2. Add the interface configuration field in include.php

 function umWm_postType() {  global $zbp, $article;  if($article->Type=="0"){ $postType='Join the first promotion | Join the selection ';  $array=explode('|',$postType);  foreach ($array as $v) {   echo '   <input type="hidden"  name="meta_'.$v.'" value=""/>   <label>   <input type=" checkbox "name="meta_'.$ v.'" value="'. html specialchars($v).' " ';   if ($article->Metas->$v == $v){echo 'checked="checked"';}   echo ' class="'.$v.'" />&nbsp;'.$ v.'</label><br />';  }  } }

This is hidden content, please review the hidden content after comments, thank you!

Reward
poster

Statement: Some of the resources on this site are original works on the site, and some are publicly shared and collated based on the Internet. The copyright belongs to the original author.
If it infringes your rights, please contact our website, and we will deal with it as soon as possible. Thank you. Please indicate the source of the transfer

Link to this article: https://www.umtheme.com/zblog/197.html

Related recommendations

 The list of zblog custom categories is sorted by browsing volume, comments, update time, ID or author

The list of zblog custom categories is sorted by browsing volume, comments, update time, ID or author

ZBLOG provides rich interfaces to facilitate the personalized customization of webmasters, so it is easy to reorder articles. For example, it may be necessary to adjust the default sorting of the system during the development and production process (the latest one is first), so that the list of articles under a certain category on its website is based on the specified (browse volume
Zblog website establishment 2022.10.16 zero two thousand eight hundred and nine
Comment List
 Xinghua Life
It's just useful, look
2023-12-09 23:20:37 reply
 have a look
have a look
2023-04-09 17:08:41 reply
 Grey Wolf
Take a look
2022-05-26 10:13:38 reply

Thank you for your support