Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x

This commit is contained in:
Evan Prodromou 2009-04-10 10:48:13 -04:00
commit a0a6a627e7
9 changed files with 34 additions and 13 deletions

2
README
View File

@ -1125,7 +1125,7 @@ default: nickname of a user account to automatically subscribe new
service updates or announcements. Users are able to unsub service updates or announcements. Users are able to unsub
if they want. Default is null; no auto subscribe. if they want. Default is null; no auto subscribe.
welcome: nickname of a user account that sends welcome messages to new welcome: nickname of a user account that sends welcome messages to new
users. Can be the same as 'subscribe' account, although on users. Can be the same as 'default' account, although on
busy servers it may be a good idea to keep that one just for busy servers it may be a good idea to keep that one just for
'urgent' messages. Default is null; no message. 'urgent' messages. Default is null; no message.

View File

@ -107,6 +107,7 @@ class FeaturedAction extends Action
$featured_nicks = common_config('nickname', 'featured'); $featured_nicks = common_config('nickname', 'featured');
if (count($featured_nicks) > 0) { if (count($featured_nicks) > 0) {
$quoted = array(); $quoted = array();
@ -118,7 +119,7 @@ class FeaturedAction extends Action
$user = new User; $user = new User;
$user->whereAdd(sprintf('nickname IN (%s)', implode(',', $quoted))); $user->whereAdd(sprintf('nickname IN (%s)', implode(',', $quoted)));
$user->limit(($this->page - 1) * PROFILES_PER_PAGE, PROFILES_PER_PAGE + 1); $user->limit(($this->page - 1) * PROFILES_PER_PAGE, PROFILES_PER_PAGE + 1);
$user->orderBy('user.nickname ASC'); $user->orderBy(common_database_tablename('user') .'.nickname ASC');
$user->find(); $user->find();

View File

@ -139,7 +139,7 @@ class SubscriptionsList extends ProfileList
$this->out->elementStart('form', array('id' => 'subedit-' . $profile->id, $this->out->elementStart('form', array('id' => 'subedit-' . $profile->id,
'method' => 'post', 'method' => 'post',
'class' => 'form_subcription_edit', 'class' => 'form_subscription_edit',
'action' => common_local_url('subedit'))); 'action' => common_local_url('subedit')));
$this->out->hidden('token', common_session_token()); $this->out->hidden('token', common_session_token());
$this->out->hidden('profile', $profile->id); $this->out->hidden('profile', $profile->id);

View File

@ -67,6 +67,8 @@ class Notice extends Memcached_DataObject
$this->blowSubsCache(true); $this->blowSubsCache(true);
$this->query('BEGIN'); $this->query('BEGIN');
//Null any notices that are replies to this notice
$this->query(sprintf("UPDATE notice set reply_to = null WHERE reply_to = %d", $this->id));
$related = array('Reply', $related = array('Reply',
'Fave', 'Fave',
'Notice_tag', 'Notice_tag',

View File

@ -3,6 +3,5 @@ A bookmarklet is a small piece of javascript code used as a bookmark. This one w
Drag-and-drop the following link to your bookmarks bar or right-click it and add it to your browser favorites to keep it handy. Drag-and-drop the following link to your bookmarks bar or right-click it and add it to your browser favorites to keep it handy.
<MTMarkdownOptions output='raw'> <MTMarkdownOptions output='raw'>
<a href="javascript:var%20d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='http://%%site.server%%/%%site.path%%/index.php?action=newnotice',l=d.location,e=encodeURIComponent,g=f+'&status_textarea=%22'+e(s)+'%22 from '+l.href;function%20a(){if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=720,height=570')){l.href=g;}}a();void(0);">Post to %%site.name%%</a> <a href="javascript:var%20d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='http://%%site.server%%/%%site.path%%/index.php?action=newnotice',l=d.location,e=encodeURIComponent,g=f+'&status_textarea=%22'+((e(s))?e(s):e(document.title))+'%22 from '+l.href;function%20a(){if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=800,height=570')){l.href=g;}}a();void(0);">Post to %%site.name%%</a>
</MTMarkdownOptions> </MTMarkdownOptions>

View File

@ -57,9 +57,14 @@ class FeaturedUsersSection extends ProfileSection
$quoted[] = "'$nick'"; $quoted[] = "'$nick'";
} }
$table = "user";
if(common_config('db','quote_identifiers')) {
$table = '"' . $table . '"';
}
$qry = 'SELECT profile.* ' . $qry = 'SELECT profile.* ' .
'FROM profile JOIN user on profile.id = user.id ' . 'FROM profile JOIN '. $table .' on profile.id = '. $table .'.id ' .
'WHERE user.nickname in (' . implode(',', $quoted) . ') ' . 'WHERE '. $table .'.nickname in (' . implode(',', $quoted) . ') ' .
'ORDER BY profile.created DESC '; 'ORDER BY profile.created DESC ';
$limit = PROFILES_PER_SECTION + 1; $limit = PROFILES_PER_SECTION + 1;

View File

@ -1321,3 +1321,16 @@ function common_compatible_license($from, $to)
// XXX: better compatibility check needed here! // XXX: better compatibility check needed here!
return ($from == $to); return ($from == $to);
} }
/**
* returns a quoted table name, if required according to config
*/
function common_database_tablename($tablename)
{
if(common_config('db','quote_identifiers')) {
$tablename = '"'. $tablename .'"';
}
//table prefixes could be added here later
return $tablename;
}

View File

@ -443,6 +443,7 @@ padding:7px 7px 16px 7px;
display:block; display:block;
float:left; float:left;
font-size:1.3em; font-size:1.3em;
margin-bottom:7px;
} }
#form_notice #notice_submit label { #form_notice #notice_submit label {
display:none; display:none;
@ -471,7 +472,7 @@ bottom:0;
right:0; right:0;
} }
#form_notice label[for=to] { #form_notice label[for=to] {
margin-top:11px; margin-top:7px;
} }
#form_notice select[id=to] { #form_notice select[id=to] {
margin-bottom:7px; margin-bottom:7px;
@ -688,7 +689,7 @@ float:none;
.profile .entity_profile .entity_note, .profile .entity_profile .entity_note,
.profile .entity_profile .entity_url, .profile .entity_profile .entity_url,
.profile .entity_profile .entity_tags, .profile .entity_profile .entity_tags,
.profile .entity_profile .form_subcription_edit { .profile .entity_profile .form_subscription_edit {
margin-left:59px; margin-left:59px;
clear:none; clear:none;
display:block; display:block;
@ -700,7 +701,7 @@ margin-right:11px;
} }
.profile .entity_profile .form_subcription_edit label { .profile .entity_profile .form_subscription_edit label {
font-weight:normal; font-weight:normal;
margin-right:11px; margin-right:11px;
} }

View File

@ -21,7 +21,7 @@ p { orphans: 2; widows: 1; }
.entity_actions, .entity_actions,
.notice-options, .notice-options,
#aside_primary, #aside_primary,
.form_subcription_edit .submit { .form_subscription_edit .submit {
display:none; display:none;
} }