本文整理汇总了PHP中user_links函数的典型用法代码示例。如果您正苦于以下问题:PHP user_links函数的具体用法?PHP user_links怎么用?PHP user_links使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_links函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_admin
function show_admin($user, $admin)
{
$admin_user = BoincUser::lookup_id($admin->userid);
$tokens = url_tokens($user->authenticator);
$date = date_str($admin->create_time);
echo "<tr>\n <td>" . user_links($admin_user) . "</td>\n <td>{$date}</td>\n <td>\n ";
show_button("team_admins.php?teamid={$admin->teamid}&action=remove&userid={$admin_user->id}" . $tokens, tra("Remove"), tra("Remove Team Admin status from this member"));
echo "</td></tr>\n ";
}
示例2: show_user
function show_user($user)
{
echo "\n <tr class=row1>\n <td>", user_links($user), " (ID {$user->id})</td>\n ";
if ($user->teamid) {
$team = BoincTeam::lookup_id($user->teamid);
echo "\n <td> <a href=team_display.php?teamid={$team->id}>{$team->name}</a> </td>\n ";
} else {
echo "<td><br></td>";
}
echo "\n <td align=right>", format_credit($user->expavg_credit), "</td>\n <td align=right>", format_credit_large($user->total_credit), "</td>\n <td>", $user->country, "</td>\n <td>", time_str($user->create_time), "</td>\n </tr>\n ";
}
示例3: show_delta
function show_delta($delta)
{
global $xml;
$user = BoincUser::lookup_id($delta->userid);
$when = time_str($delta->timestamp);
$what = $delta->joining ? "joined" : "quit";
if ($xml) {
echo " <action>\n <id>{$user->id}</id>\n <name>{$user->name}</name>\n <action>{$what}</action>\n <total_credit>{$delta->total_credit}</total_credit>\n <when>{$when}</when>\n </action>\n";
} else {
echo "<tr>\n <td>{$when}</td>\n <td>", user_links($user), " (ID {$user->id})</td>\n <td>{$what}</td>\n <td>{$delta->total_credit}</td>\n </tr>\n ";
}
}
示例4: show_user_row
function show_user_row($user, $i)
{
echo '
<tr class="row1">
<td>$i</td>
<td>' . user_links($user) . '</td>
<td class="right">' . format_credit_large($user->expavg_credit) . '</td>
<td class="right">' . format_credit_large($user->total_credit) . '</td>
<td>' . $user->country . '</td>
<td>' . time_str($user->create_time) . '</td>
</tr>
';
}
示例5: show_row
function show_row($item, $apps, $is_team, $i)
{
$j = $i % 2;
if ($is_team) {
$team = BoincTeam::lookup_id($item->teamid);
if (!$team) {
return;
}
$x = "<td>" . team_links($team) . "</td>\n";
} else {
$user = BoincUser::lookup_id($item->userid);
if (!$user) {
return;
}
$x = "<td>" . user_links($user, BADGE_HEIGHT_MEDIUM) . "</td>\n";
}
echo "<tr class=row{$j}>";
echo "<td>{$i}</td>\n";
echo $x;
foreach ($apps as $app) {
if ($app->id == $item->appid) {
$c = $item;
} else {
if ($is_team) {
$c = BoincCreditTeam::lookup("teamid={$item->teamid} and appid={$app->id}");
} else {
$c = BoincCreditUser::lookup("userid={$item->userid} and appid={$app->id}");
}
if (!$c) {
$c = new StdClass();
$c->expavg = 0;
$c->total = 0;
}
}
echo "<td align=right>" . format_credit($c->expavg) . "</td><td align=right>" . format_credit_large($c->total) . "</td>\n";
}
echo "</tr>\n";
}
示例6: do_read
function do_read($logged_in_user)
{
$id = get_int("id");
$message = BoincPrivateMessage::lookup_id($id);
if (!$message || $message->userid != $logged_in_user->id) {
error_page(tra("no such message"));
}
page_head(tra("Private messages") . " : " . $message->subject);
pm_header();
$sender = BoincUser::lookup_id($message->senderid);
start_table();
echo "<tr><th>" . tra("Subject") . "</th><td>" . $message->subject . "</td></tr>";
echo "<tr><th>" . tra("Sender") . "</th><td>" . user_links($sender, BADGE_HEIGHT_SMALL);
show_block_link($message->senderid);
echo "</td></tr>";
echo "<tr><th>" . tra("Date") . "</th><td>" . time_str($message->date) . "</td></tr>";
echo "<tr><th>" . tra("Message") . "</th><td>" . output_transform($message->content, $options) . "</td></tr>";
echo "<tr><td class=\"pm_footer\"></td><td>\n";
echo "<a href=\"pm.php?action=new&replyto={$id}\">" . tra("Reply") . "</a>\n";
echo " · <a href=\"pm.php?action=delete&id={$id}\">" . tra("Delete") . "</a>\n";
echo " · <a href=\"pm.php?action=inbox\">" . tra("Inbox") . "</a>\n";
end_table();
if ($message->opened == 0) {
$message->update("opened=1");
}
}
示例7: error_page
if (!$team) {
error_page("no such team");
}
require_admin($logged_in_user, $team);
page_head(tra("Remove members from %1", $team->name));
echo "\n <form method=\"post\" action=\"team_remove_inactive_action.php\">\n <input type=\"hidden\" name=\"id\" value=\"" . $team->id . "\">\n";
start_table();
echo "<tr>\n <th>" . tra("Remove?") . "</th>\n <th>" . tra("Name (ID)") . "</th>\n <th>" . tra("Total credit") . "</th>\n <th>" . tra("Recent average credit") . "</th>\n </tr>\n";
$users = BoincUser::enum("teamid={$team->id}");
$ninactive_users = 0;
foreach ($users as $user) {
if ($user->id == $logged_in_user->id) {
continue;
}
if ($user->id == $team->userid) {
continue;
}
$user_total_credit = format_credit($user->total_credit);
$user_expavg_credit = format_credit($user->expavg_credit);
echo "\n <tr>\n <td align=center><input type=checkbox name=remove_{$ninactive_users} value={$user->id}>\n <td>" . user_links($user) . " ({$user->id})</td>\n <td>{$user_total_credit}</td>\n <td>{$user_expavg_credit}</td>\n </tr>\n ";
$ninactive_users++;
}
end_table();
if ($ninactive_users == 0) {
echo "<p>" . tra("No members are eligible for removal.") . "</p>";
} else {
echo "<input type=hidden name=ninactive_users value={$ninactive_users}>";
echo "<input type=submit value=\"" . tra("Remove users") . "\">";
}
echo "</form>";
page_tail();
示例8: get_int
$plain = get_int("plain", true);
$team = BoincTeam::lookup_id($teamid);
if (!$team) {
error_page(tra("no such team"));
}
require_founder_login($user, $team);
if ($plain) {
header("Content-type: text/plain");
} else {
page_head(tra("%1 Email List", $team->name));
start_table();
table_header(array(tra("Member list of %1", $team->name), "colspan=\"6\""));
table_header(tra("Name"), tra("Email address"), tra("Total credit"), tra("Recent average credit"), tra("Country"));
}
$users = BoincUser::enum_fields("id, email_addr, send_email, name, total_credit, expavg_credit, has_profile, donated, country, cross_project_id, create_time, url", "teamid={$team->id}");
foreach ($users as $user) {
if ($plain) {
$e = $user->send_email ? "<{$user->email_addr}>" : "";
echo "{$user->name} {$e}\n";
} else {
$e = $user->send_email ? "{$user->email_addr}" : "";
table_row(user_links($user, BADGE_HEIGHT_MEDIUM), $e, format_credit($user->total_credit), format_credit($user->expavg_credit), $user->country);
}
}
if (!$plain) {
end_table();
echo "<p><a href=\"team_email_list.php?teamid=" . $teamid . "&plain=1\">" . tra("Show as plain text") . "</a></p>";
page_tail();
}
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
示例9: time
$team = BoincTeam::lookup_id($user->teamid);
$now = time();
if ($user->id == $team->ping_user && transfer_ok($team, $now)) {
page_head(tra("Assumed foundership of %1", $team->name));
$team->update("userid={$user->id}, ping_user=0, ping_time=0");
echo tra("Congratulations, you are now the founder of team %1. Go to %2Your Account page%3 to find the Team Admin options.", $team->name, "<a href=\"" . URL_BASE . "home.php\">", "</a>");
} else {
error_page(tra("Foundership request not allowed now"));
}
break;
case "decline":
$teamid = post_int("teamid");
$team = BoincTeam::lookup_id($teamid);
require_founder_login($user, $team);
page_head(tra("Decline founder change request"));
if ($team->ping_user) {
$ping_user = BoincUser::lookup_id($team->ping_user);
$team->update("ping_user=0");
send_founder_transfer_decline_email($team, $ping_user);
echo "<p>" . tra("The foundership request from %1 has been declined.", user_links($ping_user)) . "</p>";
} else {
echo "<p>" . tra("There were no foundership requests.") . "</p>";
}
break;
default:
error_page(tra("undefined action %1", $action));
}
echo "<a href='team_display.php?teamid={$team->id}'>" . tra("Return to team page") . "</a>";
page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
示例10: handle_query
function handle_query($user)
{
$target_userid = get_int('target_userid', true);
if ($target_user && $target_userid != $user->id) {
$target_user = BoincUser::lookup_id($target_userid);
page_head(tra("Please log in as %1", $target_user->name));
echo tra("You must log in as %1 to view this friend request", $target_user->name);
page_tail();
exit;
}
$srcid = get_int('userid');
$srcuser = BoincUser::lookup_id($srcid);
if (!$srcuser) {
error_page("No such user");
}
$friend = BoincFriend::lookup($srcid, $user->id);
if (!$friend) {
error_page("Request not found");
}
page_head(tra("Friend request"));
echo time_str($friend->create_time) . "<p>\n";
$x = user_links($srcuser, true);
echo tra("%1 has requested friendship with you.", $x);
if (strlen($friend->message)) {
echo "<p>" . tra("%1 says: %2", $srcuser->name, $friend->message) . "</p>";
}
echo "<p>";
show_button("friend.php?action=accept&userid=" . $srcid, tra("Accept friendship"), tra("Click accept if %1 is in fact a friend", $srcuser->name));
show_button("friend.php?action=ignore&userid=" . $srcid, tra("Decline"), tra("Click decline if %1 is not a friend", $srcuser->name));
echo " <p>\n ";
page_tail();
}
示例11: select_profile
if ($option) {
select_profile($option);
exit;
}
page_head(tra("Profiles"));
echo "\n <p>" . tra("%1Profiles%2 let individuals share backgrounds and opinions with the %3 community.", "<b>", "</b>", PROJECT) . " " . tra("Explore the diversity of your fellow volunteers, and contribute your own views for others to enjoy.") . "\n <p>" . tra("If you haven't already, you can %1create your own user profile%2 for others to see!", "<a href=\"create_profile.php\">", "</a>");
start_table_noborder();
$today = getdate(time());
$UOTD_heading = tra("User of the Day") . " -- " . $today['month'] . " " . $today['mday'] . ", " . $today['year'];
row1($UOTD_heading);
echo "<tr><td>";
$profile = get_current_uotd();
if ($profile) {
$user = BoincUser::lookup_id($profile->userid);
echo uotd_thumbnail($profile, $user);
echo user_links($user) . "<br>";
$resp = output_transform($profile->response1);
$resp = sanitize_tags($resp);
echo sub_sentence($resp, ' ', 150, true);
}
echo "</td></tr>";
row1(tra("User Profile Explorer"));
echo "<tr><td>\n <ul>\n <li>" . tra("View the %1User Picture Gallery%2.", "<a href=\"" . URL_BASE . "user_profile/user_gallery_1.html\">", "</a>") . "</li>\n <li>" . tra("Browse profiles %1by country%2.", "<a href=\"" . URL_BASE . "user_profile/profile_country.html\">", "</a>") . "</li>\n <li>" . tra("Browse profiles %1at random%2, %3at random with pictures%2, or %4at random without pictures%2.", "<a href=\"?cmd=rand&pic=-1\">", "</a>", "<a href=\"?cmd=rand&pic=1\">", "<a href=\"?cmd=rand&pic=0\">") . "</li>\n";
if (file_exists(PROFILE_PATH . "profile_alpha.html")) {
echo "<li>" . tra("Alphabetical profile listings:") . "<br>";
include PROFILE_PATH . "profile_alpha.html";
}
echo "</ul></td></tr>";
row1(tra("Search profile text"));
rowify("\n <form action=\"profile_search_action.php\" method=\"GET\">\n <input type=\"text\" name=\"search_string\">\n <input type=\"submit\" value=\"" . tra("Search") . "\">\n </form>\n");
end_table();
示例12: intval
$forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount);
row1(tra("Message display"));
row2(tra("What to display"), "<input type=\"checkbox\" name=\"forum_hide_avatars\" " . $forum_hide_avatars . "> " . tra("Hide avatar images") . "<br>\n <input type=\"checkbox\" name=\"forum_hide_signatures\" " . $forum_hide_signatures . "> " . tra("Hide signatures") . "<br>\n <input type=\"checkbox\" name=\"forum_images_as_links\" " . $forum_image_as_link . "> " . tra("Show images as links") . "<br>\n <input type=\"checkbox\" name=\"forum_link_popup\" " . $forum_link_popup . "> " . tra("Open links in new window/tab") . "<br>\n <input type=\"checkbox\" name=\"forum_highlight_special\" " . $forum_highlight_special . "> " . tra("Highlight special users") . "<br>\n <input type=\"text\" name=\"forum_display_wrap_postcount\" size=3 value=\"" . $forum_display_wrap_postcount . "\"> " . tra("Display this many messages per page") . "<br />\n ");
row2(tra("How to sort"), tra("Threads:") . " " . select_from_array("forum_sort", $forum_sort_styles, $user->prefs->forum_sorting) . "<br>" . tra("Posts:") . " " . select_from_array("thread_sort", $thread_sort_styles, $user->prefs->thread_sorting) . "<br>\n <input type=\"checkbox\" name=\"forum_jump_to_unread\" " . $forum_jump_to_unread . "> " . tra("Jump to first new post in thread automatically") . "<br>\n <input type=\"checkbox\" name=\"forum_ignore_sticky_posts\" " . $forum_ignore_sticky_posts . ">" . tra("Don't move sticky posts to top") . "<br>\n ");
}
// DISABLE_FORUMS
// ------------ Message filtering -----------
row1(tra("Message filtering"));
$filtered_userlist = get_ignored_list($user);
$forum_filtered_userlist = "";
for ($i = 0; $i < sizeof($filtered_userlist); $i++) {
$id = (int) $filtered_userlist[$i];
if ($id) {
$filtered_user = BoincUser::lookup_id($id);
if (!$filtered_user) {
echo "Missing user {$id}";
continue;
}
$forum_filtered_userlist .= "<input class=\"btn btn-default\" type=\"submit\" name=\"remove" . $filtered_user->id . "\" value=\"" . tra("Remove") . "\"> " . $filtered_user->id . " - " . user_links($filtered_user) . "<br>";
}
}
row2(tra("Filtered users") . "<br><p class=\"text-muted\">" . tra("Ignore message board posts and private messages from these users.") . "</p>", "{$forum_filtered_userlist}\n <input type=\"text\" name=\"forum_filter_user\" size=12> " . tra("User ID (For instance: 123456789)") . "\n <br><input class=\"btn btn-default\" type=\"submit\" name=\"add_user_to_filter\" value=\"" . tra("Add user to filter") . "\">\n ");
row1(tra("Update"));
row2(tra("Click here to update preferences"), "<input class=\"btn btn-primary\" type=submit value=\"" . tra("Update") . "\">");
echo "</form>\n";
row1(tra("Reset"));
row2(tra("Or click here to reset preferences to the defaults"), "<form method=\"post\" action=\"edit_forum_preferences_action.php\"><input class=\"btn btn-warning\" type=\"submit\" value=\"" . tra("Reset") . "\"><input type=\"hidden\" name=\"action\" value=\"reset_confirm\"></form>");
end_table();
page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
示例13: page_tail
page_tail();
exit;
}
if ($user->id == $team->ping_user) {
echo "<p>" . tra("You requested the foundership of %1 on %2.", $team->name, date_str($team->ping_time)) . "\n </p>";
if (transfer_ok($team, $now)) {
echo tra("60 days have elapsed since your request, and the founder has not responded. You may now assume foundership by clicking here:") . "<form method=\"post\" action=\"team_founder_transfer_action.php\">\n <input type=\"hidden\" name=\"action\" value=\"finalize_transfer\">\n <input class=\"btn btn-default\" type=\"submit\" value=\"" . tra("Assume foundership") . "\">\n </form>\n ";
} else {
echo "<p>" . tra("The founder was notified of your request. If he/she does not respond by %1 you will be given an option to become founder.", date_str(transfer_ok_time($team))) . "</p>";
}
} else {
if (new_transfer_request_ok($team, $now)) {
echo "<form method=\"post\" action=\"team_founder_transfer_action.php\">";
echo "<p>" . tra("If the team founder is not active and you want to assume the role of founder, click the button below. The current founder will be sent an email detailing your request, and will be able to transfer foundership to you or to decline your request. If the founder does not respond in 60 days, you will be allowed to become the founder.<br /><br />\n Are you sure you want to request foundership?") . "</p>";
echo "<input type=\"hidden\" name=\"action\" value=\"initiate_transfer\">\n <input class=\"btn btn-default\" type=\"submit\" value=\"" . tra("Request foundership") . "\">\n </form>\n ";
} else {
if ($team->ping_user) {
if ($team->ping_user < 0) {
$team->ping_user = -$team->ping_user;
}
$ping_user = BoincUser::lookup_id($team->ping_user);
echo "<p>" . tra("Founder change has already been requested by %1 on %2.", user_links($ping_user), date_str($team->ping_time)) . "</p>";
} else {
echo "<p>" . tra("A foundership change was requested during the last 90 days, so new requests are not allowed. Please try again later.") . "</p>";
}
}
}
echo "<p><a href=\"team_display.php?teamid=" . $team->id . "\">" . tra("Return to team page") . "</a>";
page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
示例14: show_user_row
function show_user_row($user, $i)
{
$j = $i % 2;
echo "\n <tr class=row{$j}>\n <td>{$i}</td>\n <td>", user_links($user, BADGE_HEIGHT_MEDIUM), "</td>\n <td align=right>", format_credit_large($user->expavg_credit), "</td>\n <td align=right>", format_credit_large($user->total_credit), "</td>\n <td>", $user->country, "</td>\n <td>", time_str($user->create_time), "</td>\n </tr>\n ";
}
示例15: select_profile
if ($option) {
select_profile($option);
exit;
}
page_head(tra("Profiles"));
echo "\n <p>" . tra("%1Profiles%2 let individuals share backgrounds and opinions with the %3 community.", "<b>", "</b>", PROJECT) . " " . tra("Explore the diversity of your fellow volunteers, and contribute your own views for others to enjoy.") . "\n <p>" . tra("If you haven't already, you can %1create your own user profile%2 for others to see!", "<a href=\"create_profile.php\">", "</a>");
start_table_noborder();
$today = getdate(time());
$UOTD_heading = tra("User of the Day") . " -- " . $today['month'] . " " . $today['mday'] . ", " . $today['year'];
row1($UOTD_heading);
echo "<tr><td>";
$profile = get_current_uotd();
if ($profile) {
$user = BoincUser::lookup_id($profile->userid);
echo uotd_thumbnail($profile, $user);
echo user_links($user, BADGE_HEIGHT_MEDIUM) . "<br>";
$resp = output_transform($profile->response1);
$resp = sanitize_tags($resp);
echo sub_sentence($resp, ' ', 150, true);
}
echo "</td></tr>";
row1(tra("User Profile Explorer"));
echo "<tr><td>\n <ul>\n <li>" . tra("View the %1User Picture Gallery%2.", "<a href=\"" . url_base() . "user_profile/user_gallery_1.html\">", "</a>") . "</li>\n <li>" . tra("Browse profiles %1by country%2.", "<a href=\"" . url_base() . "user_profile/profile_country.html\">", "</a>") . "</li>\n <li>" . tra("Browse profiles %1at random%2, %3at random with pictures%2, or %4at random without pictures%2.", "<a href=\"?cmd=rand&pic=-1\">", "</a>", "<a href=\"?cmd=rand&pic=1\">", "<a href=\"?cmd=rand&pic=0\">") . "</li>\n";
if (file_exists(PROFILE_PATH . "profile_alpha.html")) {
echo "<li>" . tra("Alphabetical profile listings:") . "<br>";
include PROFILE_PATH . "profile_alpha.html";
}
echo "</ul></td></tr>";
row1(tra("Search profile text"));
rowify("\n <form action=\"profile_search_action.php\" method=\"GET\">\n <input type=\"text\" name=\"search_string\">\n <input class=\"btn btn-default\" type=\"submit\" value=\"" . tra("Search") . "\">\n </form>\n");
end_table();