</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>
<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>
$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>
<?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>
$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>
<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>
}
function gmc_doConversion() {
- global $HTTP_POST_VARS;
+ global $HTTP_POST_VARS, $manager;
// 1. get all data
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;
}
}
// 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++)
// {{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",
// 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");
// 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)%>";
}