Ticket #708: util.inc.patch

File util.inc.patch, 6.4 KB (added by Simek, 16 years ago)
  • util.inc

     
    7777function show_login($user) {
    7878    if ($user) {
    7979        echo "Logged in as %s.\n", $user->name;
    80         echo "<br><a href=login_form.php>Log in as someone else.</a>\n";
     80        echo "<br><a href=\"login_form.php\">Log in as someone else.</a>\n";
    8181    } else {
    82         echo "Not logged in";
     82        echo "Not logged in.";
    8383    }
    8484}
    8585
     
    120120        </head>
    121121    ";
    122122    if ($java_onload){
    123         echo "<body bgcolor=\"#ffffff\" onload=\"".$java_onload."\">";
     123        echo "<body onload=\"".$java_onload."\">";
    124124    } else {
    125         echo "<body bgcolor=\"#ffffff\">";
     125        echo "<body>";
    126126    }
    127127    display_cvs_versions();
    128128    project_banner($title, $prefix);
     
    158158    echo "A database error occurred while handling your request.
    159159        <br>Please try again later.
    160160        <br>If the error persists, please submit a
    161         <a href=bug_report_form.php>problem report</a>.
     161        <a href=\"bug_report_form.php\">problem report</a>.
    162162    ";
    163163    page_tail();
    164164}
     
    282282}
    283283
    284284function row3($x, $y, $z) {
    285     echo "<tr><td width=30% valign=top align=right>$x</td><td>$y</td><td>$z</td></tr>\n";
     285    echo "<tr><td width=\"30%\" valign=\"top\" align=\"right\">$x</td><td>$y</td><td>$z</td></tr>\n";
    286286}
    287287
    288288function row4($xx, $xy, $yx, $yy) {
    289     echo "<tr><td width=25% valign=top>$xx</td><td width=25%>$xy</td>"
    290         . "<td width=25% >$yx</td><td width=%25>$yy</td></tr>
     289    echo "<tr><td width=\"25%\" valign=\"top\">$xx</td><td width=\"25%\">$xy</td>"
     290        . "<td width=\"25%\">$yx</td><td width=\"%25\">$yy</td></tr>
    291291    ";
    292292}
    293293
     
    306306function row_heading_array($x) {
    307307    echo "<tr>";
    308308    foreach ($x as $h) {
    309         echo "<th class=heading>$h</th>";
     309        echo "<th class=\"heading\">$h</th>";
    310310    }
    311311    echo "</tr>\n";
    312312}
     
    349349function check_tokens($auth) {
    350350    if (valid_tokens($auth)) return;
    351351    error_page(
    352         "Link has timed out.  Please click Back, refresh the page,
     352        "Link has timed out. Please click Back, refresh the page,
    353353        and try again."
    354354    );
    355355}
    356356
    357357function print_login_form_aux($next_url, $user) {
    358358    echo "
    359         <form name=f method=post action=login_action.php>
    360         <input type=hidden name=next_url value='$next_url'>
     359        <form name=\"f\" method=\"post\" action=\"login_action.php\">
     360        <input type=\"hidden\" name=\"next_url\" value=\"$next_url\">
    361361    ";
    362362    start_table();
    363363    row2("Email address:", '<input name="email_addr" size="40" tabindex="1">');
    364     row2("Password:<br><font size=-2><a href=get_passwd.php>Forgot password?</a>",
     364    row2("Password:<br><font size=\"-2\"><a href=\"get_passwd.php\">Forgot password?</a>",
    365365        '<input type="password" name="passwd" size="40" tabindex="2">'
    366366    );
    367367    row2("Stay logged in on this computer",
    368         "<input type=checkbox name=stay_logged_in checked>"
     368        '<input type="checkbox" name="stay_logged_in" checked>'
    369369    );
    370370    $x = urlencode($next_url);
    371371    row2("",
    372         "<input type=submit name=mode value=\"Log in\" tabindex=\"3\"><br><br>or <a href=create_account_form.php?next_url=$x>create an account</a>"
     372        "<input type=\"submit\" name=\"mode\" value=\"Log in\" tabindex=\"3\"><br><br>or <a href=\"create_account_form.php?next_url=$x\">create an account</a>/."
    373373    );
    374374    if ($user) {
    375375        row1("Log out");
    376376        row2("You are logged in as $user->name",
    377             "<a href=logout.php?".url_tokens($user->authenticator).">Log out</a>"
     377            "<a href=\"logout.php?".url_tokens($user->authenticator)."\">Log out</a>"
    378378        );
    379379    }
    380380    end_table();
     
    449449    if (is_banished($user)) {
    450450        return "";
    451451    }
    452     $x = "<table height=100 width=150 border=0 cellpadding=4><tr><td bgcolor=#e8e8e8>";
     452    $x = "<table height=\"100\" width=\"150\" border=\"0\" cellpadding=\"4\"><tr><td class=\"friend\">";
    453453    if ($user->has_profile) {
    454454        $profile = BoincProfile::lookup_fields("has_picture", "userid=$user->id");
    455455        if ($profile && $profile->has_picture) {
     
    457457        } else {
    458458            $img_url = URL_BASE."img/head_20.png";
    459459        }
    460         $x .= ' <a href="'.URL_BASE.'view_profile.php?userid='.$user->id.'"><img title="View the profile of '.$user->name.'" border="0" align=top src="'.$img_url.'" alt="Profile"></a><br>';
     460        $x .= ' <a href="'.URL_BASE.'view_profile.php?userid='.$user->id.'"><img class="userimg" title="View the profile of '.$user->name.'" align="top" src="'.$img_url.'" alt="Profile"></a><br>';
    461461    }
    462462    $x .= " <a href=\"".URL_BASE."show_user.php?userid=".$user->id."\">".$user->name."</a>";
    463463    if ($user->donated == 1) {
     
    476476    $x = "";
    477477    if ($user->has_profile) {
    478478        $img_url = URL_BASE."img/head_20.png";
    479         $x .= ' <a href="'.URL_BASE.'view_profile.php?userid='.$user->id.'"><img title="View the profile of '.$user->name.'" border="0" align=top src="'.$img_url.'" alt="Profile"></a>';
     479        $x .= ' <a href="'.URL_BASE.'view_profile.php?userid='.$user->id.'"><img class="userimg" title="View the profile of '.$user->name.'" align="top" src="'.$img_url.'" alt="Profile"></a>';
    480480    }
    481481    $x .= " <a href=\"".URL_BASE."show_user.php?userid=".$user->id."\">".$user->name."</a>";
    482482    if ($user->donated == 1) {
     
    488488
    489489function host_link($hostid) {
    490490    if ($hostid) {
    491         return "<a href=show_host_detail.php?hostid=$hostid>$hostid</a>";
     491        return "<a href=\"show_host_detail.php?hostid=$hostid\">$hostid</a>";
    492492    } else {
    493493        return "---";
    494494    }
     
    668668    $desc_esc = addslashes($desc);
    669669    echo "
    670670        <script>
    671         document.write('<input onClick=\"document.location.href=\'$url\'\" class=btn type=button value=\"$text_esc\" title=\"$desc_esc\">')
     671        document.write('<input onClick=\"document.location.href=\'$url\'\" class=\"btn\" type=\"button\" value=\"$text_esc\" title=\"$desc_esc\">')
    672672        </script>
    673673        <noscript>
    674         <a href=$url title=$desc>$text</a>
     674        <a href=\"$url\" title=\"$desc\">$text</a>
    675675        </noscript>
    676676    ";
    677677}
     
    681681    if ($height) {
    682682        $h = "height=\"$height\"";
    683683    }
    684     echo "<img border=0 title=\"$title\" alt=\"$alt\" src=\"$src\" $h>";
     684    echo "<img border=\"0\" title=\"$title\" alt=\"$alt\" src=\"$src\" $h>";
    685685}
    686686
    687687function check_web_stopped() {