Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web: fix factorization of project-specific code #2318

Merged
merged 2 commits into from
Jan 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 11 additions & 34 deletions html/inc/user.inc
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,8 @@ function friend_links($user) {
$x .= ' <a href="'.url_base().'view_profile.php?userid='.$user->id.'"><img title="'.$title.'" src="'.$img_url.'" alt="'.$alt.'"></a><br>';
}
$x .= " <a href=\"".url_base()."show_user.php?userid=".$user->id."\">".$user->name."</a>";
if ($user->donated == 1) {
require_once("../project/donations.inc");
$x .= DONATION_LINK;
}
if ($user->donated == 2) {
require_once("../project/donations.inc");
$x .= DONATION_LINK_TWO;
if (function_exists("project_user_links")) {
$x .= project_user_links($user);
}
$x .= "</td></tr></table>\n";
return $x;
Expand All @@ -336,20 +331,12 @@ function user_links($user, $badge_height=0) {
$x .= ' <a href="'.url_base().'view_profile.php?userid='.$user->id.'"><img title="View the profile of '.$user->name.'" src="'.$img_url.'" alt="Profile"></a>';
}
$x .= " <a href=\"".url_base()."show_user.php?userid=".$user->id."\">".$user->name."</a>";
if ($user->donated == 1) {
require_once("../project/donations.inc");
$x .= DONATION_LINK;
}
if ($user->donated == 2) {
require_once("../project/donations.inc");
$x .= DONATION_LINK_TWO;
if (function_exists("project_user_links")){
$x .= project_user_links($user);
}
if ($badge_height) {
$x .= badges_string(true, $user, $badge_height);
}
if (function_exists("project_user_links")){
$x .= project_user_links($user);
}
return $x;
}

Expand Down Expand Up @@ -457,17 +444,8 @@ function show_user_summary_public($user) {
row2(tra("Computers"), tra("hidden"));
}
}
if ($user->donated == 1) {
if (file_exists("../project/donations.inc")) {
require_once("../project/donations.inc");
row2(tra("Donor"), DONATION_LINK);
}
}
if ($user->donated == 2) {
if (file_exists("../project/donations.inc")) {
require_once("../project/donations.inc");
row2(tra("Donor"), DONATION_LINK_TWO);
}
if (function_exists("project_user_summary_public")) {
project_user_summary_public($user);
}
}

Expand Down Expand Up @@ -547,17 +525,16 @@ function show_account_private($user) {
show_preference_links();
show_user_stats_private($user);

if (file_exists("../project/donations.inc")) {
require_once("../project/donations.inc");
if (function_exists('show_user_donations_private')) {
show_user_donations_private($user);
}
if (function_exists('show_user_donations_private')) {
show_user_donations_private($user);
}
end_table();
if (!NO_COMPUTING) {
show_other_projects($user, true);
}
project_user_page_private($user);
if (function_exists("project_user_page_private")) {
project_user_page_private($user);
}
//echo "<a href=delete_account.php>Delete account</a>\n";
},
function() use ($user) {
Expand Down