Example #1
0
             $filemtime = filemtime($entrydir);
             while ($f = $d->read()) {
                 if (preg_match('/^discuz\\_plugin\\_' . $entry . '(\\_\\w+)?\\.xml$/', $f)) {
                     $entrytitle = $entry;
                     $entryversion = $entrycopyright = '';
                     if (file_exists($entrydir . '/discuz_plugin_' . $entry . '.xml')) {
                         $importtxt = @implode('', file($entrydir . '/discuz_plugin_' . $entry . '.xml'));
                         $pluginarray = getimportdata('Discuz! Plugin', 1, 1);
                         if (!empty($pluginarray['plugin']['name'])) {
                             $entrytitle = dhtmlspecialchars($pluginarray['plugin']['name']);
                             $entryversion = dhtmlspecialchars($pluginarray['plugin']['version']);
                             $entrycopyright = dhtmlspecialchars($pluginarray['plugin']['copyright']);
                         }
                     }
                     $file = $entrydir . '/' . $f;
                     showtablerow('class="hover"', array('width="40%"', '', 'align="right"'), array('<img src="' . cloudaddons_pluginlogo_url($entry) . '.png" onerror="this.src=\'static/image/admincp/plugin_logo.png\';this.onerror=null" width="40" height="40" align="left" style="margin:0 5px 0 30px" />' . $entrytitle . ' ' . $entryversion . ($filemtime > TIMESTAMP - 86400 ? ' <font color="red">New!</font>' : '') . '<br />' . '<span class="sml">' . $entry . '</span>', $entrycopyright, '<a href="' . ADMINSCRIPT . '?action=plugins&operation=import&dir=' . $entry . '" class="bold act">' . $lang['plugins_config_install'] . '</a>'));
                     break;
                 }
             }
         }
     }
     showsubmit();
     showtablefooter();
     echo '<br />';
 } else {
     cloudaddons_validator($_G['gp_dir'] . '.plugin');
     if (!isset($_G['gp_dir'])) {
         $pluginarray = getimportdata('Discuz! Plugin');
     } elseif (!isset($_G['gp_installtype'])) {
         $pdir = DISCUZ_ROOT . './source/plugin/' . $_G['gp_dir'];
         $d = dir($pdir);
Example #2
0
                         $pluginids[$func[0]] = $func[0];
                     }
                     if (in_array($plugin['identifier'], $pluginids) && count($pluginids) > 1) {
                         unset($pluginids[$plugin['identifier']]);
                         foreach ($pluginids as $pluginid) {
                             $exists[$pluginid][$k . $funcname] = $k . $funcname;
                         }
                     }
                 }
             }
         }
     }
     if ($exists) {
         $plugins = array();
         foreach (C::t('common_plugin')->fetch_all_by_identifier(array_keys($exists)) as $plugin) {
             $plugins[] = '<b>' . $plugin['name'] . '</b>:' . '&nbsp;<a href="javascript:;" onclick="display(\'conflict_' . $plugin['identifier'] . '\')">' . cplang('plugins_conflict_view') . '</a>' . '&nbsp;<a href="' . cloudaddons_pluginlogo_url($plugin['identifier']) . '" target="_blank">' . cplang('plugins_conflict_info') . '</a>' . '<span id="conflict_' . $plugin['identifier'] . '" style="display:none"><br />' . implode(',', $exists[$plugin['identifier']]) . '</span>';
         }
         $conflictplugins = '<div align="left" style="margin: auto 100px; border: 1px solid #DEEEFA;padding: 4px;line-height: 25px;">' . implode('<br />', $plugins) . '</div>';
     }
 }
 $available = $operation == 'enable' ? 1 : 0;
 C::t('common_plugin')->update($_GET['pluginid'], array('available' => $available));
 updatecache(array('plugin', 'setting', 'styles'));
 cleartemplatecache();
 updatemenu('plugin');
 if ($operation == 'enable') {
     if (!$conflictplugins) {
         cpmsg('plugins_enable_succeed', 'action=plugins' . (!empty($_GET['system']) ? '&system=1' : ''), 'succeed');
     } else {
         cpmsg('plugins_conflict', 'action=plugins' . (!empty($_GET['system']) ? '&system=1' : ''), 'succeed', array('plugins' => $conflictplugins));
     }
Example #3
0
						if(in_array($plugin['identifier'], $pluginids) && count($pluginids) > 1) {
							unset($pluginids[$plugin['identifier']]);
							foreach($pluginids as $pluginid) {
								$exists[$pluginid][$k.$funcname] = $k.$funcname;
							}
						}
					}
				}
			}
		}
		if($exists) {
			$plugins = array();
			foreach(C::t('common_plugin')->fetch_all_by_identifier(array_keys($exists)) as $plugin) {
				$plugins[] = '<b>'.$plugin['name'].'</b>:'.
					'&nbsp;<a href="javascript:;" onclick="display(\'conflict_'.$plugin['identifier'].'\')">'.cplang('plugins_conflict_view').'</a>'.
					'&nbsp;<a href="'.cloudaddons_pluginlogo_url($plugin['identifier']).'" target="_blank">'.cplang('plugins_conflict_info').'</a>'.
					'<span id="conflict_'.$plugin['identifier'].'" style="display:none"><br />'.implode(',', $exists[$plugin['identifier']]).'</span>';
			}
			$conflictplugins = '<div align="left" style="margin: auto 100px; border: 1px solid #DEEEFA;padding: 4px;line-height: 25px;">'.implode('<br />', $plugins).'</div>';
		}
	}
	$available = $operation == 'enable' ? 1 : 0;
	C::t('common_plugin')->update($_GET['pluginid'], array('available' => $available));
	updatecache(array('plugin', 'setting', 'styles'));
	cleartemplatecache();
	updatemenu('plugin');
	if($operation == 'enable') {
		if(!$conflictplugins) {
			cpmsg('plugins_enable_succeed', 'action=plugins'.(!empty($_GET['system']) ? '&system=1' : ''), 'succeed');
		} else {
			cpmsg('plugins_conflict', 'action=plugins'.(!empty($_GET['system']) ? '&system=1' : ''), 'succeed', array('plugins' => $conflictplugins));
Example #4
0
                //				}
                //dump($nodes1);
                //file_put_contents (MOKUAI_DIR."/".$mk."/".$kk."/node.xml",diconv(array2xml($nodes1, 1),"UTF-8", $_G['charset']."//IGNORE"));
                $ico = '';
                if ($subrow['ico'] != '') {
                    $ico = str_replace('{STATICURL}', STATICURL, $subrow['ico']);
                    if (!preg_match("/^" . preg_quote(STATICURL, '/') . "/i", $ico) && !(($valueparse = parse_url($ico)) && isset($valueparse['host']))) {
                        $ico = $_G['setting']['attachurl'] . 'common/' . $subrow['ico'] . '?' . random(6);
                    }
                }
                $op_text = ($kk != $row['currentversion'] ? "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&subop=currentver&biaoshi={$mk}&version={$kk}\" >" . lang('plugin/yiqixueba', 'version') . "</a>" : '<span class="bold">' . lang('plugin/yiqixueba', 'version') . '</span>') . "&nbsp;&nbsp;";
                $op_text .= "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&subop=mokuaiedit&biaoshi={$mk}&version={$kk}\" >" . lang('plugin/yiqixueba', 'edit') . "</a>&nbsp;&nbsp;";
                $op_text .= '<a href="plugin.php?id=yiqixueba&mokuai=server&submod=mokuaiplay&biaoshi=' . $mk . '&version=' . $row['currentversion'] . '" target="_blank">' . $lang['detail'] . '</a>&nbsp;&nbsp;';
                $op_text .= !$subrow['available'] ? "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&subop=mokuainode&biaoshi={$mk}&version={$kk}\" >" . lang('plugin/yiqixueba', 'mokuainode') . "</a>&nbsp;&nbsp;" : '';
                $op_text .= !$subrow['available'] && $subrow['template'] ? "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&ptype=source&subop=templatelist&biaoshi={$mk}&version={$kk}\" >" . lang('plugin/yiqixueba', 'templatelist') . "</a>" : '';
                showtablerow('', array('class="td25"', 'class="td25"', 'style="width:300px"', 'style="width:45px"', '', 'class="td25"'), array('<input class="checkbox" type="checkbox" name="delete[]" value="' . $mk . '_' . $kk . '">', "<div class=\"board\">&nbsp;</div>", "<input type=\"text\" class=\"txt\" size=\"15\" name=\"vernamenew[{$kk}]\" value=\"" . $kk . "\" readonly=\"readonly\">", $ico ? '<img src="' . $ico . '" width="40" height="40" align="left" style="margin-right:5px" />' : '<img src="' . cloudaddons_pluginlogo_url($mk) . '" onerror="this.src=\'static/image/admincp/plugin_logo.png\';this.onerror=null" width="40" height="40" align="left" />', $op_text . '<br />' . lang('plugin/yiqixueba', 'price:') . $subrow['price'] . lang('plugin/yiqixueba', 'rmb'), '<input class="checkbox" type="checkbox"  name="statusnew[' . $mk . '_' . $kk . ']" value="1" ' . ($subrow['available'] ? ' checked="checked"' : '') . ' />'));
            }
            showtagfooter('tbody');
        }
        echo '<tr><td colspan="1"></td><td colspan="8"><div><a href="###" onclick="addrow(this, 0, 0)" class="addtr">' . lang('plugin/yiqixueba', 'add_mokuai') . '</a></div></td></tr>';
        showsubmit('submit', 'submit', 'del');
        showtablefooter();
        showformfooter();
        echo <<<EOT
<script type="text/JavaScript">
\tvar rowtypedata = [
\t\t[[1, '', 'td25'], [1,'<input name="newdisplayorder[]" value="0" size="3" type="text" class="txt">', 'td25'], [1, '<input name="newbiaoshi[]" value="" size="15" type="text" class="txt"><input name="newname[]" value="" size="15" type="text" class="txt">'],[3,'']],
\t\t[[1, '', 'td25'], [1,'<div class=\\"board\\">&nbsp;</div>', 'td25'], [1, '<input name="newverbiaoshi[]" value="" size="15" type="text" class="txt"><input type="hidden" name="newupbiaoshi[]" value="{1}" />'], [3,'']]
\t];
</script>
EOT;
Example #5
0
}
if ($subop == 'list') {
    showtips(lang('plugin/yiqixueba', 'mokuai_list_tips'));
    showformheader($this_page . '&subop=list');
    showtableheader(lang('plugin/yiqixueba', 'mokuai_list'));
    showsubtitle(array('', lang('plugin/yiqixueba', 'mokuai_name'), lang('plugin/yiqixueba', 'mokuai_version'), lang('plugin/yiqixueba', 'mokuai_price'), lang('plugin/yiqixueba', 'mokuai_installtime'), lang('plugin/yiqixueba', 'status'), ''));
    foreach (C::t(GM('main_mokuai'))->range() as $k => $row) {
        unset($mokuai_info[$row['biaoshi']][$row['version']]);
        if (!count($mokuai_info[$row['biaoshi']])) {
            unset($mokuai_info[$row['biaoshi']]);
        }
        showtablerow('', array('class="td25"', 'style="width:120px"', 'class="td28"', '', '', '', ''), array('<img src="' . cloudaddons_pluginlogo_url($row['biaoshi']) . '" onerror="this.src=\'static/image/admincp/plugin_logo.png\';this.onerror=null" width="40" height="40" align="left" />', '<span class="bold">' . $row['name'] . '-V' . $row['version'] . '</span>', $row['description'], $row['price'], dgmdate($row['createtime'], 'dt'), ($row['available'] ? "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&subop=close&mokuaiid={$row['mokuaiid']}\" >{$lang['closed']}</a>" : "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&subop=open&mokuaiid={$row['mokuaiid']}\">{$lang['enable']}</a>") . "&nbsp;&nbsp;" . (intval(end(array_keys($mokuai_info[$row['biaoshi']]))) > intval($row['version']) ? "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&subop=update&mokuaiid={$row['mokuaiid']}\">{$lang['plugins_config_upgrade']}</a>&nbsp;&nbsp;" : '') . "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&subop=uninstall&mokuaiid={$row['mokuaiid']}\">{$lang['plugins_config_uninstall']}</a>&nbsp;&nbsp;"));
    }
    foreach ($mokuai_info as $k => $v) {
        $row = end($v);
        $key = end(array_keys($v));
        showtablerow('', array('class="td25"', 'style="width:120px"', 'class="td28"', '', '', '', ''), array('<img src="' . cloudaddons_pluginlogo_url($k) . '" onerror="this.src=\'static/image/admincp/plugin_logo.png\';this.onerror=null" width="40" height="40" align="left" />', '<span class="bold">' . $row['name'] . '-V' . $key . '</span>', $row['description'], $row['price'] ? $row['price'] . lang('plugin/yiqixueba', 'rmb') : lang('plugin/yiqixueba', 'mianfei'), '', "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&subop=install&mokuainame=" . $k . "_" . $key . "\">{$lang['plugins_config_install']}</a>"));
    }
    showtablefooter();
    showformfooter();
} elseif ($subop == 'install') {
    $data['mokuai'] = getgpc('mokuainame');
    $installmokuai = api_indata('server_installmokuai', $data);
    dump($installmokuai);
}
$data = array('biaoshi' => 'server', 'version' => '1.0', 'available' => 1, 'createtime' => time(), 'updatetime' => '', 'displayorder' => 0, 'name' => '服务端', 'price' => 50000, 'description' => '平台的模块设计部分');
//C::t(GM('main_mokuai'))->insert($data);
?>