Read Image address-PHP source code

Source: Internet
Author: User
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 ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.