Index: trunk/wp-content/plugins/xpressme/include/custom_functions.php
===================================================================
--- trunk/wp-content/plugins/xpressme/include/custom_functions.php	(revision 55)
+++ trunk/wp-content/plugins/xpressme/include/custom_functions.php	(revision 56)
@@ -171,9 +171,11 @@
 function get_xoops_prefix()
 {
-	global $wpdb;
-	
-	$prefix = $wpdb->prefix;
-	$ret = str_replace(get_wp_prefix_only(),'',$prefix);
+	$ret =XOOPS_DB_PREFIX . '_';
 	return $ret;
+}
+function get_wp_prefix()
+{
+	$prefix = get_xoops_prefix() . get_wp_prefix_only();
+	return $prefix;
 }
 
@@ -218,5 +220,5 @@
 // Retrieves post views given a post ID or post object. 
 function xpress_post_views_count($post_id=0,$format= '',$show = true) {
-	global $xoops_db;
+	global $xoops_db,$wpdb;
 
 	static $post_cache_views;
@@ -230,5 +232,5 @@
 	if($post_id==0) return null;
 	if(!isset($post_cache_views[$post_id])){
-        $sql = "SELECT post_views FROM " . get_xoops_prefix() . "views" . " WHERE post_id=$post_id";
+        $sql = "SELECT post_views FROM " . get_wp_prefix() . "views" . " WHERE post_id=$post_id";
         $post_views = $xoops_db->get_var($sql);
         if (!$post_views) {
