本文整理汇总了PHP中user_realname函数的典型用法代码示例。如果您正苦于以下问题:PHP user_realname函数的具体用法?PHP user_realname怎么用?PHP user_realname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_realname函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: preg_replace
$quotereplace[4] = "<span class='quoteirrel'>\\1</span>";
$quotereplace[5] = "<span class='quoteirrel'>\\1</span>";
$quotereplace[6] = "<span class='quoteirrel'>\\1</span>";
$quotereplace[7] = "<span class='quote1'>\\1</span>";
$quotereplace[8] = "<span class='quote2'>\\1</span>";
$quotereplace[9] = "<span class='quote3'>\\1</span>";
$updatebody = preg_replace($quote, $quotereplace, $updatebody);
$updatebody = bbcode($updatebody);
//$updatebody = emotion($updatebody);
//"!(http:/{2}[\w\.]{2,}[/\w\-\.\?\&\=\#]*)!e"
// [\n\t ]+
$updatebody = preg_replace("!([\n\t ]+)(http[s]?:/{2}[\\w\\.]{2,}[/\\w\\-\\.\\?\\&\\=\\#\$\\%|;|\\[|\\]~:]*)!e", "'\\1<a href=\"\\2\" title=\"\\2\">'.(strlen('\\2')>=70 ? substr('\\2',0,70).'...':'\\2').'</a>'", $updatebody);
// Lookup some extra data
$updateuser = user_realname($update->userid, TRUE);
$updatetime = readable_date($update->timestamp);
$currentowner = user_realname($update->currentowner, TRUE);
$currentstatus = incident_status($update->currentstatus);
echo "<div class='detailhead' align='center'>";
//show update type icon
if (array_key_exists($update->type, $updatetypes)) {
if (!empty($update->sla) and $update->type == 'slamet') {
echo icon($slatypes[$update->sla]['icon'], 16, $update->type);
}
echo icon($updatetypes[$update->type]['icon'], 16, $update->type);
} else {
echo icon($updatetypes['research']['icon'], 16, $strResearch);
if ($update->sla != '') {
echo icon($slatypes[$update->sla]['icon'], 16, $update->type);
}
}
echo " {$updatetime}</div>";
示例3: trigger_error
} else {
trigger_error('User input error: ' . $error_string, E_USER_ERROR);
}
}
include APPLICATION_INCPATH . 'htmlfooter.inc.php';
} elseif ($action == 'reassign') {
// External variables
$incidentid = cleanvar($_REQUEST['incidentid']);
$uid = cleanvar($_REQUEST['userid']);
$nextaction = cleanvar($_REQUST['nextaction']);
include APPLICATION_INCPATH . 'htmlheader.inc.php';
echo "<h2>{$strIncidentAdded} - {$strSummary}</h2>";
echo "<p align='center'>";
$incidentnum = "<a href=\"javascript:incident_details_window('{$incidentid}','incident{$incidentid}');\">{$strIncident} {$incidentid}</a>";
$queuename = "<strong style='color: red'>{$strActionNeeded}</strong>";
$name = user_realname($uid);
printf($strHasBeenAutoMovedToX, $incidentnum, $name, $queuename);
echo help_link('AutoAssignIncidents') . "</p><br /><br />";
$userphone = user_phone($userid);
if ($userphone != '') {
echo "<p align='center'>{$strTelephone}: {$userphone}</p>";
}
$sql = "UPDATE `{$dbIncidents}` SET owner='{$uid}', lastupdated='{$now}' WHERE id='{$incidentid}'";
mysql_query($sql);
if (mysql_error()) {
trigger_error("MySQL Query Error " . mysql_error(), E_USER_ERROR);
}
trigger('TRIGGER_INCIDENT_ASSIGNED', array('userid' => $uid, 'incidentid' => $incidentid));
// add update
$sql = "INSERT INTO `{$dbUpdates}` (incidentid, userid, type, timestamp, currentowner, currentstatus, nextaction) ";
$sql .= "VALUES ('{$incidentid}', '{$sit[2]}', 'reassigning', '{$now}', '{$uid}', '1', '{$nextaction}')";
示例4: 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
示例5: mysql_query
}
}
if ($moved_attachments) {
// retrieve the update body so that we can insert time headers
$sql = "SELECT incidentid, bodytext, timestamp FROM `{$dbUpdates}` WHERE id='{$updateid}'";
$uresult = mysql_query($sql);
if (mysql_error()) {
trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING);
}
list($oldincidentid, $bodytext, $timestamp) = mysql_fetch_row($uresult);
if ($oldincidentid == 0) {
$oldincidentid = 'Inbox';
}
$prettydate = ldate('r', $timestamp);
// prepend 'moved' header to bodytext
$body = sprintf($SYSLANG['strMovedFromXtoXbyX'], "<b>{$oldincidentid}</b>", "<b>{$incidentid}</b>", "<b>" . user_realname($sit[2]) . "</b>") . "\n";
$body .= sprintf($SYSLANG['strOriginalMessageReceivedAt'], "<b>{$prettydate}</b>") . "\n";
$body .= $SYSLANG['strStatus'] . " -> <b>{$SYSLANG['strActive']}</b>\n";
$bodytext = $body . $bodytext;
$bodytext = mysql_real_escape_string($bodytext);
// move the update.
$sql = "UPDATE `{$dbUpdates}` SET incidentid='{$incidentid}', userid='{$sit[2]}', bodytext='{$bodytext}', timestamp='{$now}' WHERE id='{$updateid}'";
mysql_query($sql);
if (mysql_error()) {
trigger_error("MySQL Query Error " . mysql_error(), E_USER_ERROR);
}
//remove from tempincoming to prevent build up
$sql = "DELETE FROM `{$dbTempIncoming}` WHERE updateid='{$updateid}'";
mysql_query($sql);
if (mysql_error()) {
trigger_error("MySQL Query Error " . mysql_error(), E_USER_ERROR);
示例6: sprintf
echo "<h2>" . sprintf($strIncidentsVerbBetweenDates, $type, $start_str, $end_str) . "</h2>";
}
echo "<table align='center'>";
if (mysql_num_rows($result) > 0) {
echo "<tr><th>{$strID}</th><th>{$strTitle}</th><th>{$strOpened}</th><th>{$strClosed}</th><th>{$strOwner}</th><th>{$strCustomer}</th><th>{$strSite}</th></tr>";
while ($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td><a href=\"javascript:incident_details_window('{$row['id']}','incident{$row['id']}')\" class='info'>{$row['id']}</a></td>";
echo "<td><a href=\"javascript:incident_details_window('{$row['id']}','incident{$row['id']}')\" class='info'>{$row['title']}</a></td>";
echo "<td>" . date($CONFIG['dateformat_datetime'], $row['opened']) . "</td>";
if ($row['status'] != 2) {
echo "<td>{$strCurrentlyOpen}</td>";
} else {
echo "<td>" . date($CONFIG['dateformat_datetime'], $row['closed']) . "</td>";
}
echo "<td>" . user_realname($row['owner']) . "</td>";
$sql = "SELECT c.forenames, c.surname, s.name ";
$sql .= "FROM `{$dbContacts}` AS c, `{$dbSites}` AS s ";
$sql .= "WHERE s.id = c.siteid AND c.id = {$row['contact']}";
$contactResult = mysql_query($sql);
if (mysql_error()) {
trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING);
}
$contact = mysql_fetch_array($contactResult);
echo "<td>{$contact['forenames']} {$contact['surname']}</td>";
echo "<td>{$contact['name']}</td>";
echo "</tr>\n";
}
echo "</table>\n";
} else {
echo user_alert($strNoRecords, E_USER_WARNING);
示例7: holiday_approval_status
echo " {$strMorning}";
}
if ($dates['length'] == 'pm') {
echo " {$strAfternoon}";
}
echo "</td>";
echo "<td>";
if (empty($dates['approvedby'])) {
echo " <em>{$strNotRequested}</em>";
} else {
echo "<strong>" . holiday_approval_status($dates['approved']) . "</strong>";
}
if ($dates['approvedby'] > 0 and $dates['approved'] >= 1) {
echo " by " . user_realname($dates['approvedby']);
} elseif ($dates['approvedby'] > 0 and empty($dates['approved'])) {
echo " of " . user_realname($dates['approvedby']);
}
echo "</td>";
echo "<td>";
if ($approver == TRUE) {
echo "<a href='holiday_add.php?hid={$dates['holidayid']}&year=";
echo substr($dates['date'], 0, 4) . "&month=" . substr($dates['date'], 5, 2);
echo "&day=" . substr($dates['date'], 8, 2) . "&user={$dates['userid']}";
echo "&type={$dates['type']}&length=0&return=list' ";
echo "onclick=\"return window.confirm('{$dates['realname']}: " . ldate('l jS F Y', mysql2date($dates['date']));
echo ": {$strAreYouSureDelete}');\">{$strDelete}</a>";
}
echo "</td></tr>\n";
if ($shade == 'shade1') {
$shade = 'shade2';
} else {
示例8: format_date_friendly
$temparray['starttime'] = $startdate;
$temparray['duration'] = $duration;
$billing[$task->owner][] = $temparray;
}
$totalduration += $duration;
echo "<td>" . format_date_friendly($lastupdated) . "</td>";
}
if ($show == 'completed') {
echo "<td>";
if ($enddate > 0) {
echo ldate($CONFIG['dateformat_date'], $enddate);
}
echo "</td>";
}
if ($mode == 'incident' or $show == 'incidents') {
echo "<td>" . user_realname($task->owner) . "</td>";
if ($task->owner == $sit[2] and $enddate == '0') {
$engineerhasrunnintask = TRUE;
}
}
if ($mode == 'incident' and $enddate == '0') {
echo "<td><a href='view_task.php?id={$task->id}&mode=incident&incident={$id}' class='info'>";
echo "{$strViewActivity}</a></td>";
} elseif ($mode == 'incident') {
echo "<td></td>";
}
echo "</tr>\n";
if ($shade == 'shade1') {
$shade = 'shade2';
} else {
$shade = 'shade1';
示例9: dashboard_tasks
function dashboard_tasks($dashletid)
{
global $sit, $CONFIG, $iconset, $dbTasks;
$user = $sit[2];
if ($CONFIG['tasks_enabled'] == TRUE) {
$sql = "SELECT * FROM `{$dbTasks}` WHERE owner='{$user}' AND (completion < 100 OR completion='' OR completion IS NULL) AND ";
$sql .= "(distribution = 'public' OR distribution = 'private') ";
if (!empty($sort)) {
if ($sort == 'id') {
$sql .= "ORDER BY id ";
} elseif ($sort == 'name') {
$sql .= "ORDER BY name ";
} elseif ($sort == 'priority') {
$sql .= "ORDER BY priority ";
} elseif ($sort == 'completion') {
$sql .= "ORDER BY completion ";
} elseif ($sort == 'startdate') {
$sql .= "ORDER BY startdate ";
} elseif ($sort == 'duedate') {
$sql .= "ORDER BY duedate ";
} elseif ($sort == 'distribution') {
$sql .= "ORDER BY distribution ";
} else {
$sql = "ORDER BY id ";
}
if ($order == 'a' or $order == 'ASC' or $order = '') {
$sql .= "ASC";
} else {
$sql .= "DESC";
}
} else {
$sql .= "ORDER BY IF(duedate,duedate,99999999) ASC, duedate ASC, startdate DESC, priority DESC, completion ASC";
}
$result = mysql_query($sql);
if (mysql_error()) {
trigger_error(mysql_error(), E_USER_WARNING);
}
if (mysql_num_rows($result) >= 1) {
$content .= "<table align='center' width='100%'>";
$content .= "<tr>";
$content .= colheader('id', $GLOBALS['strID']);
$content .= colheader('name', $GLOBALS['strTask']);
$content .= colheader('priority', $GLOBALS['strPriority']);
$content .= colheader('completion', $GLOBALS['strCompletion']);
$content .= "</tr>\n";
$shade = 'shade1';
while ($task = mysql_fetch_object($result)) {
$duedate = mysql2date($task->duedate);
$startdate = mysql2date($task->startdate);
if (empty($task->name)) {
$task->name = $GLOBALS['strUntitled'];
}
$content .= "<tr class='{$shade}'>";
$content .= "<td>{$task->id}</td>";
$content .= "<td><a href='view_task.php?id={$task->id}' class='info'>" . truncate_string($task->name, 23);
if (!empty($task->description)) {
$content .= "<span>" . nl2br($task->description) . "</span>";
}
$content .= "</a></td>";
$content .= "<td>" . priority_icon($task->priority) . priority_name($task->priority) . "</td>";
$content .= "<td>" . percent_bar($task->completion) . "</td>";
$content .= "</tr>\n";
if ($shade == 'shade1') {
$shade = 'shade2';
} else {
$shade = 'shade1';
}
}
$content .= "</table>\n";
} else {
$content .= "<p align='center'>{$GLOBALS['strNoRecords']}</p>";
}
} else {
$content .= "<p class='warning'>{$GLOBALS['strDisabled']}</p>";
}
echo dashlet('tasks', $dashletid, icon('task', 16), sprintf($GLOBALS['strXsTasks'], user_realname($user, TRUE)), 'tasks.php', $content);
}
示例10: 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>" . user_realname($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>";
include APPLICATION_INCPATH . 'htmlfooter.inc.php';
示例11: ldate
}
echo "<tr><th>{$strLocation}:</th><td><a href=\"ftp://{$CONFIG['ftp_hostname']}{$ftp_path}{$obj->filename}\"><code>";
echo "ftp://{$CONFIG['ftp_hostname']}{$ftp_path}{$obj->filename}</code></a></td></tr>\n";
echo "<tr><th>{$strTitle}:</th><td>";
echo "<input type='text' size='40' name='shortdescription' value='{$obj->shortdescription}' />";
echo "</td></tr>\n";
echo "<tr><th>{$strCategory}:</th><td>";
echo "<input type='text' size='40' name='webcategory' value='{$obj->webcategory}' />";
echo "</td></tr>\n";
echo "<tr><th>{$strDescription}:</th><td>";
echo "<textarea rows='6' cols='40' name='longdescription'>{$obj->longdescription}</textarea>";
echo "</td></tr>\n";
echo "<tr><th>{$strFileVersion}:</th><td>";
echo "<input type='text' size='40' name='fileversion' value='{$obj->fileversion}' />";
echo "</td></tr>\n";
echo "<tr><th>{$strFileDate}:</th><td>" . ldate('D jS M Y @ g:i A', $obj->filedate) . " {$strby} " . user_realname($obj->userid, TRUE) . "</td></tr>\n";
if ($obj->expiry > 0) {
echo "<tr><th>{$strExpiryDate}</th><td>" . ldate('D jS M Y @ g:i A', $obj->expiry) . " </td></tr>\n";
}
echo "</table>\n\n";
echo "<input type='hidden' name='id' value='{$id}' />";
echo "<input type='hidden' name='mode' value='save' />";
echo "<p align='center'><input type='submit' value='{$strSavePublish}' /></p>";
echo "</form>";
include APPLICATION_INCPATH . 'htmlfooter.inc.php';
break;
case 'save':
$shortdescription = mysql_real_escape_string($_REQUEST['shortdescription']);
$longdescription = mysql_real_escape_string($_REQUEST['longdescription']);
$fileversion = mysql_real_escape_string($_REQUEST['fileversion']);
$webcategory = mysql_real_escape_string($_REQUEST['webcategory']);
示例12: mysql2date
$startdate = mysql2date($task->startdate);
$duedate = mysql2date($task->duedate);
$enddate = mysql2date($task->enddate);
echo "<table class='vertical' width='100%'>";
echo "<tr><th>{$strTitle}</th>";
echo "<td>{$task->name}</td></tr>";
echo "<tr><th>{$strDescription}</th>";
echo "<td>" . nl2br($task->description) . "</td></tr>";
if ($task->distribution == 'public') {
echo "<tr><th>{$strTags}:</th><td>";
echo list_tags($taskid, 4);
echo "</td></tr>";
}
if ($task->owner != $sit[2]) {
echo "<tr><th>{$strOwner}</th>";
echo "<td>" . user_realname($task->owner, TRUE) . "</td></tr>";
}
echo "<tr><th>{$strPriority}</th>";
echo "<td>" . priority_icon($task->priority) . ' ' . priority_name($task->priority) . "</td></tr>";
echo "<tr><th>{$strStartDate}</th>";
echo "<td>";
if ($startdate > 0) {
echo ldate($CONFIG['dateformat_datetime'], $startdate);
}
echo "</td></tr>";
echo "<tr><th>{$strDueDate}</th>";
echo "<td>";
if ($duedate > 0) {
echo ldate($CONFIG['dateformat_datetime'], $duedate);
}
echo "</td></tr>";
示例13: dashboard_user_incidents
function dashboard_user_incidents($dashletid)
{
$title = sprintf($GLOBALS['strUserIncidents'], user_realname($_SESSION['userid'], TRUE));
//"({$GLOBALS['strActionNeeded']})";
echo dashlet('user_incidents', $dashletid, icon('support', 16), $title, 'incidents.php?user=current&queue=1&type=support', $content);
}
示例14: cleanvar
$user = $sit[2];
} else {
$user = cleanvar($_REQUEST['user']);
}
$title = $strEditUserSkills;
if (empty($submit)) {
include APPLICATION_INCPATH . 'htmlheader.inc.php';
$sql = "SELECT * FROM `{$dbUserSoftware}` AS us, `{$dbSoftware}` AS s WHERE us.softwareid = s.id AND userid = '{$user}' ORDER BY name";
$result = mysql_query($sql);
if (mysql_num_rows($result) >= 1) {
while ($software = mysql_fetch_object($result)) {
$expertise[] = $software->id;
}
}
echo "<h2>" . icon('skill', 32) . " ";
echo sprintf($strSkillsFor, user_realname($user, TRUE)) . "</h2>";
echo "<p align='center'>{$strSelectYourSkills}</p>";
echo "<form name='softwareform' action='{$_SERVER['PHP_SELF']}' method='post' onsubmit=\"populateHidden(document.softwareform.elements['expertise[]'],document.softwareform.choices)\">";
echo "<table align='center'>";
echo "<tr><th>{$strNOSkills}</th><th> </th><th>{$strHAVESkills}</th></tr>";
echo "<tr><td align='center' width='300' class='shade1'>";
$sql = "SELECT * FROM `{$dbSoftware}` ORDER BY name";
$result = mysql_query($sql);
if (mysql_num_rows($result) >= 1) {
echo "\n<select name='noskills[]' multiple='multiple' size='20' style='width: 100%; min-width: 200px;'>";
while ($software = mysql_fetch_object($result)) {
if (is_array($expertise)) {
if (!in_array($software->id, $expertise)) {
echo "<option value='{$software->id}'>{$software->name}</option>\n";
}
} else {
示例15: explode
$dashboardstr = $obj->dashboard;
$dashboardcomponents = explode(",", $obj->dashboard);
}
if (empty($dashboardid)) {
foreach ($dashboardcomponents as $db) {
$c = explode("-", $db);
$ondashboard[$c[1]] = $c[1];
}
include APPLICATION_INCPATH . 'htmlheader.inc.php';
$sql = "SELECT * FROM `{$dbDashboard}` WHERE enabled = 'true'";
$result = mysql_query($sql);
if (mysql_error()) {
trigger_error(mysql_error(), E_USER_WARNING);
}
echo "<h2>" . icon('dashboard', 32) . " {$strDashboard}: ";
echo user_realname($sit[2]) . "</h2>\n";
if (mysql_num_rows($result) > 0) {
echo "<table align='center'>\n";
while ($obj = mysql_fetch_object($result)) {
if (empty($ondashboard[$obj->id])) {
//not already on dashbaord
echo "<tr><th>{$strName}:</th><td>{$obj->name}</td><td><a href='{$_SERVER['PHP_SELF']}?action=add&id={$obj->id}'>{$strAdd}</a></td></tr>\n";
} else {
echo "<tr><th>{$strName}:</th><td>{$obj->name}</td><td><a href='{$_SERVER['PHP_SELF']}?action=remove&id={$obj->id}'>{$strRemove}</a></td></tr>\n";
}
}
echo "</table>\n";
} else {
echo "<p class='info'>{$strNoDashletsInstalled}</p>";
}
include APPLICATION_INCPATH . 'htmlfooter.inc.php';