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


PHP check_type函数代码示例

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


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

示例1: page_remove

function page_remove($id)
{
    global $_CLASS;
    $result = $_CLASS['core_db']->query('SELECT page_status, page_name, page_type FROM ' . CORE_PAGES_TABLE . ' WHERE page_id = ' . $id);
    $page = $_CLASS['core_db']->fetch_row_assoc($result);
    $_CLASS['core_db']->free_result($result);
    if (!$page || $page['page_status'] != STATUS_PENDING) {
        trigger_error($page ? 'MODULE_NOT_REMOVABLE' : 'MODULE_NOT_FOUND');
    }
    check_type($page['page_type']);
    if (display_confirmation()) {
        if ($page['page_type'] == PAGE_TEMPLATE) {
            @unlink(SITE_FILE_ROOT . 'includes/templates/' . $page['page_location']);
        }
        $_CLASS['core_db']->query('DELETE from ' . CORE_PAGES_TABLE . ' WHERE page_id = ' . $id);
        return true;
    }
    return false;
}
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:19,代码来源:page_functions.php

示例2: check_type

## Support: http://www.idevsupport.com/
## Email:   support@idevdirect.com
#############################################################
// CHECK AUTHORIZATION
// ------------------------------------------------------------------------------
if ($MailingListAuth == true) {
    // DEFINE AVAILABLE VARIABLES
    // - The variable is already sanitized.
    // - This is affiliate information from the signup form or new_affiliate.php API.
    // ------------------------------------------------------------------------------
    $username = check_type('username');
    $company = check_type('company');
    $f_name = check_type('f_name');
    $l_name = check_type('l_name');
    $email = check_type('email');
    $address_one = check_type('address_one');
    $address_two = check_type('address_two');
    $city = check_type('city');
    $state = check_type('state');
    $zip = check_type('zip');
    $country = check_type('country');
    $phone = check_type('phone');
    $fax = check_type('fax');
    $website = check_type('website');
    // ------------------------------------------------------------------------------
    ###################################################################
    ##  Write queries here.
    ##  Tip: Connect to your mailing list manager API here.
    ##  Pass the above variables to your mailing list manager.
    ###################################################################
}
开发者ID:E-SOFTinc,项目名称:Mailnetwork_Yii,代码行数:31,代码来源:mailing_list.php

示例3: check_field

function check_field(&$fields, &$field, $checks)
{
    if (!isset($checks[5])) {
        $checks[5] = $field;
    }
    list($type, $opt, $flags, $validation, $exception, $caption) = $checks;
    if ($flags & P_UNSET_EMPTY && isset($_REQUEST[$field]) && $_REQUEST[$field] == '') {
        unset_request($field);
    }
    $except = !is_null($exception) ? calc_exp($fields, $field, $exception) : false;
    if ($except) {
        if ($opt == O_MAND) {
            $opt = O_NO;
        } elseif ($opt == O_OPT) {
            $opt = O_MAND;
        } elseif ($opt == O_NO) {
            $opt = O_MAND;
        }
    }
    if ($opt == O_MAND) {
        if (!isset($_REQUEST[$field])) {
            info(_s('Field "%1$s" is mandatory.', $caption));
            return $flags & P_SYS ? ZBX_VALID_ERROR : ZBX_VALID_WARNING;
        }
    } elseif ($opt == O_NO) {
        if (!isset($_REQUEST[$field])) {
            return ZBX_VALID_OK;
        }
        unset_request($field);
        info(_s('Field "%1$s" must be missing.', $caption));
        return $flags & P_SYS ? ZBX_VALID_ERROR : ZBX_VALID_WARNING;
    } elseif ($opt == O_OPT) {
        if (!isset($_REQUEST[$field])) {
            return ZBX_VALID_OK;
        } elseif ($flags & P_ACT) {
            if (!isset($_REQUEST['sid']) || isset($_COOKIE['zbx_sessionid']) && $_REQUEST['sid'] != substr($_COOKIE['zbx_sessionid'], 16, 16)) {
                info(_('Operation cannot be performed due to unauthorized request.'));
                return ZBX_VALID_ERROR;
            }
        }
    }
    if (!($flags & P_NO_TRIM)) {
        check_trim($_REQUEST[$field]);
    }
    $err = check_type($field, $flags, $_REQUEST[$field], $type, $caption);
    if ($err != ZBX_VALID_OK) {
        return $err;
    }
    if ((is_null($exception) || $except) && $validation && !calc_exp($fields, $field, $validation)) {
        if ($validation == NOT_EMPTY) {
            info(_s('Incorrect value for field "%1$s": cannot be empty.', $caption));
        } elseif (preg_match('/\\(\\{\\}\\>=([0-9]*)\\&\\&\\{\\}\\<=([0-9]*)\\)\\&\\&/', $validation, $result)) {
            info(_s('Incorrect value "%1$s" for "%2$s" field: must be between %3$s and %4$s.', $_REQUEST[$field], $caption, $result[1], $result[2]));
        } else {
            info(_s('Incorrect value "%1$s" for "%2$s" field.', $_REQUEST[$field], $caption));
        }
        return $flags & P_SYS ? ZBX_VALID_ERROR : ZBX_VALID_WARNING;
    }
    return ZBX_VALID_OK;
}
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:60,代码来源:validate.inc.php

示例4: check_type

 $company = check_type('company');
 $payable = check_type('payable');
 $tax_id = check_type('tax_id');
 $website = check_type('website');
 $address_1 = check_type('address_1');
 $address_2 = check_type('address_2');
 $city = check_type('city');
 $state = check_type('state');
 $zip = check_type('zip');
 $country = check_type('country');
 $phone = check_type('phone');
 $fax = check_type('fax');
 // FORCED TIER ACCOUNT LOGGING
 $tier = check_type('tier');
 // STANDARD TIER ACCOUNT LOGGING (overrides forced entry)
 $ip_address = check_type('ip_address');
 if ($ip_address) {
     $cta = mysql_query("select ta from idevaff_tlog where ti = '{$ip_address}' order by id desc");
     $ctb = mysql_fetch_array($cta);
     $tier = $ctb['ta'];
 }
 // OVERRIDE APPROVED VARIABLE WITH SETTINGS FROM ADMIN CENTER
 // Uncomment to disable this override.
 // ----------------------------------------------------------------
 if (!$account_approval) {
     $approved = 1;
 } else {
     $approved = 0;
 }
 // SET PAYOUT TYPE TO FIRST AVAILABLE IF NONE WAS PRESENT
 // ----------------------------------------------------------------
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:31,代码来源:new_affiliate.php

示例5: upload

/**
 *  处理上传文件,若上传出错,返回''或空array(),错误信息在$error中返回
 *  @param $upload  上传文件数组
 *  @param $mode	是否是批量模式
 *  @param $ext	文件格式
 *  @param $type	文件类别或用图,如:pic,txt,media,user/logo等, 主要用于为文件分类
 *  @param $error	返回错误信息
 */
function upload($upload, $mode = false, $ext = 'jpg,jpeg,gif,png', $type = "pic", &$error = '')
{
    $picsavedir = Config::get('env.picsavedir');
    $root_dir = SIMPHP_ROOT . $picsavedir;
    $relative_dir = $type . '/' . date('Ym') . "/";
    //相对地址
    $target_dir = $root_dir . $relative_dir;
    //绝对地址
    if (!file_exists($target_dir)) {
        mkdirs($target_dir);
        /*
        		$mode = 0777;
        		mkdir($target_dir,$mode,true);
        		chmod($target_dir, $mode);*/
        @fclose(fopen($target_dir . '/index.htm', 'w'));
    }
    //批量上传
    if ($mode) {
        $array = array();
        foreach ($upload["error"] as $key => $error) {
            $check_type = check_type($upload['tmp_name'][$key], $upload['name'][$key], $ext);
            if (!empty($check_type)) {
                if (!empty($upload['name'][$key]) && $upload['size'][$key] < 2 * 1024 * 1024) {
                    $get_ext = get_ext($upload['name'][$key]);
                    if (check_ext($get_ext, $ext)) {
                        $name = date('d_His');
                        $name .= "_" . randchar();
                        $name .= "." . $get_ext;
                        if (upload_move_file($upload['tmp_name'][$key], $target_dir . $name)) {
                            $array[] = $picsavedir . $relative_dir . $name;
                            //记录相对于网站根路径的文件路径
                        }
                    }
                }
            }
        }
        return $array;
    } else {
        //单个上传
        $filename = '';
        //图片的相对地址
        $localName = '';
        //上传文件的本地名称
        $maxAttachSize = 10 * 1024 * 1024;
        //允许上传的文件大小,10M
        $err = "";
        //错误信息
        $tempName = '';
        //临时文件名
        $tempName_noExt = '';
        //不带后缀的文件名
        $tempPath = '';
        //临时文件绝对路径
        $tempName = date('d_His');
        $tempName .= "_" . randchar();
        $tempName_noExt = $tempName;
        $tempName .= ".tmp";
        $tempPath = $target_dir . $tempName;
        //HTML5上传
        if (isset($_SERVER['HTTP_CONTENT_DISPOSITION']) && preg_match('/attachment;\\s+name="(.+?)";\\s+filename="(.+?)"/i', $_SERVER['HTTP_CONTENT_DISPOSITION'], $info)) {
            file_put_contents($tempPath, file_get_contents("php://input"));
            $localName = urldecode($info[2]);
        } else {
            //普通上传
            /*
            			 //检测上传文件的类型
            			//$check_type=check_type($upload['tmp_name'],$upload['name'],$ext);
            			$check_type=true;
            			if(!empty($check_type)){
            			//上传的文件不能超过10M
            			if (!empty($upload['name'])&&$upload['size']<10*1024*1024){
            			$get_ext=get_ext($upload['name']);
            			if(check_ext($get_ext,$ext)){
            			$name = date('YmdHis');
            			$name.="_";
            			for ($i = 0; $i < 6; $i++){
            			$name .=chr(mt_rand(97, 122));
            			}
            			$name .=".".$get_ext;
            			if (upload_move_file($upload['tmp_name'],$target_dir.$name)){
            			$filename=$relative_dir.$name;
            			}
            			}
            			}else{
            				
            			}
            			}*/
            if (!isset($upload)) {
                $err = '文件域的name错误';
            } elseif (!empty($upload['error'])) {
                switch ($upload['error']) {
                    case '1':
//.........这里部分代码省略.........
开发者ID:GavinLai,项目名称:SimMatch,代码行数:101,代码来源:func.global.php

示例6: mysql_query

require_once "../../API/config.php";
include_once "../../includes/validation_functions.php";
// QUERY THE DATABASE FOR SECRET KEY
// ------------------------------------------------------------------------------
$s_key = mysql_query("select secret from idevaff_config");
$s_key = mysql_fetch_array($s_key);
$s_key = $s_key['secret'];
// CHECK VALID SECRET KEY IS PRESENT AND VALID
// - The variable is already sanitized.
// - The variable is already validated through _GET, or _POST.
// ------------------------------------------------------------------------------
$secret = check_type_api('secret');
if ($secret == $s_key) {
    // QUERY & SANITIZE ALL INCOMING DATA
    // ----------------------------------------------------------------
    $order_number = check_type('order_number');
    // CHECK IF ORDER NUMBER EXISTS
    // ----------------------------------------------------------------
    if ($order_number) {
        $check_order_number = mysql_query("select id from idevaff_recurring where tracking = '{$order_number}'");
        if (mysql_num_rows($check_order_number)) {
            // REMOVE THE COMMISSIONS
            // ----------------------------------------------------------------
            mysql_query("delete from idevaff_recurring where tracking = '{$order_number}'");
            if ($email_html_delivery == true) {
                $content = "The API file (terminate_recurring.php) successfully removed a recurring commission.<br/><br />Order Number: " . $order_number . "<br /><br />--------<br />Message Auto-Sent By iDevAffiliate " . $version;
            } else {
                $content = "The API file (terminate_recurring.php) successfully removed a recurring commission.\n\nOrder Number: " . $order_number . "\n\n--------\nMessage Auto-Sent By iDevAffiliate " . $version;
            }
        } else {
            // COMMISSION NOT FOUND
开发者ID:E-SOFTinc,项目名称:Mailnetwork_Yii,代码行数:31,代码来源:terminate_recurring.php

示例7: check_type

<?php

// FILE INCLUDE VALIDATION
if (!$EmailAuth) {
    exit;
}
// -------------------------------------------------------------------------------------------------
// ----------------------------------------------------------
// SANITIZE AND ASSIGN THE VARIABLE
// ----------------------------------------------------------
$id = check_type('id');
// ----------------------------------------------------------
$adata = mysql_query("select id, username, password, f_name, l_name, email, email_override from idevaff_affiliates where id = '{$id}'");
$indv_data = mysql_fetch_array($adata);
$id = $indv_data['id'];
$name = $indv_data['username'];
$pass = $indv_data['password'];
$fname = $indv_data['f_name'];
$lname = $indv_data['l_name'];
$e = $indv_data['email'];
$email_override = $indv_data['email_override'];
if ($email_override) {
    $email_table_extension = $email_override;
}
// ------------------------------------------------
$edata = mysql_query("select approved_subject, approved_body from idevaff_email_{$email_table_extension}");
$indv_data = mysql_fetch_array($edata);
$sub = $indv_data['approved_subject'];
$sub = preg_replace("/Sitename/", $sitename, $sub);
$con = $indv_data['approved_body'];
$con = preg_replace("/Sitename/", $sitename, $con);
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:31,代码来源:affiliate.account_approved.php

示例8: check_field

function check_field(&$fields, &$field, $checks)
{
    list($type, $opt, $flags, $validation, $exception) = $checks;
    if ($flags & P_UNSET_EMPTY && isset($_REQUEST[$field]) && $_REQUEST[$field] == '') {
        unset_request($field, 'P_UNSET_EMPTY');
    }
    //echo "Field: $field<br>";
    if ($exception == NULL) {
        $except = FALSE;
    } else {
        $except = calc_exp($fields, $field, $exception);
    }
    if ($opt == O_MAND && $except) {
        $opt = O_NO;
    } else {
        if ($opt == O_OPT && $except) {
            $opt = O_MAND;
        } else {
            if ($opt == O_NO && $except) {
                $opt = O_MAND;
            }
        }
    }
    if ($opt == O_MAND) {
        if (!isset($_REQUEST[$field])) {
            if ($flags & P_SYS) {
                info("Critical error. Field [" . $field . "] is mandatory");
                return ZBX_VALID_ERROR;
            } else {
                info("Warning. Field [" . $field . "] is mandatory");
                return ZBX_VALID_WARNING;
            }
        }
    } else {
        if ($opt == O_NO) {
            if (!isset($_REQUEST[$field])) {
                return ZBX_VALID_OK;
            }
            unset_request($field, 'O_NO');
            if ($flags & P_SYS) {
                info("Critical error. Field [" . $field . "] must be missing");
                return ZBX_VALID_ERROR;
            } else {
                info("Warning. Field [" . $field . "] must be missing");
                return ZBX_VALID_WARNING;
            }
        } else {
            if ($opt == O_OPT) {
                if (!isset($_REQUEST[$field])) {
                    return ZBX_VALID_OK;
                } else {
                    if ($flags & P_ACT) {
                        if (!isset($_REQUEST['sid'])) {
                            return ZBX_VALID_ERROR;
                        } else {
                            if (isset($_COOKIE['zbx_sessionid']) && $_REQUEST['sid'] != substr($_COOKIE['zbx_sessionid'], 16, 16)) {
                                return ZBX_VALID_ERROR;
                            }
                        }
                    }
                }
            }
        }
    }
    check_trim($_REQUEST[$field]);
    $err = check_type($field, $flags, $_REQUEST[$field], $type);
    if ($err != ZBX_VALID_OK) {
        return $err;
    }
    if ($exception == NULL || $except == TRUE) {
        if (!$validation) {
            $valid = TRUE;
        } else {
            $valid = calc_exp($fields, $field, $validation);
        }
        if (!$valid) {
            if ($flags & P_SYS) {
                info("Critical error. Incorrect value for [" . $field . "] = '" . $_REQUEST[$field] . "'");
                return ZBX_VALID_ERROR;
            } else {
                info("Warning. Incorrect value for [" . $field . "]");
                return ZBX_VALID_WARNING;
            }
        }
    }
    return ZBX_VALID_OK;
}
开发者ID:phedders,项目名称:zabbix,代码行数:87,代码来源:validate.inc.php

示例9: time

document.write('font-size: 12px;');
document.write('font-family: Arial, Helvetica, sans-serif;');
document.write('font-weight: bold;');

document.write('}');
document.write('-->');
document.write('</style>');

<?php 
$time_now = time();
include "API/config.php";
include "includes/validation_functions.php";
include "includes/tracking.php";
// SANITIZE AND SET INCOMING TOKEN VARIABLE
// -----------------------------------------------------------
$token = check_type('token');
if ($idev) {
    // GET AFFILIATE DATA
    // -----------------------------------------------------------
    $aff_data = mysql_query("select username, phone, f_name, l_name, company, city, state, zip, url from idevaff_affiliates where id = '{$idev}'");
    if (mysql_num_rows($aff_data)) {
        $aff_data = mysql_fetch_array($aff_data);
        $affiliate_username = $aff_data['username'];
        $affiliate_phone = $aff_data['phone'];
        $affiliate_fname = $aff_data['f_name'];
        $affiliate_lname = $aff_data['l_name'];
        $affiliate_name = $affiliate_fname . "&nbsp;" . $affiliate_lname;
        $affiliate_company = $aff_data['company'];
        $affiliate_city = $aff_data['city'];
        $affiliate_state = $aff_data['state'];
        $affiliate_zip = $aff_data['zip'];
开发者ID:E-SOFTinc,项目名称:Mailnetwork_Yii,代码行数:31,代码来源:display.php

示例10: check_type

<?php

// FILE INCLUDE VALIDATION
if (!$EmailAuth) {
    exit;
}
// -------------------------------------------------------------------------------------------------
// ----------------------------------------------------------
// SANITIZE AND ASSIGN THE VARIABLE
// ----------------------------------------------------------
$username = check_type('username');
// ----------------------------------------------------------
$adata = mysql_query("select id, username, password, f_name, l_name, email from idevaff_affiliates where username = '{$username}'");
$indv_data = mysql_fetch_array($adata);
$id = $indv_data['id'];
$name = $indv_data['username'];
$pass = $indv_data['password'];
$fname = $indv_data['f_name'];
$lname = $indv_data['l_name'];
$e = $indv_data['email'];
// ------------------------------------------------
$edata = mysql_query("select admin_acct_subject, admin_acct_body from idevaff_email_english");
$indv_data = mysql_fetch_array($edata);
$sub = $indv_data['admin_acct_subject'];
$sub = preg_replace("/Sitename/", $sitename, $sub);
$con = $indv_data['admin_acct_body'];
$con = preg_replace("/Sitename/", $sitename, $con);
// ------------------------------------------------
$con = preg_replace("/_id_/", "{$id}", $con);
$con = preg_replace("/_username_/", "{$name}", $con);
$con = preg_replace("/_password_/", "{$pass}", $con);
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:31,代码来源:admin.new_account.php

示例11: check_type

<?php

// FILE INCLUDE VALIDATION
if (!$EmailAuth) {
    exit;
}
// -------------------------------------------------------------------------------------------------
// ----------------------------------------------------------
// SANITIZE AND ASSIGN THE VARIABLE
// ----------------------------------------------------------
$sendpass = check_type('sendpass');
// ----------------------------------------------------------
$adata = mysql_query("select id, username, password, f_name, l_name, email, email_override from idevaff_affiliates where username = '{$sendpass}'");
$indv_data = mysql_fetch_array($adata);
$id = $indv_data['id'];
$name = $indv_data['username'];
$pass = $indv_data['password'];
$fname = $indv_data['f_name'];
$lname = $indv_data['l_name'];
$e = $indv_data['email'];
$email_override = $indv_data['email_override'];
if ($email_override) {
    $email_table_extension = $email_override;
}
// ------------------------------------------------
$edata = mysql_query("select login_subject, login_body from idevaff_email_{$email_table_extension}");
$indv_data = mysql_fetch_array($edata);
$sub = preg_replace("/Sitename/", $sitename, $indv_data['login_subject']);
$con = preg_replace("/Sitename/", $sitename, $indv_data['login_body']);
// ------------------------------------------------
$con = preg_replace("/_id_/", "{$id}", $con);
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:31,代码来源:affiliate.send_login.php

示例12: trigger_error

                if (!$page || $page['page_status'] != STATUS_PENDING) {
                    trigger_error($page ? 'PAGE_ALREADY_INSTALLED' : 'PAGE_NOT_FOUND');
                }
                check_type($page['page_type']);
                if (display_confirmation()) {
                    $_CLASS['core_db']->query('UPDATE ' . CORE_PAGES_TABLE . ' set page_status = ' . STATUS_DISABLED . ' WHERE page_id = ' . $id);
                }
                break;
            case 'uninstall':
                $result = $_CLASS['core_db']->query('SELECT page_status, page_name, page_type FROM ' . CORE_PAGES_TABLE . ' WHERE page_id = ' . $id);
                $page = $_CLASS['core_db']->fetch_row_assoc($result);
                $_CLASS['core_db']->free_result($result);
                if (!$page || $page['page_status'] == STATUS_PENDING) {
                    trigger_error($page ? 'PAGE_NOT_UNINSTALLABLE' : 'PAGE_NOT_FOUND');
                }
                check_type($page['page_type']);
                if (display_confirmation()) {
                    $_CLASS['core_db']->query('UPDATE ' . CORE_PAGES_TABLE . ' set page_status = ' . STATUS_PENDING . ' WHERE page_id = ' . $id);
                }
                break;
        }
    }
}
$sql = 'SELECT * FROM ' . CORE_PAGES_TABLE . '
			WHERE page_type = ' . PAGE_TEMPLATE . '
				ORDER BY page_name';
$result = $_CLASS['core_db']->query($sql);
$pages = array();
$admin_auth = false;
while ($pages = $_CLASS['core_db']->fetch_row_assoc($result)) {
    settype($pages['page_status'], 'int');
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:pages.php

示例13: pixie


//.........这里部分代码省略.........
            } else {
                $p = NULL;
            }
            switch ($count) {
                case $dir_level + 3:
                    $rel_path = '../';
                    break;
                case $dir_level + 4:
                    $rel_path = '../../';
                    break;
                case $dir_level + 5:
                    $rel_path = '../../../';
                    break;
                case $dir_level + 6:
                    $rel_path = '../../../../';
                    break;
                default:
                    $rel_path = './';
                    break;
            }
        }
    } else {
        $rel_path = './';
    }
    if (!isset($s) or !$s) {
        $last = $default_page[strlen($default_page) - 1];
        $default = explode('/', $default_page);
        if (isset($default['0'])) {
            $s = sterilise_txt($default['0']);
        } else {
            $s = NULL;
        }
        if (isset($default['1'])) {
            $m = sterilise_txt($default['1']);
        } else {
            $m = NULL;
        }
        if (isset($default['2'])) {
            $x = sterilise_txt($default['2']);
        } else {
            $x = NULL;
        }
        if (isset($default['3'])) {
            $p = sterilise_txt($default['3']);
        } else {
            $p = NULL;
        }
    }
    $s = public_check_404($s);
    if (isset($s) && $s == '404') {
        $m = "";
        $x = "";
        $p = "";
    }
    if ($m == 'rss') {
        if (isset($s)) {
            $rss = public_check_rss($s);
        }
        if (!$rss) {
            $s = '404';
            $m = "";
            $x = "";
            $p = "";
        }
    }
    if (isset($s)) {
        $page_type = check_type($s);
    }
    if ($page_type == 'dynamic') {
        $style = $page_type;
    } else {
        if ($page_type == 'static') {
            $style = $s;
            $m = "";
            $x = "";
            $p = "";
        } else {
            if ($s == '404') {
                $style = '404';
            } else {
                $style = $s;
            }
        }
    }
    function resolver($string)
    {
        $string = str_replace('-', 'BREAK', $string);
        $string = preg_replace('/[^a-zA-Z0-9]/', "", $string);
        $string = str_replace('BREAK', '-', $string);
        return $string;
    }
    $s = resolver($s);
    $m = resolver($m);
    $x = resolver($x);
    $p = resolver($p);
    $page_id = get_page_id($s);
    $page_hits = safe_field('page_views', 'pixie_core', "page_name='{$s}'");
    $page_display_name = safe_field('page_display_name', 'pixie_core', "page_name='{$s}'");
    safe_update('pixie_core', "page_views  = {$page_hits} + 1", "page_name = '{$s}'");
}
开发者ID:joseph-mudloff,项目名称:pixie-cms,代码行数:101,代码来源:lib_pixie.php

示例14: get_page_id

 *
 * Title: Tag Cloud block
 *
 * @package Pixie
 * @copyright 2008-2010 Scott Evans
 * @author Scott Evans
 * @author Sam Collett
 * @author Tony White
 * @author Isa Worcs
 * @link http://www.getpixie.co.uk
 * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3
 *
 */
if (isset($s)) {
    $id = get_page_id($s);
    $type = check_type($s);
    global $lang;
    global $timezone;
    if ($type == 'dynamic') {
        $table = 'pixie_dynamic_posts';
    } else {
        if ($type == 'module') {
            $table = "pixie_module_{$s}";
        }
    }
    echo "\t\t\t\t\t<div id=\"block_tagcloud\" class=\"block\">\n\t\t\t\t\t\t<div class=\"block_header\">\n\t\t\t\t\t\t\t<h4>" . $lang['tags'] . "</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"block_body\">\n";
    if ($type == 'dynamic') {
        public_tag_cloud($table, "page_id = {$id} and public = 'yes'");
    } else {
        $condition = "{$s}_id >= '0'";
        if (isset($table)) {
开发者ID:joseph-mudloff,项目名称:pixie-cms,代码行数:31,代码来源:block_tagcloud.php

示例15: array

         }
         $_CLASS['core_db']->query('UPDATE ' . CORE_PAGES_TABLE . ' set page_status = ' . STATUS_DISABLED . ' WHERE page_id = ' . $id);
         if ($page_configurer->admin) {
             $array = array('module_name' => (string) $module['page_name'], 'module_status' => STATUS_ACTIVE, 'module_type' => 0);
             $_CLASS['core_db']->query('INSERT INTO ' . CORE_ADMIN_MODULES_TABLE . ' ' . $_CLASS['core_db']->sql_build_array('INSERT', $array));
         }
     }
     break;
 case 'uninstall':
     $result = $_CLASS['core_db']->query('SELECT page_status, page_name, page_type FROM ' . CORE_PAGES_TABLE . ' WHERE page_id = ' . $id);
     $module = $_CLASS['core_db']->fetch_row_assoc($result);
     $_CLASS['core_db']->free_result($result);
     if (!$module || $module['page_status'] == STATUS_PENDING) {
         trigger_error($module ? 'MODULE_NOT_UNINSTALLABLE' : 'MODULE_NOT_FOUND');
     }
     check_type($module['page_type']);
     if (display_confirmation()) {
         if (file_exists(SITE_FILE_ROOT . 'modules/' . $module['page_name'] . '/configurator.php')) {
             require_once SITE_FILE_ROOT . 'modules/' . $module['page_name'] . '/configurator.php';
             $name = $module['page_name'] . '_configurator';
             if (class_exists($name)) {
                 $page_configurer = new $name();
                 if (method_exists($page_configurer, 'uninstall')) {
                     $status = $page_configurer->uninstall();
                     if ($status !== true) {
                         trigger_error(is_string($status) ? $status : 'UNISTALLATION_FAILED');
                     }
                 }
             }
         }
         $_CLASS['core_db']->query('UPDATE ' . CORE_PAGES_TABLE . ' set page_status = ' . STATUS_PENDING . ' WHERE page_id = ' . $id);
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:modules.php


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