require_once $oop . '/stations.php'; require_once $oop . '/display_classes.php'; require_once $oop . '/display_functions.php'; // global variables $default_zoom = 14; $start_zoom = 12; $location_marker = "mm_20_yellow.png"; $station_marker_img = "mm_20_blue.png"; $transfer_marker_img = "mm_20_orange.png"; $start_marker_img = "mm_20_green.png"; $end_marker_img = "mm_20_red.png"; $WALKING_SPEED = 2 / 3600; $debug = false; $logging = false; $current_url = $_SERVER['PHP_SELF']; $slogan = getSlogan(); $linksTable = new Table("linkstable"); $homeCell = new Cell("link", new Link("/", "home")); $aboutCell = new Cell("link", new Link("/about.php", "about")); $linksRow = new Row(); $linksRow->addCell($homeCell); $linksRow->addCell($aboutCell); $linksTable->addRow($linksRow); $linksDiv = new Div("about", "noselect", null, $linksTable); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <meta name="Description" content="<?php echo $description; ?>
function saveDraftEntry($blogid, $entry) { global $database, $blog; requireModel('blog.tag'); requireModel('blog.locative'); requireModel('blog.attachment'); requireModel('blog.category'); requireModel('blog.feed'); requireComponent('Textcube.Data.Tag'); if ($entry['id'] == 0) { return -11; } $draftCount = POD::queryCell("SELECT count(*) FROM {$database['prefix']}Entries\n\t\tWHERE blogid = {$blogid}\n\t\t\tAND id = " . $entry['id'] . "\n\t\t\tAND draft = 1"); if ($draftCount > 0) { // draft가 없으면 insert를, 있으면 update를. $doUpdate = true; } else { $doUpdate = false; } // 원 글을 읽어서 몇가지 정보를 보존한다. 원래 글이 없는 경우 draft는 저장될 수 없다. $origEntry = POD::queryRow("SELECT created, comments, trackbacks, pingbacks, password\n\t\tFROM {$database['prefix']}Entries\n\t\tWHERE blogid = {$blogid}\n\t\t\tAND id = " . $entry['id'] . "\n\t\t\tAND draft = 0"); if (empty($origEntry)) { return -12; } $created = $origEntry['created']; $comments = $origEntry['comments']; $trackbacks = $origEntry['trackbacks']; $pingbacks = $origEntry['pingbacks']; $password = $origEntry['password']; if (empty($entry['userid'])) { $entry['userid'] = getUserId(); } $entry['title'] = UTF8::lessenAsEncoding(trim($entry['title'])); $entry['location'] = UTF8::lessenAsEncoding(trim($entry['location'])); $entry['slogan'] = array_key_exists('slogan', $entry) ? trim($entry['slogan']) : ''; if (empty($entry['slogan'])) { $slogan = $slogan0 = getSlogan($entry['title']); } else { $slogan = $slogan0 = getSlogan($entry['slogan']); } $slogan = POD::escapeString(UTF8::lessenAsEncoding($slogan, 255)); $title = POD::escapeString($entry['title']); if ($entry['category'] == -1) { if ($entry['visibility'] == 1 || $entry['visibility'] == 3) { return false; } if (POD::queryCell("SELECT count(*) \n\t\t\tFROM {$database['prefix']}Entries \n\t\t\tWHERE blogid = {$blogid} \n\t\t\t\tAND id <> {$entry['id']} \n\t\t\t\tAND draft = 0 \n\t\t\t\tAND title = '{$title}' \n\t\t\t\tAND category = -1") > 0) { return -13; } } if ($entry['category'] < 0) { if ($entry['visibility'] == 1) { $entry['visibility'] = 0; } if ($entry['visibility'] == 3) { $entry['visibility'] = 2; } } if ($entry['category'] == -4) { $entry['visibility'] = 0; } $result = POD::queryCount("SELECT slogan \n\t\tFROM {$database['prefix']}Entries \n\t\tWHERE blogid = {$blogid} \n\t\tAND slogan = '{$slogan}' \n\t\tAND id = {$entry['id']} \n\t\tAND draft = 0 LIMIT 1"); if ($result == 0) { // if changed $result = POD::queryExistence("SELECT slogan FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND slogan = '{$slogan}' AND draft = 0 LIMIT 1"); for ($i = 1; $result != false; $i++) { if ($i > 1000) { return false; } $slogan = POD::escapeString(UTF8::lessenAsEncoding($slogan0, 245) . '-' . $i); $result = POD::queryExistence("SELECT slogan FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND slogan = '{$slogan}' AND draft = 0 LIMIT 1"); } } $tags = getTagsWithEntryString($entry['tag']); Tag::modifyTagsWithEntryId($blogid, $entry['id'], $tags); $location = POD::escapeString($entry['location']); $latitude = isset($entry['latitude']) && !is_null($entry['latitude']) ? $entry['latitude'] : 'NULL'; $longitude = isset($entry['longitude']) && !is_null($entry['longitude']) ? $entry['longitude'] : 'NULL'; $content = POD::escapeString($entry['content']); $contentformatter = POD::escapeString($entry['contentformatter']); $contenteditor = POD::escapeString($entry['contenteditor']); switch ($entry['published']) { case 0: $published = 'published'; break; case 1: $published = 'UNIX_TIMESTAMP()'; break; default: $published = $entry['published']; $entry['visibility'] = 0 - $entry['visibility']; break; } if ($doUpdate) { $result = POD::query("UPDATE {$database['prefix']}Entries\n\t\t\tSET\n\t\t\t\tuserid = {$entry['userid']},\n\t\t\t\tvisibility = {$entry['visibility']},\n\t\t\t\tstarred = {$entry['starred']},\n\t\t\t\tcategory = {$entry['category']},\n\t\t\t\tdraft = 1,\n\t\t\t\tlocation = '{$location}',\n\t\t\t\tlatitude = {$latitude},\n\t\t\t\tlongitude = {$longitude},\n\t\t\t\ttitle = '{$title}',\n\t\t\t\tcontent = '{$content}',\n\t\t\t\tcontentformatter = '{$contentformatter}',\n\t\t\t\tcontenteditor = '{$contenteditor}',\n\t\t\t\tslogan = '{$slogan}',\n\t\t\t\tacceptcomment = {$entry['acceptcomment']},\n\t\t\t\taccepttrackback = {$entry['accepttrackback']},\n\t\t\t\tpublished = {$published},\n\t\t\t\tmodified = UNIX_TIMESTAMP()\n\t\t\tWHERE blogid = {$blogid} AND id = {$entry['id']} AND draft = 1"); } else { $result = POD::query("INSERT INTO {$database['prefix']}Entries \n\t\t\t(blogid, userid, id, draft, visibility, starred, category, title, slogan, content, contentformatter,\n\t\t\t contenteditor, location, password, acceptcomment, accepttrackback, published, created, modified,\n\t\t\t comments, trackbacks, pingbacks) \n\t\t\tVALUES (\n\t\t\t{$blogid},\n\t\t\t{$entry['userid']},\n\t\t\t{$entry['id']},\n\t\t\t1,\n\t\t\t{$entry['visibility']},\n\t\t\t{$entry['starred']},\n\t\t\t{$entry['category']},\n\t\t\t'{$title}',\n\t\t\t'{$slogan}',\n\t\t\t'{$content}',\n\t\t\t'{$contentformatter}',\n\t\t\t'{$contenteditor}',\n\t\t\t'{$location}',\n\t\t\t'{$password}',\n\t\t\t{$entry['acceptcomment']},\n\t\t\t{$entry['accepttrackback']},\n\t\t\t{$published},\n\t\t\t{$created},\n\t\t\tUNIX_TIMESTAMP(),\n\t\t\t{$comments},\n\t\t\t{$trackbacks},\n\t\t\t{$pingbacks})"); } return $result ? $entry['id'] : false; }
/* SOMETHING WENT WRONG; NO THEMES */ @($THEME_NAME = "themes/" . $properties->DB_PREFIX . "/exempt/"); } else { while ($FETCH_THEME_NAME = mysql_fetch_array($GET_THEME_NAME)) { @($THEME_NAME = "themes/" . $FETCH_THEME_NAME['name'] . "/exempt/"); } } } else { @($THEME_NAME = "themes/" . str_replace("(THEME_NAME)", Theme($properties, $REPLACEMENT_THE_ACTION, $ip, $SESSIONID), $THEME_ASSETS_STRING) . "/exempt/"); } ?> <title><?php echo $properties->WEBSITE_NAME; ?> - <?php echo getSlogan($properties, $launchpadPN); echo getPageName($launchpadPN, $page, $properties); ?> </title> <link rel="stylesheet" type="text/css" href="<?php echo $WEBSITE_URL; echo @$THEME_NAME; ?> mainall/main.css" media="screen" > <?php if (@$launchpadPN == "pad1") { ?> <link rel="stylesheet" type="text/css" href="<?php echo $WEBSITE_URL; echo @$THEME_NAME;
function saveDraftEntry($blogid, $entry) { $ctx = Model_Context::getInstance(); $pool = DBModel::getInstance(); importlib('model.blog.tag'); importlib('model.blog.locative'); importlib('model.blog.attachment'); importlib('model.blog.category'); importlib('model.blog.feed'); if ($entry['id'] == 0) { return -11; } $pool->init("Entries"); $pool->setQualifier("blogid", "eq", $blogid); $pool->setQualifier("id", "eq", $entry['id']); $pool->setQualifier("draft", "eq", 1); $draftCount = $pool->getCount(); if ($draftCount > 0) { // draft가 없으면 insert를, 있으면 update를. $doUpdate = true; } else { $doUpdate = false; } // 원 글을 읽어서 몇가지 정보를 보존한다. 원래 글이 없는 경우 draft는 저장될 수 없다. $pool->init("Entries"); $pool->setQualifier("blogid", "eq", $blogid); $pool->setQualifier("id", "eq", $entry['id']); $pool->setQualifier("draft", "eq", 0); $origEntry = $pool->getRow("created, comments, trackbacks, pingbacks, password, published"); if (empty($origEntry)) { return -12; } $created = $origEntry['created']; $comments = $origEntry['comments']; $trackbacks = $origEntry['trackbacks']; $pingbacks = $origEntry['pingbacks']; $password = $origEntry['password']; if (empty($entry['userid'])) { $entry['userid'] = getUserId(); } $entry['title'] = Utils_Unicode::lessenAsEncoding(trim($entry['title'])); $entry['location'] = Utils_Unicode::lessenAsEncoding(trim($entry['location'])); $entry['slogan'] = array_key_exists('slogan', $entry) ? trim($entry['slogan']) : ''; if (empty($entry['slogan'])) { $slogan = $slogan0 = getSlogan($entry['title']); } else { $slogan = $slogan0 = getSlogan($entry['slogan']); } $slogan = Utils_Unicode::lessenAsEncoding($slogan, 255); $title = $entry['title']; if ($entry['category'] == -1) { if ($entry['visibility'] == 1 || $entry['visibility'] == 3) { return false; } $pool->init("Entries"); $pool->setQualifier("blogid", "eq", $blogid); $pool->setQualifier("id", "neq", $entry['id']); $pool->setQualifier("draft", "eq", 0); $pool->setQualifier("title", "eq", $entry['title'], true); $pool->setQualifier("category", "eq", -1); if ($pool->getCount() > 0) { return -13; } } if ($entry['category'] < 0) { if ($entry['visibility'] == 1) { $entry['visibility'] = 0; } if ($entry['visibility'] == 3) { $entry['visibility'] = 2; } } if ($entry['category'] == -4) { $entry['visibility'] = 0; } $slogan = getUniqueSlogan($blogid, $slogan, $entry['id']); $tags = getTagsWithEntryString($entry['tag']); Tag::modifyTagsWithEntryId($blogid, $entry['id'], $tags); $location = $entry['location']; $latitude = isset($entry['latitude']) && !is_null($entry['latitude']) ? $entry['latitude'] : null; $longitude = isset($entry['longitude']) && !is_null($entry['longitude']) ? $entry['longitude'] : null; $content = $entry['content']; $contentformatter = $entry['contentformatter']; $contenteditor = $entry['contenteditor']; switch ($entry['published']) { case 0: $published = $origEntry['published']; break; case 1: $published = Timestamp::getUNIXtime(); break; default: $published = $entry['published']; $entry['visibility'] = 0 - $entry['visibility']; break; } if ($doUpdate) { $pool->reset("Entries"); $pool->setAttribute("userid", $entry['userid']); $pool->setAttribute("draft", 1); $pool->setAttribute("visibility", $entry['visibility']); $pool->setAttribute("starred", $entry['starred']); $pool->setAttribute("category", $entry['category']); $pool->setAttribute("title", $title, true); $pool->setAttribute("slogan", $slogan, true); $pool->setAttribute("content", $entry['content'], true); $pool->setAttribute("contentformatter", $entry['contentformatter'], true); $pool->setAttribute("contenteditor", $entry['contenteditor'], true); $pool->setAttribute("location", $entry['location'], true); $pool->setAttribute("latitude", $latitude); $pool->setAttribute("longitude", $longitude); $pool->setAttribute("acceptcomment", $entry['acceptcomment']); $pool->setAttribute("accepttrackback", $entry['accepttrackback']); $pool->setAttribute("published", $published); $pool->setAttribute("modified", Timestamp::getUNIXtime()); $pool->setQualifier("blogid", "eq", $blogid); $pool->setQualifier("id", "eq", $entry['id']); $pool->setQualifier("draft", "eq", 1); $result = $pool->update(); } else { $pool->reset("Entries"); $pool->setAttribute("blogid", $blogid); $pool->setAttribute("userid", $entry['userid']); $pool->setAttribute("id", $entry['id']); $pool->setAttribute("draft", 1); $pool->setAttribute("visibility", $entry['visibility']); $pool->setAttribute("starred", $entry['starred']); $pool->setAttribute("category", $entry['category']); $pool->setAttribute("title", $title, true); $pool->setAttribute("slogan", $slogan, true); $pool->setAttribute("content", $entry['content'], true); $pool->setAttribute("contentformatter", $entry['contentformatter'], true); $pool->setAttribute("contenteditor", $entry['contenteditor'], true); $pool->setAttribute("location", $entry['location'], true); $pool->setAttribute("latitude", $latitude); $pool->setAttribute("longitude", $longitude); $pool->setAttribute("password", $password, true); $pool->setAttribute("acceptcomment", $entry['acceptcomment']); $pool->setAttribute("accepttrackback", $entry['accepttrackback']); $pool->setAttribute("published", $published); $pool->setAttribute("created", $created); $pool->setAttribute("modified", Timestamp::getUNIXtime()); $pool->setAttribute("comments", $comments); $pool->setAttribute("trackbacks", $trackbacks); $pool->setAttribute("pingbacks", $pingbacks); $result = $pool->insert(); } return $result ? $entry['id'] : false; }
if (POD::execute("ALTER TABLE {$database['prefix']}Links \n\t\t\t\t\tADD category int(11) NOT NULL DEFAULT 0 AFTER id,\n\t\t\t\t\tADD pid int(11) NOT NULL DEFAULT 0 FIRST,\n\t\t\t\t\tCHANGE id id int(11) NOT NULL default '0'") && POD::execute("UPDATE {$database['prefix']}Links \n\t\t\t\t\tSET pid = id") && POD::execute("ALTER TABLE {$database['prefix']}Links \n\t\t\t\t\tDROP PRIMARY KEY,\n\t\t\t\t\tADD PRIMARY KEY (pid)")) { showCheckupMessage(true); } else { @POD::execute("DROP TABLE {$database['prefix']}LinkCategories"); showCheckupMessage(false); } } else { showCheckupMessage(false); } } /* FROM Textcube 1.7.3 */ if (!is_null($notices = POD::queryAll("SELECT blogid, id, title, slogan\n\t\tFROM {$database['prefix']}Entries \n\t\tWHERE category = -2\n\t\t\tAND slogan = ''")) && !empty($notices)) { $changed = true; echo '<li>', _text('fancyURL이 적용되지 않는 공지 글에 슬로건을 추가합니다.'), ': '; foreach ($notices as $notice) { $notice['slogan'] = getSlogan($notice['title']); $succeed = POD::execute("UPDATE {$database['prefix']}Entries\n\t\t\t\tSET slogan = '" . POD::escapeString($notice['slogan']) . "'\n\t\t\t\tWHERE blogid = {$notice['blogid']}\n\t\t\t\tAND id = {$notice['id']}"); } if ($succeed) { showCheckupMessage(true); } else { showCheckupMessage(false); } } /* From Textcube 1.7.6 */ if (!POD::queryExistence("DESC {$database['prefix']}Filters filtertype") && !strpos(POD::queryCell("DESC {$database['prefix']}Filters type", 'Type'), 'whiteurl')) { $changed = true; echo '<li>', _text('필터 테이블에 예외 목록을 추가하기 위하여 필드 속성을 변경합니다.'), ': '; if (POD::execute("ALTER TABLE {$database['prefix']}Filters CHANGE type type ENUM('content','ip','name','url','whiteurl') NOT NULL DEFAULT 'content'")) { showCheckupMessage(true); } else {