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


PHP tbl函数代码示例

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


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

示例1: install_editors_pick

function install_editors_pick()
{
    global $db;
    $db->Execute("CREATE TABLE IF NOT EXISTS " . tbl('editors_picks') . " (\n  `pick_id` int(225) NOT NULL AUTO_INCREMENT,\n  `videoid` int(225) NOT NULL,\n  `sort` bigint(5) NOT NULL DEFAULT '1',\n  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n  PRIMARY KEY (`pick_id`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
    //inserting new announcment
    $db->Execute("INSERT INTO  " . tbl('global_announcement') . " (announcement) VALUES ('')");
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:7,代码来源:install_editors_picks.php

示例2: the_form

function the_form()
{
    global $db;
    $key_check = $db->_select('SELECT the_key FROM ' . tbl("the_captcha"));
    $the_key = $key_check[0]['the_key'];
    $site_key = $the_key;
    echo '<div class="g-recaptcha" data-sitekey=' . $site_key . '></div>';
}
开发者ID:Coding110,项目名称:cbvideo,代码行数:8,代码来源:cb_captcha.php

示例3: install_cb_captcha

function install_cb_captcha()
{
    global $db;
    $db->Execute('CREATE TABLE IF NOT EXISTS ' . tbl("the_captcha") . ' (
	  `the_key` text NOT NULL
	) ENGINE=MyISAM DEFAULT CHARSET=utf8;;');
    //inserting new announcment
    $db->Execute("INSERT INTO  " . tbl('the_captcha') . " (the_key) VALUES ('')");
}
开发者ID:Coding110,项目名称:cbvideo,代码行数:9,代码来源:install_cb_captcha.php

示例4: install_global_announcement

function install_global_announcement()
{
    global $db;
    $db->Execute('CREATE TABLE IF NOT EXISTS ' . tbl("global_announcement") . ' (
	  `announcement` text NOT NULL
	) ENGINE=MyISAM DEFAULT CHARSET=utf8;;');
    //inserting new announcment
    $db->Execute("INSERT INTO  " . tbl('global_announcement') . " (announcement) VALUES ('')");
}
开发者ID:Coding110,项目名称:cbvideo,代码行数:9,代码来源:install_global_announcement.php

示例5: install_terminator

function install_terminator()
{
    global $db;
    $db->Execute('CREATE TABLE IF NOT EXISTS ' . tbl("terminator") . ' (
	  `terminate_vids` text NOT NULL,
	  `terminate_users` text NOT NULL
	) ENGINE=MyISAM DEFAULT CHARSET=utf8;;');
    $db->Execute("INSERT INTO  " . tbl('terminator') . " (terminate_vids) VALUES ('')");
    $db->Execute("INSERT INTO  " . tbl('terminator') . " (terminate_users) VALUES ('')");
}
开发者ID:saqirzzq,项目名称:cb_terminator,代码行数:10,代码来源:install_terminator.php

示例6: count_total_notification

/**
 * Function used to count total notifications
 */
function count_total_notification($item = false)
{
    global $db;
    $type = $this->type;
    $results = $db->count(tbl('notifications'), "*");
    echo $db->query;
    if ($db->num_rows > 0) {
        return $results;
    } else {
        return false;
    }
}
开发者ID:reactvideos,项目名称:Website,代码行数:15,代码来源:functions_actions.php

示例7: get_website_configurations

/**
 * Created by JetBrains PhpStorm.
 * User: Fawaz
 * Date: 8/28/13
 * Time: 12:17 PM
 * To change this template use File | Settings | File Templates.
 */
function get_website_configurations()
{
    $query = "SELECT name, value FROM " . tbl('config');
    $results = select($query);
    $data = array();
    if ($results) {
        foreach ($results as $config) {
            $data[$config['name']] = $config['value'];
        }
    }
    return $data;
}
开发者ID:Coding110,项目名称:cbvideo,代码行数:19,代码来源:functions_helper.php

示例8: install_customfield

function install_customfield()
{
    global $db;
    $db->Execute('CREATE TABLE IF NOT EXISTS ' . tbl("custom_field") . ' (
  `custom_field_list_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  `field_name` text NOT NULL,
  `field_title` text NOT NULL,
  `field_type` text NOT NULL,
  `db_field` text NOT NULL,
  `default_value` text NOT NULL,
  `customfields_flag` text NOT NULL,
  `date_added` DATETIME NOT NULL
  ) ENGINE=MyISAM;');
    //inserting new announcement
    //$db->Execute("INSERT INTO  ".tbl('custom_field')." (field_name,field_title,) VALUES ('Hello World!')");
}
开发者ID:Coding110,项目名称:cbvideo,代码行数:16,代码来源:install_customfield.php

示例9: load_form_fields

 /**
  * Function used add fields in upload form
  */
 function load_form_fields()
 {
     global $db;
     $results = $db->select(tbl("custom_fields"), "*");
     if (count($results[0]) > 0) {
         foreach ($results as $result) {
             $name = $result['custom_field_name'];
             foreach ($result as $field => $value) {
                 $field_array[$name][substr($field, 13, strlen($field))] = $value;
             }
         }
     }
     if (count($field_array) > 0) {
         return false;
     }
     return $field_array;
 }
开发者ID:Coding110,项目名称:cbvideo,代码行数:20,代码来源:custom_fields.php

示例10: call_download_video_function

/**
 * Funcion used to call functions
 * when video is going to dwnload
 * ie in download.php
 */
function call_download_video_function($vdo)
{
    global $db;
    $funcs = get_functions('download_video_functions');
    if (is_array($funcs) && count($funcs) > 0) {
        foreach ($funcs as $func) {
            if (function_exists($func)) {
                $func($vdo);
            }
        }
    }
    //Updating Video Downloads
    $db->update(tbl("video"), array("downloads"), array("|f|downloads+1"), "videoid = '" . $vdo['videoid'] . "'");
    //Updating User Download
    if (userid()) {
        $db->update(tbl("users"), array("total_downloads"), array("|f|total_downloads+1"), "userid = '" . userid() . "'");
    }
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:23,代码来源:functions_filters.php

示例11: send_video_notification

function send_video_notification($videoId)
{
    global $myquery, $db;
    #checking if we have vid , so fetch the details
    if (!empty($videoId)) {
        $vdetails = $myquery->get_video_details($videoId);
    }
    $title = $vdetails['title'];
    // Put your private key's passphrase here:
    $passphrase = 'janjuajanjua';
    ////////////////////////////////////////////////////////////////////////////////
    $ctx = stream_context_create();
    stream_context_set_option($ctx, 'ssl', 'local_cert', 'E:\\wamp\\www\\clipbucket_bug1\\api\\apns-dev.pem');
    stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);
    // Open a connection to the APNS server
    $fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT, $ctx);
    if (!$fp) {
        exit("Failed to connect: {$err} {$errstr}" . PHP_EOL);
    }
    echo 'Connected to APNS' . PHP_EOL;
    $token_result = $db->select(tbl('token'), 'token');
    if ($token_result) {
        foreach ($token_result as $token_value) {
            // Create the pahanyload body
            $payload['aps'] = array('alert' => "'" . $title . "' has been Featured.", 'sound' => 'default');
            $payload['details'] = array('type' => 'featured', 'videoId' => $videoId, 'title' => $title);
            $output = json_encode($payload);
            // Build the binary notification
            $msg = chr(0) . pack('n', 32) . pack('H*', $token_value['token']) . pack('n', strlen($output)) . $output;
            // Send it to the server
            $result = fwrite($fp, $msg, strlen($msg));
        }
        if (!$result) {
            echo 'Messages not delivered' . PHP_EOL;
        } else {
            echo 'Messages successfully delivered' . PHP_EOL;
        }
    } else {
        return json_encode(array('err' => lang(error('single'))));
    }
    // Close the connection to the server
    fclose($fp);
}
开发者ID:reactvideos,项目名称:Website,代码行数:43,代码来源:push.php

示例12: insert

 /**
  * Function used to insert log
  * @param VARCHAR $type, type of action
  * @param ARRAY $details_array , action details array
  */
 function insert($type, $details_array)
 {
     global $db, $userquery;
     $a = $details_array;
     $ip = $_SERVER['REMOTE_ADDR'];
     $agent = $_SERVER['HTTP_USER_AGENT'];
     $userid = getArrayValue($a, 'userid');
     $username = $a['username'];
     $useremail = getArrayValue($a, 'useremail');
     $userlevel = getArrayValue($a, 'userlevel');
     $action_obj_id = getArrayValue($a, 'action_obj_id');
     $action_done_id = getArrayValue($a, 'action_done_id');
     $userid = $userid ? $userid : $userquery->udetails['userid'];
     $username = $username ? $username : $userquery->udetails['username'];
     $useremail = $useremail ? $useremail : $userquery->udetails['email'];
     $userlevel = $userlevel ? $userlevel : getArrayValue($userquery->udetails, 'level');
     $success = $a['success'];
     $details = getArrayValue($a, 'details');
     $db->insert(tbl('action_log'), array('action_type', 'action_username', 'action_userid', 'action_useremail', 'action_ip', 'date_added', 'action_success', 'action_details', 'action_userlevel', 'action_obj_id', 'action_done_id'), array($type, $username, $userid, $useremail, $ip, NOW(), $success, $details, $userlevel, $action_obj_id, $action_done_id));
 }
开发者ID:Coding110,项目名称:cbvideo,代码行数:25,代码来源:log.class.php

示例13: send_emails

 /**
  * function send emails
  */
 function send_emails($id)
 {
     global $db, $userquery, $cbemail;
     if (!is_array($id)) {
         $email = $this->get_email($id);
     } else {
         $email = $id;
     }
     if ($email['status'] == 'completed') {
         return false;
     }
     $settings = json_decode($email['configs'], true);
     $users = $email['users'];
     $total = $email['total'];
     //Creating limit
     $start_index = $email['start_index'];
     $limit = $start_index . ',' . $settings['loop_size'];
     //Creating condition
     $condition = "";
     //Levels
     $level_query = "";
     $levels = $settings['level'];
     if ($levels) {
         foreach ($levels as $level) {
             if ($level_query) {
                 $level_query .= " OR ";
             }
             $level_query .= " level='{$level}' ";
         }
         if ($condition) {
             $condition .= " AND ";
         }
         $condition = $level_query = " ( " . $level_query . ") ";
     }
     //Categories
     $cats_query = "";
     $cats = $settings['cat'];
     if ($cats) {
         foreach ($cats as $cat) {
             if ($cats_query) {
                 $cats_query .= " OR ";
             }
             $cats_query .= " category='{$cat}' ";
         }
         $cats_query = " ( " . $cats_query . ") ";
         if ($condition) {
             $condition .= " AND ";
         }
         $condition .= $cats_query;
     }
     //Ative users
     if ($settings['active'] != 'any') {
         if ($condition) {
             $condition .= " AND ";
         }
         if ($settings['active'] == 'yes') {
             $condition .= "\tusr_status = 'Ok' ";
         }
         if ($settings['active'] == 'no') {
             $condition .= "\tusr_status = 'ToActivate' ";
         }
     }
     //Banned users
     if ($settings['ban'] != 'any') {
         if ($condition) {
             $condition .= " AND ";
         }
         if ($settings['ban'] == 'yes') {
             $condition .= "\tban_status = 'yes' ";
         }
         if ($settings['ban'] == 'no') {
             $condition .= "\tban_status = 'no' ";
         }
     }
     if (!$users) {
         $users = $db->select(tbl("users"), "*", $condition, $limit, " userid ASC ");
         if (!$total) {
             $total = $db->count(tbl("users"), "userid", $condition);
         }
         $sent = $email['sent'];
         $send_msg = array();
         foreach ($users as $user) {
             $var = array('{username}' => $user['username'], '{userid}' => $user['userid'], '{email}' => $user['email'], '{datejoined}' => $user['doj'], '{avcode}' => $user['avcode'], '{avlink}' => BASEURL . '/activation.php?av_username=' . $user['username'] . '&avcode=' . $user['avcode']);
             $subj = $cbemail->replace($email['email_subj'], $var);
             $msg = nl2br($cbemail->replace($email['email_msg'], $var));
             $send_message = "";
             //Now Finally Sending Email
             cbmail(array('to' => $user['email'], 'from' => $email['email_from'], 'subject' => $subj, 'content' => $msg));
             $sent++;
             $send_msg[] = $user['userid'] . ": Email has been sent to <strong><em>" . $user['username'] . "</em></strong>";
         }
         $sent_to = $start_index + $settings['loop_size'];
         if ($sent_to > $total) {
             $sent_to = $total;
         }
         e(sprintf(lang("Sending email from %s to %s"), $start_index + 1, $sent_to), "m");
         $start_index = $start_index + $settings['loop_size'];
//.........这里部分代码省略.........
开发者ID:yukisky,项目名称:clipbucket,代码行数:101,代码来源:cbemail.class.php

示例14: count

    $total = count($_POST['check_queue']);
    for ($i = 0; $i <= $total; $i++) {
        $myquery->queue_action("delete", $_POST['check_queue'][$i]);
    }
    e("Selected items have been deleted", "m");
}
if (isset($_POST['processed'])) {
    $total = count($_POST['check_queue']);
    for ($i = 0; $i <= $total; $i++) {
        $myquery->queue_action("processed", $_POST['check_queue'][$i]);
    }
    e("Selected items have been set changed to processed", "m");
}
if (isset($_POST['pending'])) {
    $total = count($_POST['check_queue']);
    for ($i = 0; $i <= $total; $i++) {
        $myquery->queue_action("pending", $_POST['check_queue'][$i]);
    }
    e("Selected items have been set changed to processed", "m");
}
//Getting List of Conversion Queue
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, RESULTS);
$queue_list = $myquery->get_conversion_queue(NULL, $get_limit);
assign('queues', $queue_list);
$total_rows = get_videos($vcount);
$total_pages = count_pages($db->count(tbl('conversion_queue'), "cqueue_id"), RESULTS);
$pages->paginate($total_pages, $page);
subtitle("Conversion Queue Manager");
template_files("cb_conversion_queue.html");
display_it();
开发者ID:Coding110,项目名称:cbvideo,代码行数:31,代码来源:cb_conversion_queue.php

示例15: define

 ***************************************************************
*/
//including config file..
require '../includes/admin_config.php';
$userquery->admin_login_check();
$pages->page_redir();
/* Assigning page and subpage */
if (!defined('MAIN_PAGE')) {
    define('MAIN_PAGE', 'Tool Box');
}
if (!defined('SUB_PAGE')) {
    define('SUB_PAGE', 'ReIndexer');
}
$vtbl = tbl("video");
$utbl = tbl("users");
$gtbl = tbl("groups");
function p_r($array)
{
    echo "<pre>";
    print_r($array);
    echo "</pre>";
}
$start_index = $_GET['start_index'] ? $_GET['start_index'] : 0;
$loop_size = $_GET['loop_size'];
$loop_size = $loop_size ? $loop_size : 5;
assign('loop_size', $loop_size);
$next_index = $start_index + $loop_size;
assign('next_index', $next_index);
//Reindex Videos
if (isset($_GET['index_vids'])) {
    $videos = get_videos(array("active" => "yes", "status" => "Successful", "limit" => $start_index . "," . $loop_size));
开发者ID:Coding110,项目名称:cbvideo,代码行数:31,代码来源:reindex_cb.php


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