
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: forum_attachment.php 23252 2011-06-28 09:34:48Z monkey $
 */
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}
$do=$_GET['do'];
if($do=='savenote'){
	if($space['self']){
		$data=trim($_POST['note']);
		$idtype=trim($_GET['idtype']);
		$typeid=intval($_GET['typeid']);
		//echo $data;
		DB::insert('dzz_plugin_note',daddslashes(array('uid'=>$space['uid'],'username'=>$space['username'],'typeid'=>$typeid,'idtype'=>$idtype,'note'=>$data,'style'=>$_POST['style'],'dateline'=>$_G['timestamp'])),1,1);
	}
	exit;

}elseif($do=='getnote'){
	$idtype=trim($_GET['idtype']);
	$typeid=intval($_GET['typeid']);
	$pluginarr=DB::fetch_first("select * from ".DB::table('dzz_plugin_note')." where uid='{$space[uid]}' and idtype='{$idtype}' and typeid='{$typeid}'");
	if(strpos($pluginarr['style'],'note-sttle-')===false) $pluginarr['style']='note-style-1';
	echo $playlist=json_encode($pluginarr);
	exit();
}else{
	
	if(!$plugin=DB::fetch_first("select * from ".DB::table('dzz_plugin')." where identifier='{$identifier}'")){
		showmessage('plugin_nonexistence');
	}
	if($plugin['available']<1){
		exit(dzzlang('message','plugin_closed'));
	}
	define('PLUGIN_ROOT','dzz/plugin/'.$plugin['directory']);
	
	include dzztemplate($identifier.':index');
}
?>
