Changeset 4097
- Timestamp:
- 08/14/07 14:41:41 (3 years ago)
- Location:
- trunk
- Files:
-
- 1 removed
- 3 modified
-
lib/plugins.php (modified) (2 diffs)
-
plugins/MT_Meta_RecentPS_Default/index.php (modified) (7 diffs)
-
plugins/MT_Meta_RecentPS_Default/index.xml (modified) (1 diff)
-
plugins/MT_RecentPS_Default (deleted)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/plugins.php
r4008 r4097 726 726 function radioTreat( $cmd, $dfVal, $name) { 727 727 $DSP = ''; 728 $cnt = 0; 728 729 $df = empty( $dfVal[$name]) ? NULL :$dfVal[$name]; 729 730 foreach( $cmd['op'] as $option ) { 731 $cnt++; 730 732 $DSP .= TAB.TAB.TAB.TAB.'<input type="radio" class="radiocontrol" '; 731 $DSP .= ' name="'.$name.'" ';733 $DSP .= ' name="'.$name.'" id="'.$name.$cnt.'" '; 732 734 $oc = empty( $option['.attributes']['checked'] ) ? NULL: $option['.attributes']['checked']; 733 735 $DSP .= !is_string( $option['.attributes']['value'] ) ? '' : 'value="'.htmlspecialchars($option['.attributes']['value']).'" '; … … 735 737 $DSP .= is_string($df) && (!is_string( $option['.attributes']['value'] ) ? false : $option['.attributes']['value']== $df ) ? 'checked="checked" ' : ''; 736 738 $DSP .= ' />' ; 737 $DSP .= "<label class='radiolabel' for='".$name. "'>{$option['.value']}</label >".CRLF;739 $DSP .= "<label class='radiolabel' for='".$name.$cnt."'>{$option['.value']}</label >".CRLF; 738 740 } 739 741 return $DSP; -
trunk/plugins/MT_Meta_RecentPS_Default/index.php
r4073 r4097 1 1 <?php 2 2 function MT_Meta_getRecentEntries($parameters){ 3 global $database,$blog,$serviceURL; 4 $blogid = getBlogId(); 3 global $database,$blog,$serviceURL,$configVal; 5 4 requireComponent('Textcube.Core'); 6 5 requireComponent('Needlworks.Cache.PageCache'); 6 requireComponent('Textcube.Function.misc'); 7 7 requireModel("blog.entry"); 8 8 requireModel("blog.tag"); 9 $data = misc::fetchConfigVal($configVal); 10 $data['metaMode'] = !isset($data['metaMode'])?1:$data['metaMode']; 11 9 12 if (isset($parameters['preview'])) { 10 13 // preview mode … … 18 21 @chmod(ROOT."/cache/thumbnail", 0777); 19 22 } 20 if (!is_dir(ROOT."/cache/thumbnail/" .$blogid)) {21 @mkdir(ROOT."/cache/thumbnail/" .$blogid);22 @chmod(ROOT."/cache/thumbnail/" .$blogid, 0777);23 if (!is_dir(ROOT."/cache/thumbnail/" . getBlogId())) { 24 @mkdir(ROOT."/cache/thumbnail/" . getBlogId()); 25 @chmod(ROOT."/cache/thumbnail/" . getBlogId(), 0777); 23 26 } 24 if (!is_dir(ROOT."/cache/thumbnail/ {$blogid}/metaPostThumbnail/")) {25 @mkdir(ROOT."/cache/thumbnail/ {$blogid}/metaPostThumbnail/");26 @chmod(ROOT."/cache/thumbnail/ {$blogid}/metaPostThumbnail/", 0777);27 if (!is_dir(ROOT."/cache/thumbnail/" . getBlogId() . "/metaPostThumbnail/")) { 28 @mkdir(ROOT."/cache/thumbnail/" . getBlogId() . "/metaPostThumbnail/"); 29 @chmod(ROOT."/cache/thumbnail/" . getBlogId() . "/metaPostThumbnail/", 0777); 27 30 } 28 31 … … 33 36 } else { 34 37 $visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 0 AND (c.visibility > 1 OR e.category = 0)'; 38 $multiple = ($data['metaMode']==2) ? '' : 'e.blogid = ' . getBlogId() . ' AND'; 35 39 $entries = DBQuery::queryAll("SELECT e.blogid, e.id, e.userid, e.title, e.content, e.slogan, e.category, e.published, c.label 36 40 FROM {$database['prefix']}Entries e 37 41 LEFT JOIN {$database['prefix']}Categories c ON e.blogid = c.blogid AND e.category = c.id 38 WHERE e.draft = 0 $visibility AND e.category >= 042 WHERE $multiple e.draft = 0 $visibility AND e.category >= 0 39 43 ORDER BY published DESC LIMIT $entryLength"); 40 44 … … 42 46 foreach ($entries as $entry){ 43 47 $tagLabelView = ""; 44 $entryTags = getTags($entry['blogid'], $entry['id']); 45 $defaultURL = getDefaultURL($entry['blogid']); 48 $blogid = ($data['metaMode']==2) ? $entry['blogid'] : getBlogId(); 49 $entryTags = getTags($blogid, $entry['id']); 50 $defaultURL = getDefaultURL($blogid); 46 51 if (sizeof($entryTags) > 0) { 47 52 $tags = array(); … … 57 62 $html .= '<div class="metapost">'.CRLF; 58 63 if($imageName = MT_Meta_getAttachmentExtract($entry['content'])){ 59 if($tempImageSrc = MT_Meta_getImageResizer($ imageName)){64 if($tempImageSrc = MT_Meta_getImageResizer($blogid, $imageName)){ 60 65 $html .= '<div class="img_preview" style="background:url('.$tempImageSrc.') top center no-repeat #ffffff;\"><img src="'.$serviceURL.'/image/spacer.gif" alt="" onclick="window.location.href=\''.$permalink.'\'; return false;" /></div>'.CRLF; 61 66 } … … 89 94 } 90 95 91 function MT_Meta_getImageResizer($ filename){96 function MT_Meta_getImageResizer($blogid, $filename){ 92 97 global $defaultURL; 93 $blogid = getBlogId();94 98 requireComponent('Textcube.Function.Image'); 95 99 96 100 $imagePath = ROOT . "/attach/{$blogid}/{$filename}"; 97 $savePath = ROOT . "/cache/thumbnail/ {$blogid}/metaPostThumbnail/th_{$filename}";98 $srcPath = "{$defaultURL}/thumbnail/ {$blogid}/metaPostThumbnail/th_{$filename}";101 $savePath = ROOT . "/cache/thumbnail/" . getBlogId() . "/metaPostThumbnail/th_{$filename}"; 102 $srcPath = "{$defaultURL}/thumbnail/" . getBlogId() . "/metaPostThumbnail/th_{$filename}"; 99 103 100 104 if(file_exists($imagePath)){ … … 138 142 return $target; 139 143 } 144 145 function MT_Meta_getRecentEntries_DataSet($DATA){ 146 requireComponent('Textcube.Function.misc'); 147 requireComponent('Needlworks.Cache.PageCache'); 148 $cfg = misc::fetchConfigVal($DATA); 149 150 $cache = new PageCache; 151 $cache->name = 'MT_Meta_RecentPS'; 152 $cache->purge(); 153 return true; 154 } 155 156 function MT_Meta_getRecentEntries_ConfigOut_ko($plugin) { 157 global $service; 158 159 $manifest = NULL; 160 161 $manifest .= '<?xml version="1.0" encoding="utf-8"?>'.CRLF; 162 $manifest .= '<config dataValHandler="MT_Meta_getRecentEntries_DataSet" >'.CRLF; 163 $manifest .= ' <window width="500" height="244" />'.CRLF; 164 $manifest .= ' <fieldset legend="메타 출력 설정">'.CRLF; 165 $manifest .= ' <field title="출력 형태 :" name="metaMode" type="radio" >'.CRLF; 166 $manifest .= ' <op value="1" checked="checked"><![CDATA[단일 사용자 ]]></op>'.CRLF; 167 $manifest .= ' <op value="2">다중 사용자</op>'.CRLF; 168 $manifest .= ' </field>'.CRLF; 169 $manifest .= ' </fieldset>'.CRLF; 170 $manifest .= '</config>'.CRLF; 171 172 return $manifest; 173 } 174 175 function MT_Meta_getRecentEntries_ConfigOut_en($plugin) { 176 global $service; 177 178 $manifest = NULL; 179 180 $manifest .= '<?xml version="1.0" encoding="utf-8"?>'.CRLF; 181 $manifest .= '<config dataValHandler="MT_Meta_getRecentEntries_DataSet" >'.CRLF; 182 $manifest .= ' <window width="500" height="244" />'.CRLF; 183 $manifest .= ' <fieldset legend="Meta list setup">'.CRLF; 184 $manifest .= ' <field title="List mode :" name="metaMode" type="radio" >'.CRLF; 185 $manifest .= ' <op value="1" checked="checked"><![CDATA[Single user ]]></op>'.CRLF; 186 $manifest .= ' <op value="2">Multi user</op>'.CRLF; 187 $manifest .= ' </field>'.CRLF; 188 $manifest .= ' </fieldset>'.CRLF; 189 $manifest .= '</config>'.CRLF; 190 191 return $manifest; 192 } 140 193 ?> -
trunk/plugins/MT_Meta_RecentPS_Default/index.xml
r3991 r4097 31 31 </params> 32 32 </metapage> 33 <config xml:lang="ko" dataValHandler="MT_Meta_getRecentEntries_DataSet" manifestHandler="MT_Meta_getRecentEntries_ConfigOut_ko"> 34 <window width="500" height="244" /> 35 </config> 36 <config xml:lang="en" dataValHandler="MT_Meta_getRecentEntries_DataSet" manifestHandler="MT_Meta_getRecentEntries_ConfigOut_en"> 37 <window width="500" height="244" /> 38 </config> 33 39 </binding> 34 40 </plugin>
