Read Image address code
GetOne ("SELECT c. addtable FROM #@__ archives AS a left join #@__ channeltype AS c ON. channel = c. id where. id = '$ imgid' "); $ addtable = trim ($ row ['addtable']); // Obtain the imgurls field of the image appended table for processing $ row = $ dsql-> GetOne ("Select imgurls From '$ addtable' where aid = '$ imgid '"); // call the ChannelUnit class $ ChannelUnit = new ChannelUnit (2, $ imgid) in inc_channel_unit.php; // call the GetlitImgLinks method in the ChannelUnit class to process the thumbnail $ lit_imglist = $ ChannelU Nit-> GetlitImgLinks ($ row ['imgurls']); // return result return $ lit_imglist ;} /**************** function GetOneImgUrl @ function: read the image address of a custom field ****************/function GetOneImgUrl ($ img, $ ftype = 1) {echo $ img; if ($ img <> '') {$ dtp = new DedeTagParse (); $ dtp-> LoadSource ($ img); if (is_array ($ dtp-> CTags )) {foreach ($ dtp-> CTags as $ ctag) {if ($ ctag-> GetName () = 'IMG ') {$ width = $ ctag-> GetAtt ('width'); $ height = $ ctag-> GetA Tt ('height'); $ imgurl = trim ($ ctag-> GetInnerText (); $ img = ''; if ($ imgurl! = '') {If ($ ftype = 1) {$ img. = $ imgurl;} else {$ img. = '';}}}$ dtp-> Clear (); return $ img ;}} /* return the article arcurl * $ id article ID */function getArcurlByArcid ($ id) {global $ dsql; $ query = "Select arc. *, tp. typedir, tp. typename, tp. corank, tp. isdefault, tp. defaultname, tp. namerule, tp. moresite, tp. siteurl, tp. sitepath from dede_archives arc left join dede_arctype tp on arc. typeid = tp. id where arc. id = ". $ ID; $ row = $ dsql-> GetOne ($ query); $ ReturnURL = GetFileUrl ($ row ['id'], $ row ['typeid'], $ row ['senddate'], $ row ['title'], $ row ['ismake'], $ row ['arcrank '], $ row ['namerule'], $ row ['typedir'], $ row ['Money'], $ row ['filename'], $ row ['moresite '], $ row ['siteurl'], $ row ['sitepath']); return $ ReturnURL ;}