tweaky tweak, plus add share tracking db, and don't show acl for guest postings, and experiment with compressing pcss on the fly

This commit is contained in:
friendica 2013-03-06 15:13:54 -08:00
parent 5754d18286
commit c5d0da43e5
11 changed files with 58 additions and 45 deletions

View File

@ -17,7 +17,7 @@ require_once('include/features.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica Red'); define ( 'FRIENDICA_PLATFORM', 'Friendica Red');
define ( 'FRIENDICA_VERSION', trim(file_get_contents('version.inc')) . 'R'); define ( 'FRIENDICA_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 ); define ( 'ZOT_REVISION', 1 );
define ( 'DB_UPDATE_VERSION', 1033 ); define ( 'DB_UPDATE_VERSION', 1034 );
define ( 'EOL', '<br />' . "\r\n" ); define ( 'EOL', '<br />' . "\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@ -1828,7 +1828,7 @@ function load_contact_links($uid) {
if(! $uid || x($a->contacts,'empty')) if(! $uid || x($a->contacts,'empty'))
return; return;
logger('load_contact_links'); // logger('load_contact_links');
$r = q("SELECT abook_id, abook_flags, abook_my_perms, abook_their_perms, xchan_hash, xchan_photo_m, xchan_name, xchan_url from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not (abook_flags & %d) ", $r = q("SELECT abook_id, abook_flags, abook_my_perms, abook_their_perms, xchan_hash, xchan_photo_m, xchan_name, xchan_url from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not (abook_flags & %d) ",
intval($uid), intval($uid),

View File

@ -993,6 +993,7 @@ function status_editor($a,$x,$popup=false) {
'$emtitle' => t('Example: bob@example.com, mary@example.com'), '$emtitle' => t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $x['lockstate'], '$lockstate' => $x['lockstate'],
'$acl' => $x['acl'], '$acl' => $x['acl'],
'$showacl' => ((array_key_exists('showacl',$x)) ? $x['showacl'] : 'yes'),
'$bang' => $x['bang'], '$bang' => $x['bang'],
'$profile_uid' => $x['profile_uid'], '$profile_uid' => $x['profile_uid'],
'$preview' => ((feature_enabled($x['profile_uid'],'preview')) ? t('Preview') : ''), '$preview' => ((feature_enabled($x['profile_uid'],'preview')) ? t('Preview') : ''),

View File

@ -309,7 +309,6 @@ CREATE TABLE IF NOT EXISTS `fserver` (
`key` text NOT NULL, `key` text NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `server` (`server`), KEY `server` (`server`),
KEY `server_2` (`server`),
KEY `posturl` (`posturl`) KEY `posturl` (`posturl`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@ -326,43 +325,6 @@ CREATE TABLE IF NOT EXISTS `fsuggest` (
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `gcign` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`gcid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `uid` (`uid`),
KEY `gcid` (`gcid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `gcontact` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` char(255) NOT NULL,
`url` char(255) NOT NULL,
`nurl` char(255) NOT NULL,
`photo` char(255) NOT NULL,
`connect` char(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `nurl` (`nurl`),
KEY `name` (`name`),
KEY `url` (`url`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `glink` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`cid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`gcid` int(11) NOT NULL,
`zcid` int(11) NOT NULL,
`updated` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `cid` (`cid`),
KEY `uid` (`uid`),
KEY `gcid` (`gcid`),
KEY `zcid` (`zcid`),
KEY `updated` (`updated`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `group` ( CREATE TABLE IF NOT EXISTS `group` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`hash` char(255) NOT NULL DEFAULT '', `hash` char(255) NOT NULL DEFAULT '',
@ -811,6 +773,17 @@ CREATE TABLE IF NOT EXISTS `session` (
KEY `expire` (`expire`) KEY `expire` (`expire`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `shares` (
`share_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`share_type` int(11) NOT NULL DEFAULT '0',
`share_target` int(10) unsigned NOT NULL DEFAULT '0',
`share_xchan` char(255) NOT NULL DEFAULT '',
PRIMARY KEY (`share_id`),
KEY `share_type` (`share_type`),
KEY `share_target` (`share_target`),
KEY `share_xchan` (`share_xchan`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `site` ( CREATE TABLE IF NOT EXISTS `site` (
`site_url` char(255) NOT NULL, `site_url` char(255) NOT NULL,
`site_flags` int(11) NOT NULL DEFAULT '0', `site_flags` int(11) NOT NULL DEFAULT '0',

View File

@ -1,6 +1,6 @@
<?php <?php
define( 'UPDATE_VERSION' , 1033 ); define( 'UPDATE_VERSION' , 1034 );
/** /**
* *
@ -410,3 +410,26 @@ KEY `xchan` (`xchan`)
return UPDATE_SUCCESS; return UPDATE_SUCCESS;
return UPDATE_FAILED; return UPDATE_FAILED;
} }
function update_r1033() {
$r = q("CREATE TABLE if not exists `shares` (
`share_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`share_type` INT NOT NULL DEFAULT '0',
`share_target` INT UNSIGNED NOT NULL DEFAULT '0',
`share_xchan` CHAR( 255 ) NOT NULL DEFAULT '',
KEY `share_type` (`share_type`),
KEY `share_target` (`share_target`),
KEY `share_xchan` (`share_xchan`)
) ENGINE = MYISAM DEFAULT CHARSET = utf8");
// if these fail don't bother reporting it
q("drop table gcign");
q("drop table gcontact");
q("drop table glink");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}

View File

@ -124,6 +124,7 @@ function channel_content(&$a, $update = 0, $load = false) {
'nickname' => $a->profile['channel_address'], 'nickname' => $a->profile['channel_address'],
'lockstate' => (((strlen($a->profile['channel_allow_cid'])) || (strlen($a->profile['channel_allow_gid'])) || (strlen($a->profile['channel_deny_cid'])) || (strlen($a->profile['channel_deny_gid']))) ? 'lock' : 'unlock'), 'lockstate' => (((strlen($a->profile['channel_allow_cid'])) || (strlen($a->profile['channel_allow_gid'])) || (strlen($a->profile['channel_deny_cid'])) || (strlen($a->profile['channel_deny_gid']))) ? 'lock' : 'unlock'),
'acl' => (($is_owner) ? populate_acl($channel, false) : ''), 'acl' => (($is_owner) ? populate_acl($channel, false) : ''),
'showacl' => (($is_owner) ? 'yes' : ''),
'bang' => '', 'bang' => '',
'visitor' => (($is_owner || $observer) ? 'block' : 'none'), 'visitor' => (($is_owner || $observer) ? 'block' : 'none'),
'profile_uid' => $a->profile['profile_uid'] 'profile_uid' => $a->profile['profile_uid']

View File

@ -3776,3 +3776,5 @@ ul.menu-popup {
.contact-block-content { .contact-block-content {
margin-top: 8px; margin-top: 8px;
} }
.profile-match-connect { margin-top: 5px; }

View File

@ -51,7 +51,16 @@
$nav_bg_2 = "2e2f2e";} $nav_bg_2 = "2e2f2e";}
if(file_exists('view/theme/' . current_theme() . '/css/style.css')) { if(file_exists('view/theme/' . current_theme() . '/css/style.css')) {
echo file_get_contents('view/theme/' . current_theme() . '/css/style.css'); $x = file_get_contents('view/theme/' . current_theme() . '/css/style.css');
if(get_config('system','pcss_compress')) {
// this shaves off about 10%, probably not enough to worry about right now.
logger('pcss compress: original size: ' . strlen($x), LOGGER_DEBUG);
$x = str_replace(array("\r","\t"," "),array("",' ',' '),$x);
$x = preg_replace('/(\n[ ]+?)/s',"\n",$x);
$x = str_replace("\n","",$x);
logger('pcss compress: final size: ' . strlen($x), LOGGER_DEBUG);
}
echo $x;
} }
echo "\r\n"; echo "\r\n";

View File

@ -53,9 +53,11 @@
<a id="profile-nolocation" class="icon noglobe" title="$noloc" onclick="jotClearLocation();return false;"></a> <a id="profile-nolocation" class="icon noglobe" title="$noloc" onclick="jotClearLocation();return false;"></a>
</div> </div>
{{ if $showacl }}
<div id="profile-jot-perms" class="profile-jot-perms" style="display: $pvisit;" > <div id="profile-jot-perms" class="profile-jot-perms" style="display: $pvisit;" >
<a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="icon $lockstate" title="$permset" ></a>$bang <a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="icon $lockstate" title="$permset" ></a>$bang
</div> </div>
{{ endif }}
{{ if $preview }}<span onclick="preview_post();" id="jot-preview-link" class="fakelink">$preview</span>{{ endif }} {{ if $preview }}<span onclick="preview_post();" id="jot-preview-link" class="fakelink">$preview</span>{{ endif }}

View File

@ -58,9 +58,11 @@
<a id="profile-nolocation" class="icon noglobe" title="{{$noloc}}" onclick="jotClearLocation();return false;"></a> <a id="profile-nolocation" class="icon noglobe" title="{{$noloc}}" onclick="jotClearLocation();return false;"></a>
</div> </div>
{{if $showacl}}
<div id="profile-jot-perms" class="profile-jot-perms" style="display: {{$pvisit}};" > <div id="profile-jot-perms" class="profile-jot-perms" style="display: {{$pvisit}};" >
<a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="icon {{$lockstate}}" title="{{$permset}}" ></a>{{$bang}} <a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="icon {{$lockstate}}" title="{{$permset}}" ></a>{{$bang}}
</div> </div>
{{/if}}
{{if $preview}}<span onclick="preview_post();" id="jot-preview-link" class="fakelink">{{$preview}}</span>{{/if}} {{if $preview}}<span onclick="preview_post();" id="jot-preview-link" class="fakelink">{{$preview}}</span>{{/if}}

View File

@ -4,7 +4,7 @@
* *
*}} *}}
<div class="profile-match-wrapper"> <div class="profile-match-wrapper">
<a href="{{$ignlnk}}" title="{{$ignore}}" class="icon drophide profile-match-ignore" onmouseout="imgdull(this);" onmouseover="imgbright(this);" onclick="return confirmDelete();" ></a> <a href="{{$ignlnk}}" title="{{$ignore}}" class="icon drophide smalldrop profile-match-ignore" onmouseout="imgdull(this);" onmouseover="imgbright(this);" onclick="return confirmDelete();" ></a>
<div class="profile-match-photo"> <div class="profile-match-photo">
<a href="{{$url}}"> <a href="{{$url}}">
<img src="{{$photo}}" alt="{{$name}}" width="80" height="80" title="{{$name}} [{{$url}}]" /> <img src="{{$photo}}" alt="{{$name}}" width="80" height="80" title="{{$name}} [{{$url}}]" />

View File

@ -1,5 +1,5 @@
<div class="profile-match-wrapper"> <div class="profile-match-wrapper">
<a href="$ignlnk" title="$ignore" class="icon drophide profile-match-ignore" onmouseout="imgdull(this);" onmouseover="imgbright(this);" onclick="return confirmDelete();" ></a> <a href="$ignlnk" title="$ignore" class="icon drophide smalldrop profile-match-ignore" onmouseout="imgdull(this);" onmouseover="imgbright(this);" onclick="return confirmDelete();" ></a>
<div class="profile-match-photo"> <div class="profile-match-photo">
<a href="$url"> <a href="$url">
<img src="$photo" alt="$name" width="80" height="80" title="$name [$url]" /> <img src="$photo" alt="$name" width="80" height="80" title="$name [$url]" />