本文整理汇总了PHP中_AT函数的典型用法代码示例。如果您正苦于以下问题:PHP _AT函数的具体用法?PHP _AT怎么用?PHP _AT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_AT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_patch_row
/**
* Generate html of each patch row at main patch page
*/
function print_patch_row($patch_row, $row_id, $enable_radiotton)
{
global $id, $patch_id; // current selected patch
global $dependent_patches;
if ($dependent_patches =="")
$description = $patch_row["description"];
else
$description = $patch_row["description"] . _AT('patch_dependent_patch_not_installed') . "<span style='color: red'>" . $dependent_patches . "</span>";
?>
<tr <?php if ($enable_radiotton) echo 'onmousedown="document.form[\'m'. $row_id.'\'].checked = true; rowselect(this);" id="r_'. $row_id .'"'; ?>>
<td><input type="radio" name="id" value="<?php echo $row_id; ?>"<?php if ($enable_radiotton) echo 'id="m'. $row_id.'"'; ?> <?php if (!$enable_radiotton) echo 'disabled="disabled" '; if (strcmp($row_id, $id) == 0 || strcmp($row_id, $patch_id) == 0) echo "checked "?> /></td>
<td><label <?php if ($enable_radiotton) echo 'for="m'.$row_id.'"'; ?>><?php echo $patch_row["atutor_patch_id"]; ?></label></td>
<td><?php echo $description; ?></td>
<td><?php if (!isset($patch_row['status'])) echo _AT("not_installed"); else echo $patch_row["status"]; ?></td>
<td><?php echo $patch_row["available_to"]; ?></td>
<td><?php echo $patch_row["author"]; ?></td>
<td><?php if (isset($patch_row['status'])) echo ($patch_row["installed_date"]=='0000-00-00 00:00:00')?_AT('na'):$patch_row["installed_date"]; ?></td>
<td>
<?php
if (preg_match('/Installed/', $patch_row["status"]) > 0 && ($patch_row["remove_permission_files"]<> "" || $patch_row["backup_files"]<>"" || $patch_row["patch_files"]<> ""))
echo '
<div class="row buttons">
<input type="button" align="middle" name="info" value="'._AT('view_message').'" onclick="location.href=\''. $_SERVER['PHP_SELF'] .'?patch_id='.$row_id.'\'" />
</div>';
?>
</td>
</tr>
<?php
}
示例2: updateExpireThreshold
/**
* Update expire threshold
* @access public
* @param consumer, expire threshold
* @return true, if successful
* false and add error into global var $msg, if unsuccessful
* @author Cindy Qi Li
*/
public function updateExpireThreshold($consumer, $expire_threshold)
{
global $addslashes, $msg;
$missing_fields = array();
/* email check */
$consumer = $addslashes(trim($consumer));
/* login name check */
if ($consumer == '') {
$missing_fields[] = _AT('consumer');
}
if ($missing_fields) {
$missing_fields = implode(', ', $missing_fields);
$msg->addError(array('EMPTY_FIELDS', $missing_fields));
}
if (!$msg->containsErrors()) {
/* update db */
$sql = "UPDATE " . TABLE_PREFIX . "oauth_server_consumers\n\t\t\t SET expire_threshold = " . $expire_threshold . "\n\t\t\t WHERE consumer = '" . $consumer . "'";
if (!$this->execute($sql)) {
$msg->addError('DB_NOT_UPDATED');
return false;
} else {
return true;
}
} else {
return false;
}
}
示例3: fm_path
function fm_path()
{
global $pathext, $framed, $popup, $cp, $cid, $pid, $a_type, $_course_id;
echo '<p>' . _AT('current_path') . ' ';
if (isset($pathext) && $pathext != '') {
echo '<a href="' . $_SERVER['PHP_SELF'] . '?popup=' . $popup . SEP . 'framed=' . $framed . SEP . 'cp=' . $cp . SEP . '_cid=' . $cid . SEP . 'pid=' . $pid . SEP . 'a_type=' . $a_type . SEP . '_course_id=' . $_course_id . '">' . _AT('home') . '</a> ';
} else {
$pathext = '';
echo _AT('home');
}
if ($pathext == '' && isset($_POST['pathext'])) {
$pathext = urlencode($_POST['pathext']);
}
if ($pathext != '') {
$bits = explode('/', $pathext);
foreach ($bits as $bit) {
if ($bit != '') {
$bit_path .= $bit . '/';
echo ' / ';
if ($bit_path == $pathext) {
echo $bit;
} else {
echo '<a href="' . $_SERVER['PHP_SELF'] . '?pathext=' . urlencode($bit_path) . SEP . 'popup=' . $popup . SEP . 'framed=' . $framed . SEP . 'cp=' . $_GET['cp'] . SEP . 'pid=' . $_GET['pid'] . SEP . '_cid=' . $cid . SEP . 'a_type=' . $a_type . SEP . '_course_id=' . $_course_id . '">' . $bit . '</a>';
}
}
}
$bit_path = "";
$bit = "";
}
echo '</p>';
}
示例4: blogs_news
function blogs_news()
{
global $db, $enrolled_courses, $system_courses;
$news = array();
if ($enrolled_courses == '') {
return $news;
}
$sql = "SELECT G.group_id, G.title, G.modules, T.course_id FROM %sgroups G INNER JOIN %sgroups_types T USING (type_id) WHERE T.course_id IN %s ORDER BY G.title";
$rows_enrolled = queryDB($sql, array(TABLE_PREFIX, TABLE_PREFIX, $enrolled_courses));
if (count($rows_enrolled) > 0) {
foreach ($rows_enrolled as $row) {
if (strpos($row['modules'], '_standard/blogs') !== FALSE) {
// check for group membership before showing news.
$sql = "SELECT member_id FROM %sgroups_members WHERE member_id=%d AND group_id= %d";
$row_group_member = queryDB($sql, array(TABLE_PREFIX, $_SESSION['member_id'], $row['group_id']), TRUE);
// check for course instructor, show blog news if so
$sql = "SELECT member_id from %scourses WHERE member_id =%d";
$row_instructor = queryDB($sql, array(TABLE_PREFIX, $_SESSION['member_id']));
if (count($row_group_member) > 0 || count($row_instructor) > 0) {
// retrieve the last posted date/time from this blog
$sql = "SELECT MAX(date) AS date FROM %sblog_posts WHERE owner_type=%d AND owner_id=%d";
$row2 = queryDB($sql, array(TABLE_PREFIX, BLOGS_GROUP, $row['group_id']), TRUE);
$last_updated = ' - ' . _AT('last_updated', AT_date(_AT('forum_date_format'), $row2['date'], AT_DATE_MYSQL_DATETIME));
$link_title = $row['title'];
$news[] = array('time' => $row2['date'], 'object' => $row, 'alt' => _AT('blogs'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-blogs_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/blogs/view.php?ot=' . BLOGS_GROUP . SEP . 'oid=' . $row['group_id']) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($link_title, 'blog_posts.title') . '"' : '') . '>' . AT_print(validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'blog_posts.title') . '</a>');
}
}
}
}
return $news;
}
示例5: display_alternative_cell
/**
* Display alternative table cell
* @param $rows_secondary_resources db 2d array of all secondary alternatives
* $alternative type the resource type of the alternative to display. Must be one of the values in resource_types.type_id
* $content_id used to pass into file_manager/index.php
* $ps used to pass into file_manager/index.php
* @return html of the table cell "<td>...</td>"
*/
function display_alternative_cell($rows_secondary_resources, $alternative_type, $content_id, $pid, $td_header_id)
{
global $content_row;
$found_alternative = false;
echo ' <td headers="' . $td_header_id . '">' . "\n";
if (count($rows_secondary_resources) > 0) {
foreach ($rows_secondary_resources as $secondary_resource) {
if ($secondary_resource['type_id'] == $alternative_type) {
echo ' <div id="' . $pid . '_' . $alternative_type . '">' . "\n";
echo ' <a href="' . $secondary_resource['secondary_resource'] . '" title="' . _AT('new_window') . '" target="_new">' . get_display_filename($secondary_resource['secondary_resource']) . '</a><br />' . "\n";
echo ' <a href="#" onclick="ATutor.poptastic(\'' . AT_BASE_HREF . 'mods/_core/file_manager/index.php?framed=1' . SEP . 'popup=1' . SEP . 'cp=' . $content_row['content_path'] . SEP . 'cid=' . $content_id . SEP . 'pid=' . $pid . SEP . 'a_type=' . $alternative_type . '\');return false;" title="' . _AT('new_window') . '">' . "\n";
echo ' <img src="' . AT_BASE_HREF . 'images/home-tests_sm.png" border="0" title="' . _AT('alter') . '" alt="' . _AT('alter') . '" />' . "\n";
echo ' </a>' . "\n";
echo ' <a href="#" onclick="removeAlternative(\'' . $content_row['content_path'] . '\', ' . $content_id . ',' . $pid . ',' . $alternative_type . ');return false;">' . "\n";
echo ' <img src="' . AT_BASE_HREF . 'images/icon_delete.gif" border="0" title="' . _AT('remove') . '" alt="' . _AT('remove') . '" />' . "\n";
echo ' </a>' . "\n";
echo ' </div>' . "\n";
$found_alternative = true;
break;
}
}
}
if (!$found_alternative) {
echo ' <div id="' . $pid . '_' . $alternative_type . '">' . "\n";
echo ' <input type="button" value="' . _AT('add') . '" title="' . _AT('new_window') . '" onclick="ATutor.poptastic(\'' . AT_BASE_HREF . 'mods/_core/file_manager/index.php?framed=1' . SEP . 'popup=1' . SEP . 'cp=' . $content_row['content_path'] . SEP . 'cid=' . $content_id . SEP . 'pid=' . $pid . SEP . 'a_type=' . $alternative_type . '\');return false;" />' . "\n";
echo ' </div>' . "\n";
}
echo ' </td>' . "\n";
}
示例6: tests_extend_date
/**
* Extending the test dates to make them accessible to Calendar Module
* @param : Course id, Member id
* @return : array (test start and end dates) in format that can be used by fullcalendar
* @author : Anurup Raveendran, Herat Gandhi
*/
function tests_extend_date($member_id, $course_id)
{
$tests = array();
// get course title
$sql = "SELECT title FROM %scourses WHERE course_id = %d";
$row = queryDB($sql, array(TABLE_PREFIX, $course_id), TRUE);
$course_title = $row['title'];
$sql = "SELECT title,test_id,start_date,end_date FROM %stests WHERE course_id = %d";
$rows_tests = queryDB($sql, array(TABLE_PREFIX, $course_id));
if (count($rows_tests) > 0) {
$index = 0;
foreach ($rows_tests as $row) {
if (strpos($row['start_date'] . '', '0000-00-00') === false) {
$unix_ts = strtotime($row['start_date']);
$time = date('h:i A', $unix_ts);
$tests[$index] = array("id" => rand(20000, 25000) . '', "title" => _AT('calendar_test_start') . $row['title'], "start" => $row['start_date'], "end" => $row['start_date'], "allDay" => false, "color" => 'lime', "textColor" => 'black', "editable" => false);
$unix_ts = strtotime($row['end_date']);
$time = date('h:i A', $unix_ts);
$index++;
}
if (strpos($row['end_date'] . '', '0000-00-00') === false) {
$tests[$index] = array("id" => rand(20000, 25000) . '', "title" => _AT('calendar_test_end') . $row['title'], "start" => $row['end_date'], "end" => $row['end_date'], "allDay" => false, "color" => 'purple', "textColor" => 'white', "editable" => false);
$index++;
}
}
}
return $tests;
}
示例7: print_feedback
function print_feedback($feedback, $notes = '')
{
?>
<div class="input-form">
<table>
<tr>
<td><h3><img src="images/feedback.gif" align="top" alt="" class="img" /> <?php
echo _AT('TR_FEEDBACK_UPDATE_INSTALLED_SUCCESSFULLY');
?>
</h3>
<?php
echo '<ul>';
foreach ($feedback as $p) {
echo '<li>' . $p . '</li>';
}
echo '</ul>';
?>
</td>
</tr>
<tr>
<td>
<?php
echo $notes;
?>
</td>
</tr>
</table>
</div>
<?php
}
示例8: blogs_news
function blogs_news()
{
global $db, $enrolled_courses, $system_courses;
$news = array();
if ($enrolled_courses == '') {
return $news;
}
$sql = "SELECT G.group_id, G.title, G.modules, T.course_id FROM " . TABLE_PREFIX . "groups G INNER JOIN " . TABLE_PREFIX . "groups_types T USING (type_id) WHERE T.course_id IN {$enrolled_courses} ORDER BY G.title";
$result = mysql_query($sql, $db);
if ($result) {
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
if (strpos($row['modules'], '_standard/blogs') !== FALSE) {
// retrieve the last posted date/time from this blog
$sql = "SELECT MAX(date) AS date FROM " . TABLE_PREFIX . "blog_posts WHERE owner_type=" . BLOGS_GROUP . " AND owner_id={$row['group_id']}";
$date_result = mysql_query($sql, $db);
$row2 = mysql_fetch_assoc($date_result);
$last_updated = ' - ' . _AT('last_updated', AT_date(_AT('forum_date_format'), $row2['date'], AT_DATE_MYSQL_DATETIME));
$link_title = $row['title'];
$news[] = array('time' => $row2['date'], 'object' => $row, 'alt' => _AT('blogs'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-blogs_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/blogs/view.php?ot=' . BLOGS_GROUP . SEP . 'oid=' . $row['group_id']) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($link_title, 'blog_posts.title') . '"' : '') . '>' . AT_print(validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'blog_posts.title') . '</a>');
}
}
}
}
return $news;
}
示例9: file_storage_news
function file_storage_news()
{
global $enrolled_courses, $system_courses;
$news = array();
if ($enrolled_courses == '') {
return $news;
}
// As personal files are listed in any enrolled courses of the student,
// randomly pick one course for bouce.php
$end_of_first_course = strpos($enrolled_courses, ",") - 1;
$any_one_enrolled_course = substr($enrolled_courses, 1, $end_of_first_course ? $end_of_first_course : -1);
$sql = "(SELECT date, file_id, file_name, owner_id course_id, description \n\t FROM " . TABLE_PREFIX . "files \n\t WHERE owner_type = " . WORKSPACE_COURSE . " AND owner_id IN " . $enrolled_courses . ")\n\t UNION\n\t (SELECT date, file_id, file_name, " . $any_one_enrolled_course . " course_id, description \n\t FROM " . TABLE_PREFIX . "files\n\t WHERE owner_type = " . WORKSPACE_PERSONAL . " AND owner_id = " . $_SESSION['member_id'] . ")\n\t UNION\n\t (SELECT f.date, f.file_id, f.file_name, gt.course_id, f.description \n\t FROM " . TABLE_PREFIX . "files f, " . TABLE_PREFIX . "groups g, " . TABLE_PREFIX . "groups_types gt\n\t WHERE owner_type = " . WORKSPACE_GROUP . " \n\t AND f.owner_id = g.group_id \n\t AND g.type_id = gt.type_id \n\t AND gt.course_id IN " . $enrolled_courses . "\n\t AND " . $_SESSION['member_id'] . " in \n\t (select member_id \n\t from " . TABLE_PREFIX . "groups_members gm \n\t where gm.group_id = g.group_id))\n\t ORDER BY date DESC";
$rows_files = queryDB($sql, array());
if (count($rows_files) > 0) {
foreach ($rows_files as $row) {
if ($row['description'] != "") {
$filetext = $row['description'];
} else {
$filetext = $row['file_name'];
}
$sql = "SELECT course_id, home_links, main_links from %scourses WHERE course_id = %d";
$row2 = queryDB($sql, array(TABLE_PREFIX, $row['course_id']), TRUE);
// check if course has file storage enabled
if (strstr($row2['home_links'], 'file_storage') || strstr($row2['main_links'], 'file_storage')) {
$news[] = array('time' => $row['date'], 'object' => $row, 'course' => $system_courses[$row['course_id']]['title'], 'alt' => _AT('download'), 'thumb' => 'images/application_get.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/file_storage/index.php?download=1' . SEP . 'files[]=' . $row['file_id']) . '"' . (strlen($filetext) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($filetext, 'input.text') . '"' : '') . '>' . AT_print(validate_length($filetext, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'input.text') . '</a>');
}
}
}
return $news;
}
示例10: photos_create_group
function photos_create_group($group_id) {
global $db;
$group_id = intval($group_id);
//get group name
$sql = 'SELECT title FROM ' . TABLE_PREFIX . "groups WHERE group_id=$group_id";
$result = mysql_query($sql, $db);
$group_info = mysql_fetch_assoc($result);
$pa = new PhotoAlbum();
$album_name = $group_info['title'] . '(' . _AT('group') . ')';
$album_location = _AT('na');
$album_description = _AT('na');
$album_type = AT_PA_TYPE_COURSE_ALBUM;
$album_permission = AT_PA_PRIVATE_ALBUM;
$album_id = $pa->createAlbum($album_name, $album_location, $album_description, $album_type, $album_permission, $_SESSION['member_id'], 0);
if ($album_id === false){
//TODO: sql failure.
$msg->addError('PA_CREATE_ALBUM_FAILED');
$result = false;
} else {
$sql = 'INSERT INTO '.TABLE_PREFIX."pa_groups (group_id, album_id) VALUES ($group_id, $album_id)";
$result = mysql_query($sql, $db);
}
}
示例11: Send
/**
* Appends a custom AContent footer to all outgoing email then sends the email.
* If mail_queue is enabled then instead of sending the mail out right away, it
* places it in the database and waits for the cron to send it using SendQueue().
* The mail queue does not support reply-to, or attachments, and converts all BCCs
* to regular To emails.
* @access public
* @return boolean whether or not the mail was sent (or queued) successfully.
* @see parent::send()
* @since AContent 0.1
* @author Joel Kronenberg
*/
function Send()
{
global $_config;
// attach the AContent footer to the body first:
$this->Body .= "\n\n" . '----------------------------------------------' . "\n";
$this->Body .= _AT(array('sent_via_transformable', TR_BASE_HREF));
$this->Body .= "\n" . _AT('home') . ': http://atutor.ca';
// if this email has been queued then don't send it. instead insert it in the db
// for each bcc or to or cc
if ($_config['enable_mail_queue'] && !$this->attachment) {
require_once TR_INCLUDE_PATH . 'classes/DAO/MailQueueDAO.class.php';
$mailQueueDAO = new MailQueueDAO();
for ($i = 0; $i < count($this->to); $i++) {
$mailQueueDAO->Create(addslashes($this->to[$i][0]), addslashes($this->to[$i][1]), addslashes($this->From), addslashes($this->FromName), addslashes($this->Subject), addslashes($this->Body), addslashes($this->CharSet));
}
for ($i = 0; $i < count($this->cc); $i++) {
$mailQueueDAO->Create(addslashes($this->cc[$i][0]), addslashes($this->cc[$i][1]), addslashes($this->From), addslashes($this->FromName), addslashes($this->Subject), addslashes($this->Body), addslashes($this->CharSet));
}
for ($i = 0; $i < count($this->bcc); $i++) {
$mailQueueDAO->Create(addslashes($this->bcc[$i][0]), addslashes($this->bcc[$i][1]), addslashes($this->From), addslashes($this->FromName), addslashes($this->Subject), addslashes($this->Body), addslashes($this->CharSet));
}
return true;
} else {
return parent::Send();
}
}
示例12: output_tabs
function output_tabs($current_tab, $changes) {
global $_base_path;
$tabs = get_tabs();
$num_tabs = count($tabs);
?>
<div class="etabbed-list-container">
<ul class="etabbed-list" >
<?php for ($i=0; $i < $num_tabs; $i++):
if ($current_tab == $i):?>
<li class="prefs_tab_selected">
<?php if ($changes[$i]): ?>
<img src="<?php echo $_base_path; ?>images/changes_bullet.gif" alt="<?php echo _AT('usaved_changes_made'); ?>" height="12" width="15" />
<?php echo '<input type="submit" name="button_'.$i.'" value="'._AT($tabs[$i][0]).'" title="'._AT($tabs[$i][0]).' - alt '.$tabs[$i][2].'" class="prefs_buttontab" accesskey="'.$tabs[$i][2].'" onmouseover="this.style.cursor=\'pointer\';" '.$clickEvent.' />'; ?>
<?php endif; ?>
<?php echo _AT($tabs[$i][0]); ?>
</li>
<?php else: ?>
<li class="prefs_tab" >
<?php if ($changes[$i]): ?>
<img src="<?php echo $_base_path; ?>images/changes_bullet.gif" alt="<?php echo _AT('usaved_changes_made'); ?>" height="12" width="15" />
<?php endif; ?>
<?php echo '<input type="submit" name="button_'.$i.'" value="'._AT($tabs[$i][0]).'" title="'._AT($tabs[$i][0]).' - alt '.$tabs[$i][2].'" class="prefs_buttontab" accesskey="'.$tabs[$i][2].'" onmouseover="this.style.cursor=\'pointer\';" '.$clickEvent.' />'; ?>
</li>
<?php endif; ?>
<?php endfor; ?>
</ul>
</div>
<?php }
示例13: print_categories
function print_categories($categories, $cat_id) {
if ($cat_id == 0) {
echo '<ul>';
foreach($categories[0] as $child_cat_id) {
print_categories($categories, $child_cat_id);
}
echo '</ul>';
} else {
echo '<li>';
if ($cat_id == $_REQUEST['cat_id']) {
echo '<strong>'.$categories[$cat_id]['cat_name'].'</strong>';
} else if ($cat_id == $_REQUEST['pcat_id']) {
echo '<a href="'.$_SERVER['PHP_SELF'].'?cat_id='.$cat_id.'"><b>'.$categories[$cat_id]['cat_name'].'</b></a>';
} else {
echo '<a href="'.$_SERVER['PHP_SELF'].'?cat_id='.$cat_id.'">'.$categories[$cat_id]['cat_name'].'</a>';
}
echo ' <small class="spacer">('.$categories[$cat_id]['num_courses'].' ';
if ($categories[$cat_id]['num_courses'] == 1) {
echo _AT('course');
} else {
echo _AT('courses');
}
echo ')</small>';
if (is_array($categories[$cat_id]['children'])) {
echo '<ul>';
foreach($categories[$cat_id]['children'] as $child_cat_id) {
print_categories($categories, $child_cat_id);
}
echo '</ul>';
}
echo '</li>';
}
}
示例14: links_news
function links_news() {
global $db, $enrolled_courses, $system_courses;
$news = array();
if ($enrolled_courses == ''){
return $news;
}
$sql = "SELECT * FROM ".TABLE_PREFIX."links L INNER JOIN ".TABLE_PREFIX."links_categories C ON C.cat_id = L.cat_id WHERE owner_id IN $enrolled_courses AND L.Approved=1 ORDER BY SubmitDate DESC";
$result = mysql_query($sql, $db);
if($result){
while($row = mysql_fetch_assoc($result)){
$news[] = array(
'time'=>$row['SubmitDate'],
'object'=>$row,
'alt'=>_AT('links'),
'course'=>$system_courses[$row['owner_id']]['title'],
'thumb'=>'images/home-links_sm.png',
'link'=>'<a href="bounce.php?course='.$row['owner_id'].'&p='.urlencode('mods/_standard/links/index.php?view='.$row['link_id']).'"'.
(strlen($row['LinkName']) > SUBLINK_TEXT_LEN ? ' title="'.$row['LinkName'].'"' : '') .'>'.
validate_length($row['LinkName'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a>');
}
}
return $news;
}
示例15: forums_news
function forums_news()
{
require_once AT_INCLUDE_PATH . '../mods/_standard/forums/lib/forums.inc.php';
global $db, $enrolled_courses, $system_courses;
$news = array();
if ($enrolled_courses == '') {
return $news;
}
$sql = 'SELECT E.approved, E.last_cid, C.* FROM ' . TABLE_PREFIX . 'course_enrollment E, ' . TABLE_PREFIX . 'courses C WHERE C.course_id in ' . $enrolled_courses . ' AND E.member_id=' . $_SESSION['member_id'] . ' AND E.course_id=C.course_id ORDER BY C.title';
$rows_en_courses = queryDB($sql, array());
if (count($rows_en_courses) > 0) {
foreach ($rows_en_courses as $row) {
$all_forums = get_forums($row['course_id']);
if (is_array($all_forums)) {
foreach ($all_forums as $forums) {
if (is_array($forums)) {
foreach ($forums as $forum_obj) {
$forum_obj['course_id'] = $row['course_id'];
$link_title = $forum_obj['title'];
$news[] = array('time' => $forum_obj['last_post'], 'object' => $forum_obj, 'alt' => _AT('forum'), 'thumb' => 'images/pin.png', 'course' => $system_courses[$row['course_id']]['title'], 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'pu=' . urlencode('mods/_standard/forums/forum/index.php?fid=' . $forum_obj['forum_id']) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($link_title, 'forums.title') . '"' : '') . '>' . AT_print(validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'forums.title') . '</a>');
}
}
}
}
}
}
return $news;
}