search
HomeCMS TutorialDEDECMSHow does dedecms publish photo albums?

How does dedecms publish photo albums?

Mar 12, 2021 am 11:09 AM
dedecms

How does dedecms publish photo albums?

dedecms’ specific method of publishing an atlas is as follows:

1. Create an image category in the background

2. Create an article, each Upload an image to the article

3. Add the following code to the /include/extend.func.php file

 function Getimgurls($aid,$num=4)    
    {
        global $dsql;
        $imgurls = $result = '';
        $imgrow = $dsql->GetOne( "Select imgurls From `dede_addonimages` where aid='$aid' ");
        $imgurls = $imgrow['imgurls'];
        if($imgurls != '')
        {
            $dtp = new DedeTagParse();
            $dtp->LoadSource($imgurls);
            $images = array();
            if(is_array($dtp->CTags))
            {
                foreach($dtp->CTags as $ctag)
                {
                    if($ctag->GetName() == 'img')
                    {
                        $row = array();
                        $row['width'] = $ctag->GetAtt('width');
                        $row['height'] = $ctag->GetAtt('height');
                        $row['imgsrc'] = trim($ctag->GetInnerText());
                        $row['text'] = $ctag->GetAtt('text');
                        $images[] = $row;
                    }
                }
            }
            $dtp->Clear();
            $i = 0;
            foreach($images as $row)
            {
                if($i == $num) break;
                if($row['imgsrc'] != '')
                {
                    $result .= "<li><img src=&#39;{$row[&#39;imgsrc&#39;]}&#39; alt=&#39;{$row[&#39;text&#39;]}&#39; width=&#39;70&#39; height=&#39;70&#39;></li>";
                }
                $i++;
            }
            return $result;
        }  
    }

4. Call

 {dede:arclist row=4 typeid =13}
  [field:id function=Getimgurls(@me,4)/]
 {/dede:arclist}

the latter
# on the web page ##

{dede:list pagesize=&#39;10&#39;}
    [field:id function=Getimgurls(@me,4)/]
{/dede:list}

Related recommendations:

梦伟cms

The above is the detailed content of How does dedecms publish photo albums?. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:csdn. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.