Changeset 56 for trunk/wp-content/plugins/xpressme
- Timestamp:
- Dec 29, 2008, 1:08:37 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/plugins/xpressme/include/custom_functions.php
r54 r56 171 171 function get_xoops_prefix() 172 172 { 173 global $wpdb; 174 175 $prefix = $wpdb->prefix; 176 $ret = str_replace(get_wp_prefix_only(),'',$prefix); 173 $ret =XOOPS_DB_PREFIX . '_'; 177 174 return $ret; 175 } 176 function get_wp_prefix() 177 { 178 $prefix = get_xoops_prefix() . get_wp_prefix_only(); 179 return $prefix; 178 180 } 179 181 … … 218 220 // Retrieves post views given a post ID or post object. 219 221 function xpress_post_views_count($post_id=0,$format= '',$show = true) { 220 global $xoops_db ;222 global $xoops_db,$wpdb; 221 223 222 224 static $post_cache_views; … … 230 232 if($post_id==0) return null; 231 233 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"; 233 235 $post_views = $xoops_db->get_var($sql); 234 236 if (!$post_views) {
Note: See TracChangeset
for help on using the changeset viewer.