Home CMS Tutorial PHPCMS How to call video in phpcms?

How to call video in phpcms?

Jun 10, 2020 pm 01:17 PM
phpcms

How to call video in phpcms?

There are three situations when adding videos in phpcms. One is to play on the home page, one is to play on the list page, and the other is to play on the content page. . The difference between playing on the home page and playing on the list page is whether the catid value is fixed or the current catid is obtained. Playing on the home page and list page is achieved by obtaining the player code from the content page and passing in certain values. Therefore, we will first introduce the process of adding videos on the content page.

(1) phpcms background operation steps

1. Check whether your phpcms navigation bar has "Video" menu

If there is no " "Video" menu, you can click "Module Management Options" in the "Module" menu, click "Uninstall" in the "Video Library" row, after updating the cache, find the "Video Library" row as above, click "Install", and update the column again Just cache.

2. After the "Video" menu appears, click the "Apply for Activation" option under the "Video" menu. At this time, the content on the right will require the logging in to register a Shanda account. You can register as required. No more details here. Repeat.

3. After the registration is completed, the correct configuration page will appear (some students may have error messages similar to verification failure, not logged in, etc.). At this time, you can exit phpcms, log in again, or close the browser and open it again. And clear the cache, or restart the computer [These days, restarting the computer can solve many problems])

4. After the above interface appears, it means that the "video" function has been enabled. Click the "Upload Video" option and click "Select File" on the right to upload the video to the phpcms server. The upload is complete when there are 0 seconds left. Click Submit after the upload is complete.

5. Click the "Video Library" option, and you will see that the uploaded video has been added to the right, but the video will not be available until "Approved" is displayed in the "Status" column. During this period, you can click Update Status to view the review process.

At this point, the work of adding videos to the video library has been completed. The next step is to add columns, select the video model, select the corresponding column in the content to add content, and add the video in the video library to the content. Specifically The implementation steps will not be repeated here.

(2) PHP code

1. Click the list page to jump to the content page to play the video

Just add the following code to the content page (if you want to implement more For multi-functions, such as ranking, commenting, sharing, etc., you can find the default video template of PHPcms [the show_video.html file under the content folder under the default folder] and paste the code from it)

 <!--视频开始-->
      <div id="picys" class="plbox">   
             {if $allow_visitor==1}
                  {if $video[vid]!=""}
          
                   {player_code(&#39;video_player&#39;,$video[&#39;channelid&#39;],$video[&#39;vid&#39;],860,500)}
    {else}
               该视频不存在,请返回!
              {/if}         
              {else}
           <CENTER><a href="{APP_PATH}index.php?m=content&c=readpoint&allow_visitor={$allow_visitor}"><font color="red">阅读此信息需要您支付 <B><I>{$readpoint} {if $paytype}元{else}点{/if}</I></B>,点击这里支付</font></a></CENTER>
                          {/if}
                                 </div>
<!--视频结束-->
Copy after login

二, to realize that clicking the list in the list page will play the video

Just add the following code to the list in the list page (if some students want to realize that the list content in the list page is a thumbnail, it will appear after clicking the thumbnail To play video in the pop-up layer, you only need to put this code into the pop-up layer code. However, if the pop-up layer code is in js, it cannot be implemented because the js data will not be refreshed during the data adjustment process. In this case, only You can create another div in the body, put the pop-up layer code into the div, and use js to get the html in the div)

{pc:content action="lists" catid="$catid" num="4" siteid="$siteid" order="id DESC" moreinfo="1"  page="$page"}
               {loop $data $key $val} 
             {pc:get sql="select vid from v9_video_store where videoid in (select videoid from v9_video_content where contentid=$val[id])" return="data"}   
                {player_code(&#39;video_player&#39;,1,$data[0][vid],300,300)}
              {/pc}
            {/loop}
    {/pc}
Copy after login

3. Play the video on the homepage

The video code on the homepage is almost the same as the video code on the list page, except that the value of catid is fixed. Because the homepage does not have a passed value of catid, the current catid cannot be obtained and can only be written to a fixed value)

Recommended tutorial: "phpcms"

The above is the detailed content of How to call video in phpcms?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What framework is phpcms? What framework is phpcms? Apr 20, 2024 pm 10:51 PM

PHP CMS is a PHP-based open source content management system for managing website content. Its features include ease of use, powerful functionality, scalability, high security, and free open source. It can save time, improve website quality, enhance collaboration and reduce development costs, and is widely used in various websites such as news websites, blogs, corporate websites, e-commerce websites and community forums.

How to jump to the details page in phpcms How to jump to the details page in phpcms Jul 27, 2023 pm 05:23 PM

How to jump to the details page in phpcms: 1. Use the header function to generate a jump link; 2. Loop through the content list; 3. Get the title and details page link of the content; 4. Generate a jump link.

WeChat Login Integration Guide: PHPCMS Practical Combat WeChat Login Integration Guide: PHPCMS Practical Combat Mar 29, 2024 am 09:18 AM

Title: WeChat Login Integration Guide: PHPCMS in Action In today’s Internet era, social login has become one of the essential functions of a website. As one of the most popular social platforms in China, WeChat’s login function is also used by more and more websites. This article will introduce how to integrate the WeChat login function in the PHPCMS website and provide specific code examples. Step 1: Register a WeChat Open Platform Account First, we need to register a developer account on the WeChat Open Platform and apply for the corresponding development permissions. Log in [WeChat open platform]

The latest phpcms video tutorial recommendations in 2023 (must learn for secondary development) The latest phpcms video tutorial recommendations in 2023 (must learn for secondary development) Oct 25, 2019 pm 03:45 PM

Many webmasters use PHPCMS for secondary development and website building. PHP Chinese website has specially launched a phpcms video tutorial. You can watch the video tutorial for free anytime and anywhere without downloading from Baidu Netdisk, which is very convenient.

Does phpcms have a comment function? Does phpcms have a comment function? Feb 16, 2023 am 10:06 AM

phpcms has a comment function. The built-in comment module of phpcms provides the function for website visitors to post their own opinions, allowing visitors to interact and exchange their opinions with each other to increase the popularity of the website. PHPCMS's comment function for users to leave messages has also added an audit function to prevent prohibited words from appearing in comments. For website administrators, the comment module of PHPCMS can easily manage user comments, and can find and manage message content based on time, keywords, review and other conditions.

What database does phpcms use? What database does phpcms use? Feb 21, 2023 pm 06:57 PM

phpcms uses mysql database. phpcms is a PHP open source website management system, developed using PHP+MYSQL as the technical basis. PHPCMS V9 adopts OOP method to build the basic operating framework. The supported PHP version is PHP5 and above, and the supported MYSQL version is MySql 4.1 and above.

How to implement WeChat login in phpcms How to implement WeChat login in phpcms Mar 09, 2023 am 09:33 AM

How to implement WeChat login in phpcms: 1. Create a new "wechat.php" in the root directory; 2. Add "public function wechat() {...}" under "\phpcms\modules\member\index.php"; 3. . Just use the wechat function in the "foreground.class.php" file to determine whether the user is logged in.

What does phpcms mean? What does phpcms mean? Apr 20, 2024 pm 10:39 PM

PHPCMS is a free and open source content management system (CMS) that features: open source, modularity, flexibility, user-friendliness and community support. It can be used to create various types of websites, including corporate websites, e-commerce websites, blogs, and community forums. Technical requirements include: PHP 5.6 or higher, MySQL, MariaDB or PostgreSQL database, and Apache or Nginx web server.

See all articles