XPressME Integration Kit

Trac


Ignore:
Timestamp:
Apr 30, 2010, 10:15:18 AM (14 years ago)
Author:
toemon
Message:

D3Forumコメント統合のForum選択から、既に他で選択済みのforumを省く。統合先を変更した場合、や統合なしに変更したとき以前の統合先のD3Forum「コメント統合時の参照方法」をクリアする。 #340

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php

    r590 r591  
    293293        } 
    294294         
     295        function D3Forum_old_Link_clear($value = null){ 
     296                global $xpress_config,$xoops_db; 
     297                if ($this->is_use_d3forum){ 
     298                        $d3forum_forum_tbl = get_xoops_prefix() . $this->d3forum_module_dir ."_forums"; 
     299                        $d3forum_external_link_format = ''; 
     300                        $d3f_forum_id = $this->d3forum_forum_id; 
     301                         
     302                        if ($value === 'none'){ 
     303                                $xoops_db->query( "UPDATE ".$d3forum_forum_tbl ." SET forum_external_link_format='' WHERE forum_id= $d3f_forum_id" ) ; 
     304                        } else { 
     305                                $d3f_set = explode('|', $value); 
     306                                if ($this->d3forum_module_dir !== $d3f_set[1] || $this->d3forum_forum_id !== $d3f_set[2]){ 
     307                                        $xoops_db->query( "UPDATE ".$d3forum_forum_tbl ." SET forum_external_link_format='' WHERE forum_id= $d3f_forum_id" ) ; 
     308                                } 
     309                        } 
     310                } 
     311        } 
     312        function D3Forum_link_set(){ 
     313                global $xoops_db; 
     314 
     315                if (empty($this->is_use_d3forum)) return; 
     316                $d3forum_forum_tbl = get_xoops_prefix() . $this->d3forum_module_dir ."_forums"; 
     317                $d3f_forum_id = $this->d3forum_forum_id; 
     318                $forum_external_link_format = addslashes($this->d3forum_external_link_format); 
     319                $xoops_db->query( "UPDATE ".$d3forum_forum_tbl ." SET forum_external_link_format='".$forum_external_link_format."' WHERE forum_id= $d3f_forum_id" ) ; 
     320        } 
     321         
    295322        function ReadPostData($post_data = null) 
    296323        { 
     
    310337                                // post d3forum 
    311338                                if ($indedx === 'd3forum') { 
     339                                        $this->D3Forum_old_Link_clear($value); 
    312340                                        if ($value == 'none'){ 
    313341                                                $this->is_use_d3forum = false; 
     
    321349                                                $this->d3forum_forum_id = $d3f_set[2]; 
    322350                                                $this->d3forum_external_link_format = get_xpress_dir_name() . '::xpressD3commentContent'; 
     351                                                $this->D3Forum_link_set(); 
    323352                                        } 
    324353                                } else { //post other 
     
    656685                        $selected = ''; 
    657686                 
    658                 if (xpress_is_multiblog() && $multi_blog_use_d3forum) { 
     687                if (xpress_is_multiblog() && !$multi_blog_use_d3forum) { 
    659688                        $forum_list .= '<option value="none"' . $selected . '>' . __('WordPress MultiBlog cannot integrate the comments.', 'xpressme') . "</option>\n"; 
    660689                } else {         
     
    677706                                                $forums = $xoops_db->get_results($sql); 
    678707                                                foreach ($forums as $forum) { 
    679                                                         if (($module->dirname == $this->d3forum_module_dir) &&  ($forum->forum_id == $this->d3forum_forum_id)) 
     708                                                        if (($module->dirname == $this->d3forum_module_dir) &&  ($forum->forum_id == $this->d3forum_forum_id)){ 
    680709                                                                $selected = ' selected="selected"'; 
    681                                                         else 
     710                                                                $forum_div = 'forum|' . $module->dirname . '|' .  $forum->forum_id; 
     711                                                                $forum_select = "$module->name($module->dirname) $forum->cat_title-$forum->forum_title(ID=$forum->forum_id)"; 
     712                                                                $forum_list .= '<option value="' . $forum_div . '" ' . $selected . '>' . $forum_select . "</option>\n"; 
     713                                                        } else if (empty($forum->forum_external_link_format)){ 
    682714                                                                $selected = ''; 
    683                                                         $forum_div = 'forum|' . $module->dirname . '|' .  $forum->forum_id; 
    684                                                         $forum_select = "$module->name($module->dirname) $forum->cat_title-$forum->forum_title(ID=$forum->forum_id)"; 
    685                                                         $forum_list .= '<option value="' . $forum_div . '" ' . $selected . '>' . $forum_select . "</option>\n"; 
     715                                                                $forum_div = 'forum|' . $module->dirname . '|' .  $forum->forum_id; 
     716                                                                $forum_select = "$module->name($module->dirname) $forum->cat_title-$forum->forum_title(ID=$forum->forum_id)"; 
     717                                                                $forum_list .= '<option value="' . $forum_div . '" ' . $selected . '>' . $forum_select . "</option>\n"; 
     718                                                        } 
    686719                                                } 
    687720                                                break; 
Note: See TracChangeset for help on using the changeset viewer.