Merge branch '0.8.x' of git@gitorious.org:laconica/mainline into 0.8.x
This commit is contained in:
commit
0a602725b1
11
README
11
README
|
@ -262,13 +262,16 @@ especially if you've previously installed PHP/MySQL packages.
|
||||||
that user's default group instead. As a last resort, you can create
|
that user's default group instead. As a last resort, you can create
|
||||||
a new group like "mublog" and add the Web server's user to the group.
|
a new group like "mublog" and add the Web server's user to the group.
|
||||||
|
|
||||||
4. You should also take this moment to make your avatar subdirectory
|
4. You should also take this moment to make your avatar, background, and
|
||||||
writeable by the Web server. An insecure way to do this is:
|
file subdirectories writeable by the Web server. An insecure way to do
|
||||||
|
this is:
|
||||||
|
|
||||||
chmod a+w /var/www/mublog/avatar
|
chmod a+w /var/www/mublog/avatar
|
||||||
|
chmod a+w /var/www/mublog/background
|
||||||
|
chmod a+w /var/www/mublog/file
|
||||||
|
|
||||||
You can also make the avatar directory writeable by the Web server
|
You can also make the avatar, background, and file directories
|
||||||
group, as noted above.
|
writeable by the Web server group, as noted above.
|
||||||
|
|
||||||
5. Create a database to hold your microblog data. Something like this
|
5. Create a database to hold your microblog data. Something like this
|
||||||
should work:
|
should work:
|
||||||
|
|
|
@ -79,7 +79,7 @@ class Fave extends Memcached_DataObject
|
||||||
$qry .= 'ORDER BY modified DESC ';
|
$qry .= 'ORDER BY modified DESC ';
|
||||||
|
|
||||||
if (!is_null($offset)) {
|
if (!is_null($offset)) {
|
||||||
$qry .= "LIMIT $offset, $limit";
|
$qry .= "LIMIT $limit OFFSET $offset";
|
||||||
}
|
}
|
||||||
|
|
||||||
$fav->query($qry);
|
$fav->query($qry);
|
||||||
|
|
|
@ -873,7 +873,7 @@ class Notice extends Memcached_DataObject
|
||||||
if ($cnt > 0) {
|
if ($cnt > 0) {
|
||||||
$qry .= ', ';
|
$qry .= ', ';
|
||||||
}
|
}
|
||||||
$qry .= '('.$id.', '.$this->id.', '.$source.', "'.$this->created.'") ';
|
$qry .= '('.$id.', '.$this->id.', '.$source.", '".$this->created. "') ";
|
||||||
$cnt++;
|
$cnt++;
|
||||||
if (rand() % NOTICE_INBOX_SOFT_LIMIT == 0) {
|
if (rand() % NOTICE_INBOX_SOFT_LIMIT == 0) {
|
||||||
Notice_inbox::gc($id);
|
Notice_inbox::gc($id);
|
||||||
|
@ -899,10 +899,14 @@ class Notice extends Memcached_DataObject
|
||||||
{
|
{
|
||||||
$user = new User();
|
$user = new User();
|
||||||
|
|
||||||
|
if(common_config('db','quote_identifiers'))
|
||||||
|
$user_table = '"user"';
|
||||||
|
else $user_table = 'user';
|
||||||
|
|
||||||
$qry =
|
$qry =
|
||||||
'SELECT id ' .
|
'SELECT id ' .
|
||||||
'FROM user JOIN subscription '.
|
'FROM '. $user_table .' JOIN subscription '.
|
||||||
'ON user.id = subscription.subscriber ' .
|
'ON '. $user_table .'.id = subscription.subscriber ' .
|
||||||
'WHERE subscription.subscribed = %d ';
|
'WHERE subscription.subscribed = %d ';
|
||||||
|
|
||||||
$user->query(sprintf($qry, $this->profile_id));
|
$user->query(sprintf($qry, $this->profile_id));
|
||||||
|
|
|
@ -275,11 +275,14 @@ class User_group extends Memcached_DataObject
|
||||||
// XXX: cache this
|
// XXX: cache this
|
||||||
|
|
||||||
$user = new User();
|
$user = new User();
|
||||||
|
if(common_config('db','quote_identifiers'))
|
||||||
|
$user_table = '"user"';
|
||||||
|
else $user_table = 'user';
|
||||||
|
|
||||||
$qry =
|
$qry =
|
||||||
'SELECT id ' .
|
'SELECT id ' .
|
||||||
'FROM user JOIN group_member '.
|
'FROM '. $user_table .' JOIN group_member '.
|
||||||
'ON user.id = group_member.profile_id ' .
|
'ON '. $user_table .'.id = group_member.profile_id ' .
|
||||||
'WHERE group_member.group_id = %d ';
|
'WHERE group_member.group_id = %d ';
|
||||||
|
|
||||||
$user->query(sprintf($qry, $this->id));
|
$user->query(sprintf($qry, $this->id));
|
||||||
|
|
|
@ -376,6 +376,20 @@ create table profile_block (
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create sequence design_seq;
|
||||||
|
create table design (
|
||||||
|
id bigint default nextval('design_seq') /* comment 'design ID'*/,
|
||||||
|
backgroundcolor integer /* comment 'main background color'*/ ,
|
||||||
|
contentcolor integer /*comment 'content area background color'*/ ,
|
||||||
|
sidebarcolor integer /*comment 'sidebar background color'*/ ,
|
||||||
|
textcolor integer /*comment 'text color'*/ ,
|
||||||
|
linkcolor integer /*comment 'link color'*/,
|
||||||
|
backgroundimage varchar(255) /*comment 'background image, if any'*/,
|
||||||
|
disposition int default 1 /*comment 'bit 1 = hide background image, bit 2 = display background image, bit 4 = tile background image'*/,
|
||||||
|
primary key (id)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
create sequence user_group_seq;
|
create sequence user_group_seq;
|
||||||
create table user_group (
|
create table user_group (
|
||||||
|
|
||||||
|
@ -391,6 +405,8 @@ create table user_group (
|
||||||
homepage_logo varchar(255) /* comment 'homepage (profile) size logo' */,
|
homepage_logo varchar(255) /* comment 'homepage (profile) size logo' */,
|
||||||
stream_logo varchar(255) /* comment 'stream-sized logo' */,
|
stream_logo varchar(255) /* comment 'stream-sized logo' */,
|
||||||
mini_logo varchar(255) /* comment 'mini logo' */,
|
mini_logo varchar(255) /* comment 'mini logo' */,
|
||||||
|
design_id integer /*comment 'id of a design' */ references design(id),
|
||||||
|
|
||||||
|
|
||||||
created timestamp not null default CURRENT_TIMESTAMP /* comment 'date this record was created' */,
|
created timestamp not null default CURRENT_TIMESTAMP /* comment 'date this record was created' */,
|
||||||
modified timestamp /* comment 'date this record was modified' */
|
modified timestamp /* comment 'date this record was modified' */
|
||||||
|
@ -487,19 +503,26 @@ create table file_to_post (
|
||||||
unique(file_id, post_id)
|
unique(file_id, post_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
create sequence design_seq;
|
create table group_block (
|
||||||
create table design (
|
group_id integer not null /* comment 'group profile is blocked from' */ references user_group (id),
|
||||||
id bigint default nextval('design_seq') /* comment 'design ID'*/,
|
blocked integer not null /* comment 'profile that is blocked' */references profile (id),
|
||||||
backgroundcolor integer /* comment 'main background color'*/ ,
|
blocker integer not null /* comment 'user making the block'*/ references "user" (id),
|
||||||
contentcolor integer /*comment 'content area background color'*/ ,
|
modified timestamp /* comment 'date of blocking'*/ ,
|
||||||
sidebarcolor integer /*comment 'sidebar background color'*/ ,
|
|
||||||
textcolor integer /*comment 'text color'*/ ,
|
primary key (group_id, blocked)
|
||||||
linkcolor integer /*comment 'link color'*/,
|
|
||||||
backgroundimage varchar(255) /*comment 'background image, if any'*/,
|
|
||||||
disposition int default 1 /*comment 'bit 1 = hide background image, bit 2 = display background image, bit 4 = tile background image'*/,
|
|
||||||
primary key (id)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table group_alias (
|
||||||
|
|
||||||
|
alias varchar(64) /* comment 'additional nickname for the group'*/ ,
|
||||||
|
group_id integer not null /* comment 'group profile is blocked from'*/ references user_group (id),
|
||||||
|
modified timestamp /* comment 'date alias was created'*/,
|
||||||
|
primary key (alias)
|
||||||
|
|
||||||
|
);
|
||||||
|
create index group_alias_group_id_idx on group_alias (group_id);
|
||||||
|
|
||||||
|
|
||||||
/* Textsearch stuff */
|
/* Textsearch stuff */
|
||||||
|
|
||||||
create index textsearch_idx on profile using gist(textsearch);
|
create index textsearch_idx on profile using gist(textsearch);
|
||||||
|
|
|
@ -60,4 +60,5 @@ VALUES
|
||||||
(100112, 'Cincinnati Bell Wireless', '%s@gocbw.com', now()),
|
(100112, 'Cincinnati Bell Wireless', '%s@gocbw.com', now()),
|
||||||
(100113, 'T-Mobile Germany', '%s@t-mobile-sms.de', now()),
|
(100113, 'T-Mobile Germany', '%s@t-mobile-sms.de', now()),
|
||||||
(100114, 'Vodafone Germany', '%s@vodafone-sms.de', now()),
|
(100114, 'Vodafone Germany', '%s@vodafone-sms.de', now()),
|
||||||
(100115, 'E-Plus', '%s@smsmail.eplus.de', now());
|
(100115, 'E-Plus', '%s@smsmail.eplus.de', now()),
|
||||||
|
(100116, 'Cellular South', '%s@csouth1.com', now());
|
||||||
|
|
130
install.php
130
install.php
|
@ -48,7 +48,7 @@ function checkPrereqs()
|
||||||
$pass = false;
|
$pass = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$reqs = array('gd', 'mysql', 'curl',
|
$reqs = array('gd', 'curl',
|
||||||
'xmlwriter', 'mbstring',
|
'xmlwriter', 'mbstring',
|
||||||
'gettext');
|
'gettext');
|
||||||
|
|
||||||
|
@ -58,6 +58,10 @@ function checkPrereqs()
|
||||||
$pass = false;
|
$pass = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!checkExtension('pgsql') && !checkExtension('mysql')) {
|
||||||
|
?><p class="error">Cannot find mysql or pgsql extension. You need one or the other: <code><?php echo $req; ?></code></p><?php
|
||||||
|
$pass = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_writable(INSTALLDIR)) {
|
if (!is_writable(INSTALLDIR)) {
|
||||||
?><p class="error">Cannot write config file to: <code><?php echo INSTALLDIR; ?></code></p>
|
?><p class="error">Cannot write config file to: <code><?php echo INSTALLDIR; ?></code></p>
|
||||||
|
@ -66,17 +70,16 @@ function checkPrereqs()
|
||||||
$pass = false;
|
$pass = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_writable(INSTALLDIR.'/avatar/')) {
|
// Check the subdirs used for file uploads
|
||||||
?><p class="error">Cannot write avatar directory: <code><?php echo INSTALLDIR; ?>/avatar/</code></p>
|
$fileSubdirs = array('avatar', 'background', 'file');
|
||||||
<p>On your server, try this command: <code>chmod a+w <?php echo INSTALLDIR; ?>/avatar/</code></p>
|
foreach ($fileSubdirs as $fileSubdir) {
|
||||||
|
$fileFullPath = INSTALLDIR."/$fileSubdir/";
|
||||||
|
if (!is_writable($fileFullPath)) {
|
||||||
|
?><p class="error">Cannot write <?php echo $fileSubdir; ?> directory: <code><?php echo $fileFullPath; ?></code></p>
|
||||||
|
<p>On your server, try this command: <code>chmod a+w <?php echo $fileFullPath; ?></code></p>
|
||||||
<?
|
<?
|
||||||
$pass = false;
|
$pass = false;
|
||||||
}
|
}
|
||||||
if (!is_writable(INSTALLDIR.'/background/')) {
|
|
||||||
?><p class="error">Cannot write background directory: <code><?php echo INSTALLDIR; ?>/background/</code></p>
|
|
||||||
<p>On your server, try this command: <code>chmod a+w <?php echo INSTALLDIR; ?>/background/</code></p>
|
|
||||||
<?
|
|
||||||
$pass = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $pass;
|
return $pass;
|
||||||
|
@ -127,7 +130,15 @@ function showForm()
|
||||||
<p class="form_guide">Database hostname</p>
|
<p class="form_guide">Database hostname</p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="host">Database</label>
|
|
||||||
|
<label for="dbtype">Type</label>
|
||||||
|
<input type="radio" name="dbtype" id="fancy-mysql" value="mysql" checked='checked' /> MySQL<br />
|
||||||
|
<input type="radio" name="dbtype" id="dbtype-pgsql" value="pgsql" /> PostgreSQL<br />
|
||||||
|
<p class="form_guide">Database type</p>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<label for="database">Name</label>
|
||||||
<input type="text" id="database" name="database" />
|
<input type="text" id="database" name="database" />
|
||||||
<p class="form_guide">Database name</p>
|
<p class="form_guide">Database name</p>
|
||||||
</li>
|
</li>
|
||||||
|
@ -139,7 +150,7 @@ function showForm()
|
||||||
<li>
|
<li>
|
||||||
<label for="password">Password</label>
|
<label for="password">Password</label>
|
||||||
<input type="password" id="password" name="password" />
|
<input type="password" id="password" name="password" />
|
||||||
<p class="form_guide">Database password</p>
|
<p class="form_guide">Database password (optional)</p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<input type="submit" name="submit" class="submit" value="Submit" />
|
<input type="submit" name="submit" class="submit" value="Submit" />
|
||||||
|
@ -163,6 +174,7 @@ function handlePost()
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$host = $_POST['host'];
|
$host = $_POST['host'];
|
||||||
|
$dbtype = $_POST['dbtype'];
|
||||||
$database = $_POST['database'];
|
$database = $_POST['database'];
|
||||||
$username = $_POST['username'];
|
$username = $_POST['username'];
|
||||||
$password = $_POST['password'];
|
$password = $_POST['password'];
|
||||||
|
@ -191,10 +203,10 @@ function handlePost()
|
||||||
$fail = true;
|
$fail = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($password)) {
|
// if (empty($password)) {
|
||||||
updateStatus("No password specified.", true);
|
// updateStatus("No password specified.", true);
|
||||||
$fail = true;
|
// $fail = true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (empty($sitename)) {
|
if (empty($sitename)) {
|
||||||
updateStatus("No sitename specified.", true);
|
updateStatus("No sitename specified.", true);
|
||||||
|
@ -206,8 +218,76 @@ function handlePost()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch($dbtype) {
|
||||||
|
case 'mysql': mysql_db_installer($host, $database, $username, $password, $sitename);
|
||||||
|
break;
|
||||||
|
case 'pgsql': pgsql_db_installer($host, $database, $username, $password, $sitename);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
if ($path) $path .= '/';
|
||||||
|
updateStatus("You can visit your <a href='/$path'>new Laconica site</a>.");
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
function pgsql_db_installer($host, $database, $username, $password, $sitename) {
|
||||||
|
$connstring = "dbname=$database host=$host user=$username";
|
||||||
|
|
||||||
|
//No password would mean trust authentication used.
|
||||||
|
if (!empty($password)) {
|
||||||
|
$connstring .= " password=$password";
|
||||||
|
}
|
||||||
updateStatus("Starting installation...");
|
updateStatus("Starting installation...");
|
||||||
updateStatus("Checking database...");
|
updateStatus("Checking database...");
|
||||||
|
$conn = pg_connect($connstring);
|
||||||
|
|
||||||
|
updateStatus("Running database script...");
|
||||||
|
//wrap in transaction;
|
||||||
|
pg_query($conn, 'BEGIN');
|
||||||
|
$res = runDbScript(INSTALLDIR.'/db/laconica_pg.sql', $conn, 'pgsql');
|
||||||
|
|
||||||
|
if ($res === false) {
|
||||||
|
updateStatus("Can't run database script.", true);
|
||||||
|
showForm();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
foreach (array('sms_carrier' => 'SMS carrier',
|
||||||
|
'notice_source' => 'notice source',
|
||||||
|
'foreign_services' => 'foreign service')
|
||||||
|
as $scr => $name) {
|
||||||
|
updateStatus(sprintf("Adding %s data to database...", $name));
|
||||||
|
$res = runDbScript(INSTALLDIR.'/db/'.$scr.'.sql', $conn, 'pgsql');
|
||||||
|
if ($res === false) {
|
||||||
|
updateStatus(sprintf("Can't run %d script.", $name), true);
|
||||||
|
showForm();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pg_query($conn, 'COMMIT');
|
||||||
|
|
||||||
|
updateStatus("Writing config file...");
|
||||||
|
if (empty($password)) {
|
||||||
|
$sqlUrl = "pgsql://$username@$host/$database";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$sqlUrl = "pgsql://$username:$password@$host/$database";
|
||||||
|
}
|
||||||
|
$res = writeConf($sitename, $sqlUrl, $fancy, 'pgsql');
|
||||||
|
if (!$res) {
|
||||||
|
updateStatus("Can't write config file.", true);
|
||||||
|
showForm();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
updateStatus("Done!");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function mysql_db_installer($host, $database, $username, $password, $sitename) {
|
||||||
|
updateStatus("Starting installation...");
|
||||||
|
updateStatus("Checking database...");
|
||||||
|
|
||||||
$conn = mysql_connect($host, $username, $password);
|
$conn = mysql_connect($host, $username, $password);
|
||||||
if (!$conn) {
|
if (!$conn) {
|
||||||
updateStatus("Can't connect to server '$host' as '$username'.", true);
|
updateStatus("Can't connect to server '$host' as '$username'.", true);
|
||||||
|
@ -240,6 +320,7 @@ function handlePost()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateStatus("Writing config file...");
|
updateStatus("Writing config file...");
|
||||||
$sqlUrl = "mysqli://$username:$password@$host/$database";
|
$sqlUrl = "mysqli://$username:$password@$host/$database";
|
||||||
$res = writeConf($sitename, $sqlUrl, $fancy);
|
$res = writeConf($sitename, $sqlUrl, $fancy);
|
||||||
|
@ -249,14 +330,8 @@ function handlePost()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
updateStatus("Done!");
|
updateStatus("Done!");
|
||||||
if ($path) $path .= '/';
|
}
|
||||||
updateStatus("You can visit your <a href='/$path'>new Laconica site</a>.");
|
function writeConf($sitename, $sqlUrl, $fancy, $type='mysql')
|
||||||
?>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
function writeConf($sitename, $sqlUrl, $fancy)
|
|
||||||
{
|
{
|
||||||
$res = file_put_contents(INSTALLDIR.'/config.php',
|
$res = file_put_contents(INSTALLDIR.'/config.php',
|
||||||
"<?php\n".
|
"<?php\n".
|
||||||
|
@ -264,11 +339,13 @@ function writeConf($sitename, $sqlUrl, $fancy)
|
||||||
"\$config['site']['name'] = \"$sitename\";\n\n".
|
"\$config['site']['name'] = \"$sitename\";\n\n".
|
||||||
($fancy ? "\$config['site']['fancy'] = true;\n\n":'').
|
($fancy ? "\$config['site']['fancy'] = true;\n\n":'').
|
||||||
"\$config['db']['database'] = \"$sqlUrl\";\n\n".
|
"\$config['db']['database'] = \"$sqlUrl\";\n\n".
|
||||||
|
($type == 'pgsql' ? "\$config['db']['quote_identifiers'] = true;\n\n" .
|
||||||
|
"\$config['db']['type'] = \"$type\";\n\n" : '').
|
||||||
"?>");
|
"?>");
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
function runDbScript($filename, $conn)
|
function runDbScript($filename, $conn, $type='mysql')
|
||||||
{
|
{
|
||||||
$sql = trim(file_get_contents($filename));
|
$sql = trim(file_get_contents($filename));
|
||||||
$stmts = explode(';', $sql);
|
$stmts = explode(';', $sql);
|
||||||
|
@ -277,8 +354,13 @@ function runDbScript($filename, $conn)
|
||||||
if (!mb_strlen($stmt)) {
|
if (!mb_strlen($stmt)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($type == 'mysql') {
|
||||||
$res = mysql_query($stmt, $conn);
|
$res = mysql_query($stmt, $conn);
|
||||||
|
} elseif ($type=='pgsql') {
|
||||||
|
$res = pg_query($conn, $stmt);
|
||||||
|
}
|
||||||
if ($res === false) {
|
if ($res === false) {
|
||||||
|
updateStatus("FAILED SQL: $stmt");
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ class GroupsByMembersSection extends GroupSection
|
||||||
$qry = 'SELECT user_group.*, count(*) as value ' .
|
$qry = 'SELECT user_group.*, count(*) as value ' .
|
||||||
'FROM user_group JOIN group_member '.
|
'FROM user_group JOIN group_member '.
|
||||||
'ON user_group.id = group_member.group_id ' .
|
'ON user_group.id = group_member.group_id ' .
|
||||||
'GROUP BY user_group.id,user_group.nickname,user_group.fullname,user_group.homepage,user_group.description,user_group.location,user_group.original_logo,user_group.homepage_logo,user_group.stream_logo,user_group.mini_logo,user_group.created,user_group.modified ' .
|
'GROUP BY user_group.id,user_group.nickname,user_group.fullname,user_group.homepage,user_group.description,user_group.location,user_group.original_logo,user_group.homepage_logo,user_group.stream_logo,user_group.mini_logo,user_group.created,user_group.modified,user_group.design_id ' .
|
||||||
'ORDER BY value DESC ';
|
'ORDER BY value DESC ';
|
||||||
|
|
||||||
$limit = GROUPS_PER_SECTION;
|
$limit = GROUPS_PER_SECTION;
|
||||||
|
|
|
@ -48,7 +48,7 @@ class GroupsByPostsSection extends GroupSection
|
||||||
$qry = 'SELECT user_group.*, count(*) as value ' .
|
$qry = 'SELECT user_group.*, count(*) as value ' .
|
||||||
'FROM user_group JOIN group_inbox '.
|
'FROM user_group JOIN group_inbox '.
|
||||||
'ON user_group.id = group_inbox.group_id ' .
|
'ON user_group.id = group_inbox.group_id ' .
|
||||||
'GROUP BY user_group.id,user_group.nickname,user_group.fullname,user_group.homepage,user_group.description,user_group.location,user_group.original_logo,user_group.homepage_logo,user_group.stream_logo,user_group.mini_logo,user_group.created,user_group.modified ' .
|
'GROUP BY user_group.id,user_group.nickname,user_group.fullname,user_group.homepage,user_group.description,user_group.location,user_group.original_logo,user_group.homepage_logo,user_group.stream_logo,user_group.mini_logo,user_group.created,user_group.modified,user_group.design_id ' .
|
||||||
'ORDER BY value DESC ';
|
'ORDER BY value DESC ';
|
||||||
|
|
||||||
$limit = GROUPS_PER_SECTION;
|
$limit = GROUPS_PER_SECTION;
|
||||||
|
|
|
@ -73,7 +73,7 @@ class GroupTagCloudSection extends TagCloudSection
|
||||||
$quoted = array();
|
$quoted = array();
|
||||||
|
|
||||||
foreach ($names as $name) {
|
foreach ($names as $name) {
|
||||||
$quoted[] = "\"$name\"";
|
$quoted[] = "'$name'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$namestring = implode(',', $quoted);
|
$namestring = implode(',', $quoted);
|
||||||
|
|
|
@ -53,7 +53,7 @@ function client_prefered_language($httplang)
|
||||||
if (!empty($httplang[2][$i])) {
|
if (!empty($httplang[2][$i])) {
|
||||||
// if no q default to 1.0
|
// if no q default to 1.0
|
||||||
$client_langs[$httplang[2][$i]] =
|
$client_langs[$httplang[2][$i]] =
|
||||||
($httplang[6][$i]? (float) $httplang[6][$i] : 1.0);
|
($httplang[6][$i]? (float) $httplang[6][$i] : 1.0 - ($i*0.01));
|
||||||
}
|
}
|
||||||
if (!empty($httplang[3][$i]) && empty($client_langs[$httplang[3][$i]])) {
|
if (!empty($httplang[3][$i]) && empty($client_langs[$httplang[3][$i]])) {
|
||||||
// if a catchall default 0.01 lower
|
// if a catchall default 0.01 lower
|
||||||
|
|
|
@ -121,7 +121,7 @@ function mail_notify_from()
|
||||||
|
|
||||||
$domain = mail_domain();
|
$domain = mail_domain();
|
||||||
|
|
||||||
$notifyfrom = common_config('site', 'name') .' <noreply@'.$domain.'>';
|
$notifyfrom = '"'.common_config('site', 'name') .'" <noreply@'.$domain.'>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $notifyfrom;
|
return $notifyfrom;
|
||||||
|
|
|
@ -74,11 +74,7 @@ class PopularNoticeSection extends NoticeSection
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
$limit = NOTICES_PER_SECTION + 1;
|
$limit = NOTICES_PER_SECTION + 1;
|
||||||
|
|
||||||
if (common_config('db', 'type') == 'pgsql') {
|
|
||||||
$qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
|
$qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
|
||||||
} else {
|
|
||||||
$qry .= ' LIMIT ' . $offset . ', ' . $limit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$notice = Memcached_DataObject::cachedQuery('Notice',
|
$notice = Memcached_DataObject::cachedQuery('Notice',
|
||||||
sprintf($qry, common_config('popular', 'dropoff')),
|
sprintf($qry, common_config('popular', 'dropoff')),
|
||||||
|
|
|
@ -414,9 +414,9 @@ function common_replace_urls_callback($text, $callback, $notice_id = null) {
|
||||||
$regex = '#'.
|
$regex = '#'.
|
||||||
'(?:'.
|
'(?:'.
|
||||||
'(?:'.
|
'(?:'.
|
||||||
'(?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|xmpp|irc)://'.
|
'(?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|irc)://'.
|
||||||
'|'.
|
'|'.
|
||||||
'(?:mailto|aim|tel):'.
|
'(?:mailto|aim|tel|xmpp):'.
|
||||||
')'.
|
')'.
|
||||||
'[^.\s]+\.[^\s]+'.
|
'[^.\s]+\.[^\s]+'.
|
||||||
'|'.
|
'|'.
|
||||||
|
|
|
@ -299,25 +299,40 @@ class MailerDaemon
|
||||||
|
|
||||||
$attachments = array();
|
$attachments = array();
|
||||||
|
|
||||||
|
$this->extract_part($parsed,$msg,$attachments);
|
||||||
|
|
||||||
|
return array($from, $to, $msg, $attachments);
|
||||||
|
}
|
||||||
|
|
||||||
|
function extract_part($parsed,&$msg,&$attachments){
|
||||||
if ($parsed->ctype_primary == 'multipart') {
|
if ($parsed->ctype_primary == 'multipart') {
|
||||||
foreach ($parsed->parts as $part) {
|
if($parsed->ctype_secondary == 'alternative'){
|
||||||
if ($part->ctype_primary == 'text' &&
|
$altmsg = $this->extract_msg_from_multipart_alternative_part($parsed);
|
||||||
$part->ctype_secondary == 'plain') {
|
if(!empty($altmsg)) $msg = $altmsg;
|
||||||
$msg = $part->body;
|
|
||||||
}else{
|
}else{
|
||||||
if ($part->body) {
|
foreach($parsed->parts as $part){
|
||||||
|
$this->extract_part($part,$msg,$attachments);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if ($parsed->ctype_primary == 'text'
|
||||||
|
&& $parsed->ctype_secondary=='plain') {
|
||||||
|
$msg = $parsed->body;
|
||||||
|
}else if(!empty($parsed->body)){
|
||||||
|
if(common_config('attachments', 'uploads')){
|
||||||
|
//only save attachments if uploads are enabled
|
||||||
$attachment = tmpfile();
|
$attachment = tmpfile();
|
||||||
fwrite($attachment, $part->body);
|
fwrite($attachment, $parsed->body);
|
||||||
$attachments[] = $attachment;
|
$attachments[] = $attachment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ($type == 'text/plain') {
|
|
||||||
$msg = $parsed->body;
|
function extract_msg_from_multipart_alternative_part($parsed){
|
||||||
} else {
|
foreach ($parsed->parts as $part) {
|
||||||
$this->unsupported_type($type);
|
$this->extract_part($part,$msg,$attachments);
|
||||||
}
|
}
|
||||||
return array($from, $to, $msg, $attachments);
|
//we don't want any attachments that are a result of this parsing
|
||||||
|
return $msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
function unsupported_type($type)
|
function unsupported_type($type)
|
||||||
|
|
|
@ -175,6 +175,10 @@ class XMPPDaemon extends Daemon
|
||||||
|
|
||||||
$user = $this->get_user($from);
|
$user = $this->get_user($from);
|
||||||
|
|
||||||
|
// For common_current_user to work
|
||||||
|
global $_cur;
|
||||||
|
$_cur = $user;
|
||||||
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
$this->from_site($from, 'Unknown user; go to ' .
|
$this->from_site($from, 'Unknown user; go to ' .
|
||||||
common_local_url('imsettings') .
|
common_local_url('imsettings') .
|
||||||
|
@ -211,6 +215,7 @@ class XMPPDaemon extends Daemon
|
||||||
|
|
||||||
$user->free();
|
$user->free();
|
||||||
unset($user);
|
unset($user);
|
||||||
|
unset($_cur);
|
||||||
|
|
||||||
unset($pl['xml']);
|
unset($pl['xml']);
|
||||||
$pl['xml'] = null;
|
$pl['xml'] = null;
|
||||||
|
|
|
@ -12,7 +12,7 @@ margin:0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
#content {
|
#content {
|
||||||
width:70%;
|
width:69%;
|
||||||
}
|
}
|
||||||
#aside_primary {
|
#aside_primary {
|
||||||
padding:5%;
|
padding:5%;
|
||||||
|
|
|
@ -383,7 +383,7 @@ margin-bottom:1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#content {
|
#content {
|
||||||
width:49.009%;
|
width:50%;
|
||||||
min-height:259px;
|
min-height:259px;
|
||||||
float:left;
|
float:left;
|
||||||
padding:0 18px;
|
padding:0 18px;
|
||||||
|
@ -402,7 +402,7 @@ float:left;
|
||||||
width:45.917%;
|
width:45.917%;
|
||||||
min-height:259px;
|
min-height:259px;
|
||||||
float:left;
|
float:left;
|
||||||
margin-left:1.385%;
|
margin-left:0.25%;
|
||||||
padding-bottom:47px;
|
padding-bottom:47px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -736,11 +736,10 @@ margin-right:11px;
|
||||||
.notice,
|
.notice,
|
||||||
.profile {
|
.profile {
|
||||||
position:relative;
|
position:relative;
|
||||||
padding-top:11px;
|
padding:11px 2%;
|
||||||
padding-bottom:11px;
|
|
||||||
clear:both;
|
clear:both;
|
||||||
float:left;
|
float:left;
|
||||||
width:96.41%;
|
width:95.7%;
|
||||||
border-width:1px;
|
border-width:1px;
|
||||||
border-style:solid;
|
border-style:solid;
|
||||||
margin-bottom:11px;
|
margin-bottom:11px;
|
||||||
|
@ -993,13 +992,36 @@ font-weight:bold;
|
||||||
padding:0;
|
padding:0;
|
||||||
}
|
}
|
||||||
#jOverlayContent h1 {
|
#jOverlayContent h1 {
|
||||||
max-width:475px;
|
max-width:425px;
|
||||||
}
|
}
|
||||||
#jOverlayContent #content {
|
#jOverlayContent #content {
|
||||||
border-radius:7px;
|
border-radius:7px;
|
||||||
-moz-border-radius:7px;
|
-moz-border-radius:7px;
|
||||||
-webkit-border-radius:7px;
|
-webkit-border-radius:7px;
|
||||||
}
|
}
|
||||||
|
#jOverlayLoading {
|
||||||
|
top:5%;
|
||||||
|
left:40%;
|
||||||
|
}
|
||||||
|
#attachment_view img {
|
||||||
|
max-width:480px;
|
||||||
|
max-height:480px;
|
||||||
|
}
|
||||||
|
#attachment_view #oembed_info {
|
||||||
|
margin-top:11px;
|
||||||
|
}
|
||||||
|
#attachment_view #oembed_info dt,
|
||||||
|
#attachment_view #oembed_info dd {
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
#attachment_view #oembed_info dt {
|
||||||
|
clear:left;
|
||||||
|
margin-right:11px;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
#attachment_view #oembed_info dt:after {
|
||||||
|
content: ":";
|
||||||
|
}
|
||||||
|
|
||||||
#usergroups #new_group {
|
#usergroups #new_group {
|
||||||
float: left;
|
float: left;
|
||||||
|
@ -1058,8 +1080,6 @@ top:3px;
|
||||||
left:3px;
|
left:3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.pagination {
|
.pagination {
|
||||||
float:left;
|
float:left;
|
||||||
clear:both;
|
clear:both;
|
||||||
|
@ -1105,7 +1125,6 @@ padding-right:30px;
|
||||||
}
|
}
|
||||||
/* END: NOTICE */
|
/* END: NOTICE */
|
||||||
|
|
||||||
|
|
||||||
.hentry .entry-content p {
|
.hentry .entry-content p {
|
||||||
margin-bottom:18px;
|
margin-bottom:18px;
|
||||||
}
|
}
|
||||||
|
@ -1122,7 +1141,6 @@ margin-bottom:18px;
|
||||||
margin-left:18px;
|
margin-left:18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* TOP_POSTERS */
|
/* TOP_POSTERS */
|
||||||
.section tbody td {
|
.section tbody td {
|
||||||
padding-right:11px;
|
padding-right:11px;
|
||||||
|
@ -1150,7 +1168,6 @@ margin-right:0;
|
||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* tagcloud */
|
/* tagcloud */
|
||||||
.tag-cloud {
|
.tag-cloud {
|
||||||
list-style-type:none;
|
list-style-type:none;
|
||||||
|
@ -1233,6 +1250,11 @@ clear:both;
|
||||||
margin-bottom:0;
|
margin-bottom:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#form_settings_design #settings_design_background-image img {
|
||||||
|
max-width:480px;
|
||||||
|
max-height:480px;
|
||||||
|
}
|
||||||
|
|
||||||
#form_settings_design #settings_design_color .form_data,
|
#form_settings_design #settings_design_color .form_data,
|
||||||
#form_settings_design #color-picker {
|
#form_settings_design #color-picker {
|
||||||
float:left;
|
float:left;
|
||||||
|
|
|
@ -14,7 +14,8 @@ background:url(../images/illustrations/illu_pigeons-01.png) no-repeat 0 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
body,
|
body,
|
||||||
a:active {
|
a:active,
|
||||||
|
#content {
|
||||||
background-color:#AEA187;
|
background-color:#AEA187;
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user