Ejemplo n.º 1
0
    echo "<a href='" . URL("conversation/markAsRead/" . $conversation["conversationId"] . "?token=" . ET::$session->token . "&return=" . urlencode(ET::$controller->selfURL)) . "' class='unreadIndicator' title='" . T("Mark as read") . "'>" . $conversation["unread"] . "</a> ";
}
// Output controls which apply to this conversation.
echo "<span class='controls'>";
// A Jump to last/unread link, depending on the user and the unread state.
if (ET::$session->user and $conversation["unread"]) {
    echo "<a href='" . URL($conversationURL . "/unread") . "' class='jumpToUnread'>" . T("Jump to unread") . "</a>";
} else {
    echo "<a href='" . URL($conversationURL . "/last") . "' class='jumpToLast'>" . T("Jump to last") . "</a>";
}
// If we're highlighting search terms (i.e. if we did a fulltext search), then output a "show matching posts" link.
if (ET::$session->get("highlight")) {
    echo " <a href='" . URL($conversationURL . "/?search=" . urlencode($data["fulltextString"])) . "' class='showMatchingPosts'>" . T("Show matching posts") . "</a>";
}
echo "</span>";
?>
</div>
<div class='col-channel'><?php 
$channel = $data["channelInfo"][$conversation["channelId"]];
echo "<a href='" . URL(searchURL("", $channel["slug"])) . "' class='channel channel-{$conversation["channelId"]}' data-channel='{$channel["slug"]}'>{$channel["title"]}</a>";
?>
</div>
<div class='col-lastPost'><?php 
echo "<span class='action'>" . avatar($conversation["lastPostMemberId"], $conversation["lastPostMemberAvatarFormat"], "thumb"), " ", sprintf(T("%s posted %s"), "<span class='lastPostMember name'>" . memberLink($conversation["lastPostMemberId"], $conversation["lastPostMember"]) . "</span>", "<span class='lastPostTime'>" . relativeTime($conversation["lastPostTime"], true) . "</span>"), "</span>";
?>
</div>
<div class='col-replies'><?php 
echo "<span>" . Ts("%s reply", "%s replies", $conversation["replies"]) . "</span>";
?>
</div>
</li>
Ejemplo n.º 2
0
 /**
  * Set up data and menus that are needed to render the member profile view.
  *
  * @param string $member The ID of the member.
  * @param string $pane The name of the active pane.
  * @return array The member details, or false if the member was not found.
  */
 public function profile($member, $pane = "")
 {
     if (!$this->allowed()) {
         return;
     }
     // Translate "me" to the currently logged in user. Otherwise, use the member ID provided.
     if ($member == "me") {
         $memberId = ET::$session->userId;
     } else {
         $memberId = (int) $member;
     }
     if (!($member = $this->getMember($memberId))) {
         return false;
     }
     // Set the title and include relevant JavaScript.
     $this->title = name($member["username"]);
     $this->addJSFile("core/js/member.js");
     $this->addJSVar("memberId", $member["memberId"]);
     $this->addJSLanguage("Controls");
     // Sort out what the canonical URL for this page is.
     $url = memberURL($member["memberId"], $member["username"], $pane);
     $this->pushNavigation("member/" . $member["memberId"], "member", URL($url));
     $this->canonicalURL = URL($url, true);
     // Make a list of default member panes, and highlight the currently active one.
     $panes = ETFactory::make("menu");
     $panes->add("activity", "<a href='" . URL(memberURL($member["memberId"], $member["username"], "activity")) . "'>" . T("Activity") . "</a>");
     $panes->add("statistics", "<a href='" . URL(memberURL($member["memberId"], $member["username"], "statistics")) . "'>" . T("Statistics") . "</a>");
     $panes->highlight($pane);
     // Set up the controls menu (things that can be changed on the member.)
     $model = ET::memberModel();
     $controls = ETFactory::make("menu");
     // Add the change permissions control (provided the member is not suspended.)
     if ($member["account"] != ACCOUNT_SUSPENDED and $model->canChangePermissions($member)) {
         $controls->add("permissions", "<a href='" . URL("member/permissions/" . $member["memberId"]) . "' id='editPermissionsLink'><i class='icon-lock'></i>" . T("Change permissions") . "</a>");
     }
     // Add the rename control.
     if ($model->canRename($member)) {
         $controls->add("rename", "<a href='" . URL("member/rename/" . $member["memberId"]) . "' id='renameLink'><i class='icon-pencil'></i>" . T("Change username") . "</a>");
     }
     // Add the suspend/unsuspend control, and the "remove avatar" control.
     if ($model->canSuspend($member)) {
         if ($member["avatarFormat"]) {
             $controls->add("removeAvatar", "<a href='" . URL("member/removeAvatar/" . $member["memberId"] . "?token=" . ET::$session->token) . "' id='removeAvatarLink'><i class='icon-picture'></i>" . T("Remove avatar") . "</a>");
         }
         $controls->separator();
         $controls->add("suspend", "<a href='" . URL("member/suspend/" . $member["memberId"]) . "' id='suspendLink'><i class='icon-shield'></i>" . T($member["account"] == ACCOUNT_SUSPENDED ? "Unsuspend member" : "Suspend member") . "</a>");
     }
     // Add the delete control.
     if ($model->canDelete($member)) {
         $controls->add("delete", "<a href='" . URL("member/delete/" . $member["memberId"]) . "' id='deleteLink'><i class='icon-remove'></i>" . T("Delete member") . "</a>");
     }
     // Set up the actions menu (things that can be done in relation to the member.)
     $actions = ETFactory::make("menu");
     // If this is the logged-in user's profile, show a link to their settings page.
     if ($member["memberId"] == ET::$session->userId) {
         $actions->add("settings", "<a href='" . URL("settings") . "'><i class='icon-pencil'></i> " . T("Edit your profile") . "</a>");
     } elseif (ET::$session->userId) {
         $actions->add("privateConversations", "<a href='" . URL(searchURL("#private + #contributor:" . $member["username"])) . "'>" . sprintf(T("See the private conversations I've had with %s"), $member["username"]) . "</a>");
         $actions->add("privateStart", "<a href='" . URL("conversation/start/" . urlencode($member["username"]) . "?token=" . ET::$session->token) . "'>" . sprintf(T("Start a private conversation with %s"), $member["username"]) . "</a>");
     }
     $this->trigger("initProfile", array(&$member, $panes, $controls, $actions));
     // Pass along these menus to the view.
     $this->data("member", $member);
     $this->data("panes", $panes);
     $this->data("controls", $controls);
     $this->data("actions", $actions);
     return $member;
 }
Ejemplo n.º 3
0
?>
<a href='<?php 
echo URL(searchURL("#" . T("gambit.author:") . $member["username"]));
?>
' class='control-search'><i class='icon-search'></i></a>
</div></li>

<li><label><?php 
echo T("Conversations participated in");
?>
</label> <div>
<?php 
echo number_format($statistics["conversationsParticipated"]);
?>
<a href='<?php 
echo URL(searchURL("#" . T("gambit.contributor:") . $member["username"]));
?>
' class='control-search'><i class='icon-search'></i></a>
</div></li>

<li><label><?php 
echo T("First posted");
?>
</label> <div><?php 
echo ucfirst(relativeTime($statistics["firstPosted"]));
?>
</div></li>

<li><label><?php 
echo T("Joined");
?>
Ejemplo n.º 4
0
?>
' class='control-search'><?php 
echo T("Search");
?>
</a>
</div></li>

<li><label><?php 
echo T("Conversations participated in");
?>
</label> <div>
<?php 
echo number_format($statistics["conversationsParticipated"]);
?>
<a href='<?php 
echo URL(searchURL("#contributor:" . $member["username"]));
?>
' class='control-search'><?php 
echo T("Search");
?>
</a>
</div></li>

<li><label><?php 
echo T("First posted");
?>
</label> <div><?php 
echo ucfirst(relativeTime($statistics["firstPosted"]));
?>
</div></li>
Ejemplo n.º 5
0
?>
<a href='<?php 
echo URL(searchURL("#" . T("gambit.author:") . $member["memberId"]));
?>
' class='control-search'><i class='icon-search'></i></a>
</div></li>

<li><label><?php 
echo T("Conversations participated in");
?>
</label> <div>
<?php 
echo number_format($statistics["conversationsParticipated"]);
?>
<a href='<?php 
echo URL(searchURL("#" . T("gambit.contributor:") . $member["memberId"]));
?>
' class='control-search'><i class='icon-search'></i></a>
</div></li>

<li><label><?php 
echo T("First posted");
?>
</label> <div><?php 
echo ucfirst(relativeTime($statistics["firstPosted"]));
?>
</div></li>

<li><label><?php 
echo T("Joined");
?>