当前位置: 首页>>代码示例>>PHP>>正文


PHP stampToDate函数代码示例

本文整理汇总了PHP中stampToDate函数的典型用法代码示例。如果您正苦于以下问题:PHP stampToDate函数的具体用法?PHP stampToDate怎么用?PHP stampToDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了stampToDate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: location_events

/**
 * Output list of upcoming events for the location.
 * @since 2.0.0
 * @version 2.0.0
 * @param integer $limit [optional] Event List Size (Default:5)
 * @return void
 */
function location_events($limit = 5)
{
    global $lID, $hc_cfg, $hc_lang_core, $hc_lang_locations;
    $result = doQuery("SELECT PkID, Title, StartDate, StartTime, EndTime, TBD\r\n\t\t\t\t\t\tFROM " . HC_TblPrefix . "events \r\n\t\t\t\t\t\t\tWHERE IsActive = 1 AND IsApproved = 1 AND LocID = '" . cIn($lID) . "' AND StartDate >= '" . cIn(SYSDATE) . "'\r\n\t\t\t\t\t\tORDER BY StartDate, TBD, StartTime, Title\r\n\t\t\t\t\t\tLIMIT " . cIn($limit));
    if (!hasRows($result)) {
        echo '<p>' . $hc_lang_locations['NoEvents'] . ' <a href="' . CalRoot . '/index.php?com=submit" rel="nofollow">' . $hc_lang_locations['NoEventsLink'] . '</a></p>';
        return 0;
    }
    $cnt = $date = 0;
    while ($row = mysql_fetch_row($result)) {
        if ($date != $row[2]) {
            $date = $row[2];
            echo $cnt > 0 ? '
			</ul>' : '';
            echo '
			<header>' . stampToDate($row[2], $hc_cfg[14]) . '</header>
			<ul>';
            $cnt = 1;
        }
        $hl = $cnt % 2 == 0 ? ' class="hl"' : '';
        if ($row[5] == 0) {
            $time = $row[3] != '' ? stampToDate($row[3], $hc_cfg[23]) : '';
            $time .= $row[4] != '' ? ' - ' . stampToDate($row[4], $hc_cfg[23]) : '';
            $stamp = date("Y-m-d\\Th:i:00", strtotime($row[2] . trim(' ' . $row[3]))) . HCTZ;
        } else {
            $time = $row[5] == 1 ? $hc_lang_locations['AllDay'] : $hc_lang_locations['TBA'];
            $stamp = date("Y-m-d", strtotime($row[2]));
        }
        echo '
			<li' . $hl . ' itemscope itemtype="http://schema.org/Event"><time itemprop="startDate" datetime="' . $stamp . '">' . $time . '</time><a itemprop="url" href="' . CalRoot . '/index.php?eID=' . $row[0] . '"><span itemprop="name">' . cOut($row[1]) . '</span></a></li>';
        ++$cnt;
    }
    echo '</ul>';
}
开发者ID:pvidali,项目名称:BCSR-1,代码行数:41,代码来源:locations.php

示例2: ou_event_carousel

/**
 * Output weekly dashboard to a page outside of Helios Calendar.
 * @since 2.0.1
 * @version 2.0.1
 * @param binary $submit include submit event link, 0 = hide , 1 = show (Default:1)
 * @param binary $ical include iCalendar subscription link, 0 = hide, 1 = show (Default:1)
 * @param binary $rss include All Events rss feed link, 0 = hide, 1 = show (Default:1)
 * @param binary $end_time include end time in event lists, 0 = hide, 1 = show (Default:1)
 * @param string $menu_format menu format string, accepts any supported strftime() format parameters (Default:%a %m/%d)
 * @return void
 */
function ou_event_carousel($submit = 1, $ical = 1, $rss = 1, $end_time = 1, $menu_format = '%a %m/%d')
{
    global $hc_cfg, $hc_lang_core;
    include HCLANG . '/public/integration.php';
    echo "SYSDATE: " . SYSDATE . "\n";
    if (file_exists(HCPATH . '/cache/int14_' . SYSDATE . '.php')) {
        if (count(glob(HCPATH . '/cache/int14_*.php')) > 0) {
            foreach (glob(HCPATH . '/cache/int14_*.php') as $file) {
                unlink($file);
            }
        }
        ob_start();
        $fp = fopen(HCPATH . '/cache/int14_' . SYSDATE . '.php', 'w');
        fwrite($fp, "<?php\n//\tHelios Dashboard Integration Events Cache - Delete this file when upgrading.\n");
        //link, category, title, start date, end date, start time, end time, location, description
        //array("05/15/2015 - 05/15/2015","1","test event")
        $result = doQuery("SELECT PkID, Title, Description, StartDate, EndDate, StartTime,  EndTime, TBD, LocID, LocationName  FROM " . HC_TblPrefix . "events\nWHERE IsActive = 1 AND IsApproved = 1 AND StartDate Between '" . SYSDATE . "' AND ADDDATE('" . SYSDATE . "', INTERVAL 14 DAY)\nORDER BY StartDate, TBD, StartTime, Title, LocationName");
        if (hasRows($result)) {
            $cur_day = -1;
            $cur_date = '';
            fwrite($fp, "\$hc_next14 = array(\n");
            while ($row = mysql_fetch_row($result)) {
                print_r($row);
                $ouTitle = $row[1];
                $ouDesc = $row[2];
                $ouLoc = $row[7];
                //echo "\nouLoc: " . $ouLoc;
                if ($cur_date = $row[3]) {
                    ++$cur_day;
                    $cur_date = $row[3];
                    if ($cur_day > 0) {
                        fwrite($fp, "\t),\n");
                    }
                    fwrite($fp, $cur_day . " => array(\n");
                }
                if ($row[6] == 0) {
                    $time = $row[4] != '' ? stampToDate($row[4], $hc_cfg[24]) : '';
                    $time .= $row[5] != '' && $end_time == 1 ? ' - ' . stampToDate($row[5], $hc_cfg[24]) : '';
                } else {
                    $time = $row[6] == 1 ? $hc_lang_int['AllDay'] : $hc_lang_int['TimeTBA'];
                }
                fwrite($fp, "\t" . $row[0] . " => array(\"" . $time . "\",\"" . stampToDate($row[3], $hc_cfg[15]) . "\",\"" . str_replace("\"", "'", cOut($row[1])) . "\"),\n");
            }
            fwrite($fp, "\t),");
        }
        fwrite($fp, "\n)\n?>");
        fwrite($fp, ob_get_contents());
        fclose($fp);
        ob_end_clean();
    }
    include HCPATH . '/cache/int14_' . SYSDATE . '.php';
}
开发者ID:pvidali,项目名称:BCSR-1,代码行数:63,代码来源:ou.php

示例3: event_list

/**
 * Output an event list. Writes list cache file if not currently available.
 * @since 2.0.0
 * @version 2.0.2
 * @param integer $type list to output, 0 = Billboard Events, 1 = Most Popular Events, 2 = Newest Events (Default:0)
 * @param integer $eTime [optional] 0 = do NOT include end time, 1 = include end time in list (Default:0)
 * @return void
 */
function event_list($type = 0, $eTime = 0)
{
    global $hc_cfg, $hc_lang_event;
    $bQuery = $uQuery = '';
    switch ($type) {
        case 0:
            $cf = 'list' . SYSDATE . '_0';
            $noList = $hc_lang_event['NoBillboard'];
            $sQuery = 'e.PkID, e.Title, e.StartDate, e.StartTime, e.IsBillboard, e.SeriesID, e.TBD, e.EndTime';
            $bQuery = $hc_cfg[13] == 0 ? ' AND e.IsBillboard = 1 ' : '';
            $oQuery = ' ORDER BY IsBillboard DESC, StartDate, StartTime, Title LIMIT ' . $hc_cfg[12];
            break;
        case 1:
            $cf = 'list' . SYSDATE . '_1';
            $noList = $hc_lang_event['NoPopular'];
            $sQuery = 'e.PkID, e.Title, e.StartDate, e.StartTime, e.IsBillboard, e.SeriesID, e.TBD, e.EndTime, (e.Views / (DATEDIFF(\'' . SYSDATE . '\', e.PublishDate)+1)) as Ave';
            $oQuery = ' ORDER BY AVE DESC, StartDate LIMIT ' . $hc_cfg[10];
            break;
        case 2:
            $cf = 'list' . SYSDATE . '_2';
            $noList = $hc_lang_event['NoNewest'];
            $sQuery = 'e.PkID, e.Title, e.StartDate, e.StartTime, e.IsBillboard, e.SeriesID, e.TBD, e.EndTime, e.PublishDate';
            $oQuery = ' ORDER BY PublishDate DESC, StartDate LIMIT ' . $hc_cfg[66];
            break;
        default:
            return 0;
    }
    if (!file_exists(HCPATH . '/cache/' . $cf)) {
        purge_cache_list($type);
        ob_start();
        $fp = fopen(HCPATH . '/cache/' . $cf, 'w');
        $uQuery = $hc_cfg[33] == 0 ? "  AND SeriesID IS NULL \r\n\t\t\t\t\tUNION \r\n\t\t\t\t\tSELECT " . $sQuery . " FROM " . HC_TblPrefix . "events e\r\n\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "events e2 ON (e.SeriesID = e2.SeriesID AND e2.StartDate > '" . SYSDATE . "' AND e.StartDate > e2.StartDate)\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\te2.StartDate IS NULL AND \r\n\t\t\t\t\t\te.IsActive = 1 AND e.IsApproved = 1 AND e.StartDate >= '" . SYSDATE . "'  AND e.SeriesID IS NOT NULL " . $bQuery . "\r\n\t\t\t\t\tGROUP BY e.SeriesID, e.PkID, e.Title, e.StartDate, e.StartTime, e.EndTime, e.TBD, e.IsBillboard, e.Views, e.PublishDate" : '';
        $curDate = $cnt = 0;
        $showHeader = $type == 0 ? 0 : 1;
        $result = doQuery("SELECT " . $sQuery . " FROM " . HC_TblPrefix . "events e WHERE e.IsActive = 1 AND e.IsApproved = 1 AND e.StartDate >= '" . cIn(SYSDATE) . "'" . $bQuery . $uQuery . $oQuery);
        if (!hasRows($result)) {
            echo $noList;
        } else {
            echo '
			<ul>';
            while ($row = mysql_fetch_row($result)) {
                if ($row[4] == 0 && $showHeader == 0) {
                    $showHeader = 1;
                    echo '
				<li class="upcoming">' . $hc_lang_event['Upcoming'] . '</li>';
                }
                if ($curDate != $row[2]) {
                    $curDate = $row[2];
                    echo '
				<li class="date">' . stampToDate($row[2], $hc_cfg[14]) . '</li>';
                }
                if ($row[6] == 0 && $hc_cfg[15] == 1) {
                    $time = $row[3] != '' ? stampToDate($row[3], $hc_cfg[23]) : '';
                    $time .= $eTime == 1 && $row[7] != '' ? ' - ' . stampToDate($row[7], $hc_cfg[23]) : '';
                } elseif ($row[6] > 0 && $hc_cfg[15] == 1) {
                    $time = $row[6] == 1 ? $hc_lang_event['AllDay'] : $hc_lang_event['TBA'];
                }
                echo '
				<li><a href="' . CalRoot . '/index.php?eID=' . $row[0] . '">' . cOut($row[1]) . '</a> ' . $time . '</li>';
                ++$cnt;
            }
            echo '
			</ul>';
        }
        fwrite($fp, ob_get_contents());
        fclose($fp);
        ob_end_clean();
    }
    include HCPATH . '/cache/' . $cf;
}
开发者ID:pvidali,项目名称:BCSR-1,代码行数:78,代码来源:theme.php

示例4: while

    echo '
		<ul class="data">
			<li class="row header uline">
				<div style="width:30%;">' . $hc_lang_admin['Name'] . '</div>
				<div style="width:40%;">' . $hc_lang_admin['EmailLabel'] . '</div>
				<div style="width:20%;">' . $hc_lang_admin['Login'] . '</div>
				<div style="width:10%;">&nbsp;</div>
			</li>';
    $cnt = 0;
    while ($row = mysql_fetch_row($result)) {
        $hl = $cnt % 2 == 1 ? ' hl' : '';
        echo '
			<li class="row ' . $hl . '">
				<div class="txt" style="width:30%;">' . cOut($row[2] . ', ' . $row[1]) . '</div>
				<div class="txt" style="width:40%;">' . cOut($row[3]) . '</div>
				<div class="txt" style="width:20%;">' . ($row[4] != '' ? stampToDate($row[4], $hc_cfg[24] . ' ' . $hc_cfg[23]) : 'N/A') . '</div>
				<div class="tools" style="width:10%;">
					<a href="' . AdminRoot . '/index.php?com=adminedit&amp;aID=' . $row[0] . '"><img src="' . AdminRoot . '/img/icons/edit.png" width="16" height="16" alt="" /></a>
					<a href="javascript:;" onclick="doDelete(\'' . $row[0] . '\');return false;"><img src="' . AdminRoot . '/img/icons/delete.png" width="16" height="16" alt="" /></a>
				</div>
			</li>';
        ++$cnt;
    }
    echo '
		</ul>
		<script>
		//<!--
		function doDelete(dID){
			if(confirm("' . $hc_lang_admin['Valid07'] . '\\n\\n          ' . $hc_lang_admin['Valid08'] . '\\n          ' . $hc_lang_admin['Valid09'] . '")){
				document.location.href = "' . AdminRoot . '/components/AdminEditAction.php?dID=" + dID + "&tkn=' . set_form_token(1) . '";
			}
开发者ID:pvidali,项目名称:BCSR-1,代码行数:31,代码来源:AdminBrowse.php

示例5: while

			<li class="row header uline">
				<div style="width:68%;">' . $hc_lang_manage['Title'] . '</div>
				<div style="width:10%;">' . $hc_lang_manage['Date'] . '</div>
				<div class="number" style="width:10%;">' . $hc_lang_manage['Views'] . '</div>
				<div style="width:10%;">&nbsp;</div>
			</li>
		</ul>
		<ul class="data">
		<div class="blbd">';
    $cnt = 0;
    while ($row = mysql_fetch_row($result)) {
        $hl = $cnt % 2 == 1 ? ' hl' : '';
        echo '
			<li class="row ' . $hl . '">
				<div class="txt" title="' . cOut($row[1]) . '" style="width:70%;">' . cOut($row[1]) . '</div>
				<div style="width:10%;">' . stampToDate($row[2], $hc_cfg[24]) . '</div>
				<div class="number" style="width:10%;">' . number_format(cOut($row[3]), 0, '', ',') . '</div>
				<div class="tools" style="width:10%;">
					<a href="' . AdminRoot . '/index.php?com=eventedit&amp;eID=' . $row[0] . '"><img src="' . AdminRoot . '/img/icons/edit.png" width="16" height="16" alt="" /></a>
					<a href="javascript:;" onclick="doDelete(\'' . $row[0] . '\');return false;"><img src="' . AdminRoot . '/img/icons/delete.png" width="16" height="16" alt="" /></a>
				</div>
			</li>';
        ++$cnt;
    }
    echo '
		</div>
		</ul>
		<script>
		//<!--
		function doDelete(eID){
			if(confirm("' . $hc_lang_manage['Valid01'] . "\\n\\n          " . $hc_lang_manage['Valid02'] . "\\n          " . $hc_lang_manage['Valid03'] . '"))
开发者ID:pvidali,项目名称:BCSR-1,代码行数:31,代码来源:EventBillboard.php

示例6: doQuery

    $result = doQuery($query);
    if (hasRows($result)) {
        echo '
	<title>' . cleanXMLChars($feedName . ' - ' . CalName) . '</title>';
        $cnt = 0;
        while ($row = mysql_fetch_row($result)) {
            $description = $hc_cfg[107] > 0 ? clean_truncate($row[2], $hc_cfg[107]) : $row[2];
            $comment = $hc_cfg[25] != '' ? '<comments><![CDATA[' . CalRoot . '/index.php?eID=' . $row[0] . '#disqus_thread' . ']]></comments>' : '';
            echo '
	<item>
		<title>' . cleanXMLChars(stampToDate(cOut($row[3]), $hc_cfg[24])) . " - " . cleanXMLChars(cOut($row[1])) . '</title>
		<link><![CDATA[' . CalRoot . '/index.php?eID=' . $row[0] . ']]></link>
		<description>' . cleanXMLChars(cOut($description)) . '</description>
		' . $comment . '
		<guid>' . CalRoot . '/index.php&#63;eID=' . $row[0] . '</guid>
		<pubDate>' . cleanXMLChars(stampToDate($row[3] . ' ' . $row[4], "%a, %d %b %Y %H:%M:%S") . ' ' . $tzRSS) . '</pubDate>
	</item>';
            ++$cnt;
        }
    } else {
        echo '
	<title>' . $hc_lang_rss['RSSSorry'] . '</title>
	<item>
		<title>' . $hc_lang_rss['RSSNoEvents'] . '</title>
		<link>' . CalRoot . '/</link>
		<description>' . $hc_lang_rss['RSSNoLink'] . '</description>
		<guid>' . CalRoot . '/</guid>
	</item>';
    }
    echo '
</channel>
开发者ID:pvidali,项目名称:BCSR-1,代码行数:31,代码来源:index.php

示例7: digest_newsletter_list

/**
 * Output digest newsletters list. Newsletters listed in decending order by sent date.
 * @since 2.1.0
 * @version 2.1.0
 * @param integer $size max number of newsletters to include in the list (list may be smaller depending on settings/available newsletters).
 * @return void
 */
function digest_newsletter_list($size, $dateFormat = '')
{
    global $hc_cfg, $hc_lang_pages;
    if (!file_exists(HCPATH . '/cache/digest_' . SYSDATE . '_n')) {
        ob_start();
        $fp = fopen(HCPATH . '/cache/digest_' . SYSDATE . '_n', 'w');
        $result = doQuery("SELECT PkID, Subject, SentDate FROM " . HC_TblPrefix . "newsletters WHERE Status > 0 AND IsArchive = 1 AND IsActive = 1 AND ArchiveContents != '' ORDER BY SentDate DESC LIMIT " . $size);
        if (!hasRows($result)) {
            echo '
			<ul class="newsletters"><li>' . $hc_lang_pages['NoNewsletters'] . '</li></ul>';
            return 0;
        }
        $cnt = 1;
        $dateFormat = $dateFormat == '' ? $hc_cfg[24] : $dateFormat;
        echo '
			<ul class="newsletters">';
        while ($row = mysql_fetch_row($result)) {
            $hl = $cnt % 2 == 0 ? ' class="hl"' : '';
            echo '<li' . $hl . '><time datetime="' . stampToDate($row[2], '%Y-%m-%d') . '">' . stampToDate($row[2], $dateFormat) . '</time><a href="' . CalRoot . '/newsletter/index.php?n=' . md5($row[0]) . '" target="_blank">' . cOut($row[1]) . '</a></li>';
            ++$cnt;
        }
        echo '
			</ul>';
        fwrite($fp, ob_get_contents());
        fclose($fp);
        ob_end_clean();
    }
    include HCPATH . '/cache/digest_' . SYSDATE . '_n';
}
开发者ID:pvidali,项目名称:BCSR-1,代码行数:36,代码来源:pages.php

示例8: mysql_result

    if (hasRows($result)) {
        $last = mysql_result($result, 0, 1) != '' ? '<lastmod>' . stampToDate(mysql_result($result, 0, 1), '%Y-%m-%d') . '</lastmod>' : '';
        $x = 1;
        $stop = mysql_result($result, 0, 0) > $hc_cfg[87] ? ceil(mysql_result($result, 0, 0) / $hc_cfg[87]) : 1;
        while ($x <= $stop) {
            echo '
  <sitemap>
    <loc>' . CalRoot . '/sitemap/events.php?map=' . $x . '</loc>
    ' . $last . '
  </sitemap>';
            ++$x;
        }
    }
    $result = doQuery("SELECT COUNT(l.PkID), MAX(l.LastMod) FROM " . HC_TblPrefix . "locations l WHERE l.IsActive = 1");
    if (hasRows($result)) {
        $last = mysql_result($result, 0, 1) != '' ? '<lastmod>' . stampToDate(mysql_result($result, 0, 1), '%Y-%m-%d') . '</lastmod>' : '';
        $x = 1;
        $stop = mysql_result($result, 0, 0) > $hc_cfg[87] ? ceil(mysql_result($result, 0, 0) / $hc_cfg[87]) : 1;
        while ($x <= $stop) {
            echo '
  <sitemap>
    <loc>' . CalRoot . '/sitemap/locations.php?map=' . $x . '</loc>
    ' . $last . '
  </sitemap>';
            ++$x;
        }
    }
    echo '
</sitemapindex>';
    fwrite($fp, ob_get_contents());
    fclose($fp);
开发者ID:pvidali,项目名称:BCSR-1,代码行数:31,代码来源:index.php

示例9: doQuery

     echo "END:VEVENT\r\n";
     echo "END:VCALENDAR";
     break;
 case 5:
     if (!preg_match("{$hc_cfg['85']}i", $_SERVER['HTTP_USER_AGENT'])) {
         doQuery("UPDATE " . HC_TblPrefix . "events SET Downloads = Downloads + 1 WHERE PkID = '" . $eID . "'");
     }
     $link = "http://calendar.live.com/calendar/calendar.aspx?rru=addevent";
     if (mysql_result($result, 0, 11) == 0) {
         if (mysql_result($result, 0, 12) != '') {
             $link .= "&dtstart=" . stampToDate(mysql_result($result, 0, 9) . " " . mysql_result($result, 0, 10), "%Y%m%dT%H%M%S") . "&dtend=" . stampToDate(mysql_result($result, 0, 9) . " " . mysql_result($result, 0, 12), "%Y%m%dT%H%M%S");
         } else {
             $link .= "&dtstart=" . stampToDate(mysql_result($result, 0, 9) . " " . mysql_result($result, 0, 10), "%Y%m%dT%H%M%S") . "&dtend=" . stampToDate(mysql_result($result, 0, 9) . " " . mysql_result($result, 0, 10), "%Y%m%dT%H%M%S");
         }
     } else {
         $link .= "&dtstart=" . stampToDate(mysql_result($result, 0, 9), "%Y%m%d") . "T000000&dtend=" . stampToDate(mysql_result($result, 0, 9), "%Y%m%d") . "T000000";
     }
     $link .= "&summary=" . urlencode(mysql_result($result, 0, 1));
     if (strlen(mysql_result($result, 0, 8)) > 400) {
         $link .= "&description=" . urlencode(htmlspecialchars(strip_tags(cOut(substr(mysql_result($result, 0, 8), 0, 400)))) . "...\n\nFull Description available at: " . CalRoot . "/index.php?eID=" . $eID);
     } else {
         $link .= "&description=" . urlencode(htmlspecialchars(strip_tags(cOut(mysql_result($result, 0, 8)))));
     }
     if (mysql_result($result, 0, 35) == 0 || mysql_result($result, 0, 35) == '') {
         $link .= "&location=" . urlencode(mysql_result($result, 0, 3) . " " . mysql_result($result, 0, 4) . " " . mysql_result($result, 0, 5) . " " . mysql_result($result, 0, 6) . " " . mysql_result($result, 0, 37) . " " . mysql_result($result, 0, 7));
     } else {
         $result = doQuery("SELECT * FROM " . HC_TblPrefix . "locations WHERE PkID = '" . cIn(mysql_result($result, 0, 35)) . "'");
         $link .= "&location=" . urlencode(mysql_result($result, 0, 2) . " " . mysql_result($result, 0, 3) . " " . mysql_result($result, 0, 4) . " " . mysql_result($result, 0, 5) . " " . mysql_result($result, 0, 6) . " " . mysql_result($result, 0, 7));
     }
     header("Location: {$link}");
     break;
开发者ID:pvidali,项目名称:BCSR-1,代码行数:31,代码来源:SaveEvent.php

示例10: sr_event_browse

function sr_event_browse($show_images = 0)
{
    global $lID, $hc_cfg, $hc_lang_event, $favQ1, $favQ2, $resultEB, $myNav;
    $location = $lID > 0 ? '&amp;lID=' . $lID : '';
    $cnt = $date = 0;
    $row_number = 1;
    echo $myNav;
    if (!hasRows($resultEB)) {
        no_event_notice();
        return 0;
    }
    while ($row = mysql_fetch_row($resultEB)) {
        //echo print_r($row);
        $color_class = sr_colorizer($row_number);
        $description = $hc_cfg[107] > 0 ? clean_truncate($row[21], $hc_cfg[107]) : $row[21];
        $categories = explode(",", $row[20]);
        //filtering out ACE
        switch (count($categories)) {
            case 0:
                $category = 'No Category';
                break;
            case 1:
                $category = substr($categories[0], 3);
                break;
            default:
                $category = substr($categories[0], -4) != '_ACE' ? substr($categories[0], 3) : substr($categories[1], 3);
                break;
        }
        $category = '<h4>' . $category . '</h4>';
        if ($date != $row[2]) {
            $date = $row[2];
            echo $cnt > 0 ? '</ul>' : '';
            echo '<h2>' . stampToDate($row[2], '%A, %B %d, %Y') . '</h2><ul>';
            $cnt = 1;
        }
        $limit = $row[8] > 0 ? cOut($row[8]) : $hc_cfg[134];
        $expire = $limit > 0 ? date("Y-m-d", strtotime($date) + $limit * 86400) : '';
        $cls = $cnt % 2 == 0 ? 'hl' : '';
        $cls .= $row[7] > 0 ? ' featured' : '';
        if ($row[5] == 0) {
            $time = $row[3] != '' ? stampToDate($row[3], $hc_cfg[23]) : '';
            $time .= $row[4] != '' ? ' - ' . stampToDate($row[4], $hc_cfg[23]) : '';
            //$stamp = date("Y-m-d\Th:i:00",strtotime($row[2] . trim(' '.$row[3]))) . HCTZ;
            $stamp = stampToDate($row[2], '%A, %B %d');
            //$hc_cfg[14]
        } else {
            $time = $row[5] == 1 ? $hc_lang_event['AllDay'] : $hc_lang_event['TBA'];
            $stamp = $row[2];
            $stamp = stampToDate($row[2], '%A, %B %d');
        }
        echo '
        <li ' . ($cls != '' ? 'class="' . $color_class . ' ' . trim($cls) . '" ' : 'class="' . $color_class . '"') . 'itemscope itemtype="http://schema.org/Event">
            <a href="' . CalRoot . '/index.php?eID=' . $row[0] . $location . '">' . '<div class="event-content-container">' . $category . '<h3 itemprop="name">' . cOut($row[1]) . '</h3><div class="date-time">
            <span itemprop="startDate" datetime="' . $stamp . '">' . $stamp . ', ' . $time . '</span>
            <span class="location"><i class="fa fa-map-marker"></i> ' . $row[14] . ($row[22] != '' ? ' - ' . $row[22] : '') . '</span></div><p>' . strip_tags(cOut($description)) . '<span class="readmore">&nbsp;READ MORE</span></p></div>' . ($show_images == 1 && $row[6] != '' ? '<div class="event-image-container" style="background-image: url(' . $row[6] . '); min-width:' . (strlen($row[1]) > 43 ? 325 : 287) . 'px;"></div>' : '') . '</a></li>';
        //'<span class="readmore">&nbsp;READ MORE</span></p></div>'.(($show_images == 1 && $row[6] != '') ? '<div class="event-image-container"><img itemprop="image" src="'.$row[6].'" class="eimage_b" /></div>':'').'</a></li>'
        ++$cnt;
        ++$row_number;
    }
    echo '
        </ul>
    ' . $myNav;
}
开发者ID:pvidali,项目名称:BCSR-1,代码行数:63,代码来源:simonsrock.php

示例11: user_manage_events

/**
 * Output user's list of submitted events.
 * @since 2.1.0
 * @version 2.2.1
 * @return void
 */
function user_manage_events()
{
    global $hc_cfg, $hc_lang_user;
    if (!user_check_status()) {
        return -1;
    }
    $date = isset($_GET['d']) && is_numeric($_GET['d']) ? strftime("%Y-%m-%d", cIn(strip_tags($_GET['d']))) : SYSDATE;
    $d = explode('-', $date);
    $year = isset($d[0]) && is_numeric($d[0]) ? $d[0] : NULL;
    $month = isset($d[1]) && is_numeric($d[1]) ? $d[1] : NULL;
    $day = isset($d[2]) && is_numeric($d[2]) ? $d[2] : NULL;
    if (!checkdate($month, $day, $year)) {
        $date = SYSDATE;
        $day = date('d', strtotime(SYSDATE));
        $month = date('m', strtotime(SYSDATE));
        $year = date('Y', strtotime(SYSDATE));
    }
    $sqlStart = $year . '-' . $month . '-1';
    $sqlEnd = strftime("%Y-%m-%d", mktime(0, 0, 0, $month + 1, 0, $year));
    $result = doQuery("SELECT DISTINCT e.PkID, e.Title, e.StartDate, e.StartTime, e.EndTime, e.TBD, e.IsApproved, e.SeriesID, er.Type, er.Space,\r\n\t\t\t\t\t\t\t(SELECT COUNT(PkID) FROM " . HC_TblPrefix . "registrants r WHERE EventID = e.PkID) as SpacesTaken\r\n\t\t\t\t\t\tFROM " . HC_TblPrefix . "events e\r\n\t\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "eventcategories ec ON (ec.EventID = e.PkID)\r\n\t\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "eventrsvps er ON (er.EventID = e.PkID)\r\n\t\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "locations l ON (e.LocID = l.PkID)\r\n\t\t\t\t\t\tWHERE e.StartDate BETWEEN '" . cIn($sqlStart) . "' AND '" . cIn($sqlEnd) . "' \r\n\t\t\t\t\t\t\tAND e.IsActive = 1 AND e.OwnerID = '" . cIn($_SESSION['UserPkID']) . "'\r\n\t\t\t\t\t\tGROUP BY e.PkID, e.Title, e.StartDate, e.StartTime, e.EndTime, e.TBD, e.IsApproved, e.SeriesID, er.Type, er.Space\r\n\t\t\t\t\t\tORDER BY e.StartDate, e.TBD, e.StartTime, e.Title");
    $i = 0;
    $jmp = 12;
    $stop = $jmp + 12;
    $jumpMonth = date("n", mktime(0, 0, 0, $month - $jmp, 1, $year));
    $jumpYear = date("Y", mktime(0, 0, 0, $month - $jmp, 1, $year));
    $actJump = date("Y-m-d", mktime(0, 0, 0, $month, 1, $year));
    $opts = '';
    while ($i <= 24) {
        $jmpDate = date("Y-m-d", mktime(0, 0, 0, $jumpMonth + $i, 1, $jumpYear));
        $select = $jmpDate == $actJump ? ' selected="selected"' : '';
        $opts .= '
					<option value="' . CalRoot . '/index.php?com=acc&sec=list&d=' . date("U", mktime(0, 0, 0, $jumpMonth + $i, 1, $jumpYear)) . '"' . $select . '>' . strftime($hc_cfg[92], mktime(0, 0, 0, $jumpMonth + $i, 1, $jumpYear)) . '</option>';
        ++$i;
    }
    echo '
		<fieldset class="user">
			<legend>' . $hc_lang_user['UserEventLabel'] . '</legend>
			<ul id="user_events">
				<li id="ue_prev"><a href="' . CalRoot . '/index.php?com=acc&sec=list&d=' . strtotime(strftime("%Y-%m-%d", mktime(0, 0, 0, $month - 1, 1, $year))) . '">&lt;</a></li>
				<li id="ue_jump">
				<select name="ue_jump_select" id="ue_jump_select" onchange="window.location.href=this.value;">' . $opts . '	
				</select>	
				</li>
				<li id="ue_next"><a href="' . CalRoot . '/index.php?com=acc&sec=list&d=' . strtotime(strftime("%Y-%m-%d", mktime(0, 0, 0, $month + 1, 1, $year))) . '">&gt;</a></li>
			</ul>';
    if (!hasRows($result)) {
        echo '<p>' . $hc_lang_user['NoEventNotice'] . '</p>';
        return -1;
    }
    echo '
			<ul class="data">';
    $cnt = 1;
    while ($row = mysql_fetch_row($result)) {
        echo '
				<li class="row' . ($cnt % 2 == 0 ? ' hl' : '') . '">
					<div class="ue_title txt" title="' . cOut($row[1]) . '">' . clean_truncate(cOut($row[1]), 100) . '</div>
					<div class="ue_date">' . stampToDate($row[2], $hc_cfg[24]) . '</div>
					<div class="ue_time txt">';
        if ($row[5] == 0) {
            $time = $row[3] != '' ? stampToDate($row[3], $hc_cfg[23]) : '';
        } else {
            $time = $row[5] == 1 ? $hc_lang_user['AllDay'] : $hc_lang_user['TBD'];
        }
        $rsvp = '';
        if ($row[8] == 1) {
            $rsvp = $row[10] > 0 && $row[6] != 2 ? '<a href="' . CalRoot . '/download-rsvp.php?eID=' . cOut($row[0]) . '"><img src="' . CalRoot . '/img/icons/rsvp_download.png" width="16" height="16" alt="" title="' . $hc_lang_user['TitleRSVP'] . '" /></a>' : '<img src="' . CalRoot . '/img/icons/rsvp_download_o.png" width="16" height="16" alt="" title="' . $hc_lang_user['TitleRSVP0'] . '" />';
        }
        echo $time . '</div>
					<div class="ue_status txt">
						' . $rsvp . $hc_lang_user['Status' . $row[6]] . '
					</div>
					<div class="ue_tools tools">
						' . ($row[6] == 2 ? '<img src="' . CalRoot . '/img/icons/single_o.png" width="16" height="16" alt="" title="' . $hc_lang_user['TitleView'] . '" />' : '<a href="' . CalRoot . '/index.php?eID=' . $row[0] . '"><img src="' . CalRoot . '/img/icons/single.png" width="16" height="16" alt="" title="' . $hc_lang_user['TitleView'] . '" /></a>') . '
						<a href="' . CalRoot . '/index.php?com=submit&amp;eID=' . $row[0] . '"><img src="' . CalRoot . '/img/icons/edit.png" width="16" height="16" alt="" title="' . $hc_lang_user['TitleEdit'] . '" /></a>';
        if ($row[7] != '') {
            echo ($row[6] == 2 ? '
						<img src="' . CalRoot . '/img/icons/series_o.png" width="16" height="16" alt="" title="' . $hc_lang_user['TitleViewSeries'] . '" />' : '<a href="' . CalRoot . '/index.php?com=series&amp;sID=' . $row[7] . '"><img src="' . CalRoot . '/img/icons/series.png" width="16" height="16" alt="" title="' . $hc_lang_user['TitleViewSeries'] . '" /></a>') . '
						<a href="' . CalRoot . '/index.php?com=submit&amp;sID=' . $row[7] . '"><img src="' . CalRoot . '/img/icons/edit_series.png" width="16" height="16" alt="" title="' . $hc_lang_user['TitleEditSeries'] . '" /></a>';
        }
        echo '
					</div>
				</li>';
        ++$cnt;
    }
    echo '
		</fieldset>';
}
开发者ID:pvidali,项目名称:BCSR-1,代码行数:93,代码来源:users.php

示例12: date

                $curYear = $dateParts[0];
                $cnt = 0;
                if ($whichDay != 0) {
                    $x = date("w", mktime(0, 0, 0, $curMonth + $whichRepeat, 1, $curYear));
                    while ($x % 7 != $whichDOW) {
                        ++$x;
                        ++$cnt;
                    }
                    $curDate = date("Y-m-d", mktime(0, 0, 0, $curMonth + $whichRepeat, 1 + $cnt + (7 * $whichDay - 7), $curYear));
                } else {
                    $x = date("w", mktime(0, 0, 0, $curMonth + $whichRepeat + 1, 0, $curYear));
                    $offset = 0;
                    if ($x < $whichDOW) {
                        $x = $x + 7;
                    }
                    while (abs($x) % 7 != $whichDOW) {
                        --$x;
                        ++$cnt;
                    }
                    $curDate = date("Y-m-d", mktime(0, 0, 0, $curMonth + $whichRepeat + 1, 0 - $cnt, $curYear));
                }
            }
        }
        break;
}
$x = 0;
foreach ($dates as $val) {
    echo $x % 7 == 0 ? '<br />' : ', ';
    echo stampToDate($val, $hc_cfg[24]);
    ++$x;
}
开发者ID:pvidali,项目名称:BCSR-1,代码行数:31,代码来源:event-recur-confirm.php

示例13: cleanXMLChars

            $date = cleanXMLChars(stampToDate($min, "%B %d")) . ' - ' . cleanXMLChars(stampToDate($max, "%B %d"));
        } else {
            $date = cleanXMLChars(stampToDate($row[3], "%B %d"));
        }
        $comment = $hc_cfg[25] != '' ? '<comments><![CDATA[' . CalRoot . '/index.php?eID=' . $row[0] . '#disqus_thread' . ']]></comments>' : '';
        echo '
	<item>
		<title>' . cleanXMLChars(stampToDate(cOut($row[3]), $hc_cfg[24])) . " - " . cleanXMLChars(cOut($row[1])) . '</title>
		<link><![CDATA[' . CalRoot . '/index.php?eID=' . $row[0] . ']]></link>
		<description>' . cleanXMLChars(cOut($description)) . '</description>
		' . $comment . '
		<guid>' . CalRoot . '/index.php&#63;eID=' . $row[0] . '</guid>
		<pubDate>' . cleanXMLChars(stampToDate($row[3] . ' ' . $row[4], "%a, %d %b %Y  %H:%M:%S") . ' ' . $tzRSS) . '</pubDate>
        <date>' . $date . '</date>
        <startTime>' . date("h:i A", strtotime(stampToDate($row[3] . ' ' . $row[4], "%d %b %Y %H:%M:%S"))) . '</startTime>
        <endTime>' . date("h:i A", strtotime(stampToDate($row[3] . ' ' . $row[7], "%d %b %Y %H:%M:%S"))) . '</endTime>
        <location>' . $row[8] . '</location>
        <category>' . cleanXMLChars($category) . '</category>
        <eventName>' . cleanXMLChars(cOut($row[1])) . '</eventName>
        <test>' . $min . '</test>
	</item>';
        ++$cnt;
    }
} else {
    echo '
	<title>' . $hc_lang_rss['RSSSorry'] . '</title>
	<item>
		<title>' . $hc_lang_rss['RSSNoEvents'] . '</title>
		<link>' . CalRoot . '/</link>
		<description>' . $hc_lang_rss['RSSNoLink'] . '</description>
		<guid>' . CalRoot . '/</guid>
开发者ID:pvidali,项目名称:BCSR-1,代码行数:31,代码来源:wnl.php

示例14: number_format

				<span class="output"><b>' . number_format($subCnt, 0, '.', ',') . '</b> ' . $hc_lang_news['SubStats'] . '</span>
				<label>&nbsp;</label>
				<span class="output"><b>' . number_format($eCnt, 0, '.', ',') . '</b> ' . $hc_lang_news['EventStats'] . '</span>
			</fieldset>
			<fieldset>
				<legend>' . $hc_lang_news['Settings'] . '</legend>
				<label>' . $hc_lang_news['MailName'] . '</label>
				<span class="output">' . mysql_result($result, 0, 1) . '</span>
				<label>' . $hc_lang_news['MailSubject'] . '</label>
				<span class="output">' . mysql_result($result, 0, 2) . '</span>
				<label>' . $hc_lang_news['Dates'] . '</label>';
        if (mysql_result($result, 0, 3) != '') {
            echo mysql_result($result, 0, 3) < date("Y-m-d") ? '<span class="output alert">' . stampToDate(mysql_result($result, 0, 3), $hc_cfg[24]) . '</span>' : '<span class="output">' . stampToDate(mysql_result($result, 0, 3), $hc_cfg[24]) . '</span>';
        }
        if (mysql_result($result, 0, 4) != '') {
            echo mysql_result($result, 0, 4) < date("Y-m-d") ? '<span class="output alert">&nbsp;-&nbsp;' . stampToDate(mysql_result($result, 0, 4), $hc_cfg[24]) . '</span>' : '<span class="output">&nbsp;-&nbsp;' . stampToDate(mysql_result($result, 0, 4), $hc_cfg[24]) . '</span>';
        }
        echo '
				<label>' . $hc_lang_news['Groups'] . '</label>
				' . ($groups == '' ? '<span class="output alert">' . $hc_lang_news['NoGroups'] . '</span>' : '<span class="output">' . $groups . '</span>') . '
				<label>' . $hc_lang_news['Template'] . '</label>
				' . (mysql_result($result, 0, 7) == '' ? '<span class="output alert">' . $hc_lang_news['NoTemplate'] . '</span>' : '<span class="output">' . mysql_result($result, 0, 7) . '</span>') . '
				<label>' . $hc_lang_news['ArchStatus'] . '</label>
				<span class="output">' . (mysql_result($result, 0, 5) == 1 ? $hc_lang_news['ArchStatus1'] : $hc_lang_news['ArchStatus0']) . '</span>
			</fieldset>
			<fieldset>
				<legend>' . $hc_lang_news['Message'] . (strpos(mysql_result($result, 0, 8), '[message]') === false ? ' ' . $hc_lang_news['NoMsgTemp'] : '') . '</legend>
				' . (mysql_result($result, 0, 6) != '' ? mysql_result($result, 0, 6) : $hc_lang_news['NoMessage']) . '
			</fieldset>
			<p>' . $stopMsg . '</p>
			<input name="save" id="save" type="button"' . ($stop > 0 ? ' disabled="disabled"' : '') . ' value="' . $hc_lang_news['Approve0'] . '" onclick="approve(0);return false;" />
开发者ID:pvidali,项目名称:BCSR-1,代码行数:31,代码来源:MailQueue.php

示例15: map_locations

/**
 * Create JavaScript array() variable named "locations" with location entries for use with location Google map. Saves array to cache if cache not present.
 * @since 2.0.0
 * @version 2.1.0
 * @return void
 */
function map_locations()
{
    global $hc_cfg;
    if (!file_exists(HCPATH . '/cache/lmap' . SYSDATE)) {
        purge_cache_map();
        $cnt = 0;
        ob_start();
        $fp = fopen(HCPATH . '/cache/lmap' . SYSDATE, 'w');
        $result = doQuery("SELECT l.PkID, l.Name, l.Address, l.Address2, l.City, l.State, l.Country, l.Zip, l.Lat, l.Lon, COUNT(e.LocID), MIN(e.StartDate), l.URL, l.Phone\r\n\t\t\t\t\t\t\tFROM " . HC_TblPrefix . "locations l\r\n\t\t\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "events e ON (e.LocID = l.PkID)\r\n\t\t\t\t\t\t\tWHERE l.Lat IS NOT NULL AND l.Lon IS NOT NULL AND l.Lat != '' AND l.Lon != '' AND l.IsActive = 1 AND\r\n\t\t\t\t\t\t\t\te.LocID > 0 AND e.IsActive = 1 AND e.IsApproved = 1 AND e.PkID IS NOT NULL AND e.StartDate >= '" . cIn(SYSDATE) . "'\r\n\t\t\t\t\t\t\tGROUP BY l.PkID, l.Name, l.Address, l.Address2, l.City, l.State, l.Country, l.Zip, l.Lat, l.Lon, l.URL, l.Phone\r\n\t\t\t\t\t\t\tHAVING COUNT(e.LocID) > 0\r\n\t\t\t\t\t\t\tORDER BY l.Name");
        if (hasRows($result)) {
            echo '
	var locations = [';
            while ($row = mysql_fetch_row($result)) {
                echo '
		["' . $row[0] . '","' . cOut($row[1]) . '","' . $row[8] . '","' . $row[9] . '","' . cOut($row[1]) . '","' . cOut($row[2]) . '","' . cOut($row[3]) . '","' . cOut($row[4]) . '","' . cOut($row[5]) . '","' . cOut($row[6]) . '","' . cOut($row[7]) . '","' . $row[10] . '","' . stampToDate($row[11], $hc_cfg[14]) . '","' . ($row[12] != '' && $row[12] != 'http://' ? '1' : '0') . '","' . cOut($row[13]) . '"],';
                ++$cnt;
            }
            echo '
	];';
        }
        fwrite($fp, ob_get_contents());
        fclose($fp);
        ob_end_clean();
    }
    include HCPATH . '/cache/lmap' . SYSDATE;
}
开发者ID:pvidali,项目名称:BCSR-1,代码行数:32,代码来源:maps.php


注:本文中的stampToDate函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。