public static function header() { Debug::log("View->renderHeader:", __LINE__, __FUNCTION__, __CLASS__, __FILE__); Config::$PATH_LINK = RouterBase::$useLanguage == true ? Config::$PATH . Config::$LANGUAGE_ACTIVE . "/" : Config::$PATH; $headerHTML = ""; $headerHTML .= "<title>" . Config::$TITLE . "</title>"; $headerHTML .= "\n\t<script> \n\t <!-- \n\t"; $headerHTML .= "\n\t page = \"" . Config::$PATH . RouterBase::getRelativePath(20) . "/\";"; $headerHTML .= "\n\t PAGE = \"" . Config::$PATH . RouterBase::getRelativePath(20) . "/\";"; $headerHTML .= "\n\t PATH = \"" . Config::$PATH . "\";"; $headerHTML .= "\n\t PATH_LINK = \"" . Config::$PATH_LINK . "\";"; if (Config::$PATH != "") { $headerHTML .= "\n\t PATH = \"" . Config::$PATH . "\";"; } $headerHTML .= "\n\t // --> \n\t</script> \n"; /* $headerHTML .= "\n\t<script type=\"text/javascript\" src=\"". Config::$PATH ."js/jquery.js\"> </script>"; //$headerHTML .= "\n\t<script type=\"text/javascript\" src=\"". Config::$PATH ."js/functions.js\"></script>\n"; */ //$headerHTML .= self::$header_extras; $headerHTML .= "\n"; self::$header_default = $headerHTML; self::$header_default .= self::googleAnalytics(); echo self::$header_default; }
<?php if (!defined("__MAGIC__")) { exit; } $tbn = $this->TBN(); $tbn_write = Write::Inst()->TBN(); $sql_result = DB::Get()->Sql_query_list("\n\tSELECT \n\t\tA.*, \n\t\tB.wr_no,\n\t\tcount(A.bo_no) as cnt\n\tFROM `{$tbn}` A\n\tLEFT JOIN `{$tbn_write}` B ON A.bo_no=B.bo_no\n WHERE A.bo_kind=''\n\tGROUP BY A.bo_no\n"); foreach ($sql_result as $k => $v) { if ($v['wr_no'] == null) { $sql_result[$k]['cnt'] = 0; } }
$linkid = $this->db_conn(); $p_data = mysql_real_escape_string(nl2br(trim($get['p_data']))); $rslt_set = mysql_query($p_data, $linkid) or $this->print_error(mysql_error($linkid)); $rslt_arr = mysql_fetch_assoc($rslt_set); //mysql_query('alter table `oneapp_db`.`tbl_reminders` add column `remainder_name` varchar (150) NULL after `timestamp`,change `note_id` `content_id` varchar (100) NULL COLLATE latin1_swedish_ci'); //mysql_query('alter table `oneapp_db`.`generic_profile` change `slno` `sno` bigint (20) NOT NULL AUTO_INCREMENT;',$linkid); //mysql_query('alter table `oneapp_db`.`generic_profile` change `uid` `uid` bigint(20) NOT NULL UNIQUE;',$linkid); /*if(mysql_errno($linkid)) { $this->print_error(array("status"=>"error","response"=>mysql_error($linkid))); } else { $rslt_arr = array("affected_rows"=>mysql_affected_rows($linkid),"result"=>"User info has inserted."); }*/ $this->print_msg($rslt_arr); } } } //$get = ($_REQUEST); //print_r($get); $ob = new Write(); switch ($get['content_style']) { case 'single_content': if (!isset($get['module'])) { $ob->print_error(array("status" => "error", "response" => "Undefined content type.")); } $output = $ob->put_single_content_info($get); break; case 'table_actions': $output = $ob->table_actions($get); break; case 'list_content': if (!isset($get['module'])) { $ob->print_error(array("status" => "error", "response" => "Undefined content type.")); } $output = $ob->put_list_content_info($get);
if (!defined("__MAGIC__")) { exit; } /* * action파일 * action.*.php 파일은 Alert을 호출하지 않고 단순한 하나의 행동을하고 * 결과 값을 알려준다. * $result에 결과값을 저장해 줌 * -------------------------- */ if ($this->list) { $result = $this->list; } else { if ($this->wr_no && !$this->mb_no) { $this->list = $this->Sql('list_by_write', $this->wr_no); // 파일 내용중에 이미지를 검사하여 출력해준다. $data = Write::Inst()->Sql('fetch', $this->wr_no); preg_match_all("/<img[^>]*src=[\"']?([^>\"']+)[\"']?[^>]*>/i", $data['wr_content'], $imgtags); if ($imgtags[1][0]) { $subfolder = explode('/', $_SERVER['PHP_SELF']); $host = 'http://' . $_SERVER['HTTP_HOST'] . '/' . $subfolder[1]; $file_path = str_replace(array_shift(explode('?', $host)), '', $imgtags[1][0]); if (strpos('http', $file_path) === false) { $this->list_content_img = array('file_path' => $file_path); } } } else { $this->list = $this->Sql('list_by_member', $this->mb_no); } $result = $this->list; }
$dbn = parent::connecting(); $firstQ = self::getAssoc(); $stmtF = $dbn->prepare("SELECT ta.tattooId, COUNT(ta.tattooId) as count FROM tattoo_assoc ta WHERE ta.assocId IN ({$firstQ}) GROUP BY ta.tattooId"); $stmtF->execute(); $assoc = $stmtF->fetchAll(); foreach ($assoc as $row) { $arr[$row['tattooId']] = $row['count']; } $maxs = array_keys($arr, max($arr)); return $maxs; } public static function getTattoo() { $dbn = parent::connecting(); $twoQ = self::getTattoos(); $stmtUser = $dbn->prepare("SELECT * FROM tattoo WHERE id = {$twoQ['0']}"); $stmtUser->execute(); foreach ($stmtUser as $row) { $tattoo = array('name' => $row['name'], 'path' => $row['path']); } return $tattoo; } } if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (isset($_GET['word'])) { $data = Write::getTattoo(); echo json_encode($data); } else { echo json_encode("nonononon"); } }
<?php if (!defined('__MAGIC__')) { exit; } $data = Widget::Inst()->Action('data_explode', $this->wg_no); echo Write::Inst($data['skin'], 0, $data['wr_no'])->SetConfig('editor', 'name', $data['editor'])->SetConfig('editor', 'width', $data['editor_width'])->SetConfig('editor', 'height', $data['editor_height'])->html();
$data['editor_height'] = GV::String('editor_height'); if (!$data['editor_height']) { $data['editor_height'] = $view['editor_height']; } if (!$data['editor_height']) { $data['editor_height'] = $this->Config('editor_height'); } $this->data = $data; // 에디터 목록 $this->editor_list = Editor::Inst('')->SkinList(); $this->action = $this->Link('insert'); if ($this->wg_no) { $this->action = $this->Link('update', $this->wg_no); } /* * 페이지 게시판 스킨 목록 */ $skin_list = array(); $skin_list[] = array('name' => '스킨 선택'); foreach (Write::Inst()->SkinList('page') as $v) { if ($data['skin'] == $v['skin']) { $v['selected'] = 'selected'; } $skin_list[] = $v; } $this->skin_list = $skin_list; /* * 하단 버튼 링크생성 */ $this->btn_ok = Widget::Inst()->path_img('btn_ok.gif'); $this->btn_cancel = Widget::Inst()->path_img('btn_cancel.gif');
* version 1.0 * 사용자의 구미에 맞도록 초기설치 제어를 수행함 */ $cfg = array(); // 데이터베이스 정보 $cfg['dbinfo'] = array('host' => 'localhost', 'user' => '', 'password' => '', 'db' => '', 'prefix' => 'm3_'); // 관리자 정보 $cfg['admin_info'] = array('id' => 'admin', 'password' => '', 'password_confirm' => '', 'name' => '최고관리자'); // 홈페이지 기본정보 $cfg['hp_info'] = array('title' => '매직보드'); // data 폴더 목록 // '폴더명'=>'권한값' $cfg['data_folder'] = array(Path::data() => 0707, Path::data_file() => 0707, Path::data('cache') => 0707, Path::data('zmLog') => 0707, Path::data('zmLogConnect') => 0755, Path::data('cheditor') => 0707, Path::data_member() => 0707); // 설치 테이블 정보 // '테이블명'=>'설치모듈 인스턴스' $cfg['tables'] = array('magic' => Magic::Inst(), 'config' => Config::Inst(), 'write' => Write::Inst(), 'board' => Board::Inst(), 'file' => File::Inst(), 'comment' => Comment::Inst(), 'member' => Member::Inst(), 'tag' => Tag::Inst(), 'widget' => Widget::Inst()); /* * 메뉴구성 및 기본 컨텐츠 설정 $cfg['default_data'] = " kr:index =widget:page=write:index.html +메뉴얼:basic =widget:page=write=widget:webclip:sub_title+=widget:page ++영문홈페이지:basic =widget:page=write=widget:webclip:sub_title+=widget:page ++모바일홈페이지:basic =widget:page=write=widget:webclip:sub_title+=widget:page +게시판:basic =widget:page=write=widget:webclip:sub_title+=widget:page ++공지사항:basic =widget:page=write=widget:webclip:sub_title+=widget:write=board:공지 eng:index =widget:page=write:index.html +English Sample:basic =widget:page=write member:member
$this->action = $this->Link('update'); } /* * 게시판 목록 : 기존에 생성된 것 */ $board_list = array(); $board_list[] = array('bo_subject' => '게시판생성'); foreach (Board::Inst()->Sql('list') as $v) { if ($data['bo_no'] == $v['bo_no']) { $v['selected'] = 'selected'; } $board_list[] = $v; } $this->board_list = $board_list; /* * 게시판 스킨 목록 */ $skin_list = array(); $skin_list[] = array('name' => '게시판스킨 선택'); foreach (Write::Inst()->SkinList() as $v) { if ($data['skin'] == $v['skin']) { $v['selected'] = 'selected'; } $skin_list[] = $v; } $this->skin_list = $skin_list; /* * 하단 버튼 링크생성 */ $this->btn_ok = Widget::Inst()->path_img('btn_ok.gif'); $this->btn_cancel = Widget::Inst()->path_img('btn_cancel.gif');
public function testUnlock() { $result = true; $this->driver->expects($this->once())->method('fileUnlock')->with($this->resource)->will($this->returnValue($result)); $this->assertEquals($result, $this->file->unlock()); }
$this->action = $this->Link('update'); } /* * 게시판 목록 : 기존에 생성된 것 */ $board_list = array(); $board_list[] = array('bo_subject' => '블로그게시판 생성'); foreach (Board::Inst()->Sql('list') as $v) { if ($data['bo_no'] == $v['bo_no']) { $v['selected'] = 'selected'; } $board_list[] = $v; } $this->board_list = $board_list; /* * 게시판 스킨 목록 */ $skin_list = array(); $skin_list[] = array('name' => '블로그스킨 선택'); foreach (Write::Inst()->SkinList('blog') as $v) { if ($data['skin'] == $v['skin']) { $v['selected'] = 'selected'; } $skin_list[] = $v; } $this->skin_list = $skin_list; /* * 하단 버튼 링크생성 */ $this->btn_ok = Widget::Inst()->path_img('btn_ok.gif'); $this->btn_cancel = Widget::Inst()->path_img('btn_cancel.gif');
function Insert($data, $key = array()) { $ret = array(); // $data의 마지막에 + 기호가 있다면 앞의 결과($key)와 합쳐서 반환함 if (strpos($data, '+') !== false) { $ret[] = $key[0]; $data = substr($data, 0, -1); } $_data = explode(':', $data); // 타입에 맞도록 데이터 입력 switch ($_data[0]) { case 'widget': // 위젯 입력 $_clear['wg_skin'] = $_data[1]; $_clear['wg_width'] = '100'; $_clear['wg_width_unit'] = '%'; if ($_data[1] == 'page') { $_clear['wg_param'] = 'wr_no=' . $key[0] . '[]editor=cheditor[]editor_width=100%[]editor_height=500px'; } else { if ($_data[1] == 'write') { if ($_data[2] == 'mobile') { $_clear['wg_param'] = 'skin=mbasic[]img_width=500[]rows=20[]columns=wr_datetime|wr_subject|wr_writer|wr_hit[]use_comment=1[]show_notice=1[]bo_no=' . $key[0]; } else { $_clear['wg_param'] = 'skin=basic[]img_width=500[]rows=20[]columns=wr_datetime|wr_subject|wr_writer|wr_hit[]use_comment=1[]show_notice=1[]bo_no=' . $key[0]; } } else { if ($_data[1] == 'webclip') { $_clear['wg_param'] = 'skin=' . $_data[2]; } } } $ret[] = DB::Get()->InsertEx(Widget::Inst()->TBN(), $_clear); break; case 'write': // 게시글 입력 파일이 있다면 파일 내용을, 없다면 받은 키 값으로 위젯호출 구문을 적어넣는다 $_path = __DIR__ . '/page/' . $_data[1]; if (is_file($_path)) { $contents = addslashes(implode('', file($_path))); } else { $contents = ''; rsort($key); foreach ($key as $v) { $contents .= '[[Widget|' . $v . ']]'; } } $_clear['bo_no'] = 0; $_clear['wr_subject'] = 'page'; $_clear['wr_content'] = $contents; $ret[] = DB::Get()->InsertEx(Write::Inst()->TBN(), $_clear); break; case 'board': // 게시판 입력 $_clear['bo_subject'] = $_data[1]; $_clear['bo_editor'] = 'cheditor'; $ret[] = DB::Get()->InsertEx(Board::Inst()->TBN(), $_clear); break; } return $ret; }
<?php if (!defined("__MAGIC__")) { exit; } // 스킨 변경시 업데이트 $_POST['wg_skin'] = GV::String('wgSkin'); $data = Widget::Inst()->Action('data_explode', $this->wg_no); if (!$data['wr_no']) { // wr_no가 없으면 입력 // 게시글 입력 $tbn = Write::Inst()->TBN(); $clear = array(); $clear['mb_no'] = Member::Inst()->mb_no; $clear['bo_no'] = 0; $clear['wr_datetime'] = 'NOW()'; $clear['wr_update'] = 'NOW()'; $clear['wr_ip'] = "INET_ATON('" . Util::GetRealIPAddr() . "')"; $clear['wr_content'] = ''; $clear['wr_subject'] = '페이지(일반형)'; $key = DB::Get()->InsertEx($tbn, $clear, array('wr_ip', 'wr_datetime', 'wr_update')); // 게시글번호 저장 $_POST['wr_no'] = $key; } else { $_POST['wr_no'] = $data['wr_no']; } // POST 데이터 변환 $data = Widget::Inst()->Action('data_implode', $_POST); // 업데이트 DB::Get()->Update($this->TBN(), $data, "where wg_no='{$this->wg_no}'"); ?>
<?php if(!defined("__MAGIC__")) exit; $table = array(); $table['write'] = Write::Inst()->Table();
<?php require './classes/Write.php'; require './classes/Bootstrap.php'; $out = NULL; try { if (Write::factory()->write($_REQUEST['path'], $_REQUEST['content'])) { $out = array('success' => 'true', 'message' => 'teste convertido com sucesso...'); } else { $out = array('success' => 'false', 'message' => 'ocorreu um erro ao tentar converter o teste selenium...'); } } catch (Exception $e) { $out = array('success' => 'false', 'message' => $e->getMessage()); } print json_encode($out);
<?php if (!defined('__MAGIC__')) { exit; } $v = $this->view; if (!$v) { $v = Widget::Inst()->Action('data_explode', $this->wg_no); } if ($v['bo_no']) { echo Write::Inst($v['skin'], $v['bo_no'])->SetConfig('img_width', '', $v['img_width'])->SetConfig('cols', '', $v['cols'])->SetConfig('rows', '', $v['rows'])->SetConfig('list_view', '', $v['list_view'])->SetConfig('use_comment', '', $v['use_comment'])->SetConfig('show_notice', '', $v['show_notice'])->html(); }
$this->action = $this->Link('update'); } /* * 게시판 목록 : 기존에 생성된 것 */ $board_list = array(); $board_list[] = array('bo_subject' => '게시판생성'); foreach (Board::Inst()->Sql('list') as $v) { if ($data['bo_no'] == $v['bo_no']) { $v['selected'] = 'selected'; } $board_list[] = $v; } $this->board_list = $board_list; /* * 게시판 스킨 목록 */ $skin_list = array(); $skin_list[] = array('name' => '게시판스킨 선택'); foreach (Write::Inst()->SkinList('gallery') as $v) { if ($data['skin'] == $v['skin']) { $v['selected'] = 'selected'; } $skin_list[] = $v; } $this->skin_list = $skin_list; /* * 하단 버튼 링크생성 */ $this->btn_ok = Widget::Inst()->path_img('btn_ok.gif'); $this->btn_cancel = Widget::Inst()->path_img('btn_cancel.gif');