function facebookSocialPlugins($target, $mother) { global $database, $suri, $blog, $configVal; $data = Misc::fetchConfigVal($configVal); $output = ''; $directive = array('archive', 'category', 'guestbook', 'imageResizer', 'link', 'login', 'logout', 'pannels', 'protected', 'search', 'tag', 'trackback', 'rss', 'atom', 'ientry', 'sync', 'm', 'commentcomment'); if (in_array(str_replace('/', '', $suri['directive']), $directive)) { return $target; } $permalink = $blog['useSloganOnPost'] ? 'entry/' . POD::queryCell("SELECT `slogan` FROM {$database['prefix']}Entries WHERE `id`={$mother} LIMIT 1") : $mother; $permalink = urlencode(getBlogURL() . '/' . $permalink); $title = urlencode(POD::queryCell("SELECT `title` FROM {$database['prefix']}Entries WHERE `id`={$mother} LIMIT 1")); $output = '<div style="margin-top:1em;width:auto;height:auto;clear:both;">'; $__width = !isset($data['content_width']) || (int) $data['content_width'] <= 0 ? 520 : $data['content_width']; if ($data['like_button']) { $output .= '<div class="fb-like" data-href="' . $permalink . '" data-send="true" data-width="' . $__width . '" data-show-faces="true"></div>'; } if ($data['comments']) { $output .= '<div class="fb-comments" data-href="' . $permalink . '" data-num-posts="2" data-width="' . $__width . '"></div>'; } if ($data['share']) { $output .= '<div class="fb-send" data-href="' . $permalink . '"></div>'; } $output .= '</div><br />'; return $target . $output; }
function myPlurk_UpdatePlurk($target, $mother) { global $blogid, $service, $database, $configVal; requireComponent('Textcube.Function.misc'); require_once "libs/plurk_api.php"; $data = misc::fetchConfigVal($configVal); $autoPlurkEntries = (int) $data['autoPlurkEntries']; $plurkwithslogan = (int) $data['plurkwithslogan']; $plurklang = Setting::getBlogSettingGlobal('blogLanguage', ''); $plurk = new plurk_api(); $googl = new googleURLShortner(); $plurkNickname = isset($data['plurknickname']) ? $data['plurknickname'] : ""; $plurkPassword = isset($data['plurkpassword']) ? $data['plurkpassword'] : ""; $plurk_api = 'iMCH3JDDda7c4bs0qiOchZcxAx7t8PA7'; if ($mother['category'] >= 0 && ($autoPlurkEntries == 1 && $mother['visibility'] >= 2 || $autoPlurkEntries == 2 && $mother['visibility'] >= 3) && !empty($plurkNickname) && !empty($plurkPassword) && $plurk->login($plurk_api, $plurkNickname, $plurkPassword) && !POD::queryCount("UPDATE {$database['prefix']}PlurkEntries SET lastaccess = UNIX_TIMESTAMP() WHERE blogid={$blogid} AND id={$target}")) { $slogan = POD::queryCell("SELECT `slogan` FROM `{$database['prefix']}Entries` WHERE `id`={$target}"); $permalink = getBlogURL() . "/" . (Setting::getBlogSettingGlobal('useSloganOnPost', true) ? "entry/" . URL::encode($slogan, $service['useEncodedURL']) : $target); $url = $googl->shortner($permalink); $url = $url !== false ? $url : $permalink; $lang = "en"; switch ($plurklang) { case "zh-TW": $lang = "tr_ch"; break; case "zh-CN": $lang = "cn"; default: $lang = "en"; } if (1 === $plurkwithslogan) { $content = $url . " (" . $mother['title'] . ") via " . Setting::getBlogSettingGlobal('title', '') . " with Textcube Plurk-API."; } else { $content = $mother['title'] . " via " . $url . " (" . Setting::getBlogSettingGlobal('title', '') . ") with Textcube Plurk-API."; } $acceptComment = $mother['acceptComment'] == 1 ? true : false; $response = $plurk->add_plurk($lang, "shares", $content, NULL, $acceptComment); if (isset($response->plurk_id) && $response->plurk_id > 0) { $plurk_id = $response->plurk_id; POD::query("INSERT INTO {$database['prefix']}PlurkEntries (blogid, id, plurkid, lastaccess) VALUES ('{$blogid}', '{$target}', '{$plurk_id}', UNIX_TIMESTAMP())"); } } return $target; }
function getBlogURLById($id = null, $domain = null, $path = null, $type = null) { $name = getBlogName($id); return getBlogURL($name, $domain, $path, $type); }
</a></h3> <div id="power-container" class="container"> <dl id="permalink-line" class="line"<?php if ($isKeyword) { echo ' style="display: none"'; } ?> > <dt><label for="permalink"><?php echo _t('절대 주소'); ?> </label></dt> <dd class="permalink-input"> <samp id="permalink-prefix"><?php echo _f('%1/entry/', link_cut(getBlogURL())); ?> </samp><input type="text" id="permalink" class="input-text" name="permalink" onkeypress="return preventEnter(event);" value="<?php echo htmlspecialchars($entry['slogan']); ?> " /> </dd> <dd> <p>* <?php echo _t('입력하지 않으면 글의 제목이 절대 주소가 됩니다.'); ?> </p> </dd> </dl> <dl id="date-line" class="line"> <dt><span class="label"><?php
function sendInvitationMail($blogid, $userid, $name, $comment, $senderName, $senderEmail) { $ctx = Model_Context::getInstance(); $pool = DBModel::getInstance(); if (empty($blogid)) { $pool->reset('BlogSettings'); $blogid = $pool->getCell('max(blogid)'); // If no blogid, get the latest created blogid. } $email = User::getEmail($userid); $pool->reset('Users'); $pool->setQualifier('userid', 'eq', $userid); $password = getCell('password'); $authtoken = getAuthToken($userid); $blogName = getBlogName($blogid); if (empty($email)) { return 1; } if (!preg_match('/^[^@]+@([-a-zA-Z0-9]+\\.)+[-a-zA-Z0-9]+$/', $email)) { return 2; } if (empty($name)) { $name = User::getName($userid); } if (strcmp($email, Utils_Unicode::lessenAsEncoding($email, 64)) != 0) { return 11; } //$loginid = POD::escapeString(Utils_Unicode::lessenAsEncoding($email, 64)); $name = POD::escapeString(Utils_Unicode::lessenAsEncoding($name, 32)); //$headers = 'From: ' . encodeMail($senderName) . '<' . $senderEmail . ">\n" . 'X-Mailer: ' . TEXTCUBE_NAME . "\n" . "MIME-Version: 1.0\nContent-Type: text/html; charset=utf-8\n"; if (empty($name)) { $subject = _textf('귀하를 %1님이 초대합니다', $senderName); } else { $subject = _textf('%1님을 %2님이 초대합니다', $name, $senderName); } $message = file_get_contents(ROOT . "/resources/style/letter/letter.html"); $message = str_replace('[##_title_##]', _text('초대장'), $message); $message = str_replace('[##_content_##]', $comment, $message); $message = str_replace('[##_images_##]', $ctx->getProperty('uri.service') . "/resources/style/letter", $message); $message = str_replace('[##_link_##]', getInvitationLink(getBlogURL($blogName), $email, $password, $authtoken), $message); $message = str_replace('[##_go_blog_##]', getBlogURL($blogName), $message); $message = str_replace('[##_link_title_##]', _text('블로그 바로가기'), $message); if (empty($name)) { $message = str_replace('[##_to_##]', '', $message); } else { $message = str_replace('[##_to_##]', _text('받는 사람') . ': ' . $name, $message); } $message = str_replace('[##_sender_##]', _text('보내는 사람') . ': ' . $senderName, $message); $ret = sendEmail($senderName, $senderEmail, $name, $email, $subject, $message); if ($ret !== true) { return array(14, $ret[1]); } return true; }
?> /><label for="useTSlogan1"><span class="text"><?php echo _t('문자를 사용합니다.'); ?> <samp><?php echo _f('(예: %1/tag/텍스트큐브)', link_cut(getBlogURL())); ?> </samp></span></label><br /> <input type="radio" id="useTSlogan0" class="radio" name="useTSlogan"<?php echo $blog['useSloganOnTag'] ? '' : ' checked="checked"'; ?> /><label for="useTSlogan0"><span class="text"><?php echo _t('숫자를 사용합니다.'); ?> <samp><?php echo _f('(예: %1/tag/101)', link_cut(getBlogURL())); ?> </samp></span></label> </dd> </dl> <?php if ($service['allowBlogVisibilitySetting']) { ?> <dl id="blog-open-type-line" class="line"> <dt><span class="label"><?php echo _t('블로그 공개 정도'); ?> </span></dt> <dd> <input type="radio" id="visibilityPrivate" class="radio" name="visibility"<?php echo $blog['visibility'] == 0 ? ' checked="checked"' : '';
function sendInvitationMail($blogid, $userid, $name, $comment, $senderName, $senderEmail) { global $database, $service, $hostURL, $serviceURL; if (empty($blogid)) { $blogid = POD::queryCell("SELECT max(blogid)\n\t\t\tFROM {$database['prefix']}BlogSettings"); // If no blogid, get the latest created blogid. } $email = getUserEmail($userid); $password = POD::queryCell("SELECT password\n\t\tFROM {$database['prefix']}Users\n\t\tWHERE userid = " . $userid); $authtoken = getAuthToken($userid); $blogName = getBlogName($blogid); if (empty($email)) { return 1; } if (!preg_match('/^[^@]+@([-a-zA-Z0-9]+\\.)+[-a-zA-Z0-9]+$/', $email)) { return 2; } if (empty($name)) { $name = User::getName($userid); } if (strcmp($email, UTF8::lessenAsEncoding($email, 64)) != 0) { return 11; } //$loginid = POD::escapeString(UTF8::lessenAsEncoding($email, 64)); $name = POD::escapeString(UTF8::lessenAsEncoding($name, 32)); //$headers = 'From: ' . encodeMail($senderName) . '<' . $senderEmail . ">\n" . 'X-Mailer: ' . TEXTCUBE_NAME . "\n" . "MIME-Version: 1.0\nContent-Type: text/html; charset=utf-8\n"; if (empty($name)) { $subject = _textf('귀하를 %1님이 초대합니다', $senderName); } else { $subject = _textf('%1님을 %2님이 초대합니다', $name, $senderName); } $message = file_get_contents(ROOT . "/resources/style/letter/letter.html"); $message = str_replace('[##_title_##]', _text('초대장'), $message); $message = str_replace('[##_content_##]', $comment, $message); $message = str_replace('[##_images_##]', $serviceURL . "/resources/style/letter", $message); $message = str_replace('[##_link_##]', getInvitationLink(getBlogURL($blogName), $email, $password, $authtoken), $message); $message = str_replace('[##_go_blog_##]', getBlogURL($blogName), $message); $message = str_replace('[##_link_title_##]', _text('블로그 바로가기'), $message); if (empty($name)) { $message = str_replace('[##_to_##]', '', $message); } else { $message = str_replace('[##_to_##]', _text('받는 사람') . ': ' . $name, $message); } $message = str_replace('[##_sender_##]', _text('보내는 사람') . ': ' . $senderName, $message); $ret = sendEmail($senderName, $senderEmail, $name, $email, $subject, $message); if ($ret !== true) { return array(14, $ret[1]); } return true; }
break; default: } } <?php echo activateDetailPanelJS(); ?> //]]> </script> <?php echo fireEvent('ShowAdminFooter', ''); if ($service['type'] == 'domain' && empty($_SESSION['sso_done']) && !empty($blog['secondaryDomain'])) { $_SESSION['sso_done'] = true; ?> <iframe style="width:0;height:0;border:0" src="<?php echo getBlogURL(); ?> /login?requestURI=about:blank&session=<?php echo $_COOKIE[Session::getName()]; ?> "></iframe> <iframe style="width:0;height:0;border:0" src="<?php echo "http://" . $context->getProperty('blog.secondaryDomain') . $context->getProperty('uri.blog'); ?> /login?requestURI=about:blank&session=<?php echo $_COOKIE[Session::getName()]; ?> "></iframe> <?php } ?>
public function buildSitemap() { global $blog, $database, $service, $hostURL, $blogid; $this->runStart = $this->getMicrotime(); if (!is_dir(ROOT . '/cache/sitemap')) { mkdir(ROOT . '/cache/sitemap'); chmod(ROOT . '/cache/sitemap', 0755); } if (!is_dir(ROOT . '/cache/sitemap/' . $blogid)) { mkdir(ROOT . '/cache/sitemap/' . $blogid); chmod(ROOT . '/cache/sitemap/' . $blogid, 0755); } $userid = getUserId(); $userBlogUrl = getBlogURL(); $cacheFile = ROOT . '/cache/sitemap/' . $blogid . '/' . $this->filename; $gzcacheFile = $cacheFile . '.gz'; $rootgzFile = ROOT . '/cache/sitemap/' . $this->filename . '.gz'; /* xml-sitemap schemas */ ob_start(); echo '<?xml version="1.0" encoding="UTF-8"?>', CRLF; echo '<urlset', CRLF; echo ' xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"', CRLF; echo ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"', CRLF; echo ' xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9', CRLF; echo ' http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">', CRLF, CRLF; /// build blog root, subroot echo '<url>', CRLF; echo ' <loc>', $userBlogUrl, '/</loc>', CRLF; echo ' <priority>0.8</priority>', CRLF; echo ' <changefreq>daily</changefreq>', CRLF; echo '</url>', CRLF; echo '<url>', CRLF; echo ' <loc>', $userBlogUrl, '/cover</loc>', CRLF; echo ' <priority>0.8</priority>', CRLF; echo ' <changefreq>daily</changefreq>', CRLF; echo '</url>', CRLF; echo '<url>', CRLF; echo ' <loc>', $userBlogUrl, '/notice</loc>', CRLF; echo ' <priority>0.8</priority>', CRLF; echo ' <changefreq>daily</changefreq>', CRLF; echo '</url>', CRLF; echo '<url>', CRLF; echo ' <loc>', $userBlogUrl, '/tag</loc>', CRLF; echo ' <priority>0.8</priority>', CRLF; echo ' <changefreq>daily</changefreq>', CRLF; echo '</url>', CRLF; echo '<url>', CRLF; echo ' <loc>', $userBlogUrl, '/location</loc>', CRLF; echo ' <priority>0.8</priority>', CRLF; echo ' <changefreq>daily</changefreq>', CRLF; echo '</url>', CRLF; echo '<url>', CRLF; echo ' <loc>', $userBlogUrl, '/keylog</loc>', CRLF; echo ' <priority>0.8</priority>', CRLF; echo ' <changefreq>daily</changefreq>', CRLF; echo '</url>', CRLF; echo '<url>', CRLF; echo ' <loc>', $userBlogUrl, '/guestbook</loc>', CRLF; echo ' <priority>0.8</priority>', CRLF; echo ' <changefreq>daily</changefreq>', CRLF; echo '</url>', CRLF; echo '<url>', CRLF; echo ' <loc>', $userBlogUrl, '/rss</loc>', CRLF; echo ' <priority>0.8</priority>', CRLF; echo ' <changefreq>daily</changefreq>', CRLF; echo '</url>', CRLF; $notices = POD::query("SELECT `id`,`slogan` FROM {$database['prefix']}Entries WHERE `category`=-2 AND `visibility`>=2 AND `userid`={$userid} AND `blogid`={$blogid} ORDER BY `created` ASC"); while ($row = POD::fetch($notices, 'array')) { $permalink = $blog['useSloganOnPost'] ? urlencode($row['slogan']) : $row['id']; echo '<url>', CRLF; echo ' <loc>', $userBlogUrl, '/notice/', $permalink, '</loc>', CRLF; echo ' <priority>0.8</priority>', CRLF; echo ' <changefreq>daily</changefreq>', CRLF; echo '</url>', CRLF; } $entries = POD::query("SELECT `id`,`slogan` FROM {$database['prefix']}Entries WHERE `category`>=0 AND `visibility`>=2 AND `userid`={$userid} AND `blogid`={$blogid} ORDER BY `created` ASC"); while ($row = POD::fetch($entries, 'array')) { $permalink = $blog['useSloganOnPost'] ? urlencode($row['slogan']) : $row['id']; echo '<url>', CRLF; echo ' <loc>', $userBlogUrl, '/', $blog['useSloganOnPost'] ? 'entry/' : '', $permalink, '</loc>', CRLF; echo ' <priority>0.5</priority>', CRLF; echo ' <changefreq>daily</changefreq>', CRLF; echo '</url>', CRLF; } echo '</urlset>', CRLF; $sitemapIndexes = ob_get_contents(); ob_end_clean(); $this->runEnd = $this->getMicrotime(); $fp = fopen($cacheFile, "w+"); if (fwrite($fp, $sitemapIndexes)) { fclose($fp); chmod($cacheFile, 0644); $zp = gzopen($gzcacheFile, "w9"); if (gzwrite($zp, $sitemapIndexes)) { gzclose($zp); chmod($gzcacheFile, 0644); if (copy($gzcacheFile, $rootgzFile)) { return true; } else { return false; } } else { gzclose($zp); return false; } } else { fclose($fp); return false; } }