Phpcms article source is divided into two kinds, one is added in the background source, the relevant data of this "source" is stored in the Database CopyFrom table, through the ID and News_data table related, the other is to add or edit the article directly written up, in the background, this " SOURCE "Only one name is stored in the" CopyFrom "field of the News_data table.
Phpcms the output array of the lists label is not the source field by default, in order to display, in the above two cases, to be processed separately in different ways.
1. The first case
In this case, all the relevant data of "source" is stored in the cache, can be useful after reading the GetCache function, add a copyfrom field to the return array of the lists tag, and then call in the foreground, the principle and the "Show article category in foreground" method as written yesterday.
2. The second case
This is actually relatively simple, because the "source" of the relevant data has only one name, stored in the News_data table, and this table is the table of articles (news table) schedule, so in the lists tag MoreInfo property is set to 1 can be directly with {$r [' CopyFrom ' ]} to show, but the problem is that the output of the data with a tail, that is, "Source name |
This requires a PHP string function explode processing the re-output, you need two commands:
$cc=explode(' | | ', $[' CopyFrom ')} {$cc}
It is important to note that these two commands cannot be written in one line, otherwise it will be an error.
Phpcms How to display the source in the foreground article list