Esempio n. 1
0
/**
 * 查询评论内容
 *
 * @access  public
 * @params  integer     $id
 * @params  integer     $type
 * @params  integer     $page
 * @return  array
 */
function GZ_assign_comment($id, $type, $page = 1, $page_size = 10)
{
    /* 取得评论列表 */
    $count = $GLOBALS['db']->getOne('SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$id}' AND comment_type = '{$type}' AND status = 1 AND parent_id = 0");
    $page_count = $count > 0 ? intval(ceil($count / $page_size)) : 1;
    $sql = 'SELECT * FROM ' . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$id}' AND comment_type = '{$type}' AND status = 1 AND parent_id = 0" . ' ORDER BY comment_id DESC';
    $res = $GLOBALS['db']->selectLimit($sql, $page_size, ($page - 1) * $page_size);
    $arr = array();
    $ids = '';
    while ($row = $GLOBALS['db']->fetchRow($res)) {
        $ids .= $ids ? ",{$row['comment_id']}" : $row['comment_id'];
        $arr[$row['comment_id']]['id'] = $row['comment_id'];
        // $arr[$row['comment_id']]['email']    = $row['email'];
        $arr[$row['comment_id']]['author'] = empty($row['user_name']) ? '匿名用户' : $row['user_name'];
        $arr[$row['comment_id']]['content'] = str_replace('\\r\\n', '<br />', htmlspecialchars($row['content']));
        $arr[$row['comment_id']]['content'] = nl2br(str_replace('\\n', '<br />', $arr[$row['comment_id']]['content']));
        // $arr[$row['comment_id']]['rank']     = $row['comment_rank'];
        $arr[$row['comment_id']]['create'] = formatTime($row['add_time']);
        $arr[$row['comment_id']]['re_content'] = '';
    }
    /* 取得已有回复的评论 */
    if ($ids) {
        $sql = 'SELECT * FROM ' . $GLOBALS['ecs']->table('comment') . " WHERE parent_id IN( {$ids} )";
        $res = $GLOBALS['db']->query($sql);
        while ($row = $GLOBALS['db']->fetch_array($res)) {
            $arr[$row['parent_id']]['re_content'] = nl2br(str_replace('\\n', '<br />', htmlspecialchars($row['content'])));
            // $arr[$row['parent_id']]['re_add_time'] = local_date($GLOBALS['_CFG']['time_format'], $row['add_time']);
            // $arr[$row['parent_id']]['re_email']    = $row['email'];
            // $arr[$row['parent_id']]['re_username'] = $row['user_name'];
        }
    }
    $pager = array("total" => $count, "count" => count($arr), "more" => $page < $page_count ? 1 : 0);
    $cmt = array('comments' => array_values($arr), 'pager' => $pager);
    return $cmt;
}
Esempio n. 2
0
function source($path, $action, $title, $content)
{
    $Head = '<meta name="robots" content="noindex, nofollow" />';
    $content['PageNav']->Active("Page History");
    if (is_numeric($action[1])) {
        $PageQuery = mysql_query("SELECT `AccountID`,`EditTime`,`Name`,`Description`,`Title`,`Content` FROM `Wiki_Edits` WHERE `ID`='{$action['1']}' and `Archived` = 0");
        list($AccountID, $PageEditTime, $PageName, $PageDescription, $PageTitle, $PageContent) = mysql_fetch_array($PageQuery);
        $Form['_Options'] = "action:;";
        $Form['Name']['Text'] = "Name:";
        $Form['Name']['Form'] = "id:Name; name:Name; value:{" . $PageName . "}; maxlength:32;";
        $Form['Title']['Text'] = "Title:";
        $Form['Title']['Form'] = "name:Title; value:x{" . $PageTitle . "}x; maxlength:255;";
        $Form['Content']['Text'] = "Content:";
        $Form['Content']['Form'] = "name:Content; value:x{" . $PageContent . "}x; type:textarea; cols:80; rows:12;";
        $Form['Description']['Text'] = "Description:";
        $Form['Description']['Form'] = "name:Description; value:x{" . $PageDescription . "}x; size: 80; maxlength:255;";
        $content['Title'] = "Viewing Source of: {$PageTitle}";
        $content['Body'] .= Format($Form, Form);
        date_default_timezone_set('America/New_York');
        //			$PageEditTime = date("F j\, Y G:i:s", $PageEditTime)." EST";
        $PageEditTime = formatTime($PageEditTime);
        $content['Footer'] = "This page is an old revision made by <b><a href='/names?id={$AccountID}'>{$PageName}</a></b> on {$PageEditTime}.";
    }
    return array($title, $content);
}
function countDown($dateStarted, $duration)
{
    date_default_timezone_set("UTC");
    $startedAt = strtotime($dateStarted);
    $currtime = time();
    $timeElapsed = $currtime - $startedAt;
    $remaining = $duration * 60 - $timeElapsed;
    $seconds = $remaining;
    $minutes = floor($remaining / 60);
    $hours = floor($remaining / 3600);
    //$days    = floor($diffInSeconds/86400);
    $minutes %= 60;
    $hours %= 24;
    $seconds %= 60;
    if ($remaining <= 0) {
        $mins = '00';
        $hrs = '00';
        $secs = '00';
    } else {
        $mins = formatTime($minutes);
        $hrs = formatTime($hours);
        $secs = formatTime($seconds);
    }
    return array($remaining, $hrs . ":" . $mins . ":" . $secs);
}
Esempio n. 4
0
 /**
 * Context is not used.
 */
 function display($context)
 {
     mpLog("notebook-view:User visited Lab Notebook page");
     $labbook = openLabbook();
     echo $this->pageHeader("Lab notebook", "notebook");
     // Set time zone form
     echo makeEventForm("onSetTimezone");
     echo "<table border='0' width='100%'><tr>\n";
     echo "<td>Current time: " . formatTime(time()) . "</td>\n";
     echo "<td>" . timeZonePicker('timezone', $_SESSION['timeZone']);
     echo "<input type='submit' name='cmd' value='Set time zone'></td>\n";
     echo "</tr></table></form>\n";
     echo "</div>\n<br>\n<div class='pagecontent'>\n";
     // Notebook table of contents
     echo "<h3><a name='top'</a>Table of contents:</h3>\n";
     echo "<div class='indent'>\n";
     $this->printTOC($labbook);
     //onNotebookEdit removed for security reasons (probably nobody was using it)
     //echo makeEventForm("onNotebookEdit");
     //echo "<input type='submit' name='cmd' value='Create new entry'>\n</form>\n";
     echo "</div>\n";
     // Actual notebook entries
     foreach ($labbook as $num => $entry) {
         $this->printEntry($num, $entry);
     }
     echo $this->pageFooter();
 }
 function widget($args, $instance)
 {
     $daysOfWeek = array("0" => array("Monday", "Mon"), "1" => array("Tuesday", "Tue"), "2" => array("Wednesday", "Wed"), "3" => array("Thursday", "Thu"), "4" => array("Friday", "Fri"), "5" => array("Saturday", "Sat"), "6" => array("Sunday", "Sun"));
     // Widget output
     $title = apply_filters('widget_title', $instance['title']);
     // before and after widget arguments are defined by themes
     echo $args['before_widget'];
     // This is where you run the code and display the output
     $widgetOutput = "";
     $widgetOutput .= "<div class='container openhours-widget'>";
     $widgetOutput .= "<h4 class='title'>" . $title . "</h4>";
     $hoursObj = json_decode($instance['hours'], true);
     $lz = $instance['leadingzero'] == '1';
     $widgetOutput .= "<div><span class='day'>" . $daysOfWeek[0][0] . ":</span> <span class='hours'>" . formatTime($hoursObj["monday"]["from"], $instance['displayformat'], $lz) . " - " . formatTime($hoursObj["monday"]["to"], $instance['displayformat'], $lz) . "</span></div>";
     $widgetOutput .= "<div><span class='day'>" . $daysOfWeek[1][0] . ":</span> <span class='hours'>" . formatTime($hoursObj["tuesday"]["from"], $instance['displayformat'], $lz) . " - " . formatTime($hoursObj["tuesday"]["to"], $instance['displayformat'], $lz) . "</span></div>";
     $widgetOutput .= "<div><span class='day'>" . $daysOfWeek[2][0] . ":</span> <span class='hours'>" . formatTime($hoursObj["wednesday"]["from"], $instance['displayformat'], $lz) . " - " . formatTime($hoursObj["wednesday"]["to"], $instance['displayformat'], $lz) . "</span></div>";
     $widgetOutput .= "<div><span class='day'>" . $daysOfWeek[3][0] . ":</span> <span class='hours'>" . formatTime($hoursObj["thursday"]["from"], $instance['displayformat'], $lz) . " - " . formatTime($hoursObj["thursday"]["to"], $instance['displayformat'], $lz) . "</span></div>";
     $widgetOutput .= "<div><span class='day'>" . $daysOfWeek[4][0] . ":</span> <span class='hours'>" . formatTime($hoursObj["friday"]["from"], $instance['displayformat'], $lz) . " - " . formatTime($hoursObj["friday"]["to"], $instance['displayformat'], $lz) . "</span></div>";
     $widgetOutput .= "<div><span class='day'>" . $daysOfWeek[5][0] . ":</span> <span class='hours'>" . formatTime($hoursObj["saturday"]["from"], $instance['displayformat'], $lz) . " - " . formatTime($hoursObj["saturday"]["to"], $instance['displayformat'], $lz) . "</span></div>";
     $widgetOutput .= "<div><span class='day'>" . $daysOfWeek[6][0] . ":</span> <span class='hours'>" . formatTime($hoursObj["sunday"]["from"], $instance['displayformat'], $lz) . " - " . formatTime($hoursObj["sunday"]["to"], $instance['displayformat'], $lz) . "</span></div>";
     $widgetOutput .= "</div>";
     //div.container
     echo __($widgetOutput, 'austeve_openhours_widget_domain');
     echo $args['after_widget'];
 }
Esempio n. 6
0
function formatDayTimeBrief($time)
{
    $day = formatDayAdaptive($time);
    if ($day == 'Today') {
        return formatTime($time);
    } else {
        return $day;
    }
}
Esempio n. 7
0
function diff($path, $action, $title, $content)
{
    $Head = '<meta name="robots" content="noindex, nofollow" />';
    $content['PageNav']->Active("Page History");
    if (is_numeric($action[1])) {
        $pageQuery = mysql_query("SELECT `PageID`,`AccountID`,`EditTime`,`Name`,`Description`,`Title`,`Content` FROM `Wiki_Edits` WHERE `ID`='{$action['1']}' and `Archived` = 0");
        list($PageID, $AccountID, $PageEditTime, $PageName, $PageDescription, $PageTitle, $pageContent) = mysql_fetch_array($pageQuery);
        $previousQuery = mysql_query("Select `ID`, `Content` from `Wiki_Edits` where `ID` < '{$action['1']}' and `PageID`='{$PageID}' and `Archived` = 0 order by `ID` desc limit 1");
        list($previousID, $previousContent) = mysql_fetch_array($previousQuery);
        $nextQuery = mysql_query("Select `ID` from `Wiki_Edits` where `ID` > '{$action['1']}' and `PageID`='{$PageID}' and `Archived` = 0 order by `ID` limit 1");
        list($nextID) = mysql_fetch_array($nextQuery);
        if (!empty($previousID)) {
            $previousPath = FormatPath("/{$path}/?diff/{$previousID}");
            $content['Title'] = "<a href='{$previousPath}' title='Previous Revision'>⟨</a> ";
        }
        $content['Title'] .= FishFormat($PageTitle);
        if (!empty($nextID)) {
            $nextPath = FormatPath("/{$path}/?diff/{$nextID}");
            $content['Title'] .= " <a href='{$nextPath}' title='Next Revision'>⟩</a>";
        }
        $content['Body'] .= <<<JavaScript
        
        <script>
            \$(document).ready(function ()
            {
                \$('body').on('keydown', function(event)
                {
                    event.stopImmediatePropagation()
                    
                    if(event.keyCode == 37) // Previous
                        location.href = '{$previousPath}';
                    else if(event.keyCode == 39) // Next
                        location.href = '{$nextPath}';
                });
            });
        </script>
JavaScript;
        $old = explode("\n", html_entity_decode($previousContent, ENT_QUOTES));
        $new = explode("\n", html_entity_decode($pageContent, ENT_QUOTES));
        // Initialize the diff class
        $diff = new Diff($old, $new);
        require_once dirname(__FILE__) . '/../libraries/Diff/Renderer/Html/SideBySide.php';
        $renderer = new Diff_Renderer_Html_SideBySide();
        $content['Body'] .= $diff->Render($renderer);
        date_default_timezone_set('America/New_York');
        $PageEditTime = formatTime($PageEditTime);
        $content['Footer'] = "This page is an old revision made by <b><a href='/names?id={$AccountID}'>{$PageName}</a></b> on {$PageEditTime}.";
        if ($PageDescription) {
            $content['Footer'] .= "<br />'{$PageDescription}'";
        }
    }
    return array($title, $content);
}
 /**
  * 导出名单
  */
 public function export()
 {
     $activeid = intval($_GET['activeid']);
     $data[0] = array('姓名', '手机', '邮箱', '报名时间');
     $members = $this->t('activedata')->where(array('activeid' => $activeid))->select();
     foreach ($members as $k => $member) {
         $data[] = array($member['username'], $member['mobile'], $member['email'], formatTime($member['dateline'], 'Y-m-d H:i:s'));
     }
     //printr($data);exit();
     include ROOT_PATH . '/core/library/class.php_excel.php';
     $xls = new Excel_XML();
     $xls->addArray($data);
     $xls->generateXML(random(10));
 }
Esempio n. 9
0
function view($path, $action, $title, $content)
{
    $content['PageNav']->Active("View Page");
    $PageQuery = mysql_query("SELECT `ID`,`Title`,`Content`,`Edits`,`Views`,`EditTime` FROM `Wiki_Pages` WHERE `Path`='{$path}'");
    list($PageID, $PageTitle, $PageContent, $PageEdits, $pageViews, $PageEditTime) = mysql_fetch_array($PageQuery);
    $tagQuery = mysql_query("Select tags.`tag`, stats.`count`\n                                from `Wiki_Tags` as tags,\n                                     `Wiki_Tag_Statistics` as stats\n                                     \n                                where tags.`pageID` = '{$PageID}'\n                                    and stats.`tag` = tags.`tag`");
    while (list($tagName, $tagCount) = mysql_fetch_array($tagQuery)) {
        $plural = 's';
        if ($tagCount == 1) {
            $plural = '';
        }
        $tagLink = urlencode($tagName);
        $tagTitle = str_replace('-', ' ', $tagName);
        $tagLinks[] = "<a href='/?tag/{$tagLink}' title='{$tagCount} tagged page{$plural}'>{$tagTitle}</a>";
    }
    if ($tagLinks) {
        $tagLinks = implode(" | ", $tagLinks);
        $tagLinks = "<hr />Tags: {$tagLinks}";
    }
    $PageTitle = PageTitler($PageTitle);
    if (empty($PageContent)) {
        $PageContent = array("Hello friend. b{Wetfish regrets to inform you this page does not exist.}", "", "Confused? This is the {{wiki|Wetfish Wiki}}, a place anyone can edit!", "It appears you've stumbled upon a place none have yet traveled.", "Would you like to be the first? {{{$path}/?edit|All it takes is a click.}}", "", "i{But please, don't wallow.}", "i{A new page surely follows.}", "i{You have the power.}");
        $PageContent = implode("<br />", $PageContent);
    } else {
        mysql_query("Update `Wiki_Pages` set `Views` = `Views` + 1 where `ID`='{$PageID}'");
    }
    if ($_SESSION['admin']) {
        $content['ExtraNav'] = new Navigation();
        $content['ExtraNav']->Add("Archive This Page", FormatPath("/{$path}/") . "?archive");
        $content['ExtraNav']->Add("Rename This Page", FormatPath("/{$path}/") . "?rename");
    }
    $title[] = FishFormat($PageTitle, "strip");
    $content['Title'] .= FishFormat($PageTitle);
    $content['Body'] .= FishFormat($PageContent);
    if ($PageEdits) {
        $EditCount = count(explode(",", $PageEdits));
        date_default_timezone_set('America/New_York');
        $PageEditTime = formatTime($PageEditTime);
        if ($pageViews != 1) {
            $viewPlural = 's';
        }
        if ($EditCount != 1) {
            $Plural = "s";
        }
        $content['Tags'] = $tagLinks;
        $content['Footer'] = "<b>" . number_format($pageViews) . "</b> page view{$viewPlural}. <b>{$EditCount}</b> edit{$Plural} &ensp;&mdash;&ensp; Last modified <b>{$PageEditTime}</b>.";
    }
    return array($title, $content);
}
Esempio n. 10
0
function formatTime($t,$type)
{
	if ($t=="") return "";
	if ($t=="DNF" || $t=="DNS") return $t;
	switch($type)
	{
	case 1:
		while(strlen($t)>4 && ((($ch=substr($t,0,1))=="0") || $ch==":")) $t = substr($t,1);
		return $t;
		break;
	case 2:
		if(strlen($t)>1 && substr($t,0,1)=="0") $t = substr($t,1);
		return $t;
		break;
	default:
		return formatTime(substr($t,0,2),2)."/".formatTime(substr($t,2,2),2)." ".formatTime(substr($t,4,9),1);
	}
}
Esempio n. 11
0
			_ticket_price.": ".number_format($row->price,2).
			"</cite></p>";
			if( key($row) != count($events_advertise)-1 ) {
				echo"<br/>";
			} 
		}
	echo "</div>";
}

// Special event of the day and outlet
$special_events = querySQL('event_data_day');
if ($special_events && $_SESSION['page'] == 2 ) {
	echo "<div class='alert_info'>";
		// special events
		foreach($special_events as $row) {
			echo "
			<img src='../web/images/icon_cutlery.png' alt='special' class='middle'/>
			<span class='bold'>
			<a href='".$_SERVER['SCRIPT_NAME']."?outletID=".$row->outlet_id."&selectedDate=".$row->event_date."'>".
			_today.": ".$row->subject."</a></span>
			<p class='margin-bottom-10'>".$row->description."</p><p><cite>
			".date($general['dateformat'],strtotime($row->event_date)).
			" ".formatTime($row->start_time,$general['timeformat']).
			" - ".formatTime($row->end_time,$general['timeformat'])." | ".
			_ticket_price.": ".number_format($row->price,2).
			"</cite></p>";
		}
	echo "</div>";
}

?>
Esempio n. 12
0
      <div class='<?php 
        echo $class;
        ?>
 comment-id'><?php 
        echo $message->id;
        ?>
</div>
      <table class='table table-borderless w-p100'>
        <tr>
        <th class='th-from'>
          <?php 
        echo $message->from;
        ?>
<br>
          <span class='time'> <?php 
        echo formatTime($message->date, 'Y/m/d');
        ?>
 </span>
        </th>
        <td class='td-content'>
          <div class='content-detail'><?php 
        echo nl2br($message->content);
        ?>
</div>
        </td>
        <td class='td-action'> <?php 
        echo html::a($this->createLink('message', 'reply', "messageID={$message->id}"), $lang->message->reply, "data-toggle='modal' data-type='iframe' data-icon='reply' data-title='{$lang->message->reply}'");
        ?>
 </td>
        </tr>
        <?php 
     echo "<img src='images/icons/clock-bolt.png' class='help tipsyold middle smicon' title='" . _sentence_11 . "' />";
 } else {
     // daylight coloring
     if ($row->reservation_time > $daylight_evening) {
         echo "<img src='images/icons/clock-moon.png' class='middle smicon'/>";
     } else {
         if ($row->reservation_time > $daylight_noon) {
             echo "<img src='images/icons/clock-sun.png' class='middle smicon'/>";
         } else {
             if ($row->reservation_time < $daylight_noon) {
                 echo "<img src='images/icons/clock-grey.png' class='middle smicon'/>";
             }
         }
     }
 }
 echo "<strong>" . formatTime($row->reservation_time, $general['timeformat']) . "</strong></td>";
 echo "<td>\n\t\t\t\t<strong class='big'>" . $row->reservation_pax . "</strong>&nbsp;&nbsp;" . $row->reservation_hotelguest_yn . "</td>";
 //<img src='images/icons/user-silhouette.png' class='middle'/>
 echo "<td style='width:20%'>" . printTitle($row->reservation_title) . "<strong> <a id='detlbuttontrigger' href='ajax/guest_detail.php?id=" . $id . "'";
 // color guest name if tautologous
 if ($tautologous > 1) {
     echo " class='tautologous tipsy' title='" . _tautologous_booking . "'";
 }
 echo ">" . $row->reservation_guest_name . "</a></strong>";
 if ($row->repeat_id != 0) {
     //print out recurring symbol
     echo "&nbsp;<img src='images/icons/loop-alt.png' alt='" . _recurring . "' title='" . _recurring . "' class='tipsy' border='0' >";
 }
 echo "</td><td style='width:20%'>";
 if ($_SESSION['page'] == 1) {
     echo $row->outlet_name;
Esempio n. 14
0
     </div>
     <div class='item-content'>
       
       <div class='text small text-muted'>
         <div class='media pull-left'>
         <?php 
       if (!empty($article->image)) {
           $title = $article->image->primary->title ? $article->image->primary->title : $article->title;
           echo html::a($url, html::image($article->image->primary->smallURL, "title='{$title}' class='thumbnail'"));
       }
       ?>
         </div>
         <strong class='text-important'>
           <?php 
       if (isset($content->time)) {
           echo "<i class='icon-time'></i> " . formatTime($article->addedDate, DT_DATE4);
       }
       ?>
         </strong> 
         &nbsp;<?php 
       echo $article->summary;
       ?>
       </div>
     </div>
   </div>
   <?php 
   }
   ?>
   </div>
 </div>
 <?php 
Esempio n. 15
0
function recent($path, $action, $title, $content)
{
    //		$Head = '<meta name="robots" content="noindex, nofollow" />';
    $content['UserNav']->Active("Recent Activity");
    if (empty($_SESSION['Recent'])) {
        $_SESSION['Recent']['Active'][0] = "All Edits";
        $_SESSION['Recent']['Active'][3] = "Descending";
        $_SESSION['Recent']['Order'] = "DESC";
    }
    $content['ExtraNav'] = new Navigation();
    $content['ExtraNav']->Add("All Edits", "?recent/all");
    $content['ExtraNav']->Add("Most Recent Edit", "?recent/unique");
    $content['ExtraNav']->Add("Ascending", "?recent/asc");
    $content['ExtraNav']->Add("Descending", "?recent/desc");
    $content['ExtraNav']->Active($_SESSION['Recent']['Active']);
    $Template['Title'] = "View:";
    $content['ExtraNav']->Template($Template);
    if (empty($action[1])) {
        $content['Title'] = "Recent Activity";
        $ActivityQuery = "SELECT {$Unique} `ID`,`PageID`,`AccountID`,`EditTime`,`Size`,`Tags`,`Name`,`Description`,`Title` FROM `Wiki_Edits` where `Archived` = 0 ORDER BY `ID` {$_SESSION['Recent']['Order']}";
        list($QueryData, $Links) = Paginate($ActivityQuery, 50, $_GET['page'], $_SERVER['QUERY_STRING']);
        $content['Body'] .= "<center class='page-navigation'>{$Links}</center>";
        $content['Body'] .= "<table width='100%' class='history'>";
        $content['Body'] .= "<tr><td><b>Revision</b></td><td><b>Size</b></td><td><b>Tags</b></td><td><b>Editor</b></td><td style='min-width:200px;'><b>Title</b></td><td><b>Description</b></td></tr>";
        if ($QueryData) {
            foreach ($QueryData as $Result) {
                list($EditID, $PageID, $AccountID, $PageTime, $PageSize, $pageTags, $PageName, $PageDescription, $PageTitle) = $Result;
                if (empty($Data[$PageID])) {
                    $PageQuery = mysql_query("SELECT `Path` FROM `Wiki_Pages` WHERE `ID`='{$PageID}'");
                    list($PagePath) = mysql_fetch_array($PageQuery);
                    $Data[$PageID] = $PagePath;
                } else {
                    $PagePath = $Data[$PageID];
                }
                $Toggle++;
                date_default_timezone_set('America/New_York');
                $minWidth = recentTime($PageTime) ? 85 : 175;
                $PageTime = formatTime($PageTime);
                if ($Toggle % 2 == 1) {
                    $Class = "class='toggle'";
                } else {
                    $Class = '';
                }
                $PageName = FishFormat($PageName, "format");
                $PageDescription = FishFormat($PageDescription, "format");
                $PageTitle = FishFormat($PageTitle, "format");
                $DiffURL = str_replace("//", "/", "/{$PagePath}/?diff/{$EditID}");
                $content['Body'] .= "<tr {$Class}><td style='min-width:{$minWidth}px;'>{$PageTime}</td><td>{$PageSize}</td><td>{$pageTags}</td><td><b><a href='/edits?name={$PageName}'>{$PageName}</a></b></td><td style='max-width:400px'><span style='float:right;'><a href='{$DiffURL}' rel='nofollow'>d</a></span><b><a href='/{$PagePath}'>{$PageTitle}</a></b></td><td class='multi-line'>{$PageDescription}</td></tr>";
            }
        }
        $content['Body'] .= "</table>";
        $content['Body'] .= "<center class='page-navigation bottom'>{$Links}</center>";
    } elseif ($action[1] == "page") {
    } else {
        switch ($action[1]) {
            case "all":
                $_SESSION['Recent']['Active'][0] = "All Edits";
                $_SESSION['Recent']['Active'][1] = "";
                $_SESSION['Recent']['View'] = "";
                break;
            case "unique":
                $_SESSION['Recent']['Active'][0] = "";
                $_SESSION['Recent']['Active'][1] = "Most Recent Edit";
                $_SESSION['Recent']['View'] = "DISTINCT";
                break;
            case "asc":
                $_SESSION['Recent']['Active'][2] = "Ascending";
                $_SESSION['Recent']['Active'][3] = "";
                $_SESSION['Recent']['Order'] = "";
                break;
            case "desc":
                $_SESSION['Recent']['Active'][2] = "";
                $_SESSION['Recent']['Active'][3] = "Descending";
                $_SESSION['Recent']['Order'] = "DESC";
                break;
        }
        $content['Body'] = "<b>Settings changed...</b> <meta http-equiv='refresh' content='2;url=" . FormatPath("/{$path}/?recent") . "'>";
    }
    return array($title, $content);
}
Esempio n. 16
0
		$events =	querySQL('db_propery_events');
		
		if ($events) {
			// remember original session outlet id
			$mem_id = $_SESSION['outletID'];
			foreach($events as $row) {
			$_SESSION['outletID'] = $row->outlet_id;
			echo "<tr id='events-".$row->id."'>";
			echo "<td><span class='bold'>".date($general['dateformat'],strtotime($row->event_date))."</strong></td>
			<td><span class='bold'><a href='?p=6&q=4&btn=3&eventID=".$row->id."'>".$row->subject."</a></strong>
			<a href='main_page.php?p=2&outletID=".$row->outlet_id."&selectedDate=".$row->event_date."' style='margin-left:12px;'>
			<img src='images/icons/arrow.png'/></a>
			</td>
			<td>".querySQL('db_outlet')."</td>
			<td>".formatTime($row->start_time,$general['timeformat'])."</td>
			<td>".formatTime($row->end_time,$general['timeformat'])."</td>";
			//<td>".$row->open_to."</td>
			//<td><small>".$row->contact."</small></td>
			echo "<td>".$row->advertise_start." "._days." "._before."</td>
			<td>".number_format($row->price,2)."</td>
		    <td>
					<a href='#modaldelete' name='events' id='".$row->id."' class='deletebtn'>
					<img src='images/icons/delete_cross.png' alt='"._cancelled."' class='help' title='"._delete."'/>
					</a>
		    	</td>
			</tr>";
			}
			//get back original session outlet id
			$_SESSION['outletID'] = $mem_id;
		}
		?>
Esempio n. 17
0
                    ?>
</span> <?php 
                    echo $rctFlag;
                    ?>
										<?php 
                    if (Member::isOnLeave($player->member_id)) {
                        ?>
											<small class='pull-right text-muted'>On Leave</small>
										<?php 
                    } else {
                        ?>
											<small class='pull-right text-<?php 
                        echo inactiveClass($player->last_activity);
                        ?>
'>Seen <?php 
                        echo formatTime(strtotime($player->last_activity));
                        ?>
</small>
										<?php 
                    }
                    ?>
</a>
									<?php 
                }
                ?>
								</div>

							<?php 
            }
            ?>
Esempio n. 18
0
     $where = array('review' => '~' . $_GET['keywords']);
 }
 $reviews = $GLOBALS['db']->select('CubeCart_reviews', false, $where, array($filter['field'] => $filter['sort']), $per_page, $page);
 if (isset($_GET['product_id']) && is_numeric($_GET['product_id'])) {
     $product = $GLOBALS['db']->select('CubeCart_inventory', array('name'), array('product_id' => (int) $_GET['product_id']));
 }
 if (!$reviews && isset($product) && $product) {
     $GLOBALS['main']->setACPWarning($lang['reviews']['error_reviews_none']);
     httpredir(currentPage(array('product_id')), 'search');
 }
 if ($reviews) {
     $GLOBALS['smarty']->assign('PAGINATION', $GLOBALS['db']->pagination(false, $per_page, $page, 9));
     foreach ($reviews as $review) {
         if (($product = $GLOBALS['db']->select('CubeCart_inventory', array('name'), array('product_id' => $review['product_id']))) !== false) {
             $review['product'] = $product[0];
             $review['date'] = formatTime($review['time']);
             $review['delete'] = currentPage(null, array('delete' => (int) $review['id']));
             $review['edit'] = currentPage(null, array('edit' => (int) $review['id']));
             $smarty_data['reviews'][] = $review;
         } else {
             $GLOBALS['db']->delete('CubeCart_reviews', array('product_id' => $review['product_id']));
         }
     }
     if (isset($smarty_data['reviews'])) {
         $GLOBALS['smarty']->assign('REVIEWS', $smarty_data['reviews']);
     }
 }
 $fields = array(array('value' => 'rating', 'name' => $lang['documents']['rating']), array('value' => 'time', 'name' => $lang['common']['date']));
 $sorts = array(array('value' => 'DESC', 'name' => $lang['category']['sort_high_low']), array('value' => 'ASC', 'name' => $lang['category']['sort_low_high']));
 $statuses = array(array('value' => '', 'name' => $lang['common']['all']), array('value' => '1', 'name' => $lang['common']['approved']), array('value' => '0', 'name' => $lang['common']['unapproved']));
 foreach ($fields as $field) {
Esempio n. 19
0
    foreach (UserAction::findByDivision($division->id, 15) as $action) {
        ?>
							<?php 
        if (!is_null($action->target_id)) {
            ?>
								<li>
									<i class="<?php 
            echo $action->icon;
            ?>
 fa-2x"></i>
									<div>
										<?php 
            echo UserAction::humanize($action->type_id, $action->target_id, $action->user_id, $action->verbage);
            ?>
										<span><?php 
            echo formatTime(strtotime($action->date), 1);
            ?>
</span>
									</div>
								</li>
							<?php 
        }
        ?>
						<?php 
    }
    ?>
					</ul>
					<div class="panel-footer"><a href="activity/" class="btn btn-default">View more &raquo;</a></div>
				</div>
			</div>
		</div>
Esempio n. 20
0
function timestampToDatetime($timestamp)
{
    $format = Config::get('dateformat') . ' ' . (Config::get('clock') == 12 ? 'g:i A' : 'H:i');
    return formatTime($format, $timestamp);
}
Esempio n. 21
0
 /**
  * Deliver digital download from _createDownload
  *
  * @param string $order_id
  * @param string $email
  * @return bool
  */
 private function _digitalDelivery($order_id, $email)
 {
     if (!empty($order_id) && !empty($email)) {
         if (($digital = $GLOBALS['db']->select('CubeCart_downloads', array('digital_id', 'accesskey', 'order_inv_id'), array('cart_order_id' => $order_id))) !== false) {
             foreach ($digital as $offset => $download) {
                 // Get product name
                 $product = $GLOBALS['db']->select('CubeCart_order_inventory', array('name'), array('id' => $download['order_inv_id']));
                 // Set minimum expiry time (min 30 mins = 1800 seconds)
                 if (!$GLOBALS['config']->isEmpty('config', 'download_expire')) {
                     $validity_time = $GLOBALS['config']->get('config', 'download_expire') > 1800 ? $GLOBALS['config']->get('config', 'download_expire') : 1800;
                     $expire = time() + $validity_time;
                 } else {
                     $expire = 0;
                 }
                 $GLOBALS['db']->update('CubeCart_downloads', array('expire' => $expire), array('digital_id' => $download['digital_id']));
                 $dkeys[] = array('accesskey' => $download['accesskey'], 'name' => $product[0]['name'], 'expire' => $expire > 0 ? formatTime($expire, false, true) : $GLOBALS['language']->common['never']);
             }
             $mailer = new Mailer();
             if ($this->_email_enabled && ($contents = $mailer->loadContent('cart.digital_download', $this->_order_summary['lang'], $this->_order_summary))) {
                 $storeURL = CC_SSL ? $GLOBALS['config']->get('config', 'ssl_url') : $GLOBALS['storeURL'];
                 foreach ($dkeys as $dkey) {
                     $download['url'] = $storeURL . '/index.php?_a=download&accesskey=' . $dkey['accesskey'];
                     $download['name'] = $dkey['name'];
                     $download['expire'] = $dkey['expire'];
                     $downloads[] = $download;
                 }
                 $GLOBALS['smarty']->assign('DOWNLOADS', $downloads);
                 return $mailer->sendEmail($email, $contents);
             }
         }
     }
     return false;
 }
Esempio n. 22
0
</div>
    <div class='article' id='blog' data-id='<?php 
echo $article->id;
?>
'>
      <header>
        <h1><?php 
echo $article->title;
?>
</h1>
        <dl class='dl-inline'>
          <dd data-toggle='tooltip' data-placement='top' data-original-title='<?php 
printf($lang->article->lblAddedDate, formatTime($article->addedDate));
?>
'><i class="icon-time icon-large"></i> <?php 
echo formatTime($article->addedDate);
?>
</dd>
          <dd data-toggle='tooltip' data-placement='top' data-original-title='<?php 
printf($lang->article->lblAuthor, $article->author);
?>
'><i class='icon-user icon-large'></i> <?php 
echo $article->author;
?>
</dd>
          <?php 
if ($article->source and $article->source != 'original' and $article->copyURL != '') {
    ?>
          <dt><?php 
    echo $lang->article->lblSource;
    ?>
Esempio n. 23
0
?>
</th>
        <td colspan='2'><?php 
echo html::textarea('content', htmlspecialchars($article->content), "rows='10' class='form-control'");
?>
</td>
      </tr>
      <tr>
        <th><?php 
echo $lang->article->addedDate;
?>
</th>
        <td>
          <div class='input-append date'>
            <?php 
echo html::input('addedDate', formatTime($article->addedDate), "class='form-control'");
?>
            <span class='add-on'><button class="btn btn-default" type="button"><i class="icon-calendar"></i></button></span>
          </div>
        </td>
        <td><span class='help-inline'><?php 
echo $lang->article->placeholder->addedDate;
?>
</span></td>
      </tr>
      <tr>
        <th><?php 
echo $lang->article->status;
?>
</th>
        <td><?php 
Esempio n. 24
0
  <div class='<?php 
        echo $class;
        ?>
 comment-id'><?php 
        echo $comment->id;
        ?>
</div>
  <table class='table table-borderless w-p100'>
    <tr>
    <th class='th-from'>
      <?php 
        echo $comment->from;
        ?>
<br>
      <span class='time'><?php 
        echo formatTime($comment->date, 'Y/m/d');
        ?>
 </span>
    </th>
    <td class='td-content'>
      <div class='content-detail'><?php 
        echo nl2br($comment->content);
        ?>
</div>
    </td>
    <td class='td-action'> <?php 
        echo html::a($this->createLink('message', 'reply', "commentID={$comment->id}"), $lang->comment->reply, "data-toggle='modal' data-type='iframe' data-icon='reply' data-title='{$lang->comment->reply}'");
        ?>
 </td>
    </tr>
    <?php 
Esempio n. 25
0
</p>
        <?php 
}
?>
        <p><?php 
printf($lang->order->infoAmount, $order->plan, $order->real);
?>
</p>
        <p>
          <?php 
if (formatTime($order->contactedDate)) {
    printf($lang->order->infoContacted, $order->contactedDate);
}
?>
          <?php 
if (formatTime($order->nextDate)) {
    printf($lang->order->infoNextDate, $order->nextDate);
}
?>
        </p>
      </div>
    </fieldset>
    </td>
  </tr>
  <tr>
    <td><?php 
include '../../../sys/common/view/mail.html.php';
?>
</td>
  </tr>
</table>
Esempio n. 26
0
        if ($game->game_id != 2) {
            ?>
					<span class="pull-left" style="margin-right: 20px;"><img class="img-thumbnail"  src="assets/images/game_icons/32x32/<?php 
            echo $game->game_id;
            ?>
.png"/></span>

				<?php 
        }
        ?>
				<span class="pull-left">
					<?php 
        echo $game->server;
        ?>
<br /><span class="text-muted">Played <?php 
        echo formatTime(strtotime($game->datetime));
        ?>
</span>
				</span>
			</a>
		<?php 
    }
    ?>



	<?php 
} else {
    ?>
		<li class='list-group-item text-muted'>No information currently available for this player, or player has not played any games in the past 30 days. Please ensure that game activity is not hidden by the user.</li>
	<?php 
Esempio n. 27
0
        // special events
        foreach ($advertise as $row) {
            echo "\n\t\t\t\t\t\t\t\t\t<img src='../web/images/icon_cutlery.png' alt='special' class='middle'/>\n\t\t\t\t\t\t\t\t\t<span class='bold'>\n\t\t\t\t\t\t\t\t\t<a href='" . $_SERVER['SCRIPT_NAME'] . "?outletID=" . $row->outlet_id . "&selectedDate=" . $row->event_date . "'>" . _today . ": " . $row->subject . "</a></span>\n\t\t\t\t\t\t\t\t\t<p>" . $row->description . "<br/><cite><span class='bold'>\n\t\t\t\t\t\t\t\t\t" . date($general['dateformat'], strtotime($row->event_date)) . "</span> " . formatTime($row->start_time, $general['timeformat']) . " - " . formatTime($row->end_time, $general['timeformat']) . " | " . _ticket_price . ": " . number_format($row->price, 2) . "</cite></p>";
            if (key($row) != count($events_advertise) - 1) {
                echo "<br/>";
            }
        }
        echo "</div>";
    } else {
        echo "<div class='alert_ads'>";
        $advertise = $events_advertise;
        // special events advertisement
        echo "<div class='ads'>" . _ads . "</div>";
        // special events
        foreach ($advertise as $row) {
            echo "\n\t\t\t\t\t\t\t\t\t<img src='../web/images/icon_cutlery.png' alt='special' class='middle'/>\n\t\t\t\t\t\t\t\t\t<span class='bold'>\n\t\t\t\t\t\t\t\t\t<a href='" . $_SERVER['SCRIPT_NAME'] . "?outletID=" . $row->outlet_id . "&selectedDate=" . $row->event_date . "'>" . _sp_events . ": " . date($general['dateformat'], strtotime($row->event_date)) . " " . $row->subject . "</a> | " . $row->outlet_name . "</span>\n\t\t\t\t\t\t\t\t\t<p>" . $row->description . "<br/><cite><span class='bold'>\n\t\t\t\t\t\t\t\t\t" . date($general['dateformat'], strtotime($row->event_date)) . "</span> " . formatTime($row->start_time, $general['timeformat']) . " - " . formatTime($row->end_time, $general['timeformat']) . " | " . _ticket_price . ": " . number_format($row->price, 2) . "</cite></p>";
            if (key($row) != count($events_advertise) - 1) {
                echo "<br/>";
            }
        }
        echo "</div>";
    }
}
?>
			<br/><br/>	
<?			
			// Restaurant dropdown
			$num_outlets = 0;
			if ($_SESSION['single_outlet'] == 'OFF') {
				$num_outlets = querySQL('num_outlets');
			}
Esempio n. 28
0
function formatDateTime($datetime, $short = 0)
{
    $date = substr($datetime, 0, 10);
    $time = substr($datetime, 11, 8);
    return formatDate($date, $short) . ' ' . formatTime($time, $short);
}
Esempio n. 29
0
 /**
  * Get all replies of a message for front.
  *
  * @param  object  $message
  * @access public
  * @return array
  */
 public function getFrontReplies($message, $type = '')
 {
     $replies = $this->getReplies($message);
     if (!empty($replies)) {
         if ($type !== 'simple') {
             foreach ($replies as $reply) {
                 echo "<tr class='reply'>";
                 echo "<th class='th-from text-important'>{$reply->from}<br />";
                 echo "<span class='time'>" . formatTime($reply->date, 'Y/m/d') . "</span></th>";
                 echo "<td class='td-content'><div class='content-detail'>" . nl2br($reply->content) . '</div></td>';
                 echo "<td class='td-action'>";
                 echo html::a(helper::createLink('message', 'reply', "id={$reply->id}"), $this->lang->message->reply, " data-toggle='modal' data-type='iframe' id='reply{$reply->id}'");
                 echo '</td>';
                 echo '</tr>';
                 $this->getFrontReplies($reply);
             }
         } else {
             echo "<div class='replies'>";
             foreach ($replies as $reply) {
                 echo "<div class='reply card'>";
                 echo "<div class='card-heading'>";
                 echo "<span class='text-primary'><i class='icon-reply'></i> {$reply->from}</span> &nbsp; <small class='text-muted'>" . formatTime($reply->date, 'Y/m/d H:m') . "</small>";
                 echo "<div class='actions'>" . html::a(helper::createLink('message', 'reply', "id={$reply->id}"), $this->lang->message->reply, " data-toggle='modal' data-type='ajax' id='reply{$reply->id}'") . "</div>";
                 echo '</div>';
                 echo "<div class='card-content'>" . nl2br($reply->content) . "</div>";
                 $this->getFrontReplies($reply, $type);
                 echo '</div>';
             }
             echo '</div>';
         }
     }
 }
Esempio n. 30
0
            <div class='media pull-right'>
              <?php 
        $title = $article->image->primary->title ? $article->image->primary->title : $article->title;
        echo html::a($url, html::image($article->image->primary->smallURL, "title='{$title}' class='thumbnail'"));
        ?>
            </div>
          <?php 
    }
    ?>
          <?php 
    echo $article->summary;
    ?>
        </div>
        <div class="card-actions text-muted">
          <span data-toggle='tooltip' title='<?php 
    printf($lang->article->lblAddedDate, formatTime($article->addedDate));
    ?>
'><i class="icon-time"></i> <?php 
    echo date('Y/m/d', strtotime($article->addedDate));
    ?>
</span>
          &nbsp; <span data-toggle='tooltip' title='<?php 
    printf($lang->article->lblAuthor, $article->author);
    ?>
'><i class="icon-user"></i> <?php 
    echo $article->author;
    ?>
</span>
          &nbsp; <span data-toggle='tooltip' title='<?php 
    printf($lang->article->lblViews, $article->views);
    ?>