fix profile selector on profile_photo page (unquoted mysql reserved word 'default')

This commit is contained in:
friendica 2013-02-10 19:54:43 -08:00
parent b92cdd2a27
commit 32d07c3df7
4 changed files with 14 additions and 5 deletions

View File

@ -257,11 +257,11 @@ function profile_photo_content(&$a) {
// go ahead as if we have just uploaded a new photo to crop // go ahead as if we have just uploaded a new photo to crop
profile_photo_crop_ui_head($a, $ph); profile_photo_crop_ui_head($a, $ph);
} }
dbg(1);
$profiles = q("select id, profile_name as name, is_default as default from profile where uid = %d", $profiles = q("select id, profile_name as name, is_default as pdefault from profile where uid = %d",
intval(local_user()) intval(local_user())
); );
dbg(0);
if(! x($a->data,'imagecrop')) { if(! x($a->data,'imagecrop')) {
$tpl = get_markup_template('profile_photo.tpl'); $tpl = get_markup_template('profile_photo.tpl');

View File

@ -3564,6 +3564,15 @@ nav a:hover {
text-decoration: none; text-decoration: none;
outline: none; outline: none;
} }
#profiles-menu li a {
color: #ffffff;
}
#profiles-menu li a:hover {
color: #000000;
}
nav ul { nav ul {
margin: 0px; margin: 0px;
padding: 0px 20px; padding: 0px 20px;

View File

@ -12,7 +12,7 @@
<label id="profile-photo-profiles-label" class="form-label" for="profile-photo-profiles">$lbl_profiles</label> <label id="profile-photo-profiles-label" class="form-label" for="profile-photo-profiles">$lbl_profiles</label>
<select name="profile" id="profile-photo-profiles" class="form-input" > <select name="profile" id="profile-photo-profiles" class="form-input" >
{{ for $profiles as $p }} {{ for $profiles as $p }}
<option value="$p.id" {{ if $p.default }}selected="selected"{{ endif }}>$p.name</option> <option value="$p.id" {{ if $p.pdefault }}selected="selected"{{ endif }}>$p.name</option>
{{ endfor }} {{ endfor }}
</select> </select>
<div class="clear"></div> <div class="clear"></div>

View File

@ -17,7 +17,7 @@
<label id="profile-photo-profiles-label" class="form-label" for="profile-photo-profiles">{{$lbl_profiles}}</label> <label id="profile-photo-profiles-label" class="form-label" for="profile-photo-profiles">{{$lbl_profiles}}</label>
<select name="profile" id="profile-photo-profiles" class="form-input" > <select name="profile" id="profile-photo-profiles" class="form-input" >
{{foreach $profiles as $p}} {{foreach $profiles as $p}}
<option value="{{$p.id}}" {{if $p.default}}selected="selected"{{/if}}>{{$p.name}}</option> <option value="{{$p.id}}" {{if $p.pdefault}}selected="selected"{{/if}}>{{$p.name}}</option>
{{/foreach}} {{/foreach}}
</select> </select>
<div class="clear"></div> <div class="clear"></div>