当前位置: 首页>>代码示例>>PHP>>正文


PHP assign函数代码示例

本文整理汇总了PHP中assign函数的典型用法代码示例。如果您正苦于以下问题:PHP assign函数的具体用法?PHP assign怎么用?PHP assign使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了assign函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display_it

/**
 * Function used to call display
 */
function display_it()
{
    try {
        global $ClipBucket, $db;
        $dir = LAYOUT;
        foreach ($ClipBucket->template_files as $file) {
            if (file_exists(LAYOUT . '/' . $file['file']) || is_array($file)) {
                if (!$ClipBucket->show_page && $file['follow_show_page']) {
                } else {
                    if (!is_array($file)) {
                        $new_list[] = $file;
                    } else {
                        if (isset($file['folder']) && file_exists($file['folder'] . '/' . $file['file'])) {
                            $new_list[] = $file['folder'] . '/' . $file['file'];
                        } else {
                            $new_list[] = $file['file'];
                        }
                    }
                }
            }
        }
        assign('template_files', $new_list);
        Template('body.html');
        footer();
    } catch (SmartyException $e) {
        show_cb_error($e);
    }
}
开发者ID:reactvideos,项目名称:Website,代码行数:31,代码来源:functions_template.php

示例2: video_js

/**
 * PLayer video in video-js player
 * @global boolean $pak_player
 * @param type $in
 * @return boolean 
 */
function video_js($in)
{
    //Assigning configs so we can easily use them in template..
    assign('configs', $in);
    //get the file for video...
    $files = $in['files'];
    $video_files = array();
    if ($files) {
        foreach ($files as $key => $file) {
            if ($key) {
                if ($key == 'flv' || $key == 'mp4' || $key == 'mobile') {
                    $video_file = $file;
                    break;
                }
            }
            if ($file['status'] == 's' && $file['is_original'] != 'yes') {
                $video_file = $file['file_path'];
                break;
            }
        }
    }
    assign('file', $video_file);
    assign('video_files', $video_files);
    $player = fetch(VIDEO_JS_DIR . '/player.html', false);
    return $player;
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:32,代码来源:videojs.php

示例3: get_mob_video

 function get_mob_video($params)
 {
     $vdo = $params['video'];
     $assign = $params['assign'];
     $vid_file = get_video_file($vdo, true, true);
     $vidfile = substr($vid_file, 0, strlen($vid_file) - 4) . '-m.mp4';
     assign($assign, $vidfile);
     if ($vidfile) {
         return $vidfile;
     }
 }
开发者ID:Coding110,项目名称:cbvideo,代码行数:11,代码来源:global.php

示例4: cb_player

 function cb_player($in)
 {
     global $cb_player;
     $cb_player = true;
     $vdetails = $in['video'];
     //Checking for YT Referal
     if (function_exists('get_refer_url_from_embed_code')) {
         $ref_details = get_refer_url_from_embed_code(unhtmlentities(stripslashes($vdetails['embed_code'])));
         $ytcode = $ref_details['ytcode'];
     }
     $files = $in['files'];
     if ($files) {
         foreach ($files as $key => $file) {
             if ($key == 'flv' || $key == 'mp4' || $key == 'mobile') {
                 $video_file = $file;
                 break;
             }
             if ($file['status'] == 's' && $file['is_original'] != 'yes') {
                 $video_file = VIDEOS_URL . '/' . $file['file_directory'] . '/';
                 $video_file .= $file['file_name'] . $file['suffix'] . '.' . $file['ext'];
                 break;
             }
         }
     }
     if ($video_file || $ytcode) {
         if ($ytcode) {
             assign('youtube', true);
             assign('ytcode', $ytcode);
         }
         if (!strstr($in['width'], "%")) {
             $in['width'] = $in['width'] . 'px';
         }
         if (!strstr($in['height'], "%")) {
             $in['height'] = $in['height'] . 'px';
         }
         if ($in['autoplay'] == 'yes' || $in['autoplay'] === true || $_COOKIE['auto_play_playlist'] && ($_GET['play_list'] || $_GET['playlist'])) {
             $in['autoplay'] = true;
         } else {
             $in['autoplay'] = false;
         }
         //Logo Placement
         assign('logo_placement', cb_player_logo_position());
         assign('logo_margin', config('logo_padding'));
         //Setting Skin
         assign('cb_skin', 'glow/glow.xml');
         assign('player_data', $in);
         assign('player_logo', website_logo());
         assign('normal_vid_file', $video_file);
         assign("hq_vid_file", $hd_file);
         assign('vdata', $vdetails);
         $player = fetch(CB_PLAYER_DIR . '/cbplayer.html', false);
         return $player;
     }
 }
开发者ID:yukisky,项目名称:clipbucket,代码行数:54,代码来源:cbplayer.php

示例5: handle

 public function handle($request, \Closure $next)
 {
     //bus('menu', geter('menu.my'));
     assign('get', sc('Get'));
     assign('post', sc('Post'));
     assign('router', sc('Router'));
     //            assign('v3',[
     //            'routerv3'=>'v33',
     //            ]);
     // Perform action
     return $next($request);
 }
开发者ID:shampeak,项目名称:ap.so,代码行数:12,代码来源:Init.php

示例6: blog_publish_smarty

function blog_publish_smarty($path, $file, $timestamp, $title, $tags, $body, $comments)
{
    assign('path');
    assign('file');
    assign('date', date($GLOBALS['DATEFORMAT_POST'], $timestamp));
    assign('title', input_sanitize_smarty($title));
    assign('tags', input_sanitize_smarty($tags));
    assign('body', input_sanitize_smarty($body));
    assign('comments', $comments);
    global $smarty;
    file_put_contents("{$smarty->template_dir}/.posts{$path}/{$file}.html", $smarty->fetch("post.smarty"), LOCK_EX);
}
开发者ID:rcrowley,项目名称:bashpress,代码行数:12,代码来源:lib_blog_publish.php

示例7: parse_and_attach_video

/**
 * Function used to pars video from attachemtn
 */
function parse_and_attach_video($att)
{
    global $cbvid;
    preg_match('/{v:(.*)}/', $att, $matches);
    $vkey = $matches[1];
    if (!empty($vkey)) {
        assign('video', $cbvid->get_video_details($vkey));
        assign('only_once', true);
        echo '<h3>Attached Video</h3>';
        template('blocks/video.html');
    }
}
开发者ID:reactvideos,项目名称:Website,代码行数:15,代码来源:pm.class.php

示例8: is_logged_in

function is_logged_in()
{
    if (isset($_SESSION['logged_in'])) {
        $DB = Mysql::init();
        $data = $DB->select('*', ACCOUNT_DATABASE . '.account', "id='" . $_SESSION['user_data']['id'] . "'");
        clear_site();
        if (is_array($data)) {
            assign('user_data', $data);
            Session::write('user_data', $data);
            return true;
        }
    }
    return false;
}
开发者ID:ionutmilica,项目名称:my-archive,代码行数:14,代码来源:functions.php

示例9: flashPlayer

/**
 * Function used to display flash player for ClipBucket video
 */
function flashPlayer($param)
{
    global $Cbucket, $swfobj;
    $param['player_div'] = $param['player_div'] ? $param['player_div'] : 'videoPlayer';
    $key = $param['key'];
    $flv = $param['flv'] . '.flv';
    $code = $param['code'];
    $flv_url = $file;
    $embed = $param['embed'];
    $code = $param['code'];
    $height = $param['height'] ? $param['height'] : config('player_height');
    $width = $param['width'] ? $param['width'] : config('player_width');
    $param['height'] = $height;
    $param['width'] = $width;
    $param['enlarge_button'] = config('enlarge_button');
    $param['player_logo_url'] = config('player_logo_url');
    //dump($code);
    if (!$param['autoplay']) {
        $param['autoplay'] = config('autoplay_video');
    }
    assign('player_params', $param);
    if (count($Cbucket->actions_play_video) > 0) {
        foreach ($Cbucket->actions_play_video as $funcs) {
            if (function_exists($funcs)) {
                $func_data = $funcs($param);
            }
            if ($func_data) {
                $player_code = $func_data;
                $show_player = true;
                break;
            }
        }
    }
    if (function_exists('cbplayer') && empty($player_code)) {
        $player_code = cbplayer($param, true);
    } elseif (function_exists('cbplayer')) {
        return $player_code;
    }
    global $pak_player;
    if ($player_code) {
        if (!$pak_player && $show_player && !is_bool($player_code)) {
            assign("player_js_code", $player_code);
            Template(PLAYER_DIR . '/player.html', false);
            return false;
        } else {
            return false;
        }
    }
    return blank_screen($param);
}
开发者ID:Coding110,项目名称:cbvideo,代码行数:53,代码来源:functions_player.php

示例10: cb_player

 function cb_player($in)
 {
     global $cb_player;
     $cb_player = true;
     $vdetails = $in['vdetails'];
     $vid_file = get_video_file($vdetails, true, true);
     //Checking for YT Referal
     if (function_exists('get_refer_url_from_embed_code')) {
         $ref_details = get_refer_url_from_embed_code(unhtmlentities(stripslashes($vdetails['embed_code'])));
         $ytcode = $ref_details['ytcode'];
     }
     if ($vid_file || $ytcode) {
         $hd = $data['hq'];
         if ($hd == 'yes') {
             $file = get_hq_video_file($vdetails);
         } else {
             $file = get_video_file($vdetails, true, true);
         }
         $hd_file = get_hq_video_file($vdetails);
         if ($ytcode) {
             assign('youtube', true);
             assign('ytcode', $ytcode);
         }
         if (!strstr($in['width'], "%")) {
             $in['width'] = $in['width'] . 'px';
         }
         if (!strstr($in['height'], "%")) {
             $in['height'] = $in['height'] . 'px';
         }
         if ($in['autoplay'] == 'yes' || $in['autoplay'] === true || $_COOKIE['auto_play_playlist'] && ($_GET['play_list'] || $_GET['playlist'])) {
             $in['autoplay'] = true;
         } else {
             $in['autoplay'] = false;
         }
         //Logo Placement
         assign('logo_placement', cb_player_logo_position());
         assign('logo_margin', config('logo_padding'));
         //Setting Skin
         assign('cb_skin', 'glow/glow.xml');
         assign('player_data', $in);
         assign('player_logo', website_logo());
         assign('normal_vid_file', $vid_file);
         assign("hq_vid_file", $hd_file);
         assign('vdata', $vdetails);
         Template(CB_PLAYER_DIR . '/cbplayer.html', false);
         return true;
     }
 }
开发者ID:Coding110,项目名称:cbvideo,代码行数:48,代码来源:cbplayer.php

示例11: business_base_init

/**
 * 商户管理后台初始化
 * @author 王仁欢
 */
function business_base_init()
{
    if (!isset($_SESSION['business_account'])) {
        $links = array(array('link' => 'index.php', 'alt' => '登陆'));
        show_system_message('请先登陆', $links);
        exit;
    }
    global $db;
    $get_business = 'select * from ' . $db->table('business');
    $get_business .= ' where business_account = \'' . $_SESSION['business_account'] . '\' and status = 2';
    $business = $db->fetchRow($get_business);
    if (empty($business)) {
        if (isset($_SESSION['business_account'])) {
            unset($_SESSION['business_shop_name']);
            unset($_SESSION['business_account']);
            unset($_SESSION['business_purview']);
        }
        $links = array(array('link' => 'index.php', 'alt' => '重新登陆'));
        show_system_message('商户不存在或不在运营中', $links);
        exit;
    }
    $current_shop = $_SESSION['business_shop_name'];
    assign('current_shop', $current_shop);
    assign('pageTitle', '网店' . $current_shop . '管理后台');
    create_business_menu();
    $active_nav = get_active_nav();
    $active_nav = explode('.', $active_nav);
    $active_nav = $active_nav[0];
    assign('active_nav', $active_nav);
    if ($active_nav == 'virtual_product') {
        $active_nav = 'product';
    }
    assign('menu_mark', 'menu_' . $active_nav);
    //未读消息数量
    $get_unread_message_count = 'select count(*) from ' . $db->table('message');
    $get_unread_message_count .= ' where business_account = \'' . $_SESSION['business_account'] . '\' and status = 0';
    $unread_message_count = $db->fetchOne($get_unread_message_count);
    assign('unread_message_count', $unread_message_count);
    if ($_SESSION['business_account'] == $_SESSION['business_admin']) {
        $primary_account = true;
    } else {
        $primary_account = false;
    }
    assign('primary_account', $primary_account);
}
开发者ID:Winsen1990,项目名称:easyilife,代码行数:49,代码来源:business.inc.php

示例12: cbv3_show_rating

/**
 * Show-rating function for cbv3 template
 *  
 */
function cbv3_show_rating($rating)
{
    $array = array();
    if (error()) {
        $array['err'] = error();
    }
    $array['rating'] = $rating;
    $rated_by = $rating['ratings'];
    $rating = $rating['rating'];
    $rating_full = $rating * 10;
    $likes = $rating_full * $rated_by / 100;
    $likes = round($likes + 0.49, 0);
    $dislikes = $rated_by - $likes;
    assign('rating', array('rating' => $rating, 'dislikes' => $dislikes, 'likes' => $likes, 'rated_by' => $rated_by, 'rating_perc' => $rating_full));
    $template = Fetch('blocks/rating.html');
    $array['template'] = $template;
    echo json_encode($array);
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:22,代码来源:template_functions.php

示例13: cb_video_player

/**
 * Loads ClipBucket players...
 * 
 * @global type $Cbucket
 * @global type $swfobj
 * @param type $param
 * @return boolean
 * 
 * @todo Write documentation on this function..
 */
function cb_video_player($param)
{
    global $Cbucket, $swfobj;
    $param['player_div'] = $param['player_div'] ? $param['player_div'] : 'videoPlayer';
    $key = $param['key'];
    $code = $param['code'];
    $flv_url = $file;
    $embed = $param['embed'];
    $code = $param['code'];
    $height = $param['height'] ? $param['height'] : config('player_height');
    $width = $param['width'] ? $param['width'] : config('player_width');
    $param['height'] = $height;
    $param['width'] = $width;
    if (!$param['autoplay']) {
        $param['autoplay'] = config('autoplay_video');
    }
    if (!$param['files']) {
        global $cbvid;
        $files = $cbvid->get_video_files($param['video']);
        $param['files'] = $files;
    }
    assign('player_params', $param);
    $param = apply_filters($param, 'play_video');
    //Calling actions for play_video
    $output = call_actions('play_video', $param);
    if ($output) {
        $player_code = $output;
        return $output;
    }
    if (function_exists('cbplayer') && empty($player_code)) {
        $player_code = cbplayer($param, true);
    }
    if ($player_code) {
        if (!$pak_player && $show_player) {
            assign("player_js_code", $player_code);
            Template(PLAYER_DIR . '/player.html', false);
            return false;
        } else {
            return false;
        }
    }
    return blank_screen($param);
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:53,代码来源:functions_players.php

示例14: cb_video_js

 function cb_video_js($in)
 {
     global $cb_video_js;
     $cb_video_js = true;
     $vdetails = $in['vdetails'];
     $video_play = get_video_files($vdetails, true, true);
     if (!strstr($in['width'], "%")) {
         $in['width'] = $in['width'] . 'px';
     }
     if (!strstr($in['height'], "%")) {
         $in['height'] = $in['height'] . 'px';
     }
     assign('height', $in['height']);
     assign('width', $in['width']);
     assign('player_config', $in);
     assign('vdata', $vdetails);
     assign('cb_logo', cb_logo());
     assign('video_files', $video_play);
     Template(CB_VJS_PLAYER_DIR . '/cb_video_js.html', false);
     return true;
 }
开发者ID:reactvideos,项目名称:Website,代码行数:21,代码来源:cb_video_js.php

示例15: assign

function assign($timestorun, $zone, $idnum, $conn, $who)
{
    $numleft = 96 - $timestorun;
    echo "<script type='text/javascript'>\n      document.body.innerHTML = '';\n      </script>";
    echo "Assigning {$numleft} / 96 numbers!<br>";
    ob_end_flush();
    flush();
    $timestorun--;
    if ($who == '0') {
        $sql = "SELECT IDKey FROM agents WHERE SupervisorID='{$idnum}' AND AccountType='0'";
    } else {
        $sql = "SELECT IDKey FROM agents WHERE IDKey='{$who}'";
    }
    //echo $sql;
    $result = mysqli_query($conn, $sql);
    while ($row = $result->fetch_assoc()) {
        $uid = $row["IDKey"];
        // (Length(Pnumber)='14' OR Length(Pnumber)='10') AND
        $dsql = "SELECT min(IDNKey) FROM numbers WHERE  (Zone LIKE '%{$zone}%' OR Address LIKE '%{$zone}%' OR Pcode LIKE '%{$zone}%') AND (AssignedUser IS NULL OR AssignedUser='0') AND Response='o'";
        $dresult = mysqli_query($conn, $dsql);
        if (mysqli_num_rows($dresult) == 0) {
            echo "<br>No number assigned, Out of unassigned numbers in that area!<br>";
            break;
        }
        $drow = $dresult->fetch_assoc();
        $idn = $drow["min(IDNKey)"];
        $csql = "UPDATE numbers SET AssignedUser='{$uid}' WHERE IDNKey='{$idn}'";
        //	echo $csql."<br>";
        if ($conn->query($csql) === TRUE) {
            echo "Record updated successfully";
        } else {
            echo "Error updating record: " . $conn->error;
        }
    }
    if ($timestorun > 0) {
        @assign($timestorun, $zone, $idnum, $conn, $who);
    }
}
开发者ID:CoolHeatCRM,项目名称:CRM,代码行数:38,代码来源:AssignNumbers.php


注:本文中的assign函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。