OSDN Git Service

ADD/FIX/CHANGE/REMOVE: スキン・テンプレート表示処理の改良
[nucleus-jp/nucleus-next.git] / nucleus / convert / greymatter.php
index c4529a2..30367f0 100644 (file)
@@ -103,7 +103,7 @@ function gmc_askGreyPath() {
                </p>
 
                <ul>
-                       <li>GreyMatter path: <input name="grey_scriptpath" size="60" value="<?php echo ENTITY::hsc($guess)?>" /></li>
+                       <li>GreyMatter path: <input name="grey_scriptpath" size="60" value="<?php echo Entity::hsc($guess)?>" /></li>
                </ul>
 
                <p>
@@ -177,14 +177,14 @@ while ($author = fgets($filehandle,4096)) {
                <tr>
                        <td>
                                <b><?php echo $a_name?></b>
-                               <input name="author[<?php echo $idx?>]" value="<?php echo ENTITY::hsc($a_name)?>" type="hidden"
+                               <input name="author[<?php echo $idx?>]" value="<?php echo Entity::hsc($a_name)?>" type="hidden" />
                        </td>
                        <td>
                <?php                   // TODO: avoid doing this query multiple times
                        $query =  'SELECT mname as text, mnumber as value FROM '.sql_table('member');
 
                        $template['name'] = 'memberid[' . $idx . ']';
-                       showlist($query,'select',$template);
+                       echo showlist($query,'select',$template);
                ?>
                        </td>
                        <td>
@@ -209,7 +209,7 @@ fclose($filehandle);
                                        $query =  'SELECT mname as text, mnumber as value FROM '.sql_table('member');
 
                                        $template['name'] = 'memberid[0]';
-                                       showlist($query,'select',$template);
+                                       echo showlist($query,'select',$template);
                                ?>
                        </td>
                        <td>
@@ -231,7 +231,7 @@ fclose($filehandle);
                        <?php                                   $query =  'SELECT bname as text, bnumber as value FROM '.sql_table('blog');
                                        $template['name'] = 'blogid';
                                        $template['selected'] = $CONF['DefaultBlog'];
-                                       showlist($query,'select',$template);
+                                       echo showlist($query,'select',$template);
                        ?>
                </div>
                <div>
@@ -243,7 +243,7 @@ fclose($filehandle);
                                        $query =  'SELECT mname as text, mnumber as value FROM '.sql_table('member');
 
                                        $template['name'] = 'newowner';
-                                       showlist($query,'select',$template);
+                                       echo showlist($query,'select',$template);
                                ?>
                                </li>
                        </ul>
@@ -252,9 +252,9 @@ fclose($filehandle);
                <h1>Do the conversion!</h1>
                <p>
                <input type="hidden" name="authorcount" value="<?php echo $idx?>" />
-               <input type="hidden" name="grey_scriptpath" value="<?php echo ENTITY::hsc($grey_scriptpath)?>" />
-               <input type="hidden" name="grey_datapath" value="<?php echo ENTITY::hsc($grey_datapath)?>" />
-               <input type="hidden" name="grey_dataurl" value="<?php echo ENTITY::hsc($grey_dataurl)?>" />
+               <input type="hidden" name="grey_scriptpath" value="<?php echo Entity::hsc($grey_scriptpath)?>" />
+               <input type="hidden" name="grey_datapath" value="<?php echo Entity::hsc($grey_datapath)?>" />
+               <input type="hidden" name="grey_dataurl" value="<?php echo Entity::hsc($grey_dataurl)?>" />
                <input type="submit" value="Do the conversion!" />
                <input type="hidden" name="action" value="doConversion" />
                </p>
@@ -266,7 +266,7 @@ fclose($filehandle);
 }
 
 function gmc_doConversion() {
-       global $HTTP_POST_VARS;
+       global $HTTP_POST_VARS, $manager;
 
        // 1. get all data
 
@@ -325,9 +325,9 @@ function gmc_doConversion() {
        if ($createnew == 1) {
                // choose unique name
                $shortname = 'greymatter';
-               if (BLOG::exists($shortname)) {
+               if (Blog::exists($shortname)) {
                        $idx = 1;
-                       while (BLOG::exists($shortname . $idx))
+                       while (Blog::exists($shortname . $idx))
                                $idx++;
                        $shortname = $shortname . $idx;
                }
@@ -337,7 +337,7 @@ function gmc_doConversion() {
        }
 
        // add authors to blog team
-       $blog = new BLOG($nucleus_blogid);
+       $blog =& $manager->getBlog($nucleus_blogid);
        global $catid;
        $catid = $blog->getDefaultCategory();
        for ($i=0;$i<$authorcount;$i++)
@@ -476,7 +476,7 @@ function gm_parsecommands($text, $authorid ) {
        // {{email address text}}
        // {{emailmo address text|mouseover text}}
        // {{popup
-       if (strstr($text,"{{link") || stristr($text,"{{email") || stristr($text,"{{popup")) {
+       if (i18n::strpos($text,"{{link") !== FALSE || stristr($text,"{{email") || stristr($text,"{{popup")) {
                $to_replace = array(
                        "/({{linkmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/ies",
                        "/({{link) (http|https|ftp)(:\/\/\S+?)(}})/is",
@@ -524,9 +524,9 @@ function gm_linkmo($url, $mouseover, $text) {
 
 // converts GM {{popup command into a link to the image
 function gm_popup($filename, $authorid, $text, $width, $height) {
-       global $grey_datapath;
+       global $grey_datapath, $manager;
 
-       $res = MEDIA::addMediaObject(MEMBER::createFromID($authorid), "$grey_datapath$filename", $filename);
+       $res = Media::addMediaObject($manager->getMember($authorid), "$grey_datapath$filename", $filename);
 
        if ($res != "")
                die("error copying media files: $res");
@@ -534,7 +534,7 @@ function gm_popup($filename, $authorid, $text, $width, $height) {
        // TODO: copy file to media directory
        // TODO: create %popup(...)% code instead
 
-       $text = ENTITY::hsc(stripslashes($text));
+       $text = Entity::hsc(stripslashes($text));
 
        return "<%popup($filename|$width|$height|$text)%>";
 }