Example #1
0
function getRoomEventList(array $rooms, $start, $end)
{
    $entries = array();
    $timed_entries = array();
    foreach ($rooms as $room) {
        $events_room = checktime_Room($start, $end, $room['area_id'], $room['room_id']);
        if (isset($events_room[$room['room_id']])) {
            foreach ($events_room[$room['room_id']] as $entry_id) {
                $event = getEntry($entry_id);
                if (count($event)) {
                    $a = '';
                    if ($event['time_start'] < $start) {
                        $a .= __('started') . ' ' . date('H:i d-m-Y', $event['time_start']);
                        $event['time_start'] = $start;
                    }
                    if ($event['time_end'] > $end) {
                        if ($a != '') {
                            $a .= ', ';
                        }
                        $a .= 'slutter ' . date('H:i d-m-Y', $event['time_end']);
                        $event['time_end'] = $end;
                    }
                    if ($a != '') {
                        $event['entry_name'] .= ' (' . $a . ')';
                    }
                    $timed_entries[$event['time_start']][$event['entry_id']] = $event['entry_id'];
                    $entries[$event['entry_id']] = $event;
                }
            }
        }
    }
    return array('timedEntries' => $timed_entries, 'allEntries' => $entries);
}
Example #2
0
function updateEntry($hash, $editor_hash, $text, $title, $description)
{
    $db = connectDB();
    $query = "\nUPDATE " . DB_TABLE . "\nSET text_content = :text ,\n\ttitle = :title ,\n\tdescription = :desc ,\n\tdate_edited = CURRENT_TIMESTAMP\nWHERE hash = :hash \nAND   editor_hash = :ehash ";
    $params = array(":hash" => $hash, ":ehash" => $editor_hash, ":text" => $text, ":title" => $title, ":desc" => $description);
    $rowCount = execute($db, $query, $params);
    close($db);
    if ($rowCount > 0) {
        return getEntry($hash);
    } else {
        return null;
    }
}
Example #3
0
function getPage($page)
{
    $entries = scandir("data");
    array_pop($entries);
    natsort($entries);
    $entries = array_reverse($entries);
    $entries = array_values($entries);
    $pageOfEntries = array_slice($entries, $page * 25, 25);
    $body = "";
    foreach ($pageOfEntries as $entry) {
        if ($entry = getEntry($entry)) {
            $body .= "{$entry} <hr />";
        }
    }
    return $body;
}
Example #4
0
function getEntries($type = Null, $limit = Null)
{
    $entries = array();
    $dir = opendir(ENTRIES_DIRECTORY);
    $count = 0;
    while ($entryFile = readdir($dir)) {
        if ($entryFile[0] == '.') {
            //Dont show hidden files
            continue;
        }
        $entryName = str_replace('.php', Null, $entryFile);
        $entry = getEntry($entryName);
        if ($type && $entry->type != $type) {
            continue;
        }
        $entries[$entry->date] = $entry;
        $count++;
    }
    krsort($entries);
    if ($limit) {
        $entries = array_slice($entries, 0, $limit, True);
    }
    return $entries;
}
Example #5
0
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
require ROOT . '/library/preprocessor.php';
requireModel('blog.entry');
requireModel('blog.response.remote');
requireModel('blog.sidebar');
define('__TEXTCUBE_NO_ENTRY_CACHE__', true);
$entries = array();
if (is_null($entry = getEntry($blogid, $suri['id'], true))) {
    $entry = getEntry($blogid, $suri['id'], false);
}
if (!is_null($entry)) {
    if (isset($entry['appointed'])) {
        $entry['published'] = $entry['appointed'];
    }
    if (isset($entry['category']) && $entry['category'] >= 0) {
        $entry['categoryLabel'] = getCategoryLabelById($blogid, $entry['category']);
    }
    $entries[0] = $entry;
}
unset($entry);
require ROOT . '/interface/common/blog/begin.php';
require ROOT . '/interface/common/blog/entries.php';
$pageTitle = _t('미리보기') . ' - ' . $pageTitle;
require ROOT . '/interface/common/blog/end.php';
Example #6
0
	'BEGIN:STANDARD'.chr(10).
		'DTSTART:16011028T030000'.chr(10).
		'RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10'.chr(10).
		'TZOFFSETFROM:+0200'.chr(10).
		'TZOFFSETTO:+0100'.chr(10).
	'END:STANDARD'.chr(10).
	'BEGIN:DAYLIGHT'.chr(10).
		'DTSTART:16010325T020000'.chr(10).
		'RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3'.chr(10).
		'TZOFFSETFROM:+0100'.chr(10).
		'TZOFFSETTO:+0200'.chr(10).
	'END:DAYLIGHT'.chr(10).
'END:VTIMEZONE'.chr(10);*/
echo 'BEGIN:VTIMEZONE' . chr(10) . 'TZID:Europe/Oslo' . chr(10) . 'BEGIN:DAYLIGHT' . chr(10) . 'TZOFFSETFROM:+0100' . chr(10) . 'TZOFFSETTO:+0200' . chr(10) . 'DTSTART:19810329T020000' . chr(10) . 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU' . chr(10) . 'TZNAME:CEST' . chr(10) . 'END:DAYLIGHT' . chr(10) . 'BEGIN:STANDARD' . chr(10) . 'TZOFFSETFROM:+0200' . chr(10) . 'TZOFFSETTO:+0100' . chr(10) . 'DTSTART:19961027T030000' . chr(10) . 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU' . chr(10) . 'TZNAME:CET' . chr(10) . 'END:STANDARD' . chr(10) . 'END:VTIMEZONE' . chr(10);
$entryObj = new EntryTemplate();
while ($R = mysql_fetch_assoc($Q)) {
    $entry_array = getEntry($R['entry_id']);
    templateAssignEntry('entryObj', $entry_array);
    echo 'BEGIN:VEVENT' . chr(10) . 'SEQUENCE:' . $entryObj->rev_num . chr(10) . 'TRANSP:TRANSPARENT' . chr(10) . 'UID:JMBOOKING-' . $entryObj->entry_id . '-' . time() . chr(10) . 'DTSTART;TZID=Europe/Oslo:' . date('Ymd', $entryObj->time_start) . 'T' . date('His', $entryObj->time_start) . chr(10) . 'DTEND;TZID=Europe/Oslo:' . date('Ymd', $entryObj->time_end) . 'T' . date('His', $entryObj->time_end) . chr(10) . 'CREATED;TZID=Europe/Oslo:' . date('Ymd', $entryObj->time_created) . 'T' . date('His', $entryObj->time_created) . chr(10) . 'DTSTAMP;TZID=Europe/Oslo:' . date('Ymd') . 'T' . date('His') . chr(10);
    //echo date('Y-m-d H:i', strtotime('2008-10-09 08:55 GMT'));
    /*
    $days = 
    echo 'DURATION:P0DT0H0M'.($entryObj->time_end - $entryObj->time_start).chr(10);
    */
    echo 'SUMMARY:' . utf8_encode(htmlspecialchars_decode($entryObj->entry_name, ENT_QUOTES)) . chr(10) . 'DESCRIPTION:' . $systemurl . '/entry.php?entry_id=' . $entryObj->entry_id . ' \\n' . utf8_encode('BID: ' . $entryObj->entry_id) . '\\n' . utf8_encode('Type: ' . $entryObj->entry_type) . '\\n' . utf8_encode('Kunde: ' . $entryObj->customer_name) . '\\n' . utf8_encode('Vert(er): ' . $entryObj->user_assigned_names) . '\\n' . utf8_encode('Antall voksne: ' . $entryObj->num_person_adult) . '\\n' . utf8_encode('Antall barn: ' . $entryObj->num_person_child) . '\\n';
    if ($entryObj->program_id_name != '') {
        echo utf8_encode('Fast program: ' . $entryObj->program_id_name) . '\\n';
    }
    echo '\\n' . utf8_encode('Programbeskrivelse:\\n' . str_replace("\n", '\\n', str_replace("\r", '', htmlspecialchars_decode($entryObj->program_description, ENT_QUOTES)))) . '\\n' . chr(10) . 'LOCATION:' . utf8_encode(implode(', ', $entryObj->rooms)) . ' (' . $entryObj->area . ')' . chr(10) . 'END:VEVENT' . chr(10);
}
echo 'END:VCALENDAR' . chr(10);
 $Q_next_entries = mysql_query($SQL);
 if (!mysql_num_rows($Q_next_entries)) {
     echo '<i>Ingen</i>' . chr(10);
 } else {
     echo '<span style="color:green">Flyttes til kunde 1:</span><br>';
     echo '<table style="border-collapse: collapse;">' . chr(10);
     echo ' <tr>' . chr(10);
     echo '  <td class="border"><b>' . _('Starts') . '</b></td>' . chr(10);
     echo '  <td class="border"><b>' . _('Name') . '</b></td>' . chr(10);
     echo '  <td class="border"><b>' . _('Where') . '</b></td>' . chr(10);
     echo '  <td class="border"><b>' . _('Contact person') . '</b></td>' . chr(10);
     echo '  <td class="border"><b>' . _('Phone') . '</b></td>' . chr(10);
     echo '  <td class="border"><b>' . _('E-mail') . '</b></td>' . chr(10);
     echo ' </tr>' . chr(10);
     while ($R_entry = mysql_fetch_assoc($Q_next_entries)) {
         $entry = getEntry($R_entry['entry_id']);
         if (count($entry)) {
             echo ' <tr>' . chr(10);
             echo '  <td class="border"><b>' . date('d-m-Y H:i', $entry['time_start']) . '</b></td>' . chr(10);
             echo '  <td class="border"><a href="entry.php?entry_id=' . $entry['entry_id'] . '">' . $entry['entry_name'] . '</a></td>' . chr(10);
             echo '  <td class="border">';
             $area = getArea($entry['area_id']);
             if (count($area)) {
                 echo $area['area_name'] . ' - ';
             }
             $rooms = array();
             foreach ($entry['room_id'] as $rid) {
                 if ($rid == '0') {
                     $rooms[] = _('Whole area');
                 } else {
                     $room = getRoom($rid);
}
if (count($_GET['entry_id']) > 50) {
    $section = 'tobemade_ready';
    include "include/invoice_menu.php";
    echo '<div class="error">Du forsøker å sende mer enn 50 bookinger til regnskap på likt. ' . 'Dette blir sannsynligvis for mye for bookingsystemet (klarer ikke så mange i en PDF), så forsøket er blitt stoppet.<br /><br />' . 'Velg et mindre antall og forsøk igjen.</div>';
    exit;
}
$ignore_errors = false;
if (isset($_GET['ignore_errors']) && $_GET['ignore_errors'] == '1') {
    $ignore_errors = true;
}
$entry_errors = false;
$entries = array();
$entry_ids_url = array();
foreach ($_GET['entry_id'] as $id) {
    $tmp_entry = getEntry($id);
    $id = $tmp_entry['entry_id'];
    $entries[$id] = $tmp_entry;
    $entry_ids_url[] = 'entry_id[]=' . $id;
    $checkInvoice = checkInvoicedata($tmp_entry);
    if (count($checkInvoice[0]) && !$ignore_errors) {
        if (!$entry_errors) {
            $section = 'tobemade_ready';
            include "include/invoice_menu.php";
            $entry_errors = true;
            echo '<span class="hiddenprint">';
            $Q_area = mysql_query("select id as area_id, area_name from mrbs_area order by area_name");
            $num_area = mysql_num_rows($Q_area);
            $counter_area = 0;
            echo '<span style="font-size: 0.8em;">Filtrer p&aring; anlegg: ';
            while ($R = mysql_fetch_assoc($Q_area)) {
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
include_once "glob_inc.inc.php";
if (!isset($_GET['confirm_id'])) {
    $confirm = array();
} else {
    $confirm = getConfirm($_GET['confirm_id']);
}
if (!count($confirm)) {
    print_header($day, $month, $year, $area);
    echo '<h1>' . _('Confirmation') . '</h1>' . chr(10);
    echo _('Can not find confirmation from the confirmation ID you gave.');
    exit;
}
$entry = getEntry($confirm['entry_id']);
if (!count($entry)) {
    print_header($day, $month, $year, $area);
    echo '<h1>' . _('Confirmation') . '</h1>' . chr(10);
    echo _('Error.');
    exit;
}
$user = getUser($confirm['user_id']);
if (!count($user)) {
    print_header($day, $month, $year, $area);
    echo '<h1>' . _('Confirmation') . '</h1>' . chr(10);
    echo _('Error.');
    exit;
}
print_header($day, $month, $year, $area);
echo '<h1>' . _('Confirmation') . ', ' . $entry['entry_name'] . '</h1>' . chr(10);
Example #10
0
		$vare->addChild('vare_id', '5');
		$vare->addChild('tid', $entry['time_start']);
		$vare->addChild('antall', $entry['num_person_child']);
	}
	if($entry['num_person_adult'] > 0)
	{
		$vare = $varer->addChild($entry['entry_id'].'_voksen');
		$vare->addChild('vare_id', '6');
		$vare->addChild('tid', $entry['time_start']);
		$vare->addChild('antall', $entry['num_person_adult']);
	}
}*/
$xml = '<?xml version="1.0" standalone="yes"?>' . chr(10);
$xml .= '<varer area="6" area_name="Vitenfabrikken">' . chr(10);
while ($R = mysql_fetch_assoc($Q)) {
    $entry = getEntry($R['entry_id']);
    if ($entry['num_person_child'] > 0) {
        $xml .= '	<vare from="' . $entry['entry_id'] . '_barn">' . chr(10);
        $xml .= '		<vareid>5</vareid>' . chr(10);
        $xml .= '		<tid>' . $entry['time_start'] . '</tid>' . chr(10);
        $xml .= '		<antall>' . $entry['num_person_child'] . '</antall>' . chr(10);
        $xml .= '	</vare>' . chr(10);
    }
    if ($entry['num_person_adult'] > 0) {
        $xml .= '	<vare from="' . $entry['entry_id'] . '_voksen">' . chr(10);
        $xml .= '		<vareid>6</vareid>' . chr(10);
        $xml .= '		<tid>' . $entry['time_start'] . '</tid>' . chr(10);
        $xml .= '		<antall>' . $entry['num_person_adult'] . '</antall>' . chr(10);
        $xml .= '	</vare>' . chr(10);
    }
}
function sendTrackback($blogid, $entryId, $url)
{
    global $defaultURL, $blog;
    requireModel('blog.entry');
    requireModel('blog.keyword');
    $entry = getEntry($blogid, $entryId);
    if (is_null($entry)) {
        return false;
    }
    $link = "{$defaultURL}/{$entryId}";
    $title = htmlspecialchars($entry['title']);
    $entry['content'] = getEntryContentView($blogid, $entryId, $entry['content'], $entry['contentformatter'], getKeywordNames($blogid));
    $excerpt = str_tag_on(UTF8::lessen(removeAllTags(stripHTML($entry['content'])), 255));
    $blogTitle = $blog['title'];
    $isNeedConvert = strpos($url, '/rserver.php?') !== false || strpos($url, 'blog.naver.com/tb') !== false || strpos($url, 'news.naver.com/tb/') !== false || strpos($url, 'blog.empas.com') !== false || strpos($url, 'blog.yahoo.com') !== false || strpos($url, 'www.blogin.com/tb/') !== false || strpos($url, 'cytb.cyworld.nate.com') !== false || strpos($url, 'www.cine21.com/Movies/tb.php') !== false;
    if ($isNeedConvert) {
        $title = UTF8::convert($title, 'EUC-KR');
        $excerpt = UTF8::convert($excerpt, 'EUC-KR');
        $blogTitle = UTF8::convert($blogTitle, 'EUC-KR');
        $content = "url=" . rawurlencode($link) . "&title=" . rawurlencode($title) . "&blog_name=" . rawurlencode($blogTitle) . "&excerpt=" . rawurlencode($excerpt);
        $request = new HTTPRequest('POST', $url);
        $request->contentType = 'application/x-www-form-urlencoded; charset=euc-kr';
        $isSuccess = $request->send($content);
    } else {
        $content = "url=" . rawurlencode($link) . "&title=" . rawurlencode($title) . "&blog_name=" . rawurlencode($blogTitle) . "&excerpt=" . rawurlencode($excerpt);
        $request = new HTTPRequest('POST', $url);
        $request->contentType = 'application/x-www-form-urlencoded; charset=utf-8';
        $isSuccess = $request->send($content);
    }
    if ($isSuccess && checkResponseXML($request->responseText) === 0) {
        //		$url = POD::escapeString(UTF8::lessenAsEncoding($url, 255));
        $trackbacklog = new TrackbackLog();
        $trackbacklog->entry = $entryId;
        $trackbacklog->url = POD::escapeString(UTF8::lessenAsEncoding($url, 255));
        $trackbacklog->add();
        //		POD::query("INSERT INTO {$database['prefix']}TrackbackLogs VALUES ($blogid, '', $entryId, '$url', UNIX_TIMESTAMP())");
        return true;
    }
    return false;
}
Example #12
0
function getDefaultCenterPanel($mapping)
{
    $ctx = Model_Context::getInstance();
    $blogid = $ctx->getProperty('blog.id');
    ?>
									<div id="<?php 
    echo $mapping['plugin'];
    ?>
" class="section">
									<h3 class="caption<?php 
    echo isset($_REQUEST['edit']) ? ' visible' : ' invisible';
    ?>
">
											<span><?php 
    echo _t('알림판');
    if (isset($_REQUEST['edit'])) {
        ?>
											<a id="<?php 
        echo $mapping['plugin'];
        ?>
widgetup" href="<?php 
        echo $ctx->getProperty('uri.blog');
        ?>
/owner/center/dashboard?edit&pos=<?php 
        echo $positionCounter;
        ?>
&amp;rel=-1&edit"><?php 
        echo _t('위로');
        ?>
</a>
											<a id="<?php 
        echo $mapping['plugin'];
        ?>
widgetdown" href="<?php 
        echo $ctx->getProperty('uri.blog');
        ?>
/owner/center/dashboard?edit&pos=<?php 
        echo $positionCounter;
        ?>
&amp;rel=1&edit"><?php 
        echo _t('아래로');
        ?>
</a>
<?php 
    }
    ?>
											</span>
										</h3>
<?php 
    if (isset($_REQUEST['edit'])) {
        ?>
									</div>
<?php 
        return true;
    } else {
        // Get default data
        $stats = Statistics::getStatistics($blogid);
        $latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0);
        $comments = getRecentComments($blogid, 10);
        $guestbooks = getRecentGuestbook($blogid, 10);
        list($commentNotifies, $paging) = getCommentsNotifiedWithPagingForOwner($blogid, 0, null, null, null, 1, 10);
        $trackbacks = getRecentTrackbacks($blogid, 10);
        $recents = array();
        // title, date, link, category
        foreach ($comments as $comment) {
            array_push($recents, array('title' => $comment['comment'], 'date' => $comment['written'], 'link' => $ctx->getProperty('uri.blog') . "/" . $comment['entry'] . "#comment" . $comment['id'], 'category' => 'comment'));
        }
        foreach ($commentNotifies as $comment) {
            array_push($recents, array('title' => $comment['comment'], 'date' => $comment['written'], 'link' => $ctx->getProperty('uri.blog') . "/owner/communication/notify", 'category' => 'commentNotify'));
        }
        foreach ($guestbooks as $guestbook) {
            array_push($recents, array('title' => $guestbook['comment'], 'date' => $guestbook['written'], 'link' => $ctx->getProperty('uri.blog') . "/guestbook/" . $guestbook['id'] . "#guestbook" . $guestbook['id'], 'category' => 'guestbook'));
        }
        foreach ($trackbacks as $trackback) {
            array_push($recents, array('title' => $trackback['subject'], 'date' => $trackback['written'], 'link' => $ctx->getProperty('uri.blog') . "/" . $trackback['entry'] . "#trackback" . $trackback['id'], 'category' => 'trackback'));
        }
        $sort_array = array();
        foreach ($recents as $uniqid => $row) {
            // Sorting.
            foreach ($row as $key => $value) {
                if (!array_key_exists($key, $sort_array)) {
                    $sort_array[$key] = array();
                }
                $sort_array[$key][$uniqid] = $value;
            }
        }
        if (!empty($sort_array)) {
            array_multisort($sort_array['date'], SORT_DESC, $recents);
        }
        $recents = array_slice($recents, 0, 14);
        ?>
										<div id="shortcut-collection">
											<h4 class="caption"><span><?php 
        echo _t('바로가기');
        ?>
</span></h4>

											<ul>
												<li class="newPost"><a class="newPost" href="<?php 
        echo $ctx->getProperty('uri.blog');
        ?>
/owner/entry/post"><span><?php 
        echo _t('새 글 쓰기');
        ?>
</span></a></li>
<?php 
        if ($latestEntryId !== 0) {
            $latestEntry = getEntry($blogid, $latestEntryId);
            if (!is_null($latestEntry)) {
                ?>
												<li class="modifyPost"><a href="<?php 
                echo $ctx->getProperty('uri.blog');
                ?>
/owner/entry/edit/<?php 
                echo $latestEntry['id'];
                ?>
"><?php 
                echo _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10)));
                ?>
</a></li>
<?php 
            }
        }
        if ($ctx->getProperty('service.reader') == true) {
            ?>
												<li class="rssReader"><a href="<?php 
            echo $ctx->getProperty('uri.blog');
            ?>
/owner/network/reader"><?php 
            echo _t('RSS로 등록한 이웃 글 보기');
            ?>
</a></li>
<?php 
        }
        if (Acl::check("group.administrators")) {
            ?>
												<li class="deleteCache"><a href="<?php 
            echo $ctx->getProperty('uri.blog');
            ?>
/owner/center/dashboard/cleanup" onclick="cleanupCache();return false;"><?php 
            echo _t('캐시 지우기');
            ?>
</a></li>
<?php 
            if (Acl::check("group.creators")) {
                ?>
												<li class="optimizeStorage"><a href="<?php 
                echo $ctx->getProperty('uri.blog');
                ?>
/owner/data" onclick="optimizeData();return false;"><?php 
                echo _t('저장소 최적화');
                ?>
</a></li>
<?php 
            }
        }
        ?>
												<li class="clear"></li>
											</ul>
										</div>

										<div id="total-information">
											<h4 class="caption"><span><?php 
        echo _t('요약');
        ?>
</span></h4>

											<table class="posts-line">
												<caption><?php 
        echo _t('글');
        ?>
</caption>
												<thead>
													<th>type</th>
													<th>sum</th>
												</thead>
												<tbody>
													<tr>
														<td class="type"><?php 
        echo _t('글');
        ?>
</td>
														<td class="sum"><?php 
        echo number_format(getEntriesTotalCount($blogid));
        ?>
</td>
													</tr>
													<tr>
														<td class="type"><?php 
        echo _t('댓글');
        ?>
</td>
														<td class="sum"><?php 
        echo number_format(getCommentCount($blogid));
        ?>
</td>
													</tr>
													<tr>
														<td class="type"><?php 
        echo _t('방명록');
        ?>
</td>
														<td class="sum"><?php 
        echo number_format(getGuestbookCount($blogid));
        ?>
</td>
													</tr>
													<tr>
														<td class="type"><?php 
        echo _t('걸린 글');
        ?>
</td>
														<td class="sum"><?php 
        echo number_format(getTrackbackCount($blogid));
        ?>
</td>
													</tr>
												</tbody>
											</table>
											<table class="visitors-line">
												<caption><?php 
        echo _t('방문자');
        ?>
</caption>
												<thead>
													<th>type</th>
													<th>sum</th>
												</thead>
												<tbody>
													<tr>
														<td class="type"><?php 
        echo _t('오늘');
        ?>
</td>
														<td class="sum"><?php 
        echo number_format($stats['today']);
        ?>
</td>
													</tr>
													<tr>
														<td class="type"><?php 
        echo _t('어제');
        ?>
</td>
														<td class="sum"><?php 
        echo number_format($stats['yesterday']);
        ?>
</td>
													</tr>
													<tr>
														<td class="type"><?php 
        echo _t('7일 평균');
        ?>
</td>
														<td class="sum"><?php 
        $weekly = Statistics::getWeeklyStatistics();
        $weeklycount = 0;
        foreach ($weekly as $day) {
            $weeklycount += $day['visits'];
        }
        echo number_format($weeklycount / 7);
        unset($weekly);
        unset($weeklycount);
        ?>
</td>
													</tr>
													<tr>
														<td class="type"><?php 
        echo _t('총방문자');
        ?>
</td>
														<td class="sum"><?php 
        echo number_format($stats['total']);
        ?>
</td>
													</tr>
												</tbody>
											</table>
										</div>

										<div id="myBlogInfo">
											<h4 class="caption"><span><a href="<?php 
        echo $ctx->getProperty('uri.blog') . '/owner/communication/comment';
        ?>
"><?php 
        echo _t('알림판');
        ?>
</a></span></h4>
											<table class="recent">
												<caption>asdasd</caption>
												<thead>
													<tr>
														<th scope="col" class="date"><?php 
        echo _t('날짜');
        ?>
</th>
														<th scope="col" class="category"><?php 
        echo _t('종류');
        ?>
</th>
														<th scope="col"><?php 
        echo _t('내용');
        ?>
</th>
													</tr>
												</thead>
												<tbody>
<?php 
        foreach ($recents as $item) {
            ?>
													<tr class="<?php 
            echo $item['category'];
            ?>
">
														<td class="date"><?php 
            echo Timestamp::format('%m/%d', $item['date']);
            ?>
</td>
														<td class="category">
															<?php 
            switch ($item['category']) {
                case 'trackback':
                    echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/trackback?status=received">' . _t('걸린글') . '</a>';
                    break;
                case 'comment':
                    echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/comment?status=comment">' . _t('댓글') . '</a>';
                    break;
                case 'commentNotify':
                    echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/notify">' . _t('알리미') . '</a>';
                    break;
                case 'guestbook':
                    echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/comment?status=guestbook">' . _t('방명록') . '</a>';
                    break;
            }
            ?>
														</td>
														<td class="title"><a href="<?php 
            echo $item['link'];
            ?>
"><?php 
            echo htmlspecialchars(Utils_Unicode::lessenAsEm($item['title'], 20));
            ?>
</a></td>
													</tr>
<?php 
        }
        ?>
												</tbody>
											</table>
										</div>

<?php 
        $noticeURL = TEXTCUBE_NOTICE_URL;
        $noticeURLRSS = $noticeURL . ($ctx->getProperty('blog.language') ? $ctx->getProperty('blog.language') : "ko") . "/rss";
        $noticeEntries = array();
        if (!is_null(Setting::getServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language')))) {
            $noticeEntries = unserialize(Setting::getServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language')));
        } else {
            list($result, $feed, $xml) = getRemoteFeed($noticeURLRSS);
            if ($result == 0) {
                $xmls = new XMLStruct();
                $xmls->setXPathBaseIndex(1);
                $noticeEntries = array();
                if ($xmls->open($xml, $ctx->getProperty('service.encoding'))) {
                    if ($xmls->getAttribute('/rss', 'version')) {
                        for ($i = 1; $link = $xmls->getValue("/rss/channel/item[{$i}]/link"); $i++) {
                            $item = array('permalink' => rawurldecode($link));
                            $item['title'] = $xmls->getValue("/rss/channel/item[{$i}]/title");
                            if ($xmls->getValue("/rss/channel/item[{$i}]/pubDate")) {
                                $item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/pubDate"));
                            } else {
                                if ($xmls->getValue("/rss/channel/item[{$i}]/dc:date")) {
                                    $item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/dc:date"));
                                } else {
                                    $item['written'] = 0;
                                }
                            }
                            array_push($noticeEntries, $item);
                        }
                    }
                }
                Setting::setServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language'), serialize($noticeEntries));
            }
        }
        ?>
										<div id="textcube-notice">
											<h4 class="caption"><span><a href="<?php 
        echo $noticeURL . ($ctx->getProperty('blog.language') ? $ctx->getProperty('blog.language') : "ko");
        ?>
"><?php 
        echo _t('공지사항');
        ?>
</a></span></h4>
<?php 
        if (count($noticeEntries) > 0) {
            array_splice($noticeEntries, 3, count($noticeEntries) - 3);
            ?>
											<table>
												<tbody>
<?php 
            foreach ($noticeEntries as $item) {
                ?>
													<tr>
														<td class="date"><?php 
                echo Timestamp::format2($item['written']);
                ?>
</td>
														<td class="title"><a href="<?php 
                echo $item['permalink'];
                ?>
" onclick="return openLinkInNewWindow(this);" ><?php 
                echo htmlspecialchars(Utils_Unicode::lessenAsEm($item['title'], 35));
                ?>
</a></td>
													</tr>
<?php 
            }
            ?>
												</tbody>
											</table>

<?php 
        } else {
            ?>
											<div id="fail-notice">
												<?php 
            echo _t('공지사항을 가져올 수 없습니다. 잠시 후 다시 시도해 주십시오.');
            ?>
											</div>
<?php 
        }
        ?>
										</div>
<?php 
    }
    ?>
									</div>
<?php 
}
Example #13
0
function sendTrackback($blogid, $entryId, $url)
{
    importlib('model.blog.entry');
    importlib('model.blog.keyword');
    $context = Model_Context::getInstance();
    $entry = getEntry($blogid, $entryId);
    if (is_null($entry)) {
        return false;
    }
    $link = $context->getProperty('uri.default') . "/" . $entryId;
    $title = htmlspecialchars($entry['title']);
    $entry['content'] = getEntryContentView($blogid, $entryId, $entry['content'], $entry['contentformatter'], getKeywordNames($blogid));
    $excerpt = str_tag_on(Utils_Unicode::lessen(removeAllTags(stripHTML($entry['content'])), 255));
    $blogTitle = $context->getProperty('blog.title');
    $isNeedConvert = strpos($url, '/rserver.php?') !== false || strpos($url, 'blog.naver.com/tb') !== false || strpos($url, 'news.naver.com/tb/') !== false || strpos($url, 'blog.empas.com') !== false || strpos($url, 'blog.yahoo.com') !== false || strpos($url, 'www.blogin.com/tb/') !== false || strpos($url, 'cytb.cyworld.nate.com') !== false || strpos($url, 'www.cine21.com/Movies/tb.php') !== false;
    if ($isNeedConvert) {
        $title = Utils_Unicode::convert($title, 'EUC-KR');
        $excerpt = Utils_Unicode::convert($excerpt, 'EUC-KR');
        $blogTitle = Utils_Unicode::convert($blogTitle, 'EUC-KR');
        $content = "url=" . rawurlencode($link) . "&title=" . rawurlencode($title) . "&blog_name=" . rawurlencode($blogTitle) . "&excerpt=" . rawurlencode($excerpt);
        $request = new HTTPRequest('POST', $url);
        $request->contentType = 'application/x-www-form-urlencoded; charset=euc-kr';
        $isSuccess = $request->send($content);
    } else {
        $content = "url=" . rawurlencode($link) . "&title=" . rawurlencode($title) . "&blog_name=" . rawurlencode($blogTitle) . "&excerpt=" . rawurlencode($excerpt);
        $request = new HTTPRequest('POST', $url);
        $request->contentType = 'application/x-www-form-urlencoded; charset=utf-8';
        $isSuccess = $request->send($content);
    }
    if ($isSuccess && checkResponseXML($request->responseText) === 0) {
        $trackbacklog = new TrackbackLog();
        $trackbacklog->entry = $entryId;
        $trackbacklog->url = Utils_Unicode::lessenAsEncoding($url, 255);
        $trackbacklog->add();
        return true;
    }
    return false;
}
Example #14
0
            $method = "create";
        } else {
            if (isset($_POST['update'])) {
                $method = "update";
            }
        }
    }
}
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
    //split request URI, remove empty elements, and rebase array to 0
    $arr = array_values(array_filter(split("/", $_SERVER['REQUEST_URI'])));
    $arr_size = count($arr);
    if ($arr_size >= 2 && $arr[$arr_size - 2] === 'gm') {
        //gm & hash
        $hash = $arr[$arr_size - 1];
        $entry = getEntry($hash);
        $input = $entry->getTextContent();
        $title = $entry->getTitle();
        $desc = $entry->getDescription();
        $method = "display";
    } else {
        if ($arr_size >= 2 && $arr[$arr_size - 3] === 'gm') {
            //gm & hash & editor hash
            $hash = $arr[$arr_size - 2];
            $editor_hash = $arr[$arr_size - 1];
            $entry = getEntryForEdit($hash, $editor_hash);
            $input = $entry->getTextContent();
            $title = $entry->getTitle();
            $desc = $entry->getDescription();
            $method = "edit";
        }
Example #15
0
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('templateId' => array('int', 'default' => 0), 'isSaved' => array('bool', 'default' => false), 'entryId' => array('int', 'default' => 0)));
require ROOT . '/library/preprocessor.php';
requireModel('blog.entry');
requireStrictRoute();
if (!is_null($entry = getEntry($blogid, $_POST['templateId']))) {
    if (!$_POST['isSaved']) {
        $entry['category'] = 0;
        $entry['visibility'] = 0;
        $entry['published'] = 'UNIX_TIMESTAMP()';
        $id = addEntry($blogid, $entry);
    } else {
        if ($_POST['entryId'] == 0) {
            Respond::ResultPage(1);
        }
        $id = $_POST['entryId'];
    }
    // Delete original attachments.
    deleteAttachments($blogid, $id);
    if (copyAttachments($blogid, $_POST['templateId'], $id) === true) {
        $result = array("error" => "0", "title" => $entry['title'], "content" => $entry['content'], "entryId" => $id);
        Respond::PrintResult($result);
    }
}
Respond::ResultPage(1);
Example #16
0
        if ($num = postNewEntry($_POST['uri'], $_POST['title'], $_POST['desc'])) {
            redir("/?e={$num}");
        }
    } else {
        $page = "Something's not right";
    }
} elseif (int_esc($_GET['p'])) {
    $page = getPage($_GET['p']);
    if (getPagesCount() > $_GET['p']) {
        $nextpage = "| <a href='{$r}/?p='" . ($_GET['p'] + 1) . "'>25 older entries »</a>";
    }
    if ($_GET['p'] > 0) {
        $prevpage = "<a href='{$r}/?p='" . ($_GET['p'] - 1) . "'>«25 newer entries</a> |";
    }
} elseif (int_esc($_GET['e'])) {
    $page = getEntry($_GET['e']) . getComments($_GET['e']) . "\n\t<form action='{$r}/?ac={$_GET['e']}' method='post'>\n\t<fieldset>\n\t<label for='name'>Your name:</label> <input type='text' name='name' id='name' size='20' /> <br />\n\t<label for='text'>Comment: (<a href='http://textile.thresholdstate.com/'>textile</a> enabled):</label> <textarea name='text' id='text' rows='10' cols='40'></textarea> <br />\n\t<input type='submit' value='Submit' />\n\t</fieldset>\n\t</form>";
} else {
    $page = "<h1> Post new link </h1>\n\t<form action='{$r}/?a=new-uri' method='post'>\n\t<fieldset>\n\t<label for='uri'>gnunet:// URI:</label> <input type='text' name='uri' id='uri' size='50' /> <br />\n\t<label for='title'>Link title:</label> <input type='text' name='title' id='title' size='50' /> <br />\n\t<label for='desc'>Description (<a href='http://textile.thresholdstate.com/'>textile</a> enabled):</label> <textarea name='desc' id='desc' rows='10' cols='40'></textarea> <br />\n\t<input type='submit' value='Submit' />\n\t</fieldset>\n\t</form>";
    $page .= getPage(0);
}
if (!$_COOKIE['style'] || !file_exists("styles/{$_COOKIE['style']}")) {
    $_COOKIE['style'] = 'dark.css';
}
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n   \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n   <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>\n   <head> <title>GNUnet file sharing v2</title>\n   <link href='{$r}/styles/{$_COOKIE['style']}' rel='stylesheet' type='text/css' />\n   <meta http-equiv='Content-Type' content='text/xhtml;charset=utf-8' />\n   </head>\n   <body>\n   <p>{$prevpage} <a href='{$r}/'>Main page</a> {$nextpage}</p>\n   {$page}\n   <p>Style: ";
$styles = scandir("styles");
array_shift($styles);
array_shift($styles);
foreach ($styles as $style) {
    echo "<a href='{$r}/?ss={$style}'>{$style}</a> ";
}
echo "</p>\n   </body>\n   </html>";
Example #17
0
function exchangesync_analyzeSync($entries, $cal_ids, $cal, $user, $user_id)
{
    global $alert_admin, $alerts;
    global $systemurl;
    global $sync, $entryObj, $entries_sync;
    global $area;
    foreach ($entries as $entry) {
        // Checking for previous sync
        if (isset($sync[$entry['entry_id']])) {
            // Okey, this entry has been synced to this user before
            // Check if it is deleted in Exchange
            $this_sync = $sync[$entry['entry_id']];
            if (!isset($cal_ids[$this_sync['exchange_id']])) {
                // So, the user or somebody has deleted the element in Exchange
                printout('Err! Calendar element for entry ' . $entry['entry_id'] . ' is deleted in Exchange! Alerting user and creates a new one.');
                $entry_sync = true;
                // Deleting from sync, this will keep the changed appointment in the users Exchange calendar but also create a new one
                mysql_query("DELETE FROM `entry_exchangesync`\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t`exchange_id` = '" . $this_sync['exchange_id'] . "'\n\t\t\t\t\t");
                printout_mysqlerror();
                // Alert user
                emailSend($user_id, 'Slettet avtale i kalender', exchangesync_getUsermsgDeleted($entry));
                // Alert admin
                $alert_admin = true;
                $alerts[] = 'User ' . $user_id . ' has deleted a calendar item.';
            } else {
                // Check if it is changed in Exchange
                if ($cal_ids[$this_sync['exchange_id']] != $this_sync['exchange_changekey']) {
                    // So, the user or something has changed the element in Exchange
                    printout('Err! Calendar element for entry ' . $entry['entry_id'] . ' is changed in Exchange! Alerting user and creates a new one.');
                    $entry_sync = true;
                    // Deleting from sync, this will keep the changed appointment in the users Exchange calendar but also create a new one
                    mysql_query("DELETE FROM `entry_exchangesync`\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t`exchange_id` = '" . $this_sync['exchange_id'] . "'\n\t\t\t\t\t\t");
                    printout_mysqlerror();
                    // Alert user
                    emailSend($user_id, 'Endret avtale i kalender', exchangesync_getUsermsgChanged($entry));
                    // Alert admin
                    $alert_admin = true;
                    $alerts[] = 'User ' . $user_id . ' has edited a calendar item.';
                } else {
                    // Okey, no changes in Exchange
                    // Is there anything changed in JM-booking?
                    // TODO: Is it possible to only check relevant fields?
                    if ($this_sync['entry_rev'] < $entry['rev_num']) {
                        // Create a new calendar element and delete the old one
                        // (no updates)
                        $entry_sync = true;
                    } else {
                        // No changes anywhere, do nothing
                        $entry_sync = false;
                    }
                }
            }
        } else {
            // Not synced in this period of time before
            // => check the others too
            $entry_sync = true;
        }
        /*
         */
        if ($entry_sync) {
            $entries_sync[$entry['entry_id']] = getEntry($entry['entry_id']);
        }
        unset($entry_sync);
        unset($sync[$entry['entry_id']]);
    }
}
Example #18
0
<?php

/// Copyright (c) 2004-2011, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('__TEXTCUBE_MOBILE__', true);
$IV = array('POST' => array('password' => array('string', 'default' => null)));
require ROOT . '/library/preprocessor.php';
requireView('mobileView');
$entry = getEntry($blogid, $suri['id']);
if (!is_null($entry) && isset($_POST['password']) && $entry['password'] == $_POST['password']) {
    setcookie('GUEST_PASSWORD', $_POST['password'], time() + 86400, "{$blogURL}/");
    header("Location: {$blogURL}/{$suri['id']}");
} else {
    printMobileErrorPage(_text('비밀번호 확인'), _text('패스워드가 틀렸습니다.'), "{$blogURL}/{$suri['id']}");
}
Example #19
0
function publishEntries()
{
    global $database;
    $blogid = getBlogId();
    $closestReservedTime = Setting::getBlogSettingGlobal('closestReservedPostTime', INT_MAX);
    if ($closestReservedTime < Timestamp::getUNIXtime()) {
        $entries = POD::queryAll("SELECT id, visibility, category\n\t\t\tFROM {$database['prefix']}Entries \n\t\t\tWHERE blogid = {$blogid} AND draft = 0 AND visibility < 0 AND published < UNIX_TIMESTAMP()");
        if (count($entries) == 0) {
            return;
        }
        foreach ($entries as $entry) {
            $result = POD::query("UPDATE {$database['prefix']}Entries \n\t\t\t\tSET visibility = 0 \n\t\t\t\tWHERE blogid = {$blogid} AND id = {$entry['id']} AND draft = 0");
            if ($entry['visibility'] == -3) {
                if ($result && setEntryVisibility($entry['id'], 2)) {
                    $updatedEntry = getEntry($blogid, $entry['id']);
                    if (!is_null($updatedEntry)) {
                        fireEvent('UpdatePost', $entry['id'], $updatedEntry);
                        setEntryVisibility($entry['id'], 3);
                    }
                }
            } else {
                if ($result) {
                    setEntryVisibility($entry['id'], abs($entry['visibility']));
                    $updatedEntry = getEntry($blogid, $entry['id']);
                    if (!is_null($updatedEntry)) {
                        fireEvent('UpdatePost', $entry['id'], $updatedEntry);
                    }
                }
            }
        }
        $newClosestTime = POD::queryCell("SELECT min(published)\n\t\t\tFROM {$database['prefix']}Entries\n\t\t\tWHERE blogid = {$blogid} AND draft = 0 AND visibility < 0 AND published > UNIX_TIMESTAMP()");
        if (!empty($newClosestTime)) {
            Setting::setBlogSettingGlobal('closestReservedPostTime', $newClosestTime);
        } else {
            Setting::setBlogSettingGlobal('closestReservedPostTime', INT_MAX);
        }
    }
}
Example #20
0
}
echo date('d.m.Y', $start);
echo '</title></head>';
echo '<body background="img/infoskjerm-bg.png" style="margin: 0px; padding: 0px;">' . chr(10);
$Q_room = mysql_query("select id as room_id, room_name from `mrbs_room` where area_id = '" . $area . "' and hidden = 'false'");
$rooms = array();
while ($R_room = mysql_fetch_assoc($Q_room)) {
    $rooms[$R_room['room_id']] = $R_room['room_name'];
}
$entries = array();
$timed_entries = array();
foreach ($rooms as $room_id => $room) {
    $events_room = checktime_Room($start, $end, $area, $room_id);
    if (isset($events_room[$room_id])) {
        foreach ($events_room[$room_id] as $entry_id) {
            $event = getEntry($entry_id);
            if (count($event)) {
                $entries[$event['entry_id']] = $event;
                if ($event['time_start'] < $start) {
                    $event['time_start'] = $start;
                }
                $event['time_start'] = round_t_down($event['time_start'], $resolution);
                $timed_entries[$event['time_start']][$event['entry_id']] = $event['entry_id'];
            }
        }
    }
}
echo '<table width="1024" style="border-collapse: collapse;">' . chr(10);
echo ' <tr>' . chr(10);
echo '  <td height="135px">' . chr(10);
echo ' <tr>' . chr(10);
Example #21
0
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
include_once "glob_inc.inc.php";
if (!isset($_GET['entry_id'])) {
    echo 'Error. No entry_id given.';
    exit;
}
$entry = getEntry($_GET['entry_id']);
if (!count($entry)) {
    echo 'Error. Entry not found.';
    exit;
}
if (isset($_POST['confirm_tpl'])) {
    $emails = array();
    if (isset($_POST['emails']) && is_array($_POST['emails'])) {
        foreach ($_POST['emails'] as $emailnum) {
            if (isset($_POST['email' . $emailnum]) && $_POST['email' . $emailnum] != '') {
                $emails[] = $_POST['email' . $emailnum];
            }
        }
    }
    $confirm_tpl = '';
    if (isset($_POST['confirm_tpl'])) {
Example #22
0
// Address_id
addChoice('invoice_address_id', array('0' => _('No customer set.')));
// Yes/no
addChoice('invoice', array('1' => _('Yes'), '0' => _('No')));
addChoice('invoice_electronic', array('1' => _('Yes'), '0' => _('No')));
addChoice('service_alco', array('1' => _('Yes'), '0' => _('No')));
addChoice('num_person_count', array('1' => _('Yes'), '0' => _('No')));
/* ### GETTING DATA FROM ENTRY OR DEFAULTS ### */
$entry_add = TRUE;
$copy_entry = false;
if ($entry_id != 0 || isset($_GET['copy_entry_id'])) {
    if ($entry_id != 0) {
        $entry = getEntry($entry_id);
        $entry_add = FALSE;
    } else {
        $entry = getEntry($_GET['copy_entry_id']);
        $copy_entry = true;
    }
    if (!count($entry)) {
        echo _('Can\'t find entry');
        exit;
    }
    // Add the values to $entry_fields
    addValue('entry_id', $entry['entry_id']);
    addValue('entry_title', $entry['entry_title']);
    addValue('entry_type_id', $entry['entry_type_id']);
    addValue('time_start', $entry['time_start']);
    addValue('time_end', $entry['time_end']);
    addValue('area_id', $entry['area_id']);
    addValueArray('room_id', $entry['room_id']);
    addValueArray('user_assigned', $entry['user_assigned']);
Example #23
0
<?php

/// Copyright (c) 2004-2015, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('visibility' => array('int', 0, 3), 'starred' => array('int', 0, 2), 'category' => array('int', 'default' => 0), 'title' => array('string'), 'content' => array('string'), 'contentformatter' => array('string'), 'contenteditor' => array('string'), 'permalink' => array('string', 'default' => ''), 'location' => array('string', 'default' => '/'), 'latitude' => array('number', 'default' => null, 'min' => -90.0, 'max' => 90.0, 'bypass' => true), 'longitude' => array('number', 'default' => null, 'min' => -180.0, 'max' => 180.0, 'bypass' => true), 'tag' => array('string', 'default' => ''), 'acceptcomment' => array(array('0', '1'), 'default' => '0'), 'accepttrackback' => array(array('0', '1'), 'default' => '0'), 'published' => array('int', 0, 'default' => 1)));
require ROOT . '/library/preprocessor.php';
importlib('model.blog.entry');
requireStrictRoute();
if (empty($suri['id'])) {
    $entry = array();
} else {
    $updateDraft = 0;
    $entry = getEntry($blogid, $suri['id']);
    if (is_null($entry)) {
        $entry = getEntry($blogid, $suri['id'], true);
        $updateDraft = 1;
    }
}
if (empty($suri['id']) || !is_null($entry)) {
    $entry['visibility'] = $_POST['visibility'];
    $entry['starred'] = $_POST['starred'];
    $entry['category'] = $_POST['category'];
    $entry['location'] = empty($_POST['location']) ? '/' : $_POST['location'];
    $entry['latitude'] = empty($_POST['latitude']) || $_POST['latitude'] == "null" ? null : $_POST['latitude'];
    $entry['longitude'] = empty($_POST['longitude']) || $_POST['longitude'] == "null" ? null : $_POST['longitude'];
    $entry['tag'] = empty($_POST['tag']) ? '' : $_POST['tag'];
    $entry['title'] = $_POST['title'];
    $entry['content'] = $_POST['content'];
    $entry['contentformatter'] = $_POST['contentformatter'];
    $entry['contenteditor'] = $_POST['contenteditor'];
Example #24
0
function updateCategoryByEntryId($blogid, $entryId, $action = 'add', $parameters = null)
{
    clearCategoryCache();
    $entry = getEntry($blogid, $entryId);
    // for deleteEntry
    if (is_null($entry) and isset($parameters['entry'])) {
        $entry = $parameters['entry'];
    }
    $categoryId = $entry['category'];
    $parent = getParentCategoryId($blogid, $categoryId);
    $categories = array($categoryId => $action);
    switch ($action) {
        case 'add':
            updateCategoryByCategoryId($blogid, $categoryId, 'add', array('visibility' => $entry['visibility']));
            if (!empty($parent)) {
                updateCategoryByCategoryId($blogid, $parent, 'add', array('visibility' => $entry['visibility']));
            }
            break;
        case 'delete':
            updateCategoryByCategoryId($blogid, $categoryId, 'delete', array('visibility' => $entry['visibility']));
            if (!empty($parent)) {
                updateCategoryByCategoryId($blogid, $parent, 'delete', array('visibility' => $entry['visibility']));
            }
            break;
        case 'update':
            if (isset($parameters['category']) && $parameters['category'][0] != $parameters['category'][1]) {
                // category is changed. oldcategory - 1, newcategory + 1.
                $oldparent = getParentCategoryId($blogid, $parameters['category'][0]);
                $newparent = getParentCategoryId($blogid, $parameters['category'][1]);
                if (is_null($oldparent) && !is_null($newparent) && $parameters['category'][0] == $newparent) {
                    // level 1 -> 2. newcategory + 1
                    updateCategoryByCategoryId($blogid, $parameters['category'][1], 'add', array('visibility' => $parameters['visibility'][1]));
                } else {
                    if (!is_null($oldparent) && is_null($newparent) && $parameters['category'][1] == $oldparent) {
                        // level 2 -> 1. oldcategory - 1
                        updateCategoryByCategoryId($blogid, $parameters['category'][0], 'delete', array('visibility' => $parameters['visibility'][0]));
                    } else {
                        // etcs
                        updateCategoryByCategoryId($blogid, $parameters['category'][0], 'delete', array('visibility' => $parameters['visibility'][0]));
                        updateCategoryByCategoryId($blogid, $parameters['category'][1], 'add', array('visibility' => $parameters['visibility'][1]));
                        if (!is_null($oldparent)) {
                            updateCategoryByCategoryId($blogid, $oldparent, 'delete', array('visibility' => $parameters['visibility'][0]));
                        }
                        if (!is_null($newparent)) {
                            updateCategoryByCategoryId($blogid, $newparent, 'add', array('visibility' => $parameters['visibility'][1]));
                        }
                    }
                }
            } else {
                // Same category case. should see the visibility change
                if (isset($parameters['visibility']) && $parameters['visibility'][0] != $parameters['visibility'][1]) {
                    updateCategoryByCategoryId($blogid, $categoryId, 'update', $parameters);
                }
            }
        default:
            break;
    }
}
Example #25
0
$IV = array('GET' => array('draft' => array('any', 'mandatory' => false), 'popupEditor' => array('any', 'mandatory' => false), 'returnURL' => array('string', 'mandatory' => false), 'slogan' => array('string', 'mandatory' => false), 'category' => array('int', 'default' => 0), 'editor' => array('string', 'mandatory' => false)), 'POST' => array('category' => array('int', 'default' => 0), 'search' => array('string', 'default' => ''), 'slogan' => array('string', 'mandatory' => false), 'returnURL' => array('string', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
requireModel("blog.entry");
requireModel("blog.tag");
requireModel("blog.locative");
requireModel("blog.attachment");
$context = Model_Context::getInstance();
$isKeyword = false;
define('__TEXTCUBE_EDIT__', true);
if (defined('__TEXTCUBE_POST__')) {
    $suri['id'] = 0;
}
if (isset($_GET['draft'])) {
    $entry = getEntry(getBlogId(), $suri['id'], true);
} else {
    $entry = getEntry(getBlogId(), $suri['id'], false);
}
if (is_null($entry)) {
    Respond::ErrorPage(_t('포스트 정보가 존재하지 않습니다.'));
    $isKeyword = $entry['category'] == -1;
}
if (defined('__TEXTCUBE_POST__') && isset($_GET['category'])) {
    $entry['category'] = $_GET['category'];
}
if (isset($_POST['slogan'])) {
    $_GET['slogan'] = $_POST['slogan'];
}
if (defined('__TEXTCUBE_POST__') && isset($_GET['slogan'])) {
    $entry['slogan'] = $_GET['slogan'];
    $entry['title'] = $_GET['slogan'];
}
Example #26
0
function publishEntries()
{
    $ctx = Model_Context::getInstance();
    $pool = DBModel::getInstance();
    $blogid = getBlogId();
    $closestReservedTime = Setting::getBlogSettingGlobal('closestReservedPostTime', INT_MAX);
    if ($closestReservedTime < Timestamp::getUNIXtime()) {
        $pool->init("Entries");
        $pool->setQualifier("blogid", "eq", $blogid);
        $pool->setQualifier("draft", "eq", 0);
        $pool->setQualifier("visibility", "<", 0);
        $pool->setQualifier("published", "<", Timestamp::getUNIXtime());
        $entries = $pool->getAll("id, visibility, category");
        if (count($entries) == 0) {
            return;
        }
        foreach ($entries as $entry) {
            $pool->init("Entries");
            $pool->setQualifier("blogid", "eq", $blogid);
            $pool->setQualifier("draft", "eq", 0);
            $pool->setQualifier("id", "eq", $entry['id']);
            $pool->setAttribute("visibility", 0);
            $result = $pool->update();
            if ($entry['visibility'] == -3) {
                if ($result && setEntryVisibility($entry['id'], 2)) {
                    $updatedEntry = getEntry($blogid, $entry['id']);
                    if (!is_null($updatedEntry)) {
                        fireEvent('UpdatePost', $entry['id'], $updatedEntry);
                        setEntryVisibility($entry['id'], 3);
                    }
                }
            } else {
                if ($result) {
                    setEntryVisibility($entry['id'], abs($entry['visibility']));
                    $updatedEntry = getEntry($blogid, $entry['id']);
                    if (!is_null($updatedEntry)) {
                        fireEvent('UpdatePost', $entry['id'], $updatedEntry);
                    }
                }
            }
        }
        $pool->init("Entries");
        $pool->setQualifier("blogid", "eq", $blogid);
        $pool->setQualifier("draft", "eq", 0);
        $pool->setQualifier("visibility", "<", 0);
        $pool->setQualifier("published", ">", Timestamp::getUNIXtime());
        $newClosestTime = $pool->getCell("min(published)");
        if (!empty($newClosestTime)) {
            Setting::setBlogSettingGlobal('closestReservedPostTime', $newClosestTime);
        } else {
            Setting::setBlogSettingGlobal('closestReservedPostTime', INT_MAX);
        }
    }
}
Example #27
0
<?php

/// Copyright (c) 2004-2015, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('__TEXTCUBE_ADMINPANEL__', true);
require ROOT . '/library/preprocessor.php';
$context = Model_Context::getInstance();
$entry = getEntry($blogid, $context->getProperty('suri.id'));
if (is_null($entry)) {
    Respond::NotFoundPage();
    exit;
}
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title><?php 
echo _text('글걸기 시도');
?>
</title>
	<link rel="stylesheet" type="text/css" href="<?php 
echo $context->getProperty('service.path') . $context->getProperty('panel.skin');
?>
/popup-trackback.css" />
	<script type="text/javascript" src="<?php 
echo $context->getProperty('service.jqueryURL');
?>
jquery-<?php 
echo JQUERY_VERSION;
Example #28
0
    $smarty->display('file:invoice.tpl');
    echo '</div>';
}
echo '<h1>Opprett faktura</h1>' . chr(10);
echo '<script language="javascript" src="js/jquery-1.3.2.min.js"></script>' . chr(10);
//echo nl2br(str_replace('  ', '_ ', print_r($invoice, 1)));
echo '<form method="post" name="invoiceform" action="' . $_SERVER['PHP_SELF'] . '">' . chr(10);
if (count($invoice->invoice_idlinks)) {
    $datafrom_string = 'Fakturadata hentet fra' . chr(10);
    foreach ($invoice->invoice_idlinks as $link) {
        list($idtype, $id) = explode('=', $link);
        $datafrom_string .= '- ';
        switch ($idtype) {
            case 'e':
                // Entry
                $thisentry = getEntry($id);
                if (!count($thisentry)) {
                    $datafrom_string .= '(BID' . $id . ') UKJENT BOOKING (ikke funnet i databasen)';
                } else {
                    $entryarea = getArea($thisentry['area_id']);
                    $a = '';
                    if (count($entryarea)) {
                        $a = ' - ' . $entryarea['area_name'];
                    }
                    $datafrom_string .= 'Booking' . $a . ', ' . date('d-m-Y', $thisentry['time_start']) . ', BID' . $id . ' - ' . '<a href="entry.php?entry_id=' . $thisentry['entry_id'] . '">' . $thisentry['entry_name'] . '</a>';
                    //' (BID'.$id.')';
                    if ($thisentry['contact_person_name'] != '') {
                        $datafrom_string .= ', kontaktperson: ' . $thisentry['contact_person_name'];
                    }
                }
                break;
Example #29
0
// Yes/no
addChoice('invoice', array('1' => __('Yes'), '0' => __('No')));
addChoice('invoice_electronic', array('1' => __('Yes'), '0' => __('No')));
addChoice('service_alco', array('1' => __('Yes'), '0' => __('No')));
addChoice('num_person_count', array('1' => __('Yes'), '0' => __('No')));
/* ### GETTING DATA FROM ENTRY OR DEFAULTS ### */
$entry_add = TRUE;
$copy_entry = false;
if ($entry_id != 0 || isset($_GET['copy_entry_id'])) {
    if ($entry_id != 0) {
        $entry_add = FALSE;
    } else {
        $entry_id = $_GET['copy_entry_id'];
        $copy_entry = true;
    }
    $entry = getEntry($entry_id);
    if (!count($entry)) {
        $entry = getEntryDeleted($entry_id);
        if (!count($entry)) {
            echo __('Can\'t find entry');
            exit;
        } else {
            $copy_entry = true;
            $deleted = true;
        }
    } else {
        $deleted = false;
    }
    // Add the values to $entry_fields
    addValue('entry_id', $entry['entry_id']);
    addValue('entry_title', $entry['entry_title']);
Example #30
0
function entrylist_invoice_tobemade($SQL)
{
    $Q = mysql_query($SQL . ' order by `time_start`');
    if (!mysql_num_rows($Q)) {
        echo _('No entries found.');
    } else {
        echo '<font color="red">' . mysql_num_rows($Q) . '</font> ' . _('entries found.');
        echo '<br>' . chr(10) . chr(10);
        echo '<table style="border-collapse: collapse;">' . chr(10);
        echo ' <tr>' . chr(10);
        echo '  <td style="border: 1px solid black;"><b>Arrangementsdato</b></td>' . chr(10);
        echo '  <td style="border: 1px solid black;"><b>' . _('Name') . '</b></td>' . chr(10);
        echo '  <td style="border: 1px solid black;"><b>' . _('Area') . '</b></td>' . chr(10);
        echo ' </tr>' . chr(10);
        while ($R = mysql_fetch_assoc($Q)) {
            $entry = getEntry($R['entry_id']);
            echo ' <tr>' . chr(10);
            // Starts
            echo '  <td style="border: 1px solid black;">';
            echo '<a href="day.php?year=' . date('Y', $entry['time_start']) . '&amp;month=' . date('m', $entry['time_start']) . '&amp;day=' . date('d', $entry['time_start']) . '&amp;area=' . $entry['area_id'] . '">' . date('d', $entry['time_start']) . '</a>-';
            echo '<a href="month.php?year=' . date('Y', $entry['time_start']) . '&amp;month=' . date('m', $entry['time_start']) . '&amp;day=' . date('d', $entry['time_start']) . '&amp;area=' . $entry['area_id'] . '">' . _(date('m', $entry['time_start'])) . '</a>-';
            echo date('Y', $entry['time_start']);
            echo '</td>' . chr(10);
            // Name
            echo '  <td style="border: 1px solid black;"><a href="entry.php?entry_id=' . $entry['entry_id'] . '">' . $entry['entry_name'] . '</a></td>' . chr(10);
            // Area
            echo '  <td style="border: 1px solid black;">';
            $area = getArea($entry['area_id']);
            if (count($area)) {
                echo $area['area_name'];
            }
            echo '</td>' . chr(10);
            echo ' </tr>' . chr(10);
        }
        echo '</table>';
    }
}