XPressME Integration Kit

Trac

Changeset 56 for trunk/wp-content


Ignore:
Timestamp:
Dec 29, 2008, 1:08:37 AM (16 years ago)
Author:
toemon
Message:

最近の記事内容の閲覧数が0になるバグ修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/plugins/xpressme/include/custom_functions.php

    r54 r56  
    171171function get_xoops_prefix() 
    172172{ 
    173         global $wpdb; 
    174          
    175         $prefix = $wpdb->prefix; 
    176         $ret = str_replace(get_wp_prefix_only(),'',$prefix); 
     173        $ret =XOOPS_DB_PREFIX . '_'; 
    177174        return $ret; 
     175} 
     176function get_wp_prefix() 
     177{ 
     178        $prefix = get_xoops_prefix() . get_wp_prefix_only(); 
     179        return $prefix; 
    178180} 
    179181 
     
    218220// Retrieves post views given a post ID or post object.  
    219221function xpress_post_views_count($post_id=0,$format= '',$show = true) { 
    220         global $xoops_db; 
     222        global $xoops_db,$wpdb; 
    221223 
    222224        static $post_cache_views; 
     
    230232        if($post_id==0) return null; 
    231233        if(!isset($post_cache_views[$post_id])){ 
    232         $sql = "SELECT post_views FROM " . get_xoops_prefix() . "views" . " WHERE post_id=$post_id"; 
     234        $sql = "SELECT post_views FROM " . get_wp_prefix() . "views" . " WHERE post_id=$post_id"; 
    233235        $post_views = $xoops_db->get_var($sql); 
    234236        if (!$post_views) { 
Note: See TracChangeset for help on using the changeset viewer.