403Webshell
Server IP : 116.153.78.57  /  Your IP : 43.159.78.123
Web Server : nginx/1.28.0
System : Linux 1763701629066 6.8.0-53-generic #55-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 17 15:37:52 UTC 2025 x86_64
User : www ( 1001)
PHP Version : 8.2.28
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/www.lengcat.cn/wp-content/themes/onenav/inc/widgets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/www.lengcat.cn/wp-content/themes/onenav/inc/widgets/w.code.php
<?php
/*
 * @Author: iowen
 * @Author URI: https://www.iowen.cn/
 * @Date: 2024-09-13 01:28:58
 * @LastEditors: iowen
 * @LastEditTime: 2024-10-06 15:20:49
 * @FilePath: /onenav/inc/widgets/w.code.php
 * @Description: 
 */

IOCF::createWidget('iow_code_embed', array(
    'title'       => 'IO 嵌入代码',
    'classname'   => 'io-widget-code-embed',
    'description' => '可插入html、js、css代码,广告代码,或者插入 iframe 视频',
    'fields'      => array(
        array(
            'id'      => 'title',
            'type'    => 'text',
            'title'   => '名称(留空不显示)',
            'default' => '',
        ),
        array(
            'id'      => 'title_ico',
            'type'    => 'icon',
            'title'   => ' ',
            'default' => 'iconfont icon-tools',
            'class'   => 'compact min'
        ),
        array(
            'id'         => 'code',
            'type'       => 'textarea',
            'title'      => '代码',
            'after'      => '请输入HTML代码,注意代码规范,不规范会破坏页面布局。',
            'class'      => 'compact min',
            'sanitize'   => false,
            'attributes' => array(
                'rows' => 5
            )
        ),
        array(
            'id'    => 'is_video',
            'type'  => 'switcher',
            'title' => '是视频',
            'help'  => '如果是iframe视频,清开启。开启后可只填视频链接,系统会自动添加iframe标签',
            'class' => 'compact min'
        ),
        array(
            'id'         => 'aspect',
            'type'       => 'slider',
            'title'      => '长宽比例(长/宽)',
            'default'    => 56,
            'max'        => 200,
            'min'        => 30,
            'unit'       => '%',
            'help'       => '16/9=56, 4/3=75, 1/1=100, 9/16=177, 3/4=133',
            'dependency' => array('is_video', '==', 'true'),
            'class'      => 'compact min'
        ),
    )
));
function iow_code_embed($args, $instance) {
    $body = '';
    if ($instance['is_video']) {
        $url = $instance['code'];
        //判断url是不是 链接
        if (filter_var($url, FILTER_VALIDATE_URL)) {
            $iframe = '<iframe class="lazy" framespacing="0" border="0" frameborder="no" data-src="' . esc_url($url) . '"></iframe>';
        } else {
            $iframe = $url;
        }
        $body = '<div class="iframe-video-aspect" style="padding-top:' . $instance['aspect'] . '%">' . $iframe . '</div>';
    }else{
        $body = $instance['code'];
    }

    echo $args['before_widget'];
    echo get_widget_title($args, $instance);
    echo $instance['title'] ? '<div class="card-body">' : '';
    echo $body;
    echo $instance['title'] ? '</div>' : '';
    echo $args['after_widget'];
}

Youez - 2016 - github.com/yon3zu
LinuXploit