本文整理汇总了PHP中getComments函数的典型用法代码示例。如果您正苦于以下问题:PHP getComments函数的具体用法?PHP getComments怎么用?PHP getComments使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getComments函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: print_files
/**
* Prints out a list of files and their comments
*
* @param unknown_type $rootDirs
* @param unknown_type $relPath
* @param unknown_type $title
*/
function print_files($rootDirs, $relPath, $title, $comments)
{
if ($comments) {
echo "<div><h2>{$title}</h2>";
} else {
echo "<div class='api-list' style='float: left;'><h2>{$title}</h2>";
}
foreach ($rootDirs as $dir) {
if (!file_exists($dir . $relPath)) {
continue;
}
$files = scandir($dir . $relPath);
echo '<ul>';
foreach ($files as $file) {
if (!is_dir($file)) {
echo '<li><STRONG>' . get_file_name($file) . '</STRONG></li>';
if ($comments) {
echo '<li><STRONG>File Path:</STRONG> ' . $dir . DIRECTORY_SEPARATOR . $relPath . DIRECTORY_SEPARATOR . $file . '</li>';
echo '<li>' . getComments($dir . DIRECTORY_SEPARATOR . $relPath . DIRECTORY_SEPARATOR . $file) . '</li>';
}
}
}
echo '</ul>';
}
echo '</div>';
}
开发者ID:jkinner,项目名称:ringside,代码行数:33,代码来源:index.php
示例2: getVar
function getVar($url, $url_comment, $url_changes, $id, $con)
{
$content = file_get_contents($url);
$json = json_decode($content, true);
$creator_email = $json['bugs'][0]['creator_detail']['email'];
$component = $json['bugs'][0]['component'];
$assigned_email = $json['bugs'][0]['assigned_to_detail']['email'];
$priority = $json['bugs'][0]['priority'];
$severity = $json['bugs'][0]['severity'];
$platform = $json['bugs'][0]['platform'];
$op_sys = $json['bugs'][0]['op_sys'];
$resolution = $json['bugs'][0]['resolution'];
$status = $json['bugs'][0]['status'];
$creation_time = $json['bugs'][0]['creation_time'];
$last_change_time = $json['bugs'][0]['last_change_time'];
$target_milestone = $json['bugs'][0]['target_milestone'];
$nr_cc_detail = count($json['bugs'][0]['cc_detail']);
$json_c = getComments($url_comment);
$nr_comments = count($json_c['bugs'][$id]['comments']);
$json_ch = getChanges($url_changes);
$nr_history = count($json_ch['bugs'][0]['history']);
//insert into mysql table
$sql = "INSERT INTO bug\n VALUES('{$id}', '{$creator_email}', '{$component}', '{$assigned_email}', '{$priority}', '{$severity}', '{$platform}', '{$op_sys}', '{$resolution}', '{$status}', '{$creation_time}', '{$last_change_time}', '{$target_milestone}', '{$nr_cc_detail}','{$nr_comments}','{$nr_history}')";
if (!mysql_query($sql, $con)) {
die('Error : ' . mysql_error());
} else {
echo 'inserito';
echo '<br>';
}
/* (id, creator_email, component, assigned_email, priority, platform, op_sys, resolution, status, creation_time, last_change_time, target_milestone, nr_cc_detail, nr_comments, nr_history)*/
}
开发者ID:Triumvirato,项目名称:Tesi,代码行数:31,代码来源:pag1.php
示例3: CommentsBlock
function CommentsBlock($ThisID, $Thiskey)
{
global $DBConn;
if ($Thiskey == 's') {
$q = "SELECT * FROM comment WHERE Story_AID = " . $ThisID . " and Parent_ID=0 ORDER by ID";
}
if ($Thiskey == 'i') {
$q = "SELECT * FROM comment WHERE Comment_Object_ID = " . $ThisID . " and Comment_Object_ID <> 0 and Parent_ID=0 ORDER by ID";
}
// comments must be wrapped in a div like this
// echo '<div class="commentsdialog" id="commentspop'.$Thiskey.'_'.$ThisID.'"><ul id=commentlist'.$Thiskey.'_'.$ThisID.'> ';
echo '<ul id=commentlist' . $Thiskey . '_' . $ThisID . '> ';
$r = mysqli_query($DBConn, $q);
while ($row = mysqli_fetch_assoc($r)) {
getComments($row, $ThisID, $Thiskey);
}
echo '</ul>';
echo '<br><div class="smaller" id="replyto_' . $Thiskey . '_' . $ThisID . '"></div>';
echo '<a href="" onclick="javascript: return false;" title="Add Comment"><img class="submit_button" id="submit_button' . $Thiskey . '_' . $ThisID . '" src="images/add.png"></a>';
echo ' <textarea class="w80 commenth" name="comment_text_' . $ThisID . '" rows="3" cols="80" id="comment_text_' . $ThisID . '"></textarea> ';
echo ' <input type="hidden" name="User_Name" id="User_Name_' . $ThisID . '' . '" value="' . $_SESSION['Name'] . '"/> ';
echo ' <input type="hidden" name="Parent_ID" id="Parent_ID_' . $Thiskey . '_' . $ThisID . '" value="0"/> ';
echo ' <input type="hidden" name="Iteration_ID" id="CIteration_ID" value="' . $_REQUEST['IID'] . '"/> ';
// remember that this is not the Story_AID for iterations it is the Comment_Object_ID
// being a lazy beggar it this is just easier
echo ' <input type="hidden" name="Story_AID" id="Story_AID_' . $ThisID . '' . '" value="' . $ThisID . '"/> ';
// echo ' <input type="hidden" name="PID" id="Story_PID_'.$ThisID.''.'" value="'.$_REQUEST['PID'].'"/> ';
// echo '</div> ';
}
开发者ID:paul-lab,项目名称:practical-agile,代码行数:29,代码来源:comment_List.php
示例4: getVar
function getVar($url, $url_comment, $url_changes, $id, $con, $collection)
{
$json = acquisisci($url);
//richiama la curl
$creator_email = $json['bugs'][0]['creator_detail']['email'];
$component = $json['bugs'][0]['component'];
$assigned_email = $json['bugs'][0]['assigned_to_detail']['email'];
$priority = $json['bugs'][0]['priority'];
$severity = $json['bugs'][0]['severity'];
$platform = $json['bugs'][0]['platform'];
$op_sys = $json['bugs'][0]['op_sys'];
$resolution = $json['bugs'][0]['resolution'];
$status = $json['bugs'][0]['status'];
$creation_time = $json['bugs'][0]['creation_time'];
$last_change_time = $json['bugs'][0]['last_change_time'];
$target_milestone = $json['bugs'][0]['target_milestone'];
$nr_cc_detail = count($json['bugs'][0]['cc_detail']);
$json_c = getComments($url_comment);
$nr_comments = count($json_c['bugs'][$id]['comments']);
$json_ch = getChanges($url_changes);
$nr_history = count($json_ch['bugs'][0]['history']);
/*insert into mysql table
$sql = "INSERT INTO bug
VALUES('$id', '$creator_email', '$creator_email', '$assigned_email', '$priority', '$severity', '$platform', '$op_sys', '$resolution', '$status', '$creation_time', '$last_change_time', '$target_milestone', '$nr_cc_detail','$nr_comments','$nr_history')";
if(!mysql_query($sql,$con))
{
die('Error : ' . mysql_error());
}
else
{
echo 'inserito';
echo '<br>';
}
*/
$collection->insert($json);
/*
//inserisco un documento nella collection appena selezionata
$document = array(
"id" => $id,
"creator_email" => $creator_email,
"assigned_email" => $assigned_email,
"priority" => $priority,
"severity", $severity,
"platform" => $platform,
"op_sys" => $op_sys,
"resolution" => $resolution,
"status" => $status,
"creation_time" => $creation_time,
"last_change_time" => $last_change_time,
"target_milestone" => $target_milestone,
"nr_cc_detail" => $nr_cc_detail,
"nr_comments" => $nr_comments,
"nr_history" => $nr_history
);
$collection->insert($document);
echo "<br>Document inserted successfully";
*/
}
开发者ID:Triumvirato,项目名称:Tesi,代码行数:59,代码来源:pag3curl.php
示例5: showComments
function showComments($option = '')
{
$pageComments = $_POST['commentPage'];
if (empty($pageComments)) {
$pageComments = 1;
}
$comments = getComments($option, $pageComments);
return $comments;
}
开发者ID:buaacotest,项目名称:cotest,代码行数:9,代码来源:commentList.php
示例6: interpretRequest
function interpretRequest($method, $data)
{
if ($method == 'getsubreddit') {
sendJsonObject(getSubreddit($data));
}
if ($method == 'getcomments') {
sendJsonObject(getComments($data));
}
}
开发者ID:anotherlongname,项目名称:Readdthrough,代码行数:9,代码来源:rtModel.php
示例7: OnOutput
protected function OnOutput()
{
if (isClosed($this->id) && $_SESSION['role'] == '2') {
$vars = array('claim' => $this->claiminfo, 'comment' => getComments($this->id));
$this->content = $this->Template('application/views/claims/close.php', $vars);
} else {
$com = getComments($this->id);
$vars = array('claim' => $this->claiminfo, 'comment' => $com);
$this->content = $this->Template('application/views/claims/editclaim.php', $vars);
}
parent::OnOutput();
}
开发者ID:khaydarov,项目名称:zabota,代码行数:12,代码来源:C_EditClaim.php
示例8: getMain
public function getMain()
{
global $config;
$output = "";
$output .= "<h2>Recent comments</h2>";
$output .= "<p>There are currently " . $this->commentsCount . " comments. ";
$output .= "You are now displaying comments " . ($this->page - 1) * $config["comments per page"] . " to " . min($this->page * $config["comments per page"], $this->commentsCount) . " in reverse chronological order.</p>";
$comments = getComments($this->db, ($this->page - 1) * $config["comments per page"], $config["comments per page"]);
$output .= "<ul>";
foreach ($comments as $comment) {
$output .= printComment($comment);
}
$output .= "</ul>";
return $output;
}
开发者ID:robertcardona,项目名称:stacks-website,代码行数:15,代码来源:recentcomments.php
示例9: displayComments
/**
* displayComments
*
* Valid params:
*
* currentUserId - The current user's id.
* id - The id of the thing we are commenting on.
* header - The header for the entire comments block. Defaults to ''.
* label - The label for the text area. Defaults to 'Add Comment'.
* submit - The value for the submit button. Defaults to 'Comment'.
* submitClass - The class for the style of the submit button. Defaults to 'sub1'.
* hidden - An array of hidden inputs for the add form. Key is name, value is value.
*
* @param string $url
* @param string $type
* @param array $params
*
* @return void
*/
function displayComments($url, $type, $params = null)
{
$addForm = getAddCommentsForm($url, $params);
$comments = getComments($url, $type, $params);
$header = '';
if (isset($params['header'])) {
$header = '<h2>' . $params['header'] . '</h2>';
}
echo '
<div id="comments">
' . $header . '
' . $comments . '
' . $addForm . '
</div>';
}
开发者ID:lmcro,项目名称:fcms,代码行数:34,代码来源:comments.php
示例10: getComments
function getComments($row)
{
echo "<div class='media'>";
echo "<div class='media-body'>\n\t\t\t<h4 class='media-heading'>" . $row['author'] . "</h4>";
echo $row['comment'];
echo "<div class='col-md-12 commeta-option'>\n\t\t\t<span class='pull-left commeta-reply'>\n\t\t\t<a class='reply' href='#comment_form' id='" . $row['id'] . "'> Reply </a>\n\t\t\t</span>\n\t\t\t<span class='pull-right'>\n\t\t\t\t" . $row['created_at'] . "\n\t\t\t</span>\n\t\t\t";
echo "</div>";
$q = "SELECT * FROM comment WHERE parent_id = " . $row['id'] . "";
$r = mysql_query($q);
if (mysql_num_rows($r) > 0) {
while ($row = mysql_fetch_assoc($r)) {
getComments($row);
}
}
echo "</div></div>";
}
开发者ID:yuliantosb,项目名称:commeta,代码行数:16,代码来源:function.php
示例11: postComment
function postComment($comment)
{
session_start();
global $con;
try {
$sql = "INSERT INTO `sports_comments` (`ID`, `USER`, `COMMENT`) VALUES (NULL, :user, :comment)";
$sql = $con->prepare($sql);
$sql->bindParam(':user', $_SESSION['username']);
$sql->bindParam(':comment', $comment);
$sql->execute();
} catch (PDOException $e) {
echo $e;
return;
}
buildCommentSection(getComments());
}
开发者ID:alwill,项目名称:SchoolProjects,代码行数:16,代码来源:inc.sports.php
示例12: getComments
function getComments(&$reply, $conn)
{
$stmnt = $conn->prepare("select id, created, name, username, content, reply_to from threads where reply_to = :id");
$stmnt->bindParam(":id", $reply["id"], PDO::PARAM_INT);
$stmnt->execute();
$results = $stmnt->fetchAll(PDO::FETCH_ASSOC);
if (sizeof($results) > 0) {
// foreach ($results as $new) {
// getComments($new, $conn);
// }
for ($i = 0; $i < sizeof($results); $i++) {
getComments($results[$i], $conn);
}
$reply["replies"] = $results;
}
}
开发者ID:Aytu5,项目名称:Forum2,代码行数:16,代码来源:getThread.php
示例13: postComment
function postComment($comment)
{
session_start();
global $con;
try {
$sql = "INSERT INTO `comments` (`id`, `title_id`, `title`, `username`, `comment`) VALUES (NULL, :title_id, :title, :name, :comment)";
$sql = $con->prepare($sql);
$sql->bindParam(':title_id', $_SESSION['title_id']);
$sql->bindParam(':title', $_SESSION['title']);
$sql->bindParam(':name', $_SESSION['username']);
$sql->bindParam(':comment', $comment);
$sql->execute();
} catch (PDOException $e) {
echo $e;
return;
}
buildCommentSection(getComments());
}
开发者ID:alwill,项目名称:SchoolProjects,代码行数:18,代码来源:inc.info.php
示例14: rmComment
if (isset($username) && isset($_GET["commentid"])) {
$commentid = $_GET["commentid"];
rmComment($commentid);
}
if (isset($username) && $_SERVER["REQUEST_METHOD"] == "POST") {
if (!empty($_POST["playlist"])) {
foreach ($_POST["playlist"] as $playlistid) {
addPlaylistMedia($playlistid, $mediaid);
}
}
if (!empty($_POST["comment"])) {
$content = $_POST["comment"];
addComment($username, $mediaid, $content);
}
if (!empty($_POST["rate"])) {
$score = $_POST["rate"];
rateMedia($mediaid, $username, $score);
}
}
$recommend = recommend($mediaid, 8);
$media = viewMedia($mediaid);
$comments = getComments($mediaid);
if (isset($username) && isset($_GET["subscribe"])) {
$subscriber_id = $username;
$channel_id = $media['username'];
if ($subscriber_id != $channel_id) {
addChannel($subscriber_id, $channel_id);
}
}
render("video_template.php", ["media" => $media, "comments" => $comments, "mediaid" => $mediaid, "recommend" => $recommend, "playlists" => $playlists, "Category" => $Category, "Keywords" => $Keywords]);
$db->sql_close();
开发者ID:lindaqq,项目名称:MeTube,代码行数:31,代码来源:video.php
示例15: editGoal
case "PATCH":
$data["goalID"] = $path[1];
$results = editGoal($data);
break;
case "DELETE":
$data["goalID"] = $path[1];
$results = deleteGoal($data);
break;
default:
$results["meta"] = methodNotAllowed($method, $path);
}
break;
case "comments":
switch ($method) {
case "GET":
$results = getComments($data);
break;
case "POST":
$results = addComment($data);
break;
case "PATCH":
$data["commentID"] = $path[1];
$results = editComment($data);
break;
case "DELETE":
$data["commentID"] = $path[1];
$results = deleteComment($data);
break;
default:
$results["meta"] = methodNotAllowed($method, $path);
}
开发者ID:jahidulpabelislam,项目名称:e-Portfolio,代码行数:31,代码来源:index.php
示例16: getComments
<div class="comment-area">
<form action="" id="comment-form">
<div class="form-item no-height"><textarea class="comment-textarea" data-id="<?php
echo $project['project_id'];
?>
"></textarea></div>
<!--<div class="form-item"><input type="submit" value="Add" class="project-action-btn" id="add-comment-btn" data-id="<?php
echo $project['project_id'];
?>
"></div>-->
</form>
<div class="inbox-messages">
<?php
$messages = getComments($project['project_id']);
if ($messages) {
foreach ($messages as $ix => $m) {
?>
<div class="message-item <?php
if ($ix % 2 == 0) {
echo 'odd';
}
?>
" data-id="<?php
echo $ix;
?>
">
<div class="message-author">
<?php
$u = getUserData($m['created_by']);
开发者ID:smilingsenti,项目名称:rangeenroute,代码行数:30,代码来源:home.php
示例17: printIphoneCommentView
function printIphoneCommentView($entryId, $page = null, $mode = null)
{
global $blogURL, $blogid, $skinSetting, $paging;
if ($mode == 'recent') {
// Recent comments
list($comments, $paging) = getCommentsWithPaging($blogid, $page, 10, null, '?page=');
} else {
if (!is_null($page)) {
// Guestbook
list($comments, $paging) = getCommentsWithPagingForGuestbook($blogid, $page, $skinSetting['commentsOnGuestbook']);
} else {
// Comments related to specific article
$comments = getComments($entryId);
}
}
if (count($comments) == 0) {
?>
<p> <?php
echo $entryId == 0 ? _text('방명록이 없습니다') : _text('댓글이 없습니다');
?>
</p>
<?php
} else {
foreach ($comments as $commentItem) {
?>
<ul id="comment_<?php
echo $commentItem['id'];
?>
" class="comment">
<li class="group">
<span class="left">
<?php
if (!empty($commentItem['name'])) {
?>
<strong><?php
echo htmlspecialchars($commentItem['name']);
?>
</strong><?php
}
?>
(<?php
echo Timestamp::format5($commentItem['written']);
?>
)
</span>
<span class="right">
<a href="<?php
echo $blogURL;
?>
/comment/comment/<?php
echo $commentItem['id'];
?>
"><?php
echo $entryId == 0 ? _text('방명록에 댓글 달기') : _text('댓글에 댓글 달기');
?>
</a> :
<a href="<?php
echo $blogURL;
?>
/comment/delete/<?php
echo $commentItem['id'];
?>
"><?php
echo _text('지우기');
?>
</a>
</span>
</li>
<li class="body">
<?php
echo ($commentItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . ($entryId == 0 ? _text('비밀 방명록') : _text('비밀 댓글')) . ' >></div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentItem['comment'])));
?>
</li>
<?php
foreach (getCommentComments($commentItem['id']) as $commentSubItem) {
?>
<li class="groupSub">
<span class="left"> Re :
<?php
if (!empty($commentSubItem['name'])) {
?>
<strong><?php
echo htmlspecialchars($commentSubItem['name']);
?>
</strong><?php
}
?>
(<?php
echo Timestamp::format5($commentSubItem['written']);
?>
)
</span>
<span class="right">
<a href="<?php
echo $blogURL;
?>
/comment/delete/<?php
echo $commentSubItem['id'];
?>
">DEL</a><br />
//.........这里部分代码省略.........
开发者ID:hinablue,项目名称:TextCube,代码行数:101,代码来源:iphoneView.php
示例18: array
if ($result == null) {
$reply['status'] = "empty";
} else {
$reply['status'] = "fail";
}
}
} else {
$reply['status'] = "invalid";
}
}
//Get comments of an activity
if (isset($_REQUEST['action']) && $_REQUEST['action'] == "comment") {
$result = array();
$noOfComments = getNoOfComments($pdo);
if ($noOfComments != 0) {
$result = getComments($pdo);
if ($result != null) {
$reply['status'] = "success";
$reply['total_c'] = $noOfComments;
$reply['comment'] = $result;
} else {
$reply['status'] = "fail";
}
} else {
$reply['status'] = "success";
$reply['total_c'] = "No";
$reply['comment'] = $result;
}
}
//Add a new comment to an activity
if (isset($_REQUEST['action']) && $_REQUEST['action'] == "addcomment") {
开发者ID:synovum,项目名称:usteventapp,代码行数:31,代码来源:post.php
示例19: getCommentView
function getCommentView($entry, $skin, $inputBlock = true, $page = 1, $count = null, $listBlock = true)
{
global $contentContainer;
static $dressCommentBlock = false;
$context = Model_Context::getInstance();
if (is_null($count)) {
if ($context->getProperty('skin.commentsOnEntry')) {
$count = $context->getProperty('skin.commentsOnEntry');
} else {
$count = 15;
}
}
if (!isset($entry)) {
$entry['id'] = 0;
}
$blogid = getBlogId();
importlib("model.common.setting");
importlib("model.blog.entry");
importlib("model.blog.comment");
importlib('blogskin');
$authorized = doesHaveOwnership();
$useAjaxBlock = $context->getProperty('blog.useAjaxComment', true);
$useMicroformat = $context->getProperty('blog.useMicroformat', 3);
$fn = '';
$fn_nickname = '';
if ($useMicroformat > 1) {
$fn = 'class="fn url nickname" ';
$fn_nickname = 'class="fn nickname" ';
}
if ($entry['id'] > 0) {
$prefix1 = 'rp';
$isComment = true;
} else {
$prefix1 = 'guest';
$isComment = false;
}
$commentView = $isComment ? $skin->comment : $skin->guest;
$commentItemsView = '';
if ($listBlock === true) {
if ($isComment == false) {
global $comments;
if (!isset($comments)) {
list($comments, $paging) = getCommentsWithPagingForGuestbook($blogid, $context->getProperty('suri.page'), $context->getProperty('skin.commentsOnGuestbook'));
}
foreach ($comments as $key => $value) {
if ($value['secret'] == 1) {
if (!$authorized) {
if (!doesHaveOpenIDPriv($value)) {
$comments[$key]['name'] = _text('비밀방문자');
$comments[$key]['homepage'] = '';
$comments[$key]['comment'] = _text('관리자만 볼 수 있는 방명록입니다.');
} else {
$comments[$key]['name'] = _text('비밀방문자') . ' ' . $comments[$key]['name'];
}
}
}
}
} else {
if ($useAjaxBlock) {
list($comments, $paging) = getCommentsWithPagingByEntryId($blogid, $entry['id'], $page, $count, 'loadComment', '(' . $entry['id'] . ',', ',true,true);return false;', null, $context->getProperty('skin.sortCommentsBy', 'ASC'));
} else {
$comments = getComments($entry['id'], $context->getProperty('skin.sortCommentsBy', 'ASC'));
}
}
if (empty($skin->dressCommentBlock)) {
if ($dressCommentBlock) {
if ($isComment) {
$skin->commentGuest = $dressCommentBlock;
} else {
$skin->guestGuest = $dressCommentBlock;
}
} else {
if ($isComment) {
$dressCommentBlock = $skin->commentGuest = addOpenIDPannel($skin->commentGuest, 'rp');
} else {
$dressCommentBlock = $skin->guestGuest = addOpenIDPannel($skin->guestGuest, 'guest');
}
}
$skin->dressCommentBlock = true;
}
/// Dressing comments
foreach ($comments as $commentItem) {
$commentItemView = $isComment ? $skin->commentItem : $skin->guestItem;
$commentSubItemsView = '';
$subComments = getCommentComments($commentItem['id'], $commentItem);
foreach ($subComments as $commentSubItem) {
$commentSubItemView = $isComment ? $skin->commentSubItem : $skin->guestSubItem;
$commentSubItem['name'] = htmlspecialchars($commentSubItem['name']);
$commentSubItem['comment'] = htmlspecialchars($commentSubItem['comment']);
$rp_class = $prefix1 . '_general';
if ($blogid == $commentSubItem['replier']) {
$rp_class = $prefix1 . '_admin';
} else {
if ($commentSubItem['secret'] == 1) {
$rp_class = $prefix1 . '_secret';
if ($authorized) {
$commentSubItem['comment'] = '<span class="hiddenCommentTag_content">' . _text('[비밀댓글]') . '</span> ' . $commentSubItem['comment'];
} else {
$rp_class .= ' hiddenComment';
$commentSubItem['name'] = '<span class="hiddenCommentTag_name">' . _text('비밀방문자') . '</span>' . (doesHaveOpenIDPriv($commentSubItem) ? ' ' . $commentSubItem['name'] : '');
//.........这里部分代码省略.........
开发者ID:Avantians,项目名称:Textcube,代码行数:101,代码来源:view.php
示例20: navigationBar
function navigationBar($id, $title, $loc)
{
global $NEXT, $PREV, $tstamp, $CHARSET;
$navClass = $NEXT[1] || $PREV[1] ? 'manual-navigation' : 'manual-navigation manual-navigation-no-nav';
echo "<!-- START MANUAL NAVIGATION -->\n";
echo "<div class=\"{$navClass}\" id=\"manual-navigation-{$loc}\">\n";
if ($PREV[1]) {
$link = $PREV[1];
if (strlen($link) > 45) {
$link = str_replace('::', '::<br />', $link);
}
// not using make_link because of embedded <span>
$accesskey = $loc == 'top' ? ' accesskey="r"' : '';
echo " <a class=\"manual-previous\" href=\"{$PREV[0]}\"{$accesskey}>";
echo $link . "\n";
echo '<span class="title">(P<span class="accesskey">r</span>evious)</span>';
echo "</a>\n";
}
echo "\n";
if ($NEXT[1]) {
$link = $NEXT[1];
if (strlen($link) > 45) {
$link = str_replace('::', '::<br />', $link);
}
// not using make_link because of embedded <span>
$accesskey = $loc == 'top' ? ' accesskey="x"' : '';
echo " <a class=\"manual-next\" href=\"{$NEXT[0]}\"{$accesskey}>";
echo $link . "\n";
echo '<span class="title">(Ne<span class="accesskey">x</span>t)</span>';
echo "</a>\n";
}
echo "\n";
echo " <div class=\"manual-clear\"></div>\n";
if ($loc == 'bottom') {
// info and download links
echo " <div class=\"manual-info\">";
echo "Last updated: {$tstamp}";
// UTF-8 em-dash
echo " — " . make_link('/manual/', 'Download Documentation');
echo "</div>\n";
echo "\n";
// bug report links
$package_name = getPackageNameForId($id);
echo " <div class=\"manual-bug\">\n";
echo ' Do you think that something on this page is wrong?';
echo ' Please <a href="' . getBugReportLink($package_name) . '">file a bug report</a> ';
echo ' or <a href="/notes/add-note-form.php?redirect=' . htmlentities($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8') . '&uri=' . htmlspecialchars(urlencode($id)) . '">add a note</a>. ';
echo "\n";
echo " </div>\n";
echo "\n";
// language chooser
global $LANGUAGES, $LANG;
$langs = array();
foreach ($LANGUAGES as $code => $name) {
if (file_exists("../{$code}/{$id}")) {
$langs[] = array('code' => $code, 'title' => $name, 'link' => make_link("../{$code}/{$id}", $name));
}
}
$file = substr($id, 0, -4);
if (file_exists("html/{$file}.html")) {
$langs[] = array('code' => null, 'title' => 'Plain HTML', 'link' => make_link("html/{$file}.html", 'Plain HTML'));
}
if (count($langs)) {
echo " <div class=\"manual-languages\">\n";
echo 'View this page in:';
echo " <ul class=\"manual-language-list\">\n";
$count = 0;
foreach ($langs as $lang) {
echo " <li class=\"manual-language\">";
if ($count > 0) {
// UTF-8 bullet
echo " • ";
}
if ($lang['code'] == $LANG) {
echo '<strong>' . $lang['title'] . '</strong>';
} else {
echo $lang['link'];
}
echo "</li>\n";
$count++;
}
echo " </ul>\n";
echo " </div>\n";
}
echo "\n";
// user notes
echo " <div class=\"manual-notes\" id=\"user-notes\">\n";
echo " <h3>User Notes:</h3>\n";
echo " " . getComments($id) . "\n";
echo " </div>\n";
}
echo "</div>\n<!-- END MANUAL NAVIGATION -->\n\n";
}
开发者ID:stof,项目名称:pearweb,代码行数:93,代码来源:pear-manual.php
注:本文中的getComments函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论