本文整理汇总了PHP中requireComponent函数的典型用法代码示例。如果您正苦于以下问题:PHP requireComponent函数的具体用法?PHP requireComponent怎么用?PHP requireComponent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了requireComponent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FlashCounterViewDataSet
function FlashCounterViewDataSet($DATA)
{
global $blog, $service;
requireComponent('Textcube.Function.misc');
$cfg = misc::fetchConfigVal($DATA);
if (!isset($blog['blogLanguage'])) {
$blog['blogLanguage'] = $service['language'];
}
// Locale language file support.
switch ($blog['blogLanguage']) {
case "zh-TW":
$retval = 'Flash 計數器尺寸 "205x85" 僅適用於黑色底色設定。';
break;
case "zh-CN":
$retval = 'Flash 计数器尺寸 "205x85" 仅适用于黑色底色设定。';
break;
default:
$retval = "플래쉬카운터 '205x85' 크기는 검정색만 설정가능합니다.";
}
if ($cfg['flashsize'] == '205') {
if ($cfg['flashcolor'] == 'white') {
return $retval;
}
}
return true;
}
示例2: resetTotalVisits
function resetTotalVisits() {
global $database, $db, $session;
requireComponent('Bloglounge.Model.Users');
if (empty($session['id']) || User::get($session['id'], 'is_admin') != 'y')
return false;
return $db->execute('UPDATE '.$database['prefix'].'Settings SET value=0 WHERE name = "totalVisit"');
}
示例3: CT_Start_Default
function CT_Start_Default($target)
{
requireModel("blog.attachment");
requireComponent("Eolin.PHP.Core");
requireComponent("Textcube.Function.misc");
global $blogid, $blogURL, $database, $service;
$target .= '<ul>';
$target .= '<li><a href="' . $blogURL . '/owner/entry/post">' . _t('새 글을 씁니다') . '</a></li>' . CRLF;
$latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0);
if ($latestEntryId !== 0) {
$latestEntry = CT_Start_Default_getEntry($blogid, $latestEntryId);
if ($latestEntry != false) {
$target .= '<li><a href="' . $blogURL . '/owner/entry/edit/' . $latestEntry['id'] . '">' . _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))) . '</a></li>';
}
}
if (Acl::check('group.administrators')) {
$target .= '<li><a href="' . $blogURL . '/owner/skin">' . _t('스킨을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/skin/sidebar">' . _t('사이드바 구성을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/skin/setting">' . _t('블로그에 표시되는 값들을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/entry/category">' . _t('카테고리를 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/plugin">' . _t('플러그인을 켜거나 끕니다') . '</a></li>' . CRLF;
}
if ($service['reader'] != false) {
$target .= '<li><a href="' . $blogURL . '/owner/network/reader">' . _t('RSS 리더를 봅니다') . '</a></li>' . CRLF;
}
$target .= '</ul>';
return $target;
}
示例4: TextcubeBirthdayDataSet
function TextcubeBirthdayDataSet($DATA)
{
requireComponent('Textcube.Function.misc');
$cfg = Setting::fetchConfigVal($DATA);
// if( $cfg['month'] != 날짜냐?) return "잘못된 날짜입니다.";
// 등등등등 여기서 원하는 검증을 하시고 검증 실패시 사용자에게 보여줄 에러메세지를 보내주심 됩니다.
// 성공하면 그냥 true
return true;
}
示例5: EntriesWithTags_DataSet
function EntriesWithTags_DataSet($data)
{
requireComponent('Textcube.Function.misc');
$cfg = misc::fetchConfigVal($data);
if (!$cfg['entries'] || empty($cfg['entries']) || intval($cfg['entries'] <= 0)) {
$cfg['entries'] = 5;
}
return true;
}
示例6: SB_Spacer
function SB_Spacer($target)
{
global $configVal;
requireComponent('Textcube.Function.misc');
$data = Setting::fetchConfigVal($configVal);
if (!is_null($data) && array_key_exists('height', $data)) {
$height = $data['height'];
} else {
$height = '20';
}
$text = '<div class="SB_Spacer" style="height:' . $height . 'px;"></div>';
return $text;
}
示例7: addTagsWithEntryId
function addTagsWithEntryId($blogid, $entry, $taglist)
{
requireComponent('Needlworks.Cache.PageCache');
global $database;
if ($taglist == null) {
return;
}
$tmptaglist = array_filter($taglist, 'Tag_removeEmptyTagHelper');
if (count($tmptaglist) == 0) {
return;
}
$taglist = array();
foreach ($tmptaglist as $tag) {
$tag = POD::escapeString(Utils_Unicode::lessenAsEncoding(trim($tag), 255));
array_push($taglist, $tag);
}
// step 1. Insert Tags
foreach ($taglist as $tg) {
if (!Tag::doesExist($tg)) {
@POD::execute("INSERT INTO {$database['prefix']}Tags (id, name) VALUES (" . (Tag::_getMaxId() + 1) . ",'" . $tg . "')");
}
}
// $tagliststr = '(\'' . implode('\') , (\'', $taglist) . '\')';
// POD::execute("INSERT IGNORE INTO {$database['prefix']}Tags (name) VALUES $tagliststr ");
// the point of Race condition
// if other entry is deleted, some missing tags can be exist so they are not related with this entry.
// step 2. Insert Relations
$tagliststr = '\'' . implode('\' , \'', $taglist) . '\'';
/*
POD::execute("INSERT INTO {$database['prefix']}TagRelations
(SELECT $blogid, t.id, $entry FROM {$database['prefix']}Tags as t
WHERE
name in ( $tagliststr ) AND
t.id NOT IN
(tag = t.id) AND (entry = $entry) AND (blogid = $blogid)
)
)");
*/
// For MySQL 3, Simple Query Version
$tagIDs = POD::queryColumn("SELECT id FROM {$database['prefix']}Tags WHERE name in ( {$tagliststr} )");
$tagrelations = array();
foreach ($tagIDs as $tagid) {
array_push($tagrelations, " ({$blogid}, {$tagid}, {$entry}) ");
CacheControl::flushTag($tagid);
}
foreach ($tagrelations as $tr) {
@POD::execute("INSERT INTO {$database['prefix']}TagRelations VALUES {$tr}");
}
//$tagRelationStr = implode(', ', $tagrelations);
//POD::execute("INSERT IGNORE INTO {$database['prefix']}TagRelations VALUES $tagRelationStr");
}
示例8: requireComponents
function requireComponents($_path, $_local = true)
{
$path = getJFolder($_path, $_local, debug_backtrace());
if (file_exists($path)) {
$files = subFolderFile($path);
foreach ($files as $i) {
if (isPhp($path . "/" . $i)) {
requireComponent($path . "/" . $i, false, 0);
}
}
} else {
requireError($_path);
}
}
示例9: URLkeeper
function URLkeeper($target)
{
global $hostURL, $blogURL;
global $configVal;
requireComponent('Tattertools.Function.misc');
$data = Setting::fetchConfigVal($configVal);
$config = $data['viewForm'];
$target .= '
<script type="text/javascript">
//<![CDATA[
window.onload = function(){
var type = navigator.appName
var lang;
var msg;
var myurl = location.href;
var config = "' . $config . '";
if (type=="Netscape")
lang = navigator.language
else
lang = navigator.userLanguage
// 국가코드에서 앞 2글자만 자름
var lang = lang.substr(0,2)
// 한글인 경우
if (lang == "ko")
msg = " 원래 주소인 "+myurl+" 로 접속해주세요.";
// 다른 언어인 경우
else
msg = "please, visit directly via "+myurl;
try {
if(top != self){
if (config == "1") {
window.open(myurl,"_top");
}else{
if (confirm(msg)) window.open(myurl,"_top");
}
}
} catch (e) {
}
}
//]]>
</script>
' . CRLF;
return $target;
}
示例10: refreshLocaleResource
function refreshLocaleResource($locale) {
global $__locale;
// po파일과 php파일의 auto convert 지원을 위한 루틴.
$lang_php = $__locale['directory'] . '/' . $locale . ".php";
$lang_po = $__locale['directory'] . '/po/' . $locale . ".po";
// 두 파일 중 최근에 갱신된 것을 찾는다.
$time_po = filemtime( $lang_po );
$time_php = filemtime( $lang_php );
// po파일이 더 최근에 갱신되었으면 php파일을 갱신한다.
if ($time_po && ($time_po > $time_php)) {
requireComponent('Needlworks.Core.Locale');
$langConvert = new Po2php;
$langConvert->open($lang_po);
$langConvert->save($lang_php);
}
return false;
}
示例11: call
function call() {
requireComponent('LZ.PHP.HTTPRequest');
if (func_num_args() < 1)
return false;
$request = new HTTPRequest();
$request->method = 'POST';
$request->url = $this->url;
$request->contentType = 'text/xml';
$request->async = $this->async;
ob_start();
echo '<?xml version="1.0" encoding="utf-8"?><methodCall><methodName>' . func_get_arg(0) . '</methodName><params>';
for ($i = 1; $i < func_num_args(); $i++) {
echo '<param>';
echo $this->_encodeValue(func_get_arg($i));
echo '</param>';
}
echo '</params></methodCall>';
$request->content = ob_get_contents();
ob_end_clean();
if (!$request->send()) {
return false;
}
if ($this->async) {
return true;
}
if ((!is_null($request->getResponseHeader('Content-Type'))) && ($request->getResponseHeader('Content-Type') != 'text/xml')) {
return false;
}
$xmls = new XMLStruct();
$request->responseText = preg_replace_callback('/&#([0-9a-fx]+);/mi', 'replace_num_entity', $request->responseText);
$xmls->open($request->responseText);
if ($xmls->error) {
return false;
}
if (isset($xmls->struct['methodResponse'][0]['fault'][0]['value']))
$this->fault = $this->_decodeValue($xmls->struct['methodResponse'][0]['fault'][0]['value'][0]);
else if (isset($xmls->struct['methodResponse'][0]['params'][0]['param'][0]['value']))
$this->result = $this->_decodeValue($xmls->struct['methodResponse'][0]['params'][0]['param'][0]['value'][0]);
else
return false;
return true;
}
示例12: Sidebar_Show
function Sidebar_Show($parameters)
{
global $configVal;
requireComponent('Textcube.Function.Setting');
$datas = setting::fetchConfigVal($configVal);
$cityname = $datas['city1'];
$weather = 'http://www.google.co.kr/ig/api?&weather=' . $cityname . '&hl=ko&oe=utf-8';
$img = "http://www.google.co.kr";
$xml = simplexml_load_file($weather)->weather->forecast_information;
$xml1 = simplexml_load_file($weather)->weather->current_conditions;
$xml2 = simplexml_load_file($weather)->weather->forecast_conditions;
$city = $xml->city;
$date = $xml->forecast_date;
$condition = $xml1->condition;
$temp_min = $xml2->low;
$temp_max = $xml2->high;
$humidity = $xml1->humidity;
$imgdata = $xml1->icon;
$wind = $xml1->wind_condition;
//인터페이스 부분//
$code = "<br>";
$code .= "<b>지역명 : </b>";
$code .= $cityname;
$code .= "<br>";
$code .= "<b>날짜</b> : ";
$code .= $date[data];
$code .= "<br><br><center>";
$code .= "<b>기상상태</b>";
$code .= "<br>";
$code .= "<img src=" . $img . $imgdata[data] . ">";
$code .= "<br>";
$code .= $condition[data];
$code .= "</center><br>";
$code .= "<b>최저 ~ 최고온도</b> : ";
$code .= $temp_min[data] . "℃ ~ ";
$code .= $temp_max[data] . "℃";
$code .= "<br>";
$code .= $humidity[data];
$code .= "<br>";
$code .= $wind[data];
return $code;
}
示例13: AddNewWindowLinks
function AddNewWindowLinks($target, $mother)
{
global $pluginURL, $configVal, $blogid;
if (is_null($configVal)) {
return $target;
}
requireComponent('Textcube.Function.misc');
$config = Misc::fetchConfigVal($configVal);
switch ($config['type']) {
case 'hack':
$replacement = '<a href="$1"$2>$4</a><a href="$1" onclick="window.open(\'$1\');return false;" ';
$replacement .= 'style="border:none; text-decoration:none; padding-left:15px; margin-right: -0.5em; background: transparent url(' . $pluginURL . '/newwindow.gif) no-repeat 0px 50%;" title="' . _t("다음 링크를 새 창으로 엽니다.") . ' : \'$4\'"> </a>';
break;
case 'img':
$replacement = '<a href="$1"$2>$4</a><a href="$1" onclick="window.open(\'$1\');return false;">';
$replacement .= '<img src="' . $pluginURL . '/newwindow.gif" style="margin-left:0.1em; margin-right:0.1em; vertical-align:middle;" alt="' . _t('(새 창으로 열기)') . '"></a>';
break;
case 'text':
default:
$replacement = '<a href="$1"$2>$4</a> <a href="$1" onclick="window.open(\'$1\');return false;" title="Open \'$4\' link in a new window">' . _t('(새 창으로 열기)') . '</a>';
}
$target = preg_replace('/<a href="(http:\\/\\/[^"]+)"(( \\w+="[^"]+")*)>([^<]+)<\\/a>/i', $replacement, $target);
return $target;
}
示例14: updateCommentsOfEntry
function updateCommentsOfEntry($blogid, $entryId)
{
global $database;
requireComponent('Needlworks.Cache.PageCache');
$commentCount = POD::queryCell("SELECT COUNT(*)\n\t\tFROM {$database['prefix']}Comments\n\t\tWHERE blogid = {$blogid}\n\t\t\tAND entry = {$entryId}\n\t\t\tAND isfiltered = 0");
POD::query("UPDATE {$database['prefix']}Entries\n\t\tSET comments = {$commentCount}\n\t\tWHERE blogid = {$blogid}\n\t\t\tAND id = {$entryId}");
if ($entryId >= 0) {
CacheControl::flushEntry($entryId);
}
return $commentCount;
}
示例15: _t
?>
<div class="warning_messages_wrap">
<br />
<?php echo _t('이 블로그는 이미 등록되어 있어 재등록 하실 수 없습니다.');?>
<br /><br />
<a href="#" class="normalbutton" onclick="history.back(); return false;"><span><?php echo _t('뒤로');?></span></a>
</div>
<?php
} else {
$result = $event->on('Add.getFeed', $xml);
if(!is_array($result)) {
$result = feed::getFeedItems($xml);
}
requireComponent('Bloglounge.Data.Groups');
$groups = Group::getGroupsAll();
$users = User::getMembers();
if(count($result)>0) {
?>
<dl>
<dt><?php echo _t('글');?></dt>
<dd class="text">
<?php echo _f('가장 최신의 글 "%1"(을)를 포함한 %2개의 글이 존재합니다.','<span class="point">'.UTF8::lessen($result[0]['title'],40).'</span>', '<span class="cnt">'.count($result).'</span>');?>
</dd>
</dl>
<?php
}
?>