• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_id函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: get_permalink

 function get_permalink($id = false)
 {
     $rewritecode = array('%year%', '%monthnum%', '%day%', '%hour%', '%minute%', '%second%', '%postname%', '%post_id%', '%category%', '%author%', '%pagename%');
     $permalink = get_settings('permalink_structure');
     $postHandler =& wp_handler('Post');
     if ($id) {
         $id = intval($id);
         if ($permalink == '') {
             return wp_siteurl() . '/index.php?p=' . $id;
         }
         if (!isset($GLOBALS['permalink_cache'][wp_id()]) || !isset($GLOBALS['permalink_cache'][wp_id()][$id])) {
             $postObject =& $postHandler->get($id);
             $GLOBALS['permalink_cache'][wp_id()][$id] =& $postObject->exportWpObject();
         }
         $idpost = $GLOBALS['permalink_cache'][wp_id()][$id];
     } else {
         $idpost = $GLOBALS['post'];
     }
     if ('' != $permalink) {
         $unixtime = strtotime($idpost->post_date);
         $cats = get_the_category($idpost->ID);
         $category = $cats[0]->category_nicename;
         $authordata = get_userdata($idpost->post_author);
         $author = $authordata->user_login;
         $rewritereplace = array(date('Y', $unixtime), date('m', $unixtime), date('d', $unixtime), date('H', $unixtime), date('i', $unixtime), date('s', $unixtime), $idpost->post_name, $idpost->ID, $category, $author, $idpost->post_name);
         return wp_siteurl() . str_replace($rewritecode, $rewritereplace, $permalink);
     } else {
         return wp_siteurl() . '/index.php?p=' . $idpost->ID;
     }
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:30,代码来源:template-functions-links.php


示例2: comments_popup_link

 function comments_popup_link($zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $CSSclass = '', $none = 'Comments Off', $echo = true)
 {
     if (get_xoops_option(wp_mod(), 'wp_use_xoops_comments') == 0) {
         if (empty($GLOBALS['comment_count_cache'][wp_id()]["{$GLOBALS['wp_post_id']}"])) {
             $criteria =& new CriteriaCompo(new Criteria('comment_post_ID', $GLOBALS['wp_post_id']));
             $criteria->add(new Criteria('comment_approved', '1 '));
             // Trick for numeric chars only string compare
             $commentHandler =& wp_handler('Comment');
             $number = $commentHandler->getCount($criteria);
         } else {
             $number = $GLOBALS['comment_count_cache'][wp_id()]["{$GLOBALS['wp_post_id']}"];
         }
     } else {
         $criteria =& new CriteriaCompo(new Criteria('comment_post_ID', $GLOBALS['wp_post_id']));
         $criteria->add(new Criteria('comment_approved', '1 '));
         // Trick for numeric chars only string compare
         $criteria_c =& new CriteriaCompo(new Criteria('comment_content', "<trackback />%", 'like'));
         $criteria_c->add(new Criteria('comment_content', "<pingback />%", 'like'), 'OR');
         $criteria_c->add(new Criteria('comment_type', 'trackback'), 'OR');
         $criteria_c->add(new Criteria('comment_type', 'pingback'), 'OR');
         $criteria->add($criteria_c);
         $commentHandler =& wp_handler('Comment');
         $number = $commentHandler->getCount($criteria);
     }
     $comments_popup_link = "";
     if (0 == $number && 'closed' == $GLOBALS['post']->comment_status && 'closed' == $GLOBALS['post']->ping_status) {
         return _echo($none, $echo);
     } else {
         if (!empty($GLOBALS['post']->post_password)) {
             // if there's a password
             if ($_COOKIE['wp-postpass_' . $GLOBALS['cookiehash']] != $GLOBALS['post']->post_password) {
                 // and it doesn't match the cookie
                 return _echo("Enter your password to view comments", $echo);
             }
         }
         $comments_popup_link .= '<a href="';
         if (!empty($GLOBALS['wpcommentsjavascript'])) {
             $comments_popup_link .= wp_siteurl() . '/' . $GLOBALS['wpcommentspopupfile'] . '?p=' . $GLOBALS['wp_post_id'] . '&amp;c=1';
             $comments_popup_link .= '" onclick="wpopen(this.href); return false"';
         } else {
             // if comments_popup_script() is not in the template, display simple comment link
             $comments_popup_link .= comments_link('', false);
             $comments_popup_link .= '"';
         }
         $comments_popup_link .= ' title="Comment for \'\'' . apply_filters('the_title', $GLOBALS['post']->post_title) . '\'\'"';
         if (!empty($CSSclass)) {
             $comments_popup_link .= ' class="' . $CSSclass . '"';
         }
         $comments_popup_link .= '>';
         $comments_popup_link .= comments_number($zero, $one, $more, $number, false);
         $comments_popup_link .= '</a>';
         return _echo($comments_popup_link, $echo);
     }
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:54,代码来源:template-functions-comment.php


示例3: apply_filters

function apply_filters($tag, $string)
{
    if (isset($GLOBALS['wp_filter'][wp_id()]['all'])) {
        foreach ($GLOBALS['wp_filter'][wp_id()]['all'] as $priority => $functions) {
            if (isset($GLOBALS['wp_filter'][wp_id()][$tag][$priority])) {
                $GLOBALS['wp_filter'][wp_id()][$tag][$priority] = array_merge($GLOBALS['wp_filter'][wp_id()]['all'][$priority], $GLOBALS['wp_filter'][wp_id()][$tag][$priority]);
            } else {
                $GLOBALS['wp_filter'][wp_id()][$tag][$priority] = array_merge($GLOBALS['wp_filter'][wp_id()]['all'][$priority], array());
            }
            $GLOBALS['wp_filter'][wp_id()][$tag][$priority] = array_unique($GLOBALS['wp_filter'][wp_id()][$tag][$priority]);
        }
    }
    /* Keep Plugin Comatibility */
    $tables = array('posts', 'users', 'categories', 'post2cat', 'comments', 'links', 'linkcategories', 'options', 'optiontypes', 'optionvalues', 'optiongroups', 'optiongroup_options', 'postmeta', 'settings');
    $oldtables = array();
    foreach ($tables as $table) {
        if (isset($GLOBALS['table' . $table])) {
            $oldtables[$table] = $GLOBALS['table' . $table];
        }
        $GLOBALS['table' . $table] = $GLOBALS['wpdb']->{$table}[wp_id()];
    }
    if (isset($GLOBALS['wp_filter'][wp_id()][$tag])) {
        ksort($GLOBALS['wp_filter'][wp_id()][$tag]);
        foreach ($GLOBALS['wp_filter'][wp_id()][$tag] as $priority => $functions) {
            foreach ($functions as $function) {
                //				echo "<br/>$tag - $function  <br>";
                $string = $function($string);
                //				echo $string;
            }
        }
    }
    foreach ($tables as $table) {
        unset($GLOBALS['table' . $table]);
    }
    foreach ($oldtables as $table => $value) {
        $GLOBALS['table' . $table] = $value;
    }
    return $string;
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:39,代码来源:functions-filter.php


示例4: add_referer

function add_referer()
{
    if (!empty($GLOBALS['single'])) {
        if (isset($_SERVER['HTTP_REFERER'])) {
            $url = $_SERVER['HTTP_REFERER'];
            if (not_excluded($url)) {
                require_once XOOPS_ROOT_PATH . '/class/snoopy.php';
                $snoopy = new Snoopy();
                if ($snoopy->fetch($url)) {
                    $page = $snoopy->results;
                    $matched = false;
                    $page = mb_conv($page, $GLOBALS['blog_charset'], 'auto');
                    if (preg_match_all('/<a\\s[^>]*?href=[\\"\']([^\\"\']*?)[\\"\'][^>]*>/', $page, $matches, PREG_PATTERN_ORDER)) {
                        foreach ($matches[1] as $match) {
                            if (strstr($match, wp_siteurl())) {
                                $matched = true;
                            }
                        }
                    }
                    if (!$matched) {
                        return;
                    }
                    preg_match('/<title>(.+)<\\/title>/is', $page, $title);
                    $title = $title[1];
                    if (!$title) {
                        preg_match('/^(http:\\/\\/)?([^\\/]+)/i', $url, $matches);
                        $host = $matches[2];
                        preg_match('/[^\\.\\/]+\\.[^\\.\\/]+$/', $host, $matches);
                        $title = $matches[0];
                    }
                    $new_entry = addslashes($title . ":!-!:" . $url);
                    add_post_meta($GLOBALS['wp_post_id'], 'wp-refer', $new_entry);
                    $GLOBALS['post_meta_cache'][wp_id()][$GLOBALS['wp_post_id']]['wp-refer'][] = $new_entry;
                }
            }
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:38,代码来源:wp-refer.php


示例5: dirname

<?php

$GLOBALS['blog'] = 1;
require dirname(__FILE__) . '/wp-config.php';
error_reporting(E_ERROR);
header("Content-type: text/css; charset=EUC-JP");
if (wp_id() == "-") {
    echo block_style_get('', false, false);
} else {
    echo block_style_get(wp_id(), false, false);
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:11,代码来源:wp-blockstyle.php


示例6: while

            //EMPTY
        } else {
            while ($smiles = $db->fetchArray($getsmiles)) {
                $GLOBALS['wpsmiliestrans'][wp_id()][$smiles['code']] = $smiles['smile_url'];
            }
        }
    } else {
        $GLOBALS['wpsmiliestrans'][wp_id()] = array(' :)' => 'icon_smile.gif', ' :D' => 'icon_biggrin.gif', ' :-D' => 'icon_biggrin.gif', ':grin:' => 'icon_biggrin.gif', ' :)' => 'icon_smile.gif', ' :-)' => 'icon_smile.gif', ':smile:' => 'icon_smile.gif', ' :(' => 'icon_sad.gif', ' :-(' => 'icon_sad.gif', ':sad:' => 'icon_sad.gif', ' :o' => 'icon_surprised.gif', ' :-o' => 'icon_surprised.gif', ':eek:' => 'icon_surprised.gif', ' 8O' => 'icon_eek.gif', ' 8-O' => 'icon_eek.gif', ':shock:' => 'icon_eek.gif', ' :?' => 'icon_confused.gif', ' :-?' => 'icon_confused.gif', ' :???:' => 'icon_confused.gif', ' 8)' => 'icon_cool.gif', ' 8-)' => 'icon_cool.gif', ':cool:' => 'icon_cool.gif', ':lol:' => 'icon_lol.gif', ' :x' => 'icon_mad.gif', ' :-x' => 'icon_mad.gif', ':mad:' => 'icon_mad.gif', ' :P' => 'icon_razz.gif', ' :-P' => 'icon_razz.gif', ':razz:' => 'icon_razz.gif', ':oops:' => 'icon_redface.gif', ':cry:' => 'icon_cry.gif', ':evil:' => 'icon_evil.gif', ':twisted:' => 'icon_twisted.gif', ':roll:' => 'icon_rolleyes.gif', ':wink:' => 'icon_wink.gif', ' ;)' => 'icon_wink.gif', ' ;-)' => 'icon_wink.gif', ':!:' => 'icon_exclaim.gif', ':?:' => 'icon_question.gif', ':idea:' => 'icon_idea.gif', ':arrow:' => 'icon_arrow.gif', ' :|' => 'icon_neutral.gif', ' :-|' => 'icon_neutral.gif', ':neutral:' => 'icon_neutral.gif', ':mrgreen:' => 'icon_mrgreen.gif');
    }
}
# sorts the smilies' array
if (!function_exists('smiliescmp')) {
    function smiliescmp($a, $b)
    {
        if (strlen($a) == strlen($b)) {
            return strcmp($a, $b);
        }
        return strlen($a) > strlen($b) ? -1 : 1;
    }
}
if (get_xoops_option(wp_mod(), 'wp_use_xoops_smilies') == 0) {
    uksort($GLOBALS['wpsmiliestrans'][wp_id()], 'smiliescmp');
}
# generates smilies' search & replace arrays
$GLOBALS['wp_smiliessearch'][wp_id()] = array();
$GLOBALS['wp_smiliesreplace'][wp_id()] = array();
foreach ($GLOBALS['wpsmiliestrans'][wp_id()] as $smiley => $img) {
    $GLOBALS['wp_smiliessearch'][wp_id()][] = $smiley;
    $smiley_masked = str_replace(' ', '', $smiley);
    $GLOBALS['wp_smiliesreplace'][wp_id()][] = " <img src='" . $GLOBALS['smilies_directory'] . "/{$img}' alt='{$smiley_masked}' />";
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:vars.php


示例7: update


//.........这里部分代码省略.........
     $p_id = $this->uri->segment(6);
     //cek usaha -> cm bisa edit yg self aja
     if ($p_usaha_id == pad_reklame_id() || $p_usaha_id == pad_air_tanah_id()) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     //cek kohir
     if ($this->sptpd_model->is_kohir_ok($p_id)) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     // cek pmb
     if ($this->sptpd_model->is_sspd_ok($p_id) || $this->sptpd_model->is_bayar_ok($p_id)) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     $data['current'] = $this->module;
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("{$this->controller}/update/{$p_usaha_id}/{$p_type_id}/{$p_id}");
     $post_data = $this->fpost($p_usaha_id);
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $update_data = array('customer_id' => $input_post['customer_id'], 'customer_usaha_id' => $input_post['customer_usaha_id'], 'pajak_id' => $input_post['pajak_id'], 'tahun' => $input_post['tahun'], 'terimatgl' => date('Y-m-d', strtotime($input_post['terimatgl'])), 'type_id' => $input_post['type_id'], 'so' => $input_post['so'], 'jatuhtempotgl' => date('Y-m-d', strtotime($input_post['jatuhtempotgl'])), 'masadari' => date('Y-m-d', strtotime($input_post['masadari'])), 'masasd' => date('Y-m-d', strtotime($input_post['masasd'])), 'minomset' => $input_post['minomset'], 'dasar' => $input_post['dasar'], 'tarif' => $input_post['tarif'], 'denda' => $input_post['denda'], 'bunga' => $input_post['bunga'], 'setoran' => $input_post['setoran'], 'kenaikan' => $input_post['kenaikan'], 'kompensasi' => $input_post['kompensasi'], 'lain2' => $input_post['lain2'], 'pajak_terhutang' => $input_post['pajak'], 'r_bayarid' => $input_post['r_bayarid'], 'r_nsr' => $input_post['r_nsr'], 'rekening_id' => $input_post['rekening_id'], 'write_date' => date('Y-m-d'), 'write_uid' => sipkd_user_id());
         $reklame_data = array();
         if ($p_usaha_id == pad_reklame_id()) {
             //
         }
         $air_tanah_data = array();
         if ($p_usaha_id == pad_air_tanah_id()) {
             //
         }
         // data tambahan
         $tambahan_data = array();
         if (wp_login()) {
             //
         }
         $update_data = array_merge($update_data, $reklame_data, $air_tanah_data, $tambahan_data);
         $this->sptpd_model->update($p_id, $update_data);
         // data tambahan / detail
         if (wp_login()) {
             //
             // uplod dokeumen
             $this->unggah($p_id);
         }
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url($this->controller));
     }
     $data['dt'] = $post_data;
     $get = (object) $post_data;
     $options = array();
     $js = 'id="customer_usaha_id" class="input-xlarge"';
     $data['select_usaha'] = form_dropdown('customer_usaha_id', $options, null, $js);
     $select_data = $this->load->model('pajak_model')->get_select($get->pajak_id);
     $options = array();
     foreach ($select_data as $rows) {
         $options[$rows->id] = $rows->pajaknm;
     }
     $js = 'id="pajak_id" class="input-xxlarge"';
     $data['select_pajak'] = form_dropdown('pajak_id', $options, $get->pajak_id, $js);
     $select_data = $this->load->model('sptpd_type_model')->get_select();
     $options = array();
     foreach ($select_data as $rows) {
         $options[$rows->id] = $rows->typenm;
     }
     $js = 'id="type_id" class="input-small" onChange="void(0);"';
     $data['select_sptpd_type'] = form_dropdown('type_id', $options, $get->type_id, $js);
     $pajak_detail = $this->load->model('pad_model');
     if ($row = $pajak_detail->sptpd_get_pajak_detail($get->pajak_id, $get->terimatgl)) {
         $data['dt']['rekening_id'] = $row->rekening_id;
         $data['dt']['rekeningkd'] = $row->rekeningkd;
         $data['dt']['jatuhtempo'] = $row->jatuhtempo;
     }
     if (wp_login()) {
         $this->load->helper('directory');
         $dir = directory_map(dirname(__FILE__) . '//..//dokumen//');
         $files = array();
         foreach ($dir as $file) {
             $f = explode('@', $file);
             if ($f[0] == $p_id) {
                 $files[] = anchor(active_module_url("sptpd/unduh/{$file}"), $f[1], array("title" => "Unduh file {$f['1']}", "target" => "_blank"));
             }
         }
         $data['dt']['files'] = $files;
     }
     if ($p_usaha_id == pad_reklame_id()) {
         //
     } else {
         if ($p_usaha_id == pad_air_tanah_id()) {
             //
         } else {
             if (!wp_login()) {
                 $this->load->view('vsptpd_form', $data);
             } else {
                 $data['dt']['customer_id'] = wp_id();
                 $this->load->view('wp/vsptpd_form', $data);
             }
         }
     }
 }
开发者ID:aagusti,项目名称:padl-tng,代码行数:101,代码来源:sptpd.OLD-.php


示例8: block_style_get

    function block_style_get($echo = true, $with_tpl = true)
    {
        $wp_num = wp_id() == '-' ? '' : wp_id();
        if ($with_tpl) {
            if (get_xoops_option(wp_mod(), 'wp_use_blockcssheader')) {
                $tplVars =& $GLOBALS['xoopsTpl']->get_template_vars();
                $csslink = "\n<link rel='stylesheet' type='text/css' media='screen' href='" . wp_siteurl() . "/wp-blockstyle.php' />";
                if (array_key_exists('xoops_block_header', $tplVars)) {
                    if (!strstr($tplVars['xoops_block_header'], $csslink)) {
                        $GLOBALS['xoopsTpl']->assign('xoops_block_header', $tplVars['xoops_block_header'] . $csslink);
                    }
                } else {
                    $GLOBALS['xoopsTpl']->assign('xoops_block_header', $csslink);
                }
                return;
            } else {
                if (!defined('WP_BLOCKSTYLE_READ' . $wp_num)) {
                    define('WP_BLOCKSTYLE_READ' . $wp_num, 1);
                    echo '<style type="text/css" midia="screen">@import url(' . wp_siteurl() . '/wp-blockstyle.php);</style>' . "\n";
                }
                return;
            }
        }
        if (file_exists(wp_base() . '/themes/' . $GLOBALS['xoopsConfig']['theme_set'] . '/wp-blocks.css.php')) {
            $themes = $GLOBALS['xoopsConfig']['theme_set'];
        } else {
            $themes = 'default';
        }
        $wp_block_style = '';
        include_once wp_base() . '/themes/' . $themes . '/wp-blocks.css.php';
        if ($echo) {
            if (trim($wp_block_style) != "") {
                echo <<<EOD
<style type="text/css" media="screen">
    <!--
\t{$wp_block_style}
    -->
</style>
EOD;
            }
        } else {
            return trim($wp_block_style);
        }
    }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:44,代码来源:functions.php


示例9: wp_table

                     if ($msg == '') {
                         //no error message
                         $result = $wpdb->query("UPDATE " . wp_table('options') . " SET option_value = '{$new_val}' WHERE option_id = {$option->option_id}");
                         if (!$result) {
                             $db_errors .= " SQL error while saving {$this_name}. ";
                         } else {
                             ++$any_changed;
                         }
                     } else {
                         $validation_message .= $msg;
                     }
                 }
             }
         }
         // end foreach
         unset($GLOBALS['cache_settings'][wp_id()]);
         // so they will be re-read
     }
     // end if options
     if ($any_changed) {
         $message = $any_changed . _LANG_WOP_SETTING_SAVED;
     }
     if ($dB_errors != '' || $validation_message != '') {
         if ($message != '') {
             $message .= '<br />and ';
         }
         $message .= $dB_errors . '<br />' . $validation_message;
     }
     //break; //fall through
 //break; //fall through
 default:
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:options.php


示例10: wp_siteurl

}
//WordPressプラグイン互換性確保用
$GLOBALS['siteurl'] = wp_siteurl();
update_option('siteurl', $GLOBALS['siteurl'], true);
$GLOBALS['querystring_start'] = '?';
$GLOBALS['querystring_equal'] = '=';
$GLOBALS['querystring_separator'] = '&amp;';
$GLOBALS['dateformat'] = stripslashes(get_settings('date_format'));
$GLOBALS['timeformat'] = stripslashes(get_settings('time_format'));
// Used to guarantee unique cookies
$GLOBALS['cookiehash'] = md5(wp_siteurl());
require wp_base() . '/wp-includes/vars.php';
require wp_base() . '/wp-includes/wp-filter-setup.php';
if (empty($GLOBALS['wp_inblock']) || $GLOBALS['wp_inblock'] != 1) {
    if (!defined('XOOPS_PULUGIN' . wp_id())) {
        define('XOOPS_PULUGIN' . wp_id(), 1);
        if (get_settings('active_plugins')) {
            $check_plugins = explode("\n", get_settings('active_plugins'));
            foreach ($check_plugins as $check_plugin) {
                if (file_exists(wp_base() . '/wp-content/plugins/' . $check_plugin)) {
                    if (!defined(md5('WP_PLUGIN_' . strtoupper($check_plugin) . '_INCLUDED'))) {
                        define(md5('WP_PLUGIN_' . strtoupper($check_plugin) . '_INCLUDED'), 1);
                        require_once wp_base() . '/wp-content/plugins/' . $check_plugin;
                    } else {
                        // It is very tricky!!
                        if (!defined(md5('WP_PLUGIN_' . strtoupper($check_plugin) . wp_base() . '_DEFINED'))) {
                            define(md5('WP_PLUGIN_' . strtoupper($check_plugin) . wp_base() . '_DEFINED'), 1);
                            if (preg_match_all('/(add|remove)_(action|filter)\\s*\\([^\\)]+\\)\\s*\\;/', implode('', file(wp_base() . '/wp-content/plugins/' . $check_plugin)), $matches, PREG_SET_ORDER)) {
                                foreach ($matches as $match) {
                                    eval($match[0]);
                                }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:wp-settings.php


示例11: while

$GLOBALS['s_weekday_length'] = _WP_CAL_SWEEK_LEN;
// the months, translate them if necessary - note: this isn't active everywhere yet
$GLOBALS['month']['01'] = _WP_CAL_JANUARY;
$GLOBALS['month']['02'] = _WP_CAL_FEBRUARY;
$GLOBALS['month']['03'] = _WP_CAL_MARCH;
$GLOBALS['month']['04'] = _WP_CAL_APRIL;
$GLOBALS['month']['05'] = _WP_CAL_MAY;
$GLOBALS['month']['06'] = _WP_CAL_JUNE;
$GLOBALS['month']['07'] = _WP_CAL_JULY;
$GLOBALS['month']['08'] = _WP_CAL_AUGUST;
$GLOBALS['month']['09'] = _WP_CAL_SEPTEMBER;
$GLOBALS['month']['10'] = _WP_CAL_OCTOBER;
$GLOBALS['month']['11'] = _WP_CAL_NOVEMBER;
$GLOBALS['month']['12'] = _WP_CAL_DECEMBER;
$GLOBALS['s_month_length'] = _WP_CAL_SMONTH_LEN;
$GLOBALS['wp_month_format'] = _WP_MONTH_FORMAT;
// here's the conversion table, you can modify it if you know what you're doing
if (get_xoops_option(wp_mod(), 'wp_use_xoops_smilies')) {
    // Get smilies infomation from XOOPS DB
    $_getsmiles = $GLOBALS['xoopsDB']->query("SELECT id, code, smile_url FROM " . $GLOBALS['xoopsDB']->prefix("smiles") . " ORDER BY id");
    if ($GLOBALS['xoopsDB']->getRowsNum($_getsmiles) == "0") {
        //EMPTY
    } else {
        while ($_smiles = $GLOBALS['xoopsDB']->fetchArray($_getsmiles)) {
            $GLOBALS['wpsmiliestrans'][wp_id()][$_smiles['code']] = $_smiles['smile_url'];
        }
    }
} else {
    $GLOBALS['wpsmiliestrans'][wp_id()] = array(' :)' => 'icon_smile.gif', ' :D' => 'icon_biggrin.gif', ' :-D' => 'icon_biggrin.gif', ':grin:' => 'icon_biggrin.gif', ' :)' => 'icon_smile.gif', ' :-)' => 'icon_smile.gif', ':smile:' => 'icon_smile.gif', ' :(' => 'icon_sad.gif', ' :-(' => 'icon_sad.gif', ':sad:' => 'icon_sad.gif', ' :o' => 'icon_surprised.gif', ' :-o' => 'icon_surprised.gif', ':eek:' => 'icon_surprised.gif', ' 8O' => 'icon_eek.gif', ' 8-O' => 'icon_eek.gif', ':shock:' => 'icon_eek.gif', ' :?' => 'icon_confused.gif', ' :-?' => 'icon_confused.gif', ' :???:' => 'icon_confused.gif', ' 8)' => 'icon_cool.gif', ' 8-)' => 'icon_cool.gif', ':cool:' => 'icon_cool.gif', ':lol:' => 'icon_lol.gif', ' :x' => 'icon_mad.gif', ' :-x' => 'icon_mad.gif', ':mad:' => 'icon_mad.gif', ' :P' => 'icon_razz.gif', ' :-P' => 'icon_razz.gif', ':razz:' => 'icon_razz.gif', ':oops:' => 'icon_redface.gif', ':cry:' => 'icon_cry.gif', ':evil:' => 'icon_evil.gif', ':twisted:' => 'icon_twisted.gif', ':roll:' => 'icon_rolleyes.gif', ':wink:' => 'icon_wink.gif', ' ;)' => 'icon_wink.gif', ' ;-)' => 'icon_wink.gif', ':!:' => 'icon_exclaim.gif', ':?:' => 'icon_question.gif', ':idea:' => 'icon_idea.gif', ':arrow:' => 'icon_arrow.gif', ' :|' => 'icon_neutral.gif', ' :-|' => 'icon_neutral.gif', ':neutral:' => 'icon_neutral.gif', ':mrgreen:' => 'icon_mrgreen.gif');
}
include get_custom_path('wp-config-custom.php');
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:wp-config-extra.php


示例12: update


//.........这里部分代码省略.........
                 $options[$row->id] = $row->nsrnm;
             }
         }
         $js = 'id="r_nsr_id" class="input-xlarge" required ';
         $data['select_nsr'] = form_dropdown('r_nsr_id', $options, $get->r_nsr_id, $js);
         $select_data = $this->load->model('rek_lokasi_pasang_model')->get_select();
         $options = array();
         if ($select_data) {
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->lokasinm;
             }
         }
         $js = 'id="r_lokasi_pasang_id" class="input-xlarge" required ';
         $data['select_lokasi_pasang'] = form_dropdown('r_lokasi_pasang_id', $options, $get->r_lokasi_pasang_id, $js);
         $select_data = $this->load->model('rek_sudut_pandang_model')->get_select();
         $options = array();
         if ($select_data) {
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->sudutnm;
             }
         }
         $js = 'id="r_sudut_pandang_id" class="input-xlarge" required ';
         $data['select_sudut_pandang'] = form_dropdown('r_sudut_pandang_id', $options, $get->r_sudut_pandang_id, $js);
         $options = array('Pasang Baru' => 'Pasang Baru', 'Perpanjangan' => 'Perpanjangan');
         $js = 'id="r_status" class="input-large" required ';
         $data['select_status'] = form_dropdown('r_status', $options, $get->r_status, $js);
         //-end-new
         $select_data = $this->load->model('jalan_klas_model')->get_select();
         $options = array();
         if ($select_data) {
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->kelasnm;
             }
         }
         $js = 'id="r_jalanklas_id" class="input-xlarge" required ';
         $data['select_jalan_klas'] = form_dropdown('r_jalanklas_id', $options, $get->r_jalanklas_id, $js);
         $select_data = $this->load->model('jalan_model')->get_select();
         $options = array();
         if ($select_data) {
             $options[] = "# KOSONG #";
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->jalannm;
             }
         }
         $js = 'id="r_jalan_id" class="input-large combobox" ';
         $data['select_jalan'] = form_dropdown('r_jalan_id', $options, $get->r_jalan_id, $js);
         $select_data = $this->load->model('kecamatan_model')->get_select();
         $options = array();
         if ($select_data) {
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->kecamatannm;
             }
         }
         $js = 'id="r_lokasi_id" class="input-medium" required ';
         $data['select_lokasi'] = form_dropdown('r_lokasi_id', $options, $get->r_lokasi_id, $js);
         $options = array(1 => 'Tidak ada', 2 => 'Produk Rokok +25%', 3 => 'Reklame Pendidikan -25%', 4 => 'Kenaikan 25% & Pengurangan 25%');
         $js = 'id="r_tarifid" class="input-large" required ';
         $data['select_tarif'] = form_dropdown('r_tarifid', $options, $get->r_tarifid, $js);
         if (!wp_login()) {
             $this->load->view('vsptpd_form_reklame', $data);
         } else {
             $data['dt']['customer_id'] = wp_id();
             $this->load->view('wp/vsptpd_form_reklame', $data);
         }
     } else {
         if ($p_usaha_id == pad_air_tanah_id()) {
             $select_data = $this->load->model('air_zona_model')->get_select();
             $options = array();
             if ($select_data) {
                 foreach ($select_data as $row) {
                     $options[$row->id] = $row->zonanm;
                 }
             }
             $js = 'id="air_zona_id" class="input-medium" required ';
             $data['select_zona'] = form_dropdown('air_zona_id', $options, $get->air_zona_id, $js);
             $select_data = $this->load->model('air_manfaat_model')->get_select();
             $options = array();
             if ($select_data) {
                 foreach ($select_data as $row) {
                     $options[$row->id] = $row->manfaatnm;
                 }
             }
             $js = 'id="air_manfaat_id" class="input-medium" required ';
             $data['select_manfaat'] = form_dropdown('air_manfaat_id', $options, $get->air_manfaat_id, $js);
             if (!wp_login()) {
                 $this->load->view('vsptpd_form_at', $data);
             } else {
                 $data['dt']['customer_id'] = wp_id();
                 $this->load->view('wp/vsptpd_form_at', $data);
             }
         } else {
             if (!wp_login()) {
                 $this->load->view('vsptpd_form', $data);
             } else {
                 $data['dt']['customer_id'] = wp_id();
                 $this->load->view('wp/vsptpd_form', $data);
             }
         }
     }
 }
开发者ID:aagusti,项目名称:padl-tng,代码行数:101,代码来源:sptpd_all.php


示例13: _b_wp_contents_show

 function _b_wp_contents_show($options, $wp_num = "")
 {
     $no_posts = empty($options[0]) ? 10 : $options[0];
     $tpl_file = empty($options[1]) ? 'wp_contents.html' : $options[1];
     $category = empty($options[2]) ? "all" : intval($options[2]);
     $GLOBALS['dateformat'] = get_settings('date_format');
     $GLOBALS['timeformat'] = get_settings('time_format');
     $_criteria = new CriteriaCompo(new Criteria('post_status', 'publish'));
     $_criteria->add(new Criteria('post_date', current_time('mysql'), '<='));
     if (empty($category) || $category == 'all' || $category == '0') {
         $_joinCriteria = null;
     } else {
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('post2cat'), 'ID', 'post_id');
         $_wCriteria =& new CriteriaCompo();
         $_wCriteria->add(new Criteria('category_id', intCriteriaVal($category)), 'OR');
         $_catc = trim(get_category_children($category, '', ' '));
         if ($_catc !== "") {
             $_catc_array = explode(' ', $_catc);
             for ($_j = 0; $_j < count($_catc_array); $_j++) {
                 $_wCriteria->add(new Criteria('category_id', intCriteriaVal($_catc_array[$_j])), 'OR');
             }
         }
         $_criteria->add($_wCriteria);
     }
     $_criteria->setGroupBy(wp_table('posts') . '.ID');
     $_criteria->setSort('post_date');
     $_criteria->setOrder('DESC');
     $_criteria->setLimit($no_posts);
     $_criteria->setStart(0);
     $postHandler =& wp_handler('Post');
     $postObjects =& $postHandler->getObjects($_criteria, false, '', 'DISTINCT', $_joinCriteria);
     //		echo $postHandler->getLastSQL();
     $lposts = array();
     foreach ($postObjects as $postObject) {
         $lposts[] =& $postObject->exportWpObject();
     }
     if ($lposts) {
         // Get the categories for all the posts
         $_post_id_list = array();
         foreach ($lposts as $post) {
             $_post_id_list[] = $post->ID;
             $GLOBALS['category_cache'][wp_id()][$post->ID] = array();
         }
         $_post_id_list = implode(',', $_post_id_list);
         $_post_id_criteria =& new Criteria('post_id', '(' . $_post_id_list . ')', 'IN');
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('post2cat'), 'ID', 'post_id');
         $_joinCriteria->cascade(new XoopsJoinCriteria(wp_table('categories'), 'category_id', 'cat_ID'));
         $postObjects =& $postHandler->getObjects($_post_id_criteria, false, 'ID, category_id, cat_name, category_nicename, category_description, category_parent', true, $_joinCriteria);
         foreach ($postObjects as $postObject) {
             $_cat->ID = $postObject->getVar('ID');
             $_cat->category_id = $postObject->getExtraVar('category_id');
             $_cat->cat_name = $postObject->getExtraVar('cat_name');
             $_cat->category_nicename = $postObject->getExtraVar('category_nicename');
             $_cat->category_description = $postObject->getExtraVar('category_description');
             $_cat->category_parent = $postObject->getExtraVar('category_parent');
             $GLOBALS['category_cache'][wp_id()][$postObject->getVar('ID')][] =& $_cat;
             unset($_cat);
         }
         // Do the same for comment numbers
         $_post_id_criteria =& new Criteria('comment_post_ID', '(' . $_post_id_list . ')', 'IN');
         $_criteria =& new CriteriaCompo(new Criteria('post_status', 'publish'));
         $_criteria->add(new Criteria('comment_approved', '1 '));
         $_criteria->add($_post_id_criteria);
         $_criteria->setGroupBy('ID');
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('comments'), 'ID', 'comment_post_ID');
         $postObjects =& $postHandler->getObjects($_criteria, false, 'ID, COUNT( comment_ID ) AS ccount', false, $_joinCriteria);
         foreach ($postObjects as $postObject) {
             $GLOBALS['comment_count_cache'][wp_id()]['' . $postObject->getVar('ID')] = $postObject->getExtraVar('ccount');
         }
         // Get post-meta info
         if ($meta_list = $GLOBALS['wpdb']->get_results('SELECT post_id, meta_key, meta_value FROM ' . wp_table('postmeta') . ' WHERE post_id IN(' . $_post_id_list . ') ORDER BY post_id, meta_key', ARRAY_A)) {
             // Change from flat structure to hierarchical:
             $GLOBALS['post_meta_cache'][wp_id()] = array();
             foreach ($meta_list as $metarow) {
                 $mpid = $metarow['post_id'];
                 $mkey = $metarow['meta_key'];
                 $mval = $metarow['meta_value'];
                 // Force subkeys to be array type:
                 if (!isset($GLOBALS['post_meta_cache'][wp_id()][$mpid]) || !is_array($GLOBALS['post_meta_cache'][wp_id()][$mpid])) {
                     $GLOBALS['post_meta_cache'][wp_id()][$mpid] = array();
                 }
                 if (!isset($GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"]) || !is_array($GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"])) {
                     $GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"] = array();
                 }
                 // Add a value to the current pid/key:
                 $GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"][] = $mval;
             }
         }
     }
     $blog = 1;
     $block = array();
     $block['use_theme_template'] = get_xoops_option(wp_mod(), 'use_theme_template');
     $block['style'] = block_style_get(false);
     $block['divid'] = 'wpBlockContent' . $wp_num;
     $block['template_content'] = "";
     $i = 0;
     $GLOBALS['previousday'] = 0;
     foreach ($lposts as $post) {
         $GLOBALS['post'] = $post;
         if ($block['use_theme_template'] == 0) {
//.........这里部分代码省略.........
开发者ID:nobunobuta,项目名称:xoops_mod_WordPress,代码行数:101,代码来源:wp_contents.php


示例14: _b_wp_contents_show

 function _b_wp_contents_show($options, $wp_num = "")
 {
     $no_posts = empty($options[0]) ? 10 : $options[0];
     $GLOBALS['dateformat'] = stripslashes(get_settings('date_format'));
     $GLOBALS['timeformat'] = stripslashes(get_settings('time_format'));
     $_criteria = new CriteriaCompo(new Criteria('post_status', 'publish'));
     $_criteria->add(new Criteria('post_date', current_time('mysql'), '<='));
     $_criteria->setGroupBy(wp_table('posts') . '.ID');
     $_criteria->setSort('post_date');
     $_criteria->setOrder('DESC');
     $_criteria->setLimit($no_posts);
     $_criteria->setStart(0);
     $postHandler =& wp_handler('Post');
     $postObjects =& $postHandler->getObjects($_criteria, false, '', 'DISTINCT');
     $lposts = array();
     foreach ($postObjects as $postObject) {
         $lposts[] =& $postObject->exportWpObject();
     }
     if ($lposts) {
         // Get the categories for all the posts
         $_post_id_list = array();
         foreach ($lposts as $post) {
             $_post_id_list[] = $post->ID;
             $GLOBALS['category_cache'][wp_id()][$post->ID] = array();
         }
         $_post_id_list = implode(',', $_post_id_list);
         $_post_id_criteria =& new Criteria('post_id', '(' . $_post_id_list . ')', 'IN');
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('post2cat'), 'ID', 'post_id');
         $_joinCriteria->cascade(new XoopsJoinCriteria(wp_table('categories'), 'category_id', 'cat_ID'));
         $postObjects =& $postHandler->getObjects($_post_id_criteria, false, 'ID, category_id, cat_name, category_nicename, category_description, category_parent', true, $_joinCriteria);
         foreach ($postObjects as $postObject) {
             $_cat->ID = $postObject->getVar('ID');
             $_cat->category_id = $postObject->getExtraVar('category_id');
             $_cat->cat_name = $postObject->getExtraVar('cat_name');
             $_cat->category_nicename = $postObject->getExtraVar('category_nicename');
             $_cat->category_description = $postObject->getExtraVar('category_description');
             $_cat->category_parent = $postObject->getExtraVar('category_parent');
             $GLOBALS['category_cache'][wp_id()][$postObject->getVar('ID')][] =& $_cat;
             unset($_cat);
         }
         // Do the same for comment numbers
         $_criteria =& new CriteriaCompo(new Criteria('post_status', 'publish'));
         $_criteria->add(new Criteria('comment_approved', '1 '));
         $_criteria->add($_post_id_criteria);
         $_criteria->setGroupBy('ID');
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('comments'), 'ID', 'comment_post_ID');
         $postObjects =& $postHandler->getObjects($_criteria, false, 'ID, COUNT( comment_ID ) AS ccount', false, $_joinCriteria);
         foreach ($postObjects as $postObject) {
             $GLOBALS['comment_count_cache'][wp_id()]['' . $postObject->getVar('ID')] = $postObject->getExtraVar('ccount');
         }
     }
     $blog = 1;
     $block = array();
     $block['use_theme_template'] = get_xoops_option(wp_mod(), 'use_theme_template');
     $block['style'] = block_style_get(false);
     $block['divid'] = 'wpBlockContent' . $wp_num;
     $block['template_content'] = "";
     $i = 0;
     $GLOBALS['previousday'] = 0;
     foreach ($lposts as $post) {
         $GLOBALS['post'] = $post;
         if ($block['use_theme_template'] == 0) {
             $content = array();
             start_wp();
             $content['date'] = the_date($GLOBALS['dateformat'], '', '', false);
             $content['time'] = the_time('', false);
             $content['title'] = the_title('', '', false);
             $content['permlink'] = get_permalink();
             $content['author'] = the_author_posts_link('', false);
             $content['category'] = the_category('', '', false);
             $content['body'] = the_content(_WP_TPL_MORE, 0, '', false);
             $content['linkpage'] = link_pages('<br />Pages: ', '<br />', 'number', 'next page', 'previous page', '%', '', false);
             if (get_xoops_option(wp_mod(), 'wp_use_xoops_comments') == 0) {
                 $content['comments'] = comments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
             } else {
                 $content['comments'] = xcomments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
                 $content['comments'] .= " | ";
                 $content['comments'] .= comments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
             }
             $content['trackback'] = trackback_rdf(0, false);
             $block['contents'][] = $content;
         } else {
             ob_start();
             include get_custom_path('content_block-template.php');
             $block['template_content'] .= ob_get_contents();
             ob_end_clean();
         }
     }
     $GLOBALS['previousday'] = 0;
     $GLOBALS['day'] = 0;
     $GLOBALS['comment_count_cache'][wp_id()] = array();
     return $block;
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:93,代码来源:wp_contents.php


示例15: get_author_link

 function get_author_link($echo = false, $author_id, $author_name = "")
 {
     $permalink_structure = get_settings('permalink_structure');
     if ($permalink_structure == '') {
         $link = wp_siteurl() . '/index.php?author=' . $author_id;
     } else {
         if ($author_name == '') {
             $author_name = $GLOBALS['cache_userdata'][wp_id()][$author_id]->user_login;
         }
         // Get any static stuff from the front
         $front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
         $link = wp_siteurl() . $front . 'author/';
         $link .= rawurlencode($author_name) . '/';
     }
     return _echo($link, $echo);
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:16,代码来源:template-functions-author.php


示例16: array

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_iframe函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_http_validate_url函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap