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


PHP ldate函数代码示例

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


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

示例1: feedback_between_dates

function feedback_between_dates()
{
    global $dates, $startdate, $enddate, $CONFIG;
    if (!empty($startdate)) {
        if (!empty($enddate)) {
            if ($dates == 'feedbackin') {
                $str = "<p>" . sprintf($GLOBALS['strFeedbackBetweenXandY'], ldate($CONFIG['dateformat_date'], $startdate), ldate($CONFIG['dateformat_date'], $enddate)) . "</p>";
            } elseif ($dates == 'closedin') {
                $str = "<p>Closed between " . ldate($CONFIG['dateformat_date'], $startdate) . " and " . ldate($CONFIG['dateformat_date'], $enddate) . "</p>";
            }
        } else {
            if ($dates == 'feedbackin') {
                $str = "<p>" . sprintf($GLOBALS['strFeedbackAfterX'], ldate($CONFIG['dateformat_date'], $startdate)) . "</p>";
            } elseif ($dates == 'closedin') {
                $str = "<p>" . sprintf($GLOBALS['strClosedAfterX'], ldate($CONFIG['dateformat_date'], $startdate)) . "</p>";
            }
        }
    } elseif (!empty($enddate)) {
        if ($dates == 'feedbackin') {
            $str = "<p>" . sprintf($GLOBALS['strFeedbackBeforeX'], ldate($CONFIG['dateformat_date'], $enddate)) . "</p>";
        } elseif ($dates == 'closedin') {
            $str = "<p>" . srintf($GLOBALS['strClosedBeforeX'], ldate($CONFIG['dateformat_date'], $enddate)) . "</p>";
        }
    }
    return $str;
}
开发者ID:sitracker,项目名称:sitracker_old,代码行数:26,代码来源:report_feedback.php

示例2: portal_incident_table

function portal_incident_table($sql)
{
    global $CONFIG, $showclosed;
    $result = mysql_query($sql);
    if (mysql_error()) {
        trigger_error(mysql_error(), E_USER_WARNING);
    }
    $numincidents = mysql_num_rows($result);
    if ($numincidents >= 1) {
        $shade = 'shade1';
        $html .= "<table align='center' width='70%'>";
        $html .= "<tr>";
        $html .= colheader('id', $GLOBALS['strID']);
        $html .= colheader('title', $GLOBALS['strTitle']);
        $html .= colheader('owner', $GLOBALS['strOwner']);
        $html .= colheader('lastupdated', $GLOBALS['strLastUpdated']);
        $html .= colheader('contact', $GLOBALS['strContact']);
        $html .= colheader('status', $GLOBALS['strStatus']);
        if ($showclosed != "true") {
            $html .= colheader('actions', $GLOBALS['strOperation']);
        }
        $html .= "</tr>\n";
        while ($incident = mysql_fetch_object($result)) {
            $html .= "<tr class='{$shade}'><td align='center'>";
            $html .= "<a href='incident.php?id={$incident->id}'>{$incident->id}</a></td>";
            $html .= "<td>";
            if (!empty($incident->softwareid)) {
                $html .= software_name($incident->softwareid) . "<br />";
            }
            $html .= "<strong><a href='incident.php?id={$incident->id}'>{$incident->title}</a></strong></td>";
            $html .= "<td align='center'>" . user_realname($incident->owner) . "</td>";
            $html .= "<td align='center'>" . ldate($CONFIG['dateformat_datetime'], $incident->lastupdated) . "</td>";
            $html .= "<td align='center'><a href='contactdetails.php?id={$incident->contactid}'>";
            $html .= "{$incident->forenames} {$incident->surname}</a></td>";
            $html .= "<td align='center'>" . incidentstatus_name($incident->status, external) . "</td>";
            if ($showclosed != "true") {
                $html .= "<td align='center'><a href='update.php?id={$incident->id}'>{$GLOBALS['strUpdate']}</a> | ";
                //check if the customer has requested a closure
                $lastupdate = list($update_userid, $update_type, $update_currentowner, $update_currentstatus, $update_body, $update_timestamp, $update_nextaction, $update_id) = incident_lastupdate($incident->id);
                if ($lastupdate[1] == "customerclosurerequest") {
                    $html .= "{$GLOBALS['strClosureRequested']}</td>";
                } else {
                    $html .= "<a href='close.php?id={$incident->id}'>{$GLOBALS['strRequestClosure']}</a></td>";
                }
            }
            $html .= "</tr>";
            if ($shade == 'shade1') {
                $shade = 'shade2';
            } else {
                $shade = 'shade1';
            }
        }
        $html .= "</table>";
    } else {
        $html .= "<p class='info'>{$GLOBALS['strNoIncidents']}</p>";
    }
    return $html;
}
开发者ID:sitracker,项目名称:sitracker_old,代码行数:58,代码来源:index.php

示例3: to_row

function to_row($contactrow)
{
    global $now, $updateid, $CONFIG, $dbg;
    $str = '';
    if (($contactrow['expirydate'] < $now or $contactrow['term'] == 'yes') and $contactrow['expirydate'] != -1) {
        $class = 'expired';
    } else {
        $class = "shade2";
    }
    $incidents_remaining = $contactrow['incident_quantity'] - $contactrow['incidents_used'];
    $str = "<tr class='{$class}'>";
    if ($contactrow['expirydate'] < $now and $contactrow['expirydate'] != '-1') {
        $str .= "<td>{$GLOBALS['strExpired']}</td>";
    } elseif ($contactrow['term'] == 'yes') {
        $str .= "<td>{$GLOBALS['strTerminated']}</td>";
    } elseif ($contactrow['incident_quantity'] >= 1 and $contactrow['incidents_used'] >= $contactrow['incident_quantity']) {
        $str .= "<td class='expired'>{$GLOBALS['strZeroRemaining']} ({$contactrow['incidents_used']}/{$contactrow['incident_quantity']} {$strUsed})</td>";
    } else {
        $str .= "<td><a href=\"{$_SERVER['PHP_SELF']}?action=incidentform&amp;type=support&amp;";
        $str .= "contactid=" . $contactrow['contactid'] . "&amp;maintid=" . $contactrow['maintid'];
        $str .= "&amp;producttext=" . urlencode($contactrow['productname']) . "&amp;productid=";
        $str .= $contactrow['productid'] . "&amp;updateid={$updateid}&amp;siteid=" . $contactrow['siteid'];
        $str .= "&amp;win={$win}\" onclick=\"return confirm_support();\">{$GLOBALS['strAddIncident']}</a> ";
        if ($contactrow['incident_quantity'] == 0) {
            $str .= "({$GLOBALS['strUnlimited']})";
        } else {
            $str .= "(" . sprintf($GLOBALS['strRemaining'], $incidents_remaining) . ")";
        }
    }
    $str .= "</td>";
    $str .= '<td>' . $contactrow['forenames'] . ' ' . $contactrow['surname'] . '</td>';
    $str .= '<td>' . $contactrow['name'] . '</td>';
    $str .= '<td>' . $contactrow['productname'] . '</td>';
    $str .= '<td>' . servicelevel_id2tag($contactrow['servicelevelid']) . '</td>';
    if ($contactrow['expirydate'] == '-1') {
        $str .= "<td>{$GLOBALS['strUnlimited']}</td>";
    } else {
        $str .= '<td>' . ldate($CONFIG['dateformat_date'], $contactrow['expirydate']) . '</td>';
    }
    $str .= "</tr>\n";
    return $str;
}
开发者ID:nicdev007,项目名称:sitracker,代码行数:42,代码来源:incident_add.php

示例4: mktime

if (!empty($groupid)) {
    $gidurl = "&amp;gid={$groupid}";
}
// skip over weekends in day view
if (date('D', mktime(0, 0, 0, $month, $day, $year)) == 'Sat') {
    $day -= 1;
}
if (date('D', mktime(0, 0, 0, $month, $day, $year)) == 'Sun') {
    $day += 1;
}
if (date('D', mktime(0, 0, 0, $month, $day, $year)) == 'Mon') {
    $pdate = mktime(0, 0, 0, $month, $day - 3, $year);
} else {
    $pdate = mktime(0, 0, 0, $month, $day - 1, $year);
}
if (date('D', mktime(0, 0, 0, $month, $day, $year)) == 'Fri') {
    $ndate = mktime(0, 0, 0, $month, $day + 3, $year);
} else {
    $ndate = mktime(0, 0, 0, $month, $day + 1, $year);
}
echo "<h2>{$strDayView}</h2>";
echo "<p align='center'>";
echo "<a href='{$_SERVER['PHP_SELF']}?display=day&amp;year=" . date('Y', $pdate) . "&amp;month=" . date('m', $pdate) . "&amp;day=" . date('d', $pdate) . "{$gidurl}'>&lt;</a> ";
echo ldate('l dS F Y', mktime(0, 0, 0, $month, $day, $year));
echo " <a href='{$_SERVER['PHP_SELF']}?display=day&amp;year=" . date('Y', $ndate) . "&amp;month=" . date('m', $ndate) . "&amp;day=" . date('d', $ndate) . "{$gidurl}'>&gt;</a>";
echo "</p>";
$numgroups = group_selector($groupid, "display={$display}&amp;year={$year}&amp;month={$month}&amp;day={$day}");
if ($groupid == 'all') {
    $groupid = '';
}
echo draw_chart('day', $year, $month, $day, $groupid, $user);
开发者ID:sitracker,项目名称:sitracker_old,代码行数:31,代码来源:day.inc.php

示例5: trigger_error

 if (mysql_error()) {
     trigger_error(mysql_error(), E_USER_WARNING);
 }
 if (mysql_num_rows($result) < 1) {
     echo "<h2>{$strError}</h2>";
     echo "<p>{$strNoFeedBackFormToCompleteHere}</p>";
     echo "\n\n<!-- f: {$formid} r:{$respondent} rr:{$responseref} dh:{$decodehash}  hc:{$hashcode} -->\n\n";
 } else {
     $reqd = 0;
     while ($form = mysql_fetch_object($result)) {
         echo "<form action='feedback.php' method='post'>\n";
         echo "<h2>{$form->name}</h2>\n";
         echo "<p>{$strRelatingToIncident} <strong>#{$incidentid}</strong> &mdash; <strong>" . incident_title($incidentid) . "</strong><br />";
         echo sprintf($strOpenedbyXonY, contact_realname(incident_contact($incidentid)), ldate($CONFIG['dateformat_date'], db_read_column('opened', $dbIncidents, $incidentid)));
         echo ' &nbsp; ';
         echo sprintf($strClosedOnX, ldate($CONFIG['dateformat_date'], db_read_column('closed', $dbIncidents, $incidentid))) . ".</p>";
         if (!empty($_REQUEST['error'])) {
             echo "<p style='color: red'>{$strErrorRequiredQuestionsNotCompleted}</p>";
         }
         echo nl2br($form->introduction);
         $qsql = "SELECT * FROM `{$dbFeedbackQuestions}` ";
         $qsql .= "WHERE formid='{$form->id}' ";
         $qsql .= "ORDER BY taborder ASC";
         $qresult = mysql_query($qsql);
         if (mysql_error()) {
             trigger_error(mysql_error(), E_USER_WARNING);
         }
         while ($question = mysql_fetch_object($qresult)) {
             if (strlen(trim($question->sectiontext)) > 3) {
                 echo "<hr />{$question->sectiontext}\n";
             }
开发者ID:sitracker,项目名称:sitracker_old,代码行数:31,代码来源:feedback.php

示例6: colheader

 echo colheader('incidentid', $strIncident, $sort, $order, $filter);
 echo "<th>{$strOperation}</th>";
 echo "</tr>\n";
 $shade = 'shade1';
 while ($resp = mysql_fetch_object($result)) {
     $respondentarr = explode('-', $resp->respondent);
     $responserefarr = explode('-', $resp->responseref);
     $hashtext = urlencode($resp->formid) . "&&" . urlencode($resp->contactid) . "&&" . urlencode($resp->incidentid);
     // $hashcode=urlencode(trim(base64_encode(gzcompress(str_rot13($hashtext)))));
     $hashcode4 = str_rot13($hashtext);
     $hashcode3 = gzcompress($hashcode4);
     $hashcode2 = base64_encode($hashcode3);
     $hashcode1 = trim($hashcode2);
     $hashcode = urlencode($hashcode1);
     echo "<tr class='{$shade}'>";
     echo "<td>" . ldate($CONFIG['dateformat_datetime'], mysqlts2date($resp->created)) . "</td>";
     echo "<td><a href='contact_details.php?id={$resp->contactid}' title='{$resp->email}'>" . contact_realname($resp->contactid) . "</a></td>";
     echo "<td><a href=\"javascript:incident_details_window('{$resp->incidentid}','incident{$resp->incidentid}')\">";
     echo "{$strIncident} [{$resp->incidentid}]</a> - ";
     echo incident_title($resp->incidentid) . "</td>";
     $url = "feedback.php?ax={$hashcode}";
     if ($resp->multi == 'yes') {
         $url .= "&amp;rr=1";
     }
     echo "<td>";
     if ($resp->completed == 'no') {
         echo "<a href='{$url}' title='{$url}' target='_blank'>URL</a>";
     }
     $eurl = urlencode($url);
     $eref = urlencode($resp->responseref);
     if ($resp->completed == 'no') {
开发者ID:sitracker,项目名称:sitracker_old,代码行数:31,代码来源:feedback_browse.php

示例7: mysql_query

$sql = "SELECT *,s.id AS siteid FROM `{$dbSites}` AS s, `{$dbMaintenance}` AS m, `{$dbSupportContacts}` AS sc, `{$dbIncidents}` AS i ";
$sql .= "WHERE s.id = m.site ";
$sql .= "AND m.id = sc.maintenanceid ";
$sql .= "AND sc.contactid = i.contact ";
$sql .= "AND i.opened > '{$monthago}' ";
$sql .= "ORDER BY s.id, i.id";
$result = mysql_query($sql);
if (mysql_error()) {
    trigger_error("MySQL Query Error: " . mysql_error(), E_USER_WARNING);
}
if (mysql_num_rows($result) > 0) {
    $prvincid = 0;
    while ($row = mysql_fetch_object($result)) {
        if ($prvincid != $row->id) {
            echo "<strong>[{$row->siteid}] {$row->name}</strong> {$strIncident}: <a href=\"javascript:incident_details_window_l('{$row->id}', 'incident{$row->id}')\">{$row->id}</a>  ";
            echo "{$strDate}: " . ldate('d M Y', $row->opened) . " ";
            echo "{$strProduct}: " . product_name($row->product);
            $site = $row->siteid;
            ${$site}++;
            $sites[] = $row->siteid;
            echo "<br />\n";
        }
        $prvincid = $row->id;
        // print_r($row);
    }
} else {
    echo "<p class='warning'>{$strNoRecords}</p>";
}
$sites = array_unique($sites);
/*
foreach ($sites AS $site => $val)
开发者ID:sitracker,项目名称:sitracker_old,代码行数:31,代码来源:report_incidents_recent.php

示例8: display_holiday_table

function display_holiday_table($result)
{
    global $CONFIG, $user, $approver, $mode, $sit;
    echo "<table align='center'>";
    echo "<tr>";
    if ($user == 'all' && $approver == TRUE) {
        echo "<th>{$GLOBALS['strName']}</th>";
    }
    echo "<th>{$GLOBALS['strDate']}</th><th>{$GLOBALS['strLength']}</th><th>{$GLOBALS['strType']}</th>";
    if ($approver and $mode == 'approval') {
        echo "<th>{$GLOBALS['strOperation']}</th><th>{$GLOBALS['strGroupMembersAway']}</th>";
    }
    //    else
    //    {
    //        echo "<th>{$GLOBALS['strStatus']}</th>";
    //    }
    echo "</tr>";
    while ($holiday = mysql_fetch_object($result)) {
        echo "<tr class='shade2'>";
        if ($user == 'all' && $approver == TRUE) {
            echo "<td><a href='{$_SERVER['PHP_SELF']}?user={$holiday->userid}&amp;mode=approval'>";
            echo user_realname($holiday->userid, TRUE);
            echo "</a></td>";
        }
        echo "<td>" . ldate($CONFIG['dateformat_longdate'], mysql2date($holiday->date, TRUE)) . "</td>";
        echo "<td>";
        if ($holiday->length == 'am') {
            echo $GLOBALS['strMorning'];
        }
        if ($holiday->length == 'pm') {
            echo $GLOBALS['strAfternoon'];
        }
        if ($holiday->length == 'day') {
            echo $GLOBALS['strFullDay'];
        }
        echo "</td>";
        echo "<td>" . holiday_type($holiday->type) . "</td>";
        if ($approver == TRUE) {
            if ($sit[2] != $holiday->userid and $mode == 'approval') {
                echo "<td>";
                $approvetext = $GLOBALS['strApprove'];
                if ($holiday->type == HOL_SICKNESS) {
                    $approvetext = $GLOBALS['strAcknowledge'];
                }
                echo "<a href=\"holiday_approve.php?approve=TRUE&amp;user={$holiday->userid}&amp;view={$user}&amp;startdate={$holiday->date}&amp;type={$holiday->type}&amp;length={$holiday->length}\">{$approvetext}</a> | ";
                echo "<a href=\"holiday_approve.php?approve=FALSE&amp;user={$holiday->userid}&amp;view={$user}&amp;startdate={$holiday->date}&amp;type={$holiday->type}&amp;length={$holiday->length}\">{$GLOBALS['strDecline']}</a>";
                if ($holiday->type == HOL_HOLIDAY) {
                    echo " | <a href=\"holiday_approve.php?approve=FREE&amp;user={$holiday->userid}&amp;view={$user}&amp;startdate={$holiday->date}&amp;type={$holiday->type}&amp;length={$holiday->length}\">{$GLOBALS['strApproveFree']}</a>";
                }
                echo "</td>";
            } else {
                echo "<td>";
                if ($holiday->approvedby > 0) {
                    echo sprintf($GLOBALS['strRequestSentToX'], user_realname($holiday->approvedby, TRUE));
                } else {
                    echo $GLOBALS['strRequestNotSent'];
                    $waiting = TRUE;
                }
                echo "</td>";
            }
            if ($approver == TRUE and $mode == 'approval') {
                echo "<td>";
                echo check_group_holiday($holiday->userid, $holiday->date, $holiday->length);
                echo "</td>";
            }
        }
        echo "</tr>\n";
    }
    echo "</table>\n";
}
开发者ID:sitracker,项目名称:sitracker_old,代码行数:70,代码来源:holiday_request.php

示例9: switch

switch ($mode) {
    case 'edit':
        $sql = "SELECT bodytext, duration FROM `{$dbUpdates}` WHERE id = {$updateid} AND duration IS NOT NULL AND duration != 0";
        $oldduration = cleanvar($_REQUEST['oldduration']);
        $reason = cleanvar($_REQUEST['reason']);
        $newduration = cleanvar($_REQUEST['newduration']);
        // In minutes
        $result = mysql_query($sql);
        if (mysql_error()) {
            trigger_error(mysql_error(), E_USER_WARNING);
        }
        if (mysql_num_rows($result) == 1) {
            $obj = mysql_fetch_object($result);
            if ($obj->duration == $oldduration) {
                // Double check the oldduration thats been passed is whats in the DB
                $text = "{$obj->bodytext}\n\n[b]Duration adjusted[/b] by " . user_realname($sit[2]) . " on " . ldate($CONFIG['dateformat_datetime'], $now) . " from " . ceil($obj->duration) . "minutes to {$newduration}minutes, reason given:\n---\n{$reason}\n---";
                // FIXME should this be i18n? If so which language
                // $newduration *= 60;
                $usql = "UPDATE `{$dbUpdates}` SET bodytext = '" . mysql_real_escape_string($text) . "', duration = '{$newduration}' WHERE id = '{$updateid}'";
                mysql_query($usql);
                if (mysql_error()) {
                    trigger_error(mysql_error(), E_USER_WARNING);
                }
                // Some error checking
                if (mysql_affected_rows() < 1) {
                    html_redirect("{$CONFIG['application_webpath']}incident_details.php?id={$incidentid}", FALSE, $strFailed);
                } else {
                    html_redirect("{$CONFIG['application_webpath']}incident_details.php?id={$incidentid}", TRUE, $strDurationUpdated);
                }
            } else {
                // The value we've been passed isn't whats in the DB
开发者ID:sitracker,项目名称:sitracker_old,代码行数:31,代码来源:billing_edit_activity_duration.php

示例10: plugin_do

    exit;
}
// Display planner chart
echo "<h2>{$strMonthView}</h2>";
$nextyear = $year;
if ($month < 12) {
    $nextmonth = $month + 1;
} else {
    $nextmonth = 1;
    $nextyear = $year + 1;
}
$prevyear = $year;
if ($month > 1) {
    $prevmonth = $month - 1;
} else {
    $prevmonth = 12;
    $prevyear = $year - 1;
}
$plugin_calendar = plugin_do('holiday_chart_cal');
echo month_select($month, $year, $gidurl);
echo "<p align='center'><a href='{$_SERVER['PHP_SELF']}?month={$prevmonth}&amp;";
echo "year={$prevyear}{$gidurl}' title='Previous Month'>&lt;</a> ";
echo ldate('F Y', mktime(0, 0, 0, $month, 1, $year));
echo " <a href='{$_SERVER['PHP_SELF']}?month={$nextmonth}&amp;year={$nextyear}{$gidurl}' ";
echo "title='Next Month'>&gt;</a></p>";
// echo draw_chart('month', $year, $month, $day, '', $user);
$numgroups = group_selector($groupid, "display={$display}&amp;year={$year}&amp;month={$month}&amp;day={$day}");
if ($groupid == 'all') {
    $groupid = '';
}
echo draw_chart('month', $year, $month, $day, $groupid, $user);
开发者ID:sitracker,项目名称:sitracker_old,代码行数:31,代码来源:month.inc.php

示例11: foreach

 foreach ($contracts as $contract) {
     $sql = "SELECT *, m.id AS id ";
     $sql .= "FROM `{$dbMaintenance}` AS m, `{$dbProducts}` AS p ";
     $sql .= "WHERE m.id={$contract} ";
     $sql .= "AND (m.expirydate > UNIX_TIMESTAMP(NOW()) OR m.expirydate = -1) ";
     $sql .= "AND m.product=p.id ";
     $result = mysql_query($sql);
     if (mysql_error()) {
         trigger_error(mysql_error(), E_USER_WARNING);
     }
     $shade = 'shade1';
     if ($row = mysql_fetch_object($result)) {
         if ($row->expirydate == -1) {
             $row->expirydate = $strUnlimited;
         } else {
             $row->expirydate = ldate("jS F Y", $row->timestamp);
         }
         echo "<tr class='{$shade}'>";
         //echo "<td>{$row->id}</td>";
         echo "<td>{$row->name}</td><td>{$row->expirydate}</td>";
         echo "<td>";
         if ($row->allcontactssupported == 'yes') {
             echo "<select disabled='disabled'>";
             echo "<option>{$strAllSiteContactsSupported}</option>";
             echo "</select>";
             echo "</td>";
         } else {
             echo "<select name='visibility[{$row->id}]'>";
             echo "<option value='no-one'";
             if ($row->var_incident_visible_contacts == 'no' and $row->var_incident_visible_all == 'no') {
                 echo " selected='selected'";
开发者ID:sitracker,项目名称:sitracker_old,代码行数:31,代码来源:admin.php

示例12: ldate

     echo "</td><td>";
     if (empty($results['licence_type'])) {
         echo $strNoLicense;
     } else {
         if ($results['licence_quantity'] == 0) {
             echo "{$strUnlimited} ";
         } else {
             echo "{$results['licence_quantity']} ";
         }
         echo $results['licence_type'];
     }
     echo "</td><td>";
     if ($results["expirydate"] == '-1') {
         echo $strUnlimited;
     } else {
         echo ldate($CONFIG['dateformat_date'], $results["expirydate"]);
     }
     echo "</td>";
     echo "<td>";
     if ($results["notes"] == '') {
         echo "&nbsp;";
     } else {
         echo nl2br($results["notes"]);
     }
     echo "</td>";
     echo "<td><a href='contract_edit.php?action=edit&amp;maintid={$results['maintid']}'>{$strEdit}</a></td>";
     echo "</tr>";
 }
 echo "</table>";
 // free result and disconnect
 mysql_free_result($result);
开发者ID:sitracker,项目名称:sitracker_old,代码行数:31,代码来源:contracts.php

示例13: elseif

            }
        } elseif ($rowcount >= 4) {
            echo "Various";
        }
        echo "<br /><a href='kb_view_article.php?id={$kbarticle->docid}' class='info'>{$kbarticle->title}";
        $asql = "SELECT LEFT(content,400) FROM `{$dbKBContent}` WHERE docid='{$kbarticle->docid}' ORDER BY id ASC LIMIT 1";
        $aresult = mysql_query($asql);
        if (mysql_error()) {
            trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING);
        }
        list($content) = mysql_fetch_row($aresult);
        $content = strip_tags(remove_slashes($content));
        echo "<span>{$content}</span>";
        echo "</a>";
        echo "</td>";
        echo "<td>" . ldate($CONFIG['dateformat_date'], mysql2date($kbarticle->published)) . "</td>";
        echo "<td>" . $kbarticle->author . "</td>";
        echo "<td>{$kbarticle->keywords}</td>";
        echo "</tr>\n";
        if ($shade == 'shade1') {
            $shade = 'shade2';
        } else {
            $shade = 'shade1';
        }
    }
    echo "</table>\n";
} else {
    echo "<p align='center'>{$strNoResults}</p>";
}
// echo "<!---SQL === $sql --->";
echo "<p align='center'><a href='kb_article.php'>{$strAddNew}</a></p>";
开发者ID:nicdev007,项目名称:sitracker,代码行数:31,代码来源:kb.php

示例14: dashboard_rss_display

function dashboard_rss_display($dashletid)
{
    global $CONFIG, $dbInterfaceStyles, $dbDashboardRSS, $sit, $lib_path;
    if ($_SESSION['auth'] == TRUE) {
        $styleid = $_SESSION['style'];
    } else {
        $styleid = $CONFIG['default_interface_style'];
    }
    $csssql = "SELECT cssurl, iconset FROM `{$dbInterfaceStyles}` WHERE id='{$styleid}'";
    $cssresult = mysql_query($csssql);
    if (mysql_error()) {
        trigger_error(mysql_error(), E_USER_WARNING);
    } else {
        list($cssurl, $iconset) = mysql_fetch_row($cssresult);
    }
    /*
    Originally from dashboard/dashboard.inc.php
    */
    require_once APPLICATION_LIBPATH . 'magpierss/rss_fetch.inc';
    $sql = "SELECT url, items FROM `{$CONFIG['db_tableprefix']}dashboard_rss` WHERE owner = {$sit[2]} AND enabled = 'true'";
    $result = mysql_query($sql);
    if (mysql_error()) {
        trigger_error(mysql_error(), E_USER_WARNING);
    }
    define('MAGPIE_CACHE_ON', TRUE);
    define('MAGPIE_CACHE_DIR', $CONFIG['attachment_fspath'] . 'feeds');
    define('MAGPIE_OUTPUT_ENCODING', $i18ncharset);
    $feedallowedtags = '<img><strong><em><br><p>';
    if (mysql_num_rows($result) > 0) {
        while ($row = mysql_fetch_row($result)) {
            $url = $row[0];
            if ($rss = fetch_rss($url)) {
                //              if ($CONFIG['debug']) echo "<pre>".print_r($rss,true)."</pre>";
                echo "<table>";
                echo "<tr><th><span style='float: right;'><a href='" . htmlspecialchars($url) . "'>";
                echo "<img src='{$CONFIG['application_webpath']}images/icons/{$iconset}/12x12/feed-icon.png' alt='Feed Icon' />";
                echo "</a></span>";
                echo "<a href='{$rss->channel['link']}' class='direct info'>{$rss->channel['title']}";
                if (!empty($rss->image['url']) or !empty($rss->channel['description']) or !empty($rss->channel['icon'])) {
                    echo "<span>";
                    if (!empty($rss->image['url'])) {
                        echo "<img src='{$rss->image['url']}' alt='{$rss->image['title']}' style='float: right; margin-right: 2px; margin-left: 5px; margin-top: 2px;' />";
                    } elseif (!empty($rss->channel['icon'])) {
                        echo "<img src='{$rss->channel['icon']}' style='float: right; margin-right: 2px; margin-left: 5px; margin-top: 2px;' />";
                    }
                    echo "{$rss->channel['description']}</span>";
                }
                echo "</a>";
                echo "</th></tr>\n";
                $counter = 0;
                foreach ($rss->items as $item) {
                    //echo "<pre>".print_r($item,true)."</pre>";
                    echo "<tr><td>";
                    echo "<a href='{$item['link']}' class='info'>{$item['title']}";
                    if ($rss->feed_type == 'RSS') {
                        if (!empty($item['pubdate'])) {
                            $itemdate = strtotime($item['pubdate']);
                        } elseif (!empty($item['dc']['date'])) {
                            $itemdate = strtotime($item['dc']['date']);
                        } else {
                            $itemdate = '';
                        }
                        $d = strip_tags($item['description'], $feedallowedtags);
                    } elseif ($rss->feed_type == 'Atom') {
                        if (!empty($item['issued'])) {
                            $itemdate = strtotime($item['issued']);
                        } elseif (!empty($item['published'])) {
                            $itemdate = strtotime($item['published']);
                        }
                        $d = strip_tags($item['atom_content'], $feedallowedtags);
                    }
                    if ($itemdate > 10000) {
                        $itemdate = ldate($CONFIG['dateformat_datetime'], $itemdate);
                    }
                    echo "<span>";
                    if (!empty($itemdate)) {
                        echo "<strong>{$itemdate}</strong><br />";
                    }
                    echo "{$d}</span></a></td></tr>\n";
                    $counter++;
                    if ($row[1] > 0 and $counter > $row[1]) {
                        break;
                    }
                }
                echo "</table>\n";
            } else {
                echo "Error: It's not possible to get {$url}...";
            }
        }
    } else {
        echo "<p align='center'>{$GLOBALS['strNoRecords']}</p>";
    }
}
开发者ID:sitracker,项目名称:sitracker_old,代码行数:93,代码来源:dashboard_rss.php

示例15: h

<?php 
        echo $Form->end();
    }
    ?>

<div class="comment">
<div class="author"><?php 
    echo h($comment->author);
    ?>
</div>
<div class="content">
<?php 
    echo h($comment->content);
    ?>
</div>
<div class="byline">
<?php 
    echo '<time datetime="' . date('c', $comment->created) . '" title="' . ldate($comment->created) . '">' . sdate($comment->created) . '</time>';
    ?>
</div>

</div>
</li>

<?php 
}
?>
</ul>

<?php 
echo $this->embed('comments/pagination.html');
开发者ID:jivoo,项目名称:jivoo,代码行数:31,代码来源:index.html.php


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