- Timestamp:
- Jun 9, 2009, 8:45:31 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Ver2.0/xpressme_integration_kit/include/general_functions.php
r261 r264 91 91 } 92 92 } 93 94 // XOOPS user ID is get from the name and the mail address of the contributor of the comment that is not user_id. 95 if (!function_exists('wp_comment_author_to_xoops_uid')){ 96 function wp_comment_author_to_xoops_uid($name = '',$email = ''){ 97 global $xoopsDB,$xoops_db; 98 if (empty($name) || empty($email)) return 0; 99 100 if (empty($xoops_db)) { // not load XPressME 101 $xoops_user_tbl = $xoopsDB->prefix('users'); 102 $wp_user_tbl = $xoopsDB->prefix($wp_prefix . "_users"); 103 104 $xoops_uid = 0; 105 $xoops_user_SQL ="SELECT uid FROM $xoops_user_tbl WHERE uname = '$name' AND email = '$email'"; 106 $xoops_user_Res = $xoopsDB->query($xoops_user_SQL, 0, 0); 107 if ($xoopsDB->getRowsNum($xoops_user_Res) > 0){ 108 $xoops_user_Row = $xoopsDB->fetchArray($xoops_user_Res); 109 $xoops_uid = $xoops_user_Row['uid']; 110 } 111 return $xoops_uid; 112 } else { // load XPressME or not Load XOOPS 113 $xoops_user_tbl = get_xoops_prefix() . 'users'; 114 $xoops_uid = $xoops_db->get_var("SELECT uid FROM $xoops_user_tbl WHERE uname = '$name' AND email = '$email'"); 115 if (empty($xoops_uid)) return 0; 116 return $xoops_uid; 117 } 118 } 119 } 120 93 121 ?>
Note: See TracChangeset
for help on using the changeset viewer.