- Timestamp:
- Apr 30, 2010, 12:21:02 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php
r591 r592 302 302 if ($value === 'none'){ 303 303 $xoops_db->query( "UPDATE ".$d3forum_forum_tbl ." SET forum_external_link_format='' WHERE forum_id= $d3f_forum_id" ) ; 304 $this->D3forum_user_access_set($this->d3forum_module_dir,$this->d3forum_forum_id, 0); 304 305 } else { 305 306 $d3f_set = explode('|', $value); 306 307 if ($this->d3forum_module_dir !== $d3f_set[1] || $this->d3forum_forum_id !== $d3f_set[2]){ 307 308 $xoops_db->query( "UPDATE ".$d3forum_forum_tbl ." SET forum_external_link_format='' WHERE forum_id= $d3f_forum_id" ) ; 309 $this->D3forum_user_access_set($this->d3forum_module_dir,$this->d3forum_forum_id, 0); 308 310 } 309 311 } … … 318 320 $forum_external_link_format = addslashes($this->d3forum_external_link_format); 319 321 $xoops_db->query( "UPDATE ".$d3forum_forum_tbl ." SET forum_external_link_format='".$forum_external_link_format."' WHERE forum_id= $d3f_forum_id" ) ; 322 $this->D3forum_user_access_set($this->d3forum_module_dir,$this->d3forum_forum_id,1); 323 324 } 325 326 function D3forum_user_access_set($forum_module_dir,$forum_id,$accsess = 0){ 327 global $xoops_db ,$user_login; 328 329 $user_id = get_xoops_user_id($user_login); 330 $d3forum_forum_access_tbl = get_xoops_prefix() . $this->d3forum_module_dir ."_forum_access"; 331 if (!$accsess){ 332 $sql = "DELETE FROM $d3forum_forum_access_tbl WHERE forum_id = $forum_id AND uid = $user_id"; 333 $xoops_db->query($sql); 334 } else { 335 $sql = "SELECT * FROM $d3forum_forum_access_tbl WHERE forum_id = $forum_id AND uid = $user_id"; 336 $row = $xoops_db->get_row($sql); 337 if (!$row){ 338 $sql = "INSERT INTO $d3forum_forum_access_tbl "; 339 $sql .= "(forum_id, uid, can_post, can_edit, can_delete, post_auto_approved, is_moderator) "; 340 $sql .= "VALUES "; 341 $sql .= "($forum_id, $user_id, 1, 1, 1, 1, 1)"; 342 $xoops_db->query($sql); 343 } 344 } 320 345 } 321 346
Note: See TracChangeset
for help on using the changeset viewer.