Ticket #421: profile_patch.patch

File profile_patch.patch, 6.2 kB (added by Simek, 1 year ago)

profile.inc patch

  • profile.inc

    old new  
    4141// 
    4242function show_combo_box($name, $filename, $selection=null) { 
    4343    if (!file_exists($filename)) { 
    44         echo "ERROR: $filename does not exist!  Cannot create combo box.<br>"; 
     44        echo "ERROR: $filename does not exist! Cannot create combo box.<br>"; 
    4545        exit(); 
    4646    } 
    4747    echo "<select name=\"$name\">\n"; 
     
    114114    rowify("<br>"); 
    115115    show_textarea("response1", stripslashes($profile->response1)); 
    116116    rowify("<br>"); 
    117     row1( show_profile_heading2()); 
    118     rowify( show_profile_question2().html_info()); 
     117    row1(show_profile_heading2()); 
     118    rowify(show_profile_question2().html_info()); 
    119119    rowify("<br>"); 
    120120    show_textarea("response2", stripslashes($profile->response2)); 
    121121    rowify("<br>"); 
     
    124124} 
    125125 
    126126function show_textarea($name, $text) { 
    127     rowify("<textarea name=\"$name\" cols=80 rows=20>" . $text . "</textarea>"); 
     127    rowify("<textarea name=\"$name\" cols=\"80\" rows=\"20\">" . $text . "</textarea>"); 
    128128} 
    129129 
    130130// When passed profile->verification, this function is used to tell the 
     
    133133function offensive_profile_warning($verify_flag) { 
    134134    if ($verify_flag == 0) { 
    135135        return " 
    136             <font size='+2' color='33cc33'
     136            <font size=\"+2\" color=\"33cc33\"
    137137            Your profile will be made visible to other people<br> 
    138138            as soon as it has been approved by the project.<br> 
    139139            This may take up to a few days.<br> 
     
    141141        "; 
    142142    } else if ($verify_flag == -1) { 
    143143        return " 
    144             <font size='+2' color='ff3333'
     144            <font size=\"+2\" color=\"ff3333\"
    145145            Your profile has been marked as unacceptable.<br> 
    146146            It is not visible to other people. Please change it.<br> 
    147147            </font> 
     
    160160 
    161161    if ($profile->has_picture) { 
    162162        echo " 
    163 <tr><td colspan=2
    164 <table border=0 cellpadding=5 
     163<tr><td colspan=\"2\"
     164<table border=\"0\" cellpadding=\"5\"> 
    165165<tr> 
    166 <td valign=top><a href=\"" . IMAGE_URL . $profile->userid . '.jpg' . "\"><img src=\"" . IMAGE_URL . $profile->userid . '_sm.jpg' . "\"></a> 
     166<td valign=\"top\"><a href=\"" . IMAGE_URL . $profile->userid . '.jpg' . "\"><img src=\"" . IMAGE_URL . $profile->userid . '_sm.jpg' . "\"></a> 
    167167</td> 
    168 <td valign=top> $warning Your profile picture is shown at left. 
     168<td valign=\"top\"> $warning Your profile picture is shown at left. 
    169169<p> 
    170 To replace it, 
    171 click the \"Browse\" button and select a JPEG or PNG file (50KB or less). 
    172 <input name=picture type=file><br> 
     170To replace it, click the \"Browse\" button and select a JPEG or PNG file (50KB or less). 
     171<input name=\"picture\" type=\"file\"><br> 
    173172<p> 
    174173To remove it from your profile, check this box: 
    175 <input type=checkbox name=delete_pic
     174<input type=\"checkbox\" name=\"delete_pic\"
    176175<p> 
    177176</td></tr>"; 
    178177        rowify("<br>"); 
     
    184183click the \"Browse\" button and select a JPEG or PNG file. 
    185184Please select images of 50KB or less. 
    186185<p> 
    187 <input name=picture type=file
     186<input name=\"picture\" type=\"file\"
    188187        "); 
    189188        rowify("<br>"); 
    190189    } 
     
    207206 
    208207function show_submit() { 
    209208    row1("Submit profile"); 
    210     rowify("<p><input type=submit value=OK name=submit>"); 
     209    rowify("<p><input type=\"submit\" value=\"OK\" name=\"submit\">"); 
    211210} 
    212211 
    213212// If the user with id = $userid has uploaded a picture his/herself, 
     
    400399    echo " 
    401400<h2>Congratulations!</h2><p> 
    402401Your profile was successfully entered into our database.<br><br> 
    403 <a href=view_profile.php?userid=$user->id>View your profile</a><br> 
     402<a href=\"view_profile.php?userid=$user->id\">View your profile</a><br> 
    404403"; 
    405404 
    406405    page_tail(); 
     
    415414//   $descriptor is an optional file descriptor to write the table to. 
    416415 
    417416function show_user_table($members, $offset, $numToDisplay, $cols) { 
    418     echo "<table class=bordered border=1 cellpadding=5>\n"; 
     417    echo "<table class=\"bordered\" border=\"1\" cellpadding=\"5\">\n"; 
    419418 
    420419    $rows = ceil($numToDisplay / $cols); 
    421420    $count = $offset; 
     
    436435                    continue; 
    437436                } 
    438437 
    439                 echo "<td class=bordered width=7% height=64><center>"; 
     438                echo "<td class=bordered width=\"7%\" height=\"64\"><center>"; 
    440439 
    441440                $show_picture = $profile->has_picture; 
    442441                if (profile_screening() && $profile->verification != 1) { 
     
    448447                    echo "&nbsp;"; 
    449448                } 
    450449 
    451                 echo "</center></td><td class=bordered width=33% height=64>\n", get_profile_summary($profile), "</td>"; 
     450                echo "</center></td><td class=\"bordered\" width=\"33%\" height=\"64\">\n", get_profile_summary($profile), "</td>"; 
    452451                $count++; 
    453452            } else { 
    454                 echo "<td width=7% height=64></td><td width=33% height=64></td>"; 
     453                echo "<td width=\"7%\" height=\"64\"></td><td width=\"33%\" height=\"64\"></td>"; 
    455454            } 
    456455        } 
    457456        echo "</tr>\n"; 
     
    515514    start_table(); 
    516515 
    517516    if ($can_edit) { 
    518         row1("<a href=create_profile.php>Edit your profile</a>"); 
     517        row1("<a href=\"create_profile.php\">Edit your profile</a>"); 
    519518    } 
    520519     
    521  
    522520    // If doing screening, only show picture in certain situations 
    523521    // 
    524522    $show_picture = $profile->has_picture; 
     
    562560        row1("Your feedback on this profile"); 
    563561        row2( 
    564562            "Recommend this profile for User of the Day:", 
    565             "I <a href=profile_rate.php?userid=$userid&vote=recommend>like</a> this profile" 
     563            "I <a href=\"profile_rate.php?userid=$userid&vote=recommend\">like</a> this profile" 
    566564        ); 
    567565        row2( 
    568566            "Alert administrators to an offensive profile:", 
    569             "I <a href=profile_rate.php?userid=$userid&vote=reject>don't like</a> this profile" 
     567            "I <a href=\"profile_rate.php?userid=$userid&vote=reject\">don't like</a> this profile" 
    570568        ); 
    571569    } 
    572570 
     
    578576    } 
    579577    if (isset($caching) && $caching) end_cache(USER_PROFILE_TTL,$cache_args); 
    580578} 
    581 ?> 
     579?> 

If this page is incomplete or incorrect, please edit it or add it to the wiki to-do list. To do this, you must be logged in; click Login or Register above.