本文整理汇总了PHP中tzdate函数的典型用法代码示例。如果您正苦于以下问题:PHP tzdate函数的具体用法?PHP tzdate怎么用?PHP tzdate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tzdate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convertdatauris
function convertdatauris($in)
{
global $CFG, $userid;
$okext = array('jpeg' => '.jpg', 'gif' => '.gif', 'png' => '.png');
if (strpos($in, 'data:image') === false) {
return $in;
}
$in = preg_replace('/<img[^>]*src="data:image[^>]*$/', '', $in);
if (!isset($CFG['GEN']['noFileBrowser'])) {
preg_match_all('/<img[^>]*src="(data:image\\/(\\w+);base64,([^"]*))"/', $in, $matches);
foreach ($matches[3] as $k => $code) {
$img = base64_decode($code);
$ext = $matches[2][$k];
if (!isset($okext[$ext])) {
continue;
}
$key = "ufiles/{$userid}/pastedimage" . tzdate("ymd-His", time()) . '-' . $k . $okext[$ext];
storecontenttofile($img, $key, "public");
$in = str_replace($matches[1][$k], getuserfileurl($key), $in);
}
return $in;
} else {
$in = preg_replace('/<img[^>]*src="data:image[^>]*>/', '', $in);
}
return $in;
}
示例2: intval
echo "No thread specified";
exit;
}
$thread = intval($_GET['thread']);
$query = "SELECT imas_forums.id FROM imas_forums JOIN imas_forum_threads ON imas_forums.id=imas_forum_threads.forumid ";
$query .= " WHERE imas_forum_threads.id={$thread} AND imas_forums.courseid='{$cid}'";
$result = mysql_query($query) or die("Query failed : {$query}: " . mysql_error());
if (mysql_num_rows($result) == 0) {
echo 'Invalid thread';
exit;
}
$flexwidth = true;
$nologo = true;
require "../header.php";
echo '<h4>' . _('Thread Views') . '</h4>';
$query = "SELECT iu.LastName,iu.FirstName,ifv.lastview FROM imas_users AS iu JOIN ";
$query .= "imas_forum_views AS ifv ON iu.id=ifv.userid WHERE ifv.threadid={$thread} ORDER BY ifv.lastview";
$result = mysql_query($query) or die("Query failed : {$query}: " . mysql_error());
if (mysql_num_rows($result) == 0) {
echo '<p>' . _('No thread views') . '</p>';
} else {
echo '<table><thead><tr><th>' . _('Name') . '</th><th>' . _('Last Viewed') . '</th></tr></thead>';
echo '<tbody>';
while ($row = mysql_fetch_assoc($result)) {
echo '<tr><td>' . $row['LastName'] . ', ' . $row['FirstName'] . '</td>';
echo '<td>' . tzdate("F j, Y, g:i a", $row['lastview']) . '</td></tr>';
}
echo '</tbody></table>';
}
echo '<p class="small">' . _('Note: Only the most recent thread view per person is shown') . '</p>';
require "../footer.php";
示例3: while
$i = 0;
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_row($result)) {
$page_gbcatSelect['val'][$i] = $row[0];
$page_gbcatSelect['label'][$i] = $row[1];
$i++;
}
}
$hr = floor($coursedeftime / 60) % 12;
$min = $coursedeftime % 60;
$am = $coursedeftime < 12 * 60 ? 'am' : 'pm';
$deftime = ($hr == 0 ? 12 : $hr) . ':' . ($min < 10 ? '0' : '') . $min . ' ' . $am;
$replybydate = tzdate("m/d/Y", time() + 7 * 24 * 60 * 60);
$replybytime = $deftime;
//tzdate("g:i a",time()+7*24*60*60);
$postbydate = tzdate("m/d/Y", time() + 7 * 24 * 60 * 60);
$postbytime = $deftime;
//tzdate("g:i a",time()+7*24*60*60);
//HTML output
$placeinhead = "<script type=\"text/javascript\" src=\"{$imasroot}/javascript/DatePicker.js\"></script>";
$placeinhead .= '<style type="text/css">
table td {
border-bottom: 1px solid #ccf;
}
</style>
<script type="text/javascript">
function valform() {
if ($("#mainform input:checkbox[name=\'checked[]\']:checked").length == 0) {
if (!confirm("No forums are selected to be changed. Cancel to go back and select some forums, or click OK to make no changes")) {
return false;
}
示例4: tzdate
if ($isteacher || $line['ownerid'] == $userid && $allowmod) {
echo "<a href=\"postsbyname.php?cid={$cid}&forum={$forumid}&thread={$line['threadid']}&modify={$line['id']}\">Modify</a> \n";
}
if ($isteacher || $allowdel && $line['ownerid'] == $userid) {
echo "<a href=\"postsbyname.php?cid={$cid}&forum={$forumid}&thread={$line['threadid']}&remove={$line['id']}\">Remove</a> \n";
}
if ($line['posttype'] != 2 && $myrights > 5 && $allowreply) {
echo "<a href=\"postsbyname.php?cid={$cid}&forum={$forumid}&thread={$line['threadid']}&modify=reply&replyto={$line['id']}\">Reply</a>";
}
echo '</span>';
echo "<input type=\"button\" value=\"+\" onclick=\"toggleshow({$cnt})\" id=\"butn{$cnt}\" />";
echo '<b>' . $line['subject'] . '</b>';
if ($line['parent'] != 0) {
echo '</span>';
}
$dt = tzdate("F j, Y, g:i a", $line['postdate']);
echo ', Posted: ' . $dt;
if ($line['lastview'] == null || $line['postdate'] > $line['lastview']) {
echo " <span style=\"color:red;\">New</span>\n";
}
echo '</div>';
echo "<div id=\"m{$cnt}\" class=\"hidden\">" . filter($line['message']);
if ($haspoints) {
if ($caneditscore && $ownerid[$child] != $userid) {
echo '<hr/>';
echo "Private Feedback: <textarea cols=\"50\" rows=\"2\" name=\"feedback[{$line['id']}]\" id=\"feedback{$line['id']}\">";
if ($feedback[$line['id']] !== null) {
echo $feedback[$line['id']];
}
echo "</textarea>";
} else {
示例5: tzdate
$edate = tzdate("m/d/Y", $row[1]);
$stime = tzdate("g:i a", $row[0]);
$etime = tzdate("g:i a", $row[1]);
//check if exception already exists
$query = "SELECT id,startdate,enddate FROM imas_exceptions WHERE userid='{$_GET['uid']}' AND assessmentid='{$_GET['aid']}'";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$erow = mysql_fetch_row($result);
$page_isExceptionMsg = "";
$savetitle = _('Create Exception');
if ($erow != null) {
$savetitle = _('Save Changes');
$page_isExceptionMsg = "<p>An exception already exists. <button type=\"button\" onclick=\"window.location.href='exception.php?cid={$cid}&aid={$_GET['aid']}&uid={$_GET['uid']}&clear={$erow[0]}&asid={$asid}&stu={$stu}&from={$from}'\">" . _("Clear Exception") . '</button> or modify below.</p>';
$sdate = tzdate("m/d/Y", $erow[1]);
$edate = tzdate("m/d/Y", $erow[2]);
$stime = tzdate("g:i a", $erow[1]);
$etime = tzdate("g:i a", $erow[2]);
}
}
}
//DEFAULT LOAD DATA MANIPULATION
$address = $urlmode . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/exception.php?cid={$_GET['cid']}&uid={$_GET['uid']}&asid={$asid}&stu={$stu}&from={$from}";
$query = "SELECT id,name from imas_assessments WHERE courseid='{$cid}' ORDER BY name";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$page_courseSelect = array();
$i = 0;
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$page_courseSelect['val'][$i] = $line['id'];
$page_courseSelect['label'][$i] = $line['name'];
$i++;
}
}
示例6: tzdate
echo "\t\t<tr class=even>";
$alt = 1;
} else {
echo "\t\t<tr class=odd>";
$alt = 0;
}
?>
<td>
<input type=checkbox name='checked[]' value='<?php
echo $calitems[$i][0];
?>
' checked="checked"/>
</td>
<td class="nowrap"><?php
echo tzdate("m/d/Y", $calitems[$i][1]);
?>
</td>
<td><?php
echo $calitems[$i][2];
?>
</td>
<td><?php
echo $calitems[$i][3];
?>
</td>
</tr>
<?php
}
?>
示例7: foreach
}
}
echo '<table><thead><tr><th>Date</th><th>Action</th></tr></thead><tbody>';
foreach ($actions as $r) {
if (isset($r[3])) {
$r3pts = explode('::', $r[3]);
if (count($r3pts) == 2) {
$thelink = '<a href="' . $r3pts[0] . '" target="_blank">' . $r3pts[1] . '</a>';
$href = $r3pts[0];
} else {
$thelink = $r[3];
$href = $r[3];
}
}
echo '<tr>';
echo '<td>' . tzdate("l, F j, Y, g:i a", $r[2]) . '</td>';
echo '<td>';
switch ($r[0]) {
case 'inlinetext':
echo 'In inline text item ' . $innames[$r[1]] . ', clicked link to ' . $thelink;
break;
case 'linkedsum':
echo 'From linked item ' . $linames[$r[1]] . ' summary, clicked link to ' . $thelink;
break;
case 'linkedlink':
if ($r[3] == $r[1] || strpos($href, 'showlinkedtext') !== false && strpos($href, 'id=' . $r[1]) !== false) {
echo 'Opened linked text item ' . $linames[$r[1]];
} else {
echo 'Clicked linked item <a target="_blank" href="' . $href . '">' . $linames[$r[1]] . '</a>';
}
break;
示例8: formatdate
function formatdate($date)
{
return tzdate("D n/j/y, g:i a", $date);
//return tzdate("M j, Y, g:i a",$date);
}
示例9: ceil
}
$duetimenote .= ceil($timebeforedue % 3600 / 60) . " " . _('minutes');
$duetimenote .= '. ';
if ($exceptionduedate > 0) {
$duetimenote .= _('Due') . " " . tzdate('D m/d/Y g:i a', $exceptionduedate);
} else {
$duetimenote .= _('Due') . " " . tzdate('D m/d/Y g:i a', $testsettings['enddate']);
}
} else {
if ($testsettings['enddate'] == 2000000000) {
$duetimenote = '';
} else {
if ($exceptionduedate > 0) {
$duetimenote = _('Due') . " " . tzdate('D m/d/Y g:i a', $exceptionduedate);
} else {
$duetimenote = _('Due') . " " . tzdate('D m/d/Y g:i a', $testsettings['enddate']);
}
}
}
}
}
$restrictedtimelimit = false;
if ($testsettings['timelimit'] > 0 && !$isreview && !$superdone) {
$now = time();
$totremaining = $testsettings['timelimit'] - ($now - $starttime);
$remaining = $totremaining;
if ($timebeforedue < $remaining) {
$remaining = $timebeforedue - 5;
$restrictedtimelimit = true;
}
if ($testsettings['timelimit'] > 3600) {
示例10: showcalendar
function showcalendar($refpage)
{
global $imasroot, $cid, $userid, $teacherid, $previewshift, $latepasses, $urlmode, $latepasshrs, $myrights, $tzoffset, $tzname, $havecalcedviewedassess, $viewedassess;
$now = time();
if ($previewshift != -1) {
$now = $now + $previewshift;
}
if (!isset($_COOKIE['calstart' . $cid]) || $_COOKIE['calstart' . $cid] == 0) {
$today = $now;
} else {
$today = $_COOKIE['calstart' . $cid];
}
if (isset($_GET['calpageshift'])) {
$pageshift = $_GET['calpageshift'];
} else {
$pageshift = 0;
}
if (!isset($_COOKIE['callength' . $cid])) {
$callength = 4;
} else {
$callength = $_COOKIE['callength' . $cid];
}
$today = $today + $pageshift * 7 * $callength * 24 * 60 * 60;
$dayofweek = tzdate('w', $today);
$curmonum = tzdate('n', $today);
$dayofmo = tzdate('j', $today);
$curyr = tzdate('Y', $today);
if ($tzname == '') {
$serveroffset = date('Z') + $tzoffset * 60;
} else {
$serveroffset = 0;
//don't need this if user's timezone has been set
}
$midtoday = mktime(12, 0, 0, $curmonum, $dayofmo, $curyr) + $serveroffset;
$hdrs = array();
$ids = array();
$lastmo = '';
for ($i = 0; $i < 7 * $callength; $i++) {
$row = floor($i / 7);
$col = $i % 7;
list($thismo, $thisday, $thismonum, $datestr) = explode('|', tzdate('M|j|n|l F j, Y', $midtoday - ($dayofweek - $i) * 24 * 60 * 60));
if ($thismo == $lastmo) {
$hdrs[$row][$col] = $thisday;
} else {
$hdrs[$row][$col] = "{$thismo} {$thisday}";
$lastmo = $thismo;
}
$ids[$row][$col] = "{$thismonum}-{$thisday}";
$dates[$ids[$row][$col]] = $datestr;
}
?>
<?php
//echo '<div class="floatleft">Jump to <a href="'.$refpage.'.php?calpageshift=0&cid='.$cid.'">Now</a></div>';
$address = $urlmode . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/{$refpage}.php?cid={$cid}";
echo '<script type="text/javascript">var calcallback = "' . $address . '";</script>';
echo '<div class="floatright">Show <select id="callength" onchange="changecallength(this)">';
for ($i = 2; $i < 26; $i++) {
echo '<option value="' . $i . '" ';
if ($i == $callength) {
echo 'selected="selected"';
}
echo '>' . $i . '</option>';
}
echo '</select> weeks </div>';
echo '<div class=center><a href="' . $refpage . '.php?calpageshift=' . ($pageshift - 1) . '&cid=' . $cid . '">< <</a> ';
//echo $longcurmo.' ';
if ($pageshift == 0 && (!isset($_COOKIE['calstart' . $cid]) || $_COOKIE['calstart' . $cid] == 0)) {
echo "Now ";
} else {
echo '<a href="' . $refpage . '.php?calpageshift=0&calstart=0&cid=' . $cid . '">Now</a> ';
}
echo '<a href="' . $refpage . '.php?calpageshift=' . ($pageshift + 1) . '&cid=' . $cid . '">> ></a> ';
echo '</div> ';
echo "<table class=\"cal\" >";
//onmouseout=\"makenorm()\"
$exlowertime = mktime(0, 0, 0, $curmonum, $dayofmo - $dayofweek, $curyr) + $serveroffset;
$lowertime = max($now, $exlowertime);
$uppertime = mktime(0, 0, 0, $curmonum, $dayofmo - $dayofweek + 7 * $callength, $curyr) + $serveroffset;
$exceptions = array();
if (!isset($teacherid)) {
$query = "SELECT assessmentid,startdate,enddate,islatepass,waivereqscore FROM imas_exceptions WHERE userid='{$userid}'";
$result = mysql_query($query) or die("Query failed : {$query}" . mysql_error());
while ($row = mysql_fetch_row($result)) {
$exceptions[$row[0]] = array($row[1], $row[2], $row[3], $row[4]);
}
}
$byid = array();
$k = 0;
$query = "SELECT id,name,startdate,enddate,reviewdate,gbcategory,reqscore,reqscoreaid,timelimit,allowlate,caltag,calrtag FROM imas_assessments WHERE avail=1 AND courseid='{$cid}' AND enddate<2000000000 ORDER BY name";
$result = mysql_query($query) or die("Query failed : {$query}" . mysql_error());
while ($row = mysql_fetch_row($result)) {
$canundolatepass = false;
$latepasscnt = 0;
if (isset($exceptions[$row[0]])) {
if ($exceptions[$row[0]][2] > 0 && ($now < $row[3] || $exceptions[$row[0]][1] > $now + $latepasshrs * 60 * 60)) {
$canundolatepass = true;
}
$latepasscnt = round(($exceptions[$row[0]][1] - $row[3]) / ($latepasshrs * 3600));
//.........这里部分代码省略.........
示例11: while
if ($numrevisions > 1) {
$i = 0;
while ($row = mysql_fetch_row($result)) {
$revisionusers[$row[5]] = $row[3] . ', ' . $row[4];
//$row[1] = filter(str_replace('"','@^@^@',$row[1]));
//$row[1] = str_replace('"','\\"',$row[1]);
//$row[1] = str_replace('@^@^@','"',$row[1]);
//$revisionhistory .= ',{u:'.$row[5].',c:'.$row[1].',t:"'.tzdate("F j, Y, g:i a",$row[2]).'",id:'.$row[0].'}';
if (function_exists('json_encode')) {
$row[1] = json_decode($row[1]);
} else {
require_once "../includes/JSON.php";
$jsonser = new Services_JSON();
$row[1] = $jsonser->decode($row[1]);
}
$revisionhistory[] = array('u' => $row[5], 'c' => $row[1], 't' => tzdate("F j, Y, g:i a", $row[2]), 'id' => $row[0]);
$i++;
}
//$revisionhistory .= ']';
$keys = array_keys($revisionusers);
$i = 0;
//$users = '{';
$users = array();
foreach ($keys as $uid) {
//if ($i>0) { $users .= ',';}
//$users .= $uid.':"'.str_replace(array('\\','"',), array('\\\\','\"'), $revisionusers[$uid]).'"';
$users[$uid] = $revisionusers[$uid];
$i++;
}
//$users .= '}';
} else {
示例12: printPostsGadget
function printPostsGadget()
{
global $page_newpostlist, $page_coursenames, $postthreads, $imasroot;
echo '<div class="block">';
//echo "<span class=\"floatright\"><a href=\"#\" onclick=\"GB_show('Forum Widget Settings','$imasroot/forms.php?action=forumwidgetsettings&greybox=true',800,'auto')\" title=\"Forum Widget Settings\"><img style=\"vertical-align:top\" src=\"$imasroot/img/gears.png\"/></a></span>";
echo "<span class=\"floatright\"><a href=\"forms.php?action=forumwidgetsettings\"><img style=\"vertical-align:top\" src=\"{$imasroot}/img/gears.png\"/></a></span>";
echo '<h3>', _('New forum posts'), '</h3></div>';
echo '<div class="blockitems">';
if (count($page_newpostlist) == 0) {
echo '<p>', _('No new posts'), '</p>';
echo '</div>';
return;
}
$threadlist = implode(',', $postthreads);
$threaddata = array();
$query = "SELECT imas_forum_posts.*,imas_users.LastName,imas_users.FirstName FROM imas_forum_posts,imas_users ";
$query .= "WHERE imas_forum_posts.userid=imas_users.id AND imas_forum_posts.id IN ({$threadlist})";
$result = mysql_query($query) or die("Query failed : {$query} " . mysql_error());
while ($tline = mysql_fetch_array($result, MYSQL_ASSOC)) {
$threaddata[$tline['id']] = $tline;
}
echo '<table class="gb" id="newpostlist"><thead><tr><th>', _('Thread'), '</th><th>', _('Started By'), '</th><th>', _('Course'), '</th><th>', _('Last Post'), '</th></tr></thead>';
echo '<tbody>';
foreach ($page_newpostlist as $line) {
echo '<tr>';
$subject = $threaddata[$line['threadid']]['subject'];
if (trim($subject) == '') {
$subject = '[' . _('No Subject') . ']';
}
$n = 0;
while (strpos($subject, 'Re: ') === 0) {
$subject = substr($subject, 4);
$n++;
}
if ($n == 1) {
$subject = 'Re: ' . $subject;
} else {
if ($n > 1) {
$subject = "Re<sup>{$n}</sup>: " . $subject;
}
}
echo "<td><a href=\"forums/posts.php?page=-3&cid={$line['courseid']}&forum={$line['id']}&thread={$line['threadid']}\">";
echo $subject;
echo '</a></td>';
if ($threaddata[$line['threadid']]['isanon'] == 1) {
echo '<td>', _('Anonymous'), '</td>';
} else {
echo '<td>' . $threaddata[$line['threadid']]['LastName'] . ', ' . $threaddata[$line['threadid']]['FirstName'] . '</td>';
}
echo '<td>' . $page_coursenames[$line['courseid']] . '</td>';
echo '<td>' . tzdate("D n/j/y, g:i a", $line['lastposttime']) . '</td>';
echo '</tr>';
}
echo '</tbody></table>';
echo '<script type="text/javascript">initSortTable("newpostlist",Array("S","S","S","D"),false);</script>';
echo '</div>';
}
示例13: gbinstrdisp
//.........这里部分代码省略.........
}
if ($hidenc == 1 && $gbt[0][1][$i][4] == 0) {
//skip NC
continue;
} else {
if ($hidenc == 2 && ($gbt[0][1][$i][4] == 0 || $gbt[0][1][$i][4] == 3)) {
//skip all NC
continue;
}
}
if ($gbt[0][1][$i][3] > $availshow) {
continue;
}
if ($hidepast && $gbt[0][1][$i][3] == 0) {
continue;
}
if ($collapsegbcat[$gbt[0][1][$i][1]] == 2) {
continue;
}
//name and points
echo '<th class="cat' . $gbt[0][1][$i][1] . '"><div>' . $gbt[0][1][$i][0] . '<br/>';
if ($gbt[0][1][$i][4] == 0 || $gbt[0][1][$i][4] == 3) {
echo $gbt[0][1][$i][2] . ' ', _('pts'), ' ', _('(Not Counted)');
} else {
echo $gbt[0][1][$i][2] . ' ', _('pts');
if ($gbt[0][1][$i][4] == 2) {
echo ' (EC)';
}
}
if ($gbt[0][1][$i][5] == 1 && $gbt[0][1][$i][6] == 0) {
echo ' (PT)';
}
if ($includeduedate && $gbt[0][1][$i][11] < 2000000000 && $gbt[0][1][$i][11] > 0) {
echo '<br/><span class="small">' . tzdate('n/j/y&\\n\\b\\s\\p;g:ia', $gbt[0][1][$i][11]) . '</span>';
}
//links
if ($gbt[0][1][$i][6] == 0) {
//online
if ($isteacher) {
echo "<br/><a class=small href=\"addassessment.php?id={$gbt[0][1][$i][7]}&cid={$cid}&from=gb\">", _('[Settings]'), "</a>";
echo "<br/><a class=small href=\"isolateassessgrade.php?cid={$cid}&aid={$gbt[0][1][$i][7]}\">", _('[Isolate]'), "</a>";
if ($gbt[0][1][$i][10] == true) {
echo "<br/><a class=small href=\"isolateassessbygroup.php?cid={$cid}&aid={$gbt[0][1][$i][7]}\">", _('[By Group]'), "</a>";
}
} else {
echo "<br/><a class=small href=\"isolateassessgrade.php?cid={$cid}&aid={$gbt[0][1][$i][7]}\">", _('[Isolate]'), "</a>";
}
} else {
if ($gbt[0][1][$i][6] == 1 && ($isteacher || $istutor && $gbt[0][1][$i][8] == 1)) {
//offline
if ($isteacher) {
echo "<br/><a class=small href=\"addgrades.php?stu={$stu}&cid={$cid}&grades=all&gbitem={$gbt[0][1][$i][7]}\">", _('[Settings]'), "</a>";
echo "<br/><a class=small href=\"addgrades.php?stu={$stu}&cid={$cid}&grades=all&gbitem={$gbt[0][1][$i][7]}&isolate=true\">", _('[Isolate]'), "</a>";
} else {
echo "<br/><a class=small href=\"addgrades.php?stu={$stu}&cid={$cid}&grades=all&gbitem={$gbt[0][1][$i][7]}&isolate=true\">", _('[Scores]'), "</a>";
}
} else {
if ($gbt[0][1][$i][6] == 2 && $isteacher) {
//discussion
echo "<br/><a class=small href=\"addforum.php?id={$gbt[0][1][$i][7]}&cid={$cid}&from=gb\">", _('[Settings]'), "</a>";
} else {
if ($gbt[0][1][$i][6] == 3 && $isteacher) {
//exttool
echo "<br/><a class=small href=\"addlinkedtext.php?id={$gbt[0][1][$i][7]}&cid={$cid}&from=gb\">", _('[Settings]'), "</a>";
echo "<br/><a class=small href=\"edittoolscores.php?stu={$stu}&cid={$cid}&uid=all&lid={$gbt[0][1][$i][7]}&isolate=true\">", _('[Isolate]'), "</a>";
}
示例14: mysql_query
} else {
$query = "SELECT name,points,showdate,gbcategory,cntingb,tutoredit,rubric,outcomes FROM imas_gbitems WHERE id='{$_GET['gbitem']}'";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
list($name, $points, $showdate, $gbcat, $cntingb, $tutoredit, $rubric, $gradeoutcomes) = mysql_fetch_row($result);
if ($gradeoutcomes != '') {
$gradeoutcomes = explode(',', $gradeoutcomes);
} else {
$gradeoutcomes = array();
}
}
if ($showdate != 0) {
$sdate = tzdate("m/d/Y", $showdate);
$stime = tzdate("g:i a", $showdate);
} else {
$sdate = tzdate("m/d/Y", time() + 60 * 60);
$stime = tzdate("g:i a", time() + 60 * 60);
}
$rubric_vals = array(0);
$rubric_names = array('None');
$query = "SELECT id,name FROM imas_rubrics WHERE ownerid='{$userid}' OR groupid='{$gropuid}' ORDER BY name";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
while ($row = mysql_fetch_row($result)) {
$rubric_vals[] = $row[0];
$rubric_names[] = $row[1];
}
$query = "SELECT id,name FROM imas_outcomes WHERE courseid='{$cid}'";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$outcomenames = array();
while ($row = mysql_fetch_row($result)) {
$outcomenames[$row[0]] = $row[1];
}
示例15: printchildren
function printchildren($base, $restricttoowner = false)
{
$curdir = rtrim(dirname(__FILE__), '/\\');
global $children, $date, $subject, $message, $poster, $email, $forumid, $threadid, $isteacher, $cid, $userid, $ownerid, $points;
global $feedback, $posttype, $lastview, $bcnt, $icnt, $myrights, $allowreply, $allowmod, $allowdel, $allowlikes, $view, $page, $allowmsg;
global $haspoints, $imasroot, $postby, $replyby, $files, $CFG, $rubric, $pointsposs, $hasuserimg, $urlmode, $likes, $mylikes, $section;
global $canviewall, $caneditscore, $canviewscore;
if (!isset($CFG['CPS']['itemicons'])) {
$itemicons = array('web' => 'web.png', 'doc' => 'doc.png', 'wiki' => 'wiki.png', 'html' => 'html.png', 'forum' => 'forum.png', 'pdf' => 'pdf.png', 'ppt' => 'ppt.png', 'zip' => 'zip.png', 'png' => 'image.png', 'xls' => 'xls.png', 'gif' => 'image.png', 'jpg' => 'image.png', 'bmp' => 'image.png', 'mp3' => 'sound.png', 'wav' => 'sound.png', 'wma' => 'sound.png', 'swf' => 'video.png', 'avi' => 'video.png', 'mpg' => 'video.png', 'nb' => 'mathnb.png', 'mws' => 'maple.png', 'mw' => 'maple.png');
} else {
$itemicons = $CFG['CPS']['itemicons'];
}
foreach ($children[$base] as $child) {
if ($restricttoowner && $ownerid[$child] != $userid) {
continue;
}
echo "<div class=block> ";
echo '<span class="leftbtns">';
if (isset($children[$child])) {
if ($view == 1) {
$lbl = '+';
$img = "expand";
} else {
$lbl = '-';
$img = "collapse";
}
//echo "<input type=button id=\"butb$bcnt\" value=\"$lbl\" onClick=\"toggleshow($bcnt)\"> ";
echo "<img class=\"pointer\" id=\"butb{$bcnt}\" src=\"{$imasroot}/img/{$img}.gif\" onClick=\"toggleshow({$bcnt})\"/> ";
}
if ($hasuserimg[$child] == 1) {
if (isset($GLOBALS['CFG']['GEN']['AWSforcoursefiles']) && $GLOBALS['CFG']['GEN']['AWSforcoursefiles'] == true) {
echo "<img src=\"{$urlmode}s3.amazonaws.com/{$GLOBALS['AWSbucket']}/cfiles/userimg_sm{$ownerid[$child]}.jpg\" onclick=\"togglepic(this)\" />";
} else {
echo "<img src=\"{$imasroot}/course/files/userimg_sm{$ownerid[$child]}.jpg\" onclick=\"togglepic(this)\" />";
}
}
echo '</span>';
echo "<span class=right>";
if ($view == 2) {
echo "<input type=button id=\"buti{$icnt}\" value=\"Show\" onClick=\"toggleitem({$icnt})\">\n";
} else {
echo "<input type=button id=\"buti{$icnt}\" value=\"Hide\" onClick=\"toggleitem({$icnt})\">\n";
}
if ($isteacher) {
echo "<a href=\"posts.php?view={$view}&cid={$cid}&forum={$forumid}&thread={$threadid}&page={$page}&move={$child}\">Move</a> \n";
}
if ($isteacher || $ownerid[$child] == $userid && $allowmod) {
if ($base == 0 && time() < $postby || $base > 0 && time() < $replyby || $isteacher) {
echo "<a href=\"posts.php?view={$view}&cid={$cid}&forum={$forumid}&thread={$threadid}&page={$page}&modify={$child}\">Modify</a> \n";
}
}
if ($isteacher || $allowdel && $ownerid[$child] == $userid && !isset($children[$child])) {
echo "<a href=\"posts.php?view={$view}&cid={$cid}&forum={$forumid}&thread={$threadid}&page={$page}&remove={$child}\">Remove</a> \n";
}
if ($posttype[$child] != 2 && $myrights > 5 && $allowreply) {
echo "<a href=\"posts.php?view={$view}&cid={$cid}&forum={$forumid}&thread={$threadid}&page={$page}&modify=reply&replyto={$child}\">Reply</a>";
}
echo "</span>\n";
echo '<span style="float:left">';
echo "<b>{$subject[$child]}</b><br/>Posted by: ";
//if ($isteacher && $ownerid[$child]!=0) {
// echo "<a href=\"mailto:{$email[$child]}\">";
//} else if ($allowmsg && $ownerid[$child]!=0) {
if (($isteacher || $allowmsg) && $ownerid[$child] != 0) {
echo "<a href=\"../msgs/msglist.php?cid={$cid}&add=new&to={$ownerid[$child]}\" ";
if ($section[$child] != '') {
echo 'title="Section: ' . $section[$child] . '"';
}
echo ">";
}
echo $poster[$child];
if (($isteacher || $allowmsg) && $ownerid[$child] != 0) {
echo "</a>";
}
if ($isteacher && $ownerid[$child] != 0 && $ownerid[$child] != $userid) {
echo " <a class=\"small\" href=\"{$imasroot}/course/gradebook.php?cid={$cid}&stu={$ownerid[$child]}\" target=\"_popoutgradebook\">[GB]</a>";
if ($base == 0 && preg_match('/Question\\s+about\\s+#(\\d+)\\s+in\\s+(.*)\\s*$/', $subject[$child], $matches)) {
$query = "SELECT ias.id FROM imas_assessment_sessions AS ias JOIN imas_assessments AS ia ON ia.id=ias.assessmentid ";
$aname = addslashes($matches[2]);
$query .= "WHERE ia.name='{$aname}' AND ias.userid=" . intval($ownerid[$child]);
$result = mysql_query($query) or die("Query failed : {$query} " . mysql_error());
if (mysql_num_rows($result) > 0) {
$r = mysql_fetch_row($result);
echo " <a class=\"small\" href=\"{$imasroot}/course/gb-viewasid.php?cid={$cid}&uid={$ownerid[$child]}&asid={$r[0]}\" target=\"_popoutgradebook\">[assignment]</a>";
}
}
}
echo ', ';
echo tzdate("D, M j, Y, g:i a", $date[$child]);
if ($date[$child] > $lastview) {
echo " <span style=\"color:red;\">New</span>\n";
}
echo '</span>';
if ($allowlikes) {
$icon = in_array($child, $mylikes) ? 'liked' : 'likedgray';
$likemsg = 'Liked by ';
$likecnt = 0;
$likeclass = '';
if ($likes[$child][0] > 0) {
$likeclass = ' liked';
//.........这里部分代码省略.........