Merge remote-tracking branch 'remotes/upstream/master'

* remotes/upstream/master: (21 commits)
  more logging on pubsub callbacks
  provide ability to autofriend ostatus accounts
  ostatus hub subscription issues
  better events-reminder theming
  png support for embedded private photos
  rev update
  png support: update database.sql, fix some typos, fix tinymce image browser
  Add support for PNG images with alpha
  fix a random profile error message
  events: fix select events query select events that starts before display start date and/or ends after display end date.
  more logging on subscribe_to_hub
  admin page untranslated strings, remove empty list element for update
  A few corrections in German translations.
  rev update
  set minchars to 2 for PM lookups too
  set minchars to 2 for contacts search
  contacts search autocomplete
  add email probe logging, limit typo check to main addon files and skip additional support files
  rev update
  named anchors on display page
  ...
This commit is contained in:
Simon L'nu 2012-06-08 23:58:46 -04:00
commit 62e9047b8d
37 changed files with 940 additions and 469 deletions

View file

@ -9,9 +9,9 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '3.0.1363' );
define ( 'FRIENDICA_VERSION', '3.0.1367' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1148 );
define ( 'DB_UPDATE_VERSION', 1149 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@ -28,6 +28,11 @@ define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
*/
define ( 'JPEG_QUALITY', 100 );
/**
* $a->config['system']['png_quality'] from 0 (uncompressed) to 9
*/
define ( 'PNG_QUALITY', 8 );
/**
* Not yet used

View file

@ -745,6 +745,7 @@ CREATE TABLE IF NOT EXISTS `photo` (
`desc` text NOT NULL,
`album` char(255) NOT NULL,
`filename` char(255) NOT NULL,
`type` CHAR(128) NOT NULL DEFAULT 'image/jpeg',
`height` smallint(6) NOT NULL,
`width` smallint(6) NOT NULL,
`data` mediumblob NOT NULL,

View file

@ -7,14 +7,34 @@ class Photo {
private $width;
private $height;
private $valid;
private $type;
private $types;
public function __construct($data) {
/**
* supported mimetypes and corresponding file extensions
*/
static function supportedTypes() {
$t = array();
$t['image/jpeg'] ='jpg';
if (imagetypes() & IMG_PNG) $t['image/png'] = 'png';
return $t;
}
public function __construct($data, $type="image/jpeg") {
$this->types = $this->supportedTypes();
if (!array_key_exists($type,$this->types)){
$type='image/jpeg';
}
$this->valid = false;
$this->type = $type;
$this->image = @imagecreatefromstring($data);
if($this->image !== FALSE) {
$this->width = imagesx($this->image);
$this->height = imagesy($this->image);
$this->valid = true;
imagealphablending($this->image, false);
imagesavealpha($this->image, true);
}
}
@ -38,6 +58,13 @@ class Photo {
public function getImage() {
return $this->image;
}
public function getType() {
return $this->type;
}
public function getExt() {
return $this->types[$this->type];
}
public function scaleImage($max) {
@ -78,6 +105,9 @@ class Photo {
$dest = imagecreatetruecolor( $dest_width, $dest_height );
imagealphablending($dest, false);
imagesavealpha($dest, true);
if ($this->type=='image/png') imagefill($dest, 0, 0, imagecolorallocatealpha($dest, 0, 0, 0, 127)); // fill with alpha
imagecopyresampled($dest, $this->image, 0, 0, 0, 0, $dest_width, $dest_height, $width, $height);
if($this->image)
imagedestroy($this->image);
@ -134,6 +164,9 @@ class Photo {
$dest = imagecreatetruecolor( $dest_width, $dest_height );
imagealphablending($dest, false);
imagesavealpha($dest, true);
if ($this->type=='image/png') imagefill($dest, 0, 0, imagecolorallocatealpha($dest, 0, 0, 0, 127)); // fill with alpha
imagecopyresampled($dest, $this->image, 0, 0, 0, 0, $dest_width, $dest_height, $width, $height);
if($this->image)
imagedestroy($this->image);
@ -148,6 +181,9 @@ class Photo {
public function scaleImageSquare($dim) {
$dest = imagecreatetruecolor( $dim, $dim );
imagealphablending($dest, false);
imagesavealpha($dest, true);
if ($this->type=='image/png') imagefill($dest, 0, 0, imagecolorallocatealpha($dest, 0, 0, 0, 127)); // fill with alpha
imagecopyresampled($dest, $this->image, 0, 0, 0, 0, $dim, $dim, $this->width, $this->height);
if($this->image)
imagedestroy($this->image);
@ -159,6 +195,9 @@ class Photo {
public function cropImage($max,$x,$y,$w,$h) {
$dest = imagecreatetruecolor( $max, $max );
imagealphablending($dest, false);
imagesavealpha($dest, true);
if ($this->type=='image/png') imagefill($dest, 0, 0, imagecolorallocatealpha($dest, 0, 0, 0, 127)); // fill with alpha
imagecopyresampled($dest, $this->image, 0, 0, $x, $y, $max, $max, $w, $h);
if($this->image)
imagedestroy($this->image);
@ -168,20 +207,38 @@ class Photo {
}
public function saveImage($path) {
$quality = get_config('system','jpeg_quality');
if((! $quality) || ($quality > 100))
$quality = JPEG_QUALITY;
imagejpeg($this->image,$path,$quality);
switch($this->type){
case "image/png":
$quality = get_config('system','png_quality');
if((! $quality) || ($quality > 9))
$quality = PNG_QUALITY;
imagepng($this->image, $path, $quality);
break;
default:
$quality = get_config('system','jpeg_quality');
if((! $quality) || ($quality > 100))
$quality = JPEG_QUALITY;
imagejpeg($this->image,$path,$quality);
}
}
public function imageString() {
ob_start();
switch($this->type){
case "image/png":
$quality = get_config('system','png_quality');
if((! $quality) || ($quality > 9))
$quality = PNG_QUALITY;
imagepng($this->image,NULL, $quality);
break;
default:
$quality = get_config('system','jpeg_quality');
if((! $quality) || ($quality > 100))
$quality = JPEG_QUALITY;
$quality = get_config('system','jpeg_quality');
if((! $quality) || ($quality > 100))
$quality = JPEG_QUALITY;
imagejpeg($this->image,NULL,$quality);
imagejpeg($this->image,NULL,$quality);
}
$s = ob_get_contents();
ob_end_clean();
return $s;
@ -200,8 +257,8 @@ class Photo {
$guid = get_guid();
$r = q("INSERT INTO `photo`
( `uid`, `contact-id`, `guid`, `resource-id`, `created`, `edited`, `filename`, `album`, `height`, `width`, `data`, `scale`, `profile`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid` )
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, '%s', '%s', '%s', '%s' )",
( `uid`, `contact-id`, `guid`, `resource-id`, `created`, `edited`, `filename`, type, `album`, `height`, `width`, `data`, `scale`, `profile`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid` )
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, '%s', '%s', '%s', '%s' )",
intval($uid),
intval($cid),
dbesc($guid),
@ -209,6 +266,7 @@ class Photo {
dbesc(datetime_convert()),
dbesc(datetime_convert()),
dbesc(basename($filename)),
dbesc($this->type),
dbesc($album),
intval($this->height),
intval($this->width),
@ -230,6 +288,40 @@ class Photo {
}}
/**
* Guess image mimetype from filename or from Content-Type header
*
* @arg $filename string Image filename
* @arg $fromcurl boolean Check Content-Type header from curl request
*/
function guess_image_type($filename, $fromcurl=false) {
logger('Photo: guess_image_type: '.$filename . ($fromcurl?' from curl headers':''), LOGGER_DEBUG);
$type = null;
if ($fromcurl) {
$a = get_app();
$headers=array();
$h = explode("\n",$a->get_curl_headers());
foreach ($h as $l) {
list($k,$v) = array_map("trim", explode(":", trim($l), 2));
$headers[$k] = $v;
}
if (array_key_exists('Content-Type', $headers))
$type = $headers['Content-Type'];
}
if (is_null($type)){
$ext = pathinfo($filename, PATHINFO_EXTENSION);
$types = Photo::supportedTypes();
$type = "image/jpeg";
foreach ($types as $m=>$e){
if ($ext==$e) $type = $m;
}
}
logger('Photo: guess_image_type: type='.$type, LOGGER_DEBUG);
return $type;
}
function import_profile_photo($photo,$uid,$cid) {
$a = get_app();
@ -238,7 +330,12 @@ function import_profile_photo($photo,$uid,$cid) {
$filename = basename($photo);
$img_str = fetch_url($photo,true);
$img = new Photo($img_str);
// guess mimetype from headers or filename
$type = guess_image_type($photo,true);
$img = new Photo($img_str, $type);
if($img->is_valid()) {
$img->scaleImageSquare(175);
@ -266,9 +363,9 @@ function import_profile_photo($photo,$uid,$cid) {
$photo = $a->get_baseurl() . '/photo/' . $hash . '-4.jpg';
$thumb = $a->get_baseurl() . '/photo/' . $hash . '-5.jpg';
$micro = $a->get_baseurl() . '/photo/' . $hash . '-6.jpg';
$photo = $a->get_baseurl() . '/photo/' . $hash . '-4.' . $img->getExt();
$thumb = $a->get_baseurl() . '/photo/' . $hash . '-5.' . $img->getExt();
$micro = $a->get_baseurl() . '/photo/' . $hash . '-6.' . $img->getExt();
}
else
$photo_failure = true;

View file

@ -435,10 +435,13 @@ function probe_url($url, $mode = PROBE_NORMAL) {
$password = '';
openssl_private_decrypt(hex2bin($r[0]['pass']),$password,$x[0]['prvkey']);
$mbox = email_connect($mailbox,$r[0]['user'],$password);
if(! $mbox)
logger('probe_url: email_connect failed.');
unset($password);
}
if($mbox) {
$msgs = email_poll($mbox,$orig_url);
logger('probe_url: searching ' . $orig_url . ', ' . count($msgs) . ' messages found.', LOGGER_DEBUG);
if(count($msgs)) {
$addr = $orig_url;
$network = NETWORK_MAIL;

View file

@ -898,7 +898,7 @@
// params
$id = intval($a->argv[3]);
logger('API: api_statuses_repeat: '.$id);
logger('API: api_statuses_repeat: '.$id);
//$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
@ -915,13 +915,15 @@
intval($id)
);
$_REQUEST['body'] = html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8')."[url=".$r[0]['reply_url']."]".$r[0]['reply_author']."[/url] \n".$r[0]['body'];
$_REQUEST['profile_uid'] = local_user();
$_REQUEST['type'] = 'wall';
$_REQUEST['api_source'] = true;
if ($r[0]['body'] != "") {
$_REQUEST['body'] = html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8')."[url=".$r[0]['reply_url']."]".$r[0]['reply_author']."[/url] \n".$r[0]['body'];
$_REQUEST['profile_uid'] = local_user();
$_REQUEST['type'] = 'wall';
$_REQUEST['api_source'] = true;
require_once('mod/item.php');
item_post($a);
require_once('mod/item.php');
item_post($a);
}
if ($type == 'xml')
$ok = "true";
@ -943,7 +945,7 @@
// params
$id = intval($a->argv[3]);
logger('API: api_statuses_destroy: '.$id);
logger('API: api_statuses_destroy: '.$id);
require_once('include/items.php');
drop_item($id, false);

View file

@ -94,6 +94,9 @@ function new_contact($uid,$url,$interactive = false) {
}
$writeable = ((($ret['network'] === NETWORK_OSTATUS) && ($ret['notify'])) ? 1 : 0);
$subhub = (($ret['network'] === NETWORK_OSTATUS) ? true : false);
$hidden = (($ret['network'] === NETWORK_MAIL) ? 1 : 0);
if($ret['network'] === NETWORK_MAIL) {
@ -116,8 +119,9 @@ function new_contact($uid,$url,$interactive = false) {
if(count($r)) {
// update contact
if($r[0]['rel'] == CONTACT_IS_FOLLOWER || ($network === NETWORK_DIASPORA && $r[0]['rel'] == CONTACT_IS_SHARING)) {
q("UPDATE `contact` SET `rel` = %d , `readonly` = 0 WHERE `id` = %d AND `uid` = %d LIMIT 1",
q("UPDATE `contact` SET `rel` = %d , `subhub` = %d, `readonly` = 0 WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval(CONTACT_IS_FRIEND),
intval($subhub),
intval($r[0]['id']),
intval($uid)
);
@ -131,8 +135,8 @@ function new_contact($uid,$url,$interactive = false) {
// create contact record
$r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `addr`, `alias`, `batch`, `notify`, `poll`, `poco`, `name`, `nick`, `photo`, `network`, `pubkey`, `rel`, `priority`,
`writable`, `hidden`, `blocked`, `readonly`, `pending` )
VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, 0, 0, 0 ) ",
`writable`, `hidden`, `blocked`, `readonly`, `pending`, `subhub` )
VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, 0, 0, 0, %d ) ",
intval($uid),
dbesc(datetime_convert()),
dbesc($ret['url']),
@ -151,7 +155,8 @@ function new_contact($uid,$url,$interactive = false) {
intval($new_relation),
intval($ret['priority']),
intval($writeable),
intval($hidden)
intval($hidden),
intval($subhub)
);
}

View file

@ -1304,6 +1304,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
$birthday = '';
$hubs = $feed->get_links('hub');
logger('consume_feed: hubs: ' . print_r($hubs,true), LOGGER_DATA);
if(count($hubs))
$hub = implode(',', $hubs);
@ -1346,7 +1347,11 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
}
$img_str = fetch_url($photo_url,true);
$img = new Photo($img_str);
// guess mimetype from headers or filename
$type = guess_image_type($photo_url,true);
$img = new Photo($img_str, $type);
if($img->is_valid()) {
if($have_photo) {
q("DELETE FROM `photo` WHERE `resource-id` = '%s' AND `contact-id` = %d AND `uid` = %d",
@ -1372,9 +1377,9 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
q("UPDATE `contact` SET `avatar-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s'
WHERE `uid` = %d AND `id` = %d LIMIT 1",
dbesc(datetime_convert()),
dbesc($a->get_baseurl() . '/photo/' . $hash . '-4.jpg'),
dbesc($a->get_baseurl() . '/photo/' . $hash . '-5.jpg'),
dbesc($a->get_baseurl() . '/photo/' . $hash . '-6.jpg'),
dbesc($a->get_baseurl() . '/photo/' . $hash . '-4.'.$img->getExt()),
dbesc($a->get_baseurl() . '/photo/' . $hash . '-5.'.$img->getExt()),
dbesc($a->get_baseurl() . '/photo/' . $hash . '-6.'.$img->getExt()),
intval($contact['uid']),
intval($contact['id'])
);
@ -2777,6 +2782,8 @@ function lose_sharer($importer,$contact,$datarray,$item) {
function subscribe_to_hub($url,$importer,$contact,$hubmode = 'subscribe') {
$a = get_app();
if(is_array($importer)) {
$r = q("SELECT `nickname` FROM `user` WHERE `uid` = %d LIMIT 1",
intval($importer['uid'])
@ -2807,7 +2814,10 @@ function subscribe_to_hub($url,$importer,$contact,$hubmode = 'subscribe') {
);
}
post_url($url,$params);
post_url($url,$params);
logger('subscribe_to_hub: returns: ' . $a->get_curl_code(), LOGGER_DEBUG);
return;
}
@ -2943,7 +2953,7 @@ function fix_private_photos($s,$uid, $item = null, $cid = 0) {
if(stristr($image , $site . '/photo/')) {
$replace = false;
$i = basename($image);
$i = str_replace('.jpg','',$i);
$i = str_replace(array('.jpg','.png'),array('',''),$i);
$x = strpos($i,'-');
if($x) {
$res = substr($i,$x+1);
@ -2985,7 +2995,7 @@ function fix_private_photos($s,$uid, $item = null, $cid = 0) {
}
if($replace) {
logger('fix_private_photos: replacing photo', LOGGER_DEBUG);
$s = str_replace($image, 'data:image/jpg;base64,' . base64_encode($r[0]['data']), $s);
$s = str_replace($image, 'data:' . $r[0]['type'] . ';base64,' . base64_encode($r[0]['data']), $s);
logger('fix_private_photos: replaced: ' . $s, LOGGER_DATA);
}
}

View file

@ -807,8 +807,11 @@ function scale_external_images($s,$include_link = true) {
if(stristr($mtch[1],$hostname))
continue;
$i = fetch_url($mtch[1]);
// guess mimetype from headers or filename
$type = guess_image_type($mtch[1],true);
if($i) {
$ph = new Photo($i);
$ph = new Photo($i, $type);
if($ph->is_valid()) {
$orig_width = $ph->getWidth();
$orig_height = $ph->getHeight();

4
include/oembed.php Normal file → Executable file
View file

@ -65,7 +65,8 @@ function oembed_fetch_url($embedurl){
}
function oembed_format_object($j){
$embedurl = $j->embedurl;
$a = get_app();
$embedurl = $j->embedurl;
$jhtml = oembed_iframe($j->embedurl,(isset($j->width) ? $j->width : null), (isset($j->height) ? $j->height : null) );
$ret="<span class='oembed ".$j->type."'>";
switch ($j->type) {
@ -78,6 +79,7 @@ function oembed_format_object($j){
$th=120; $tw = $th*$tr;
$tpl=get_markup_template('oembed_video.tpl');
$ret.=replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(),
'$embedurl'=>$embedurl,
'$escapedhtml'=>base64_encode($jhtml),
'$tw'=>$tw,

View file

@ -477,6 +477,9 @@ function onepoll_run($argv, $argc){
if($contact['network'] === NETWORK_DFRN || $contact['blocked'] || $contact['readonly'])
$hubmode = 'unsubscribe';
if($contact['network'] === NETWORK_OSTATUS && (! $contact['hub-verify']))
$hub_update = true;
if((strlen($hub)) && ($hub_update) && ($contact['rel'] != CONTACT_IS_FOLLOWER)) {
logger('poller: hub ' . $hubmode . ' : ' . $hub . ' contact name : ' . $contact['name'] . ' local user : ' . $importer['name']);
$hubs = explode(',', $hub);

View file

@ -284,7 +284,11 @@ function create_user($arr) {
$filename = basename($photo);
$img_str = fetch_url($photo,true);
$img = new Photo($img_str);
// guess mimetype from headers or filename
$type = guess_image_type($photo,true);
$img = new Photo($img_str, $type);
if($img->is_valid()) {
$img->scaleImageSquare(175);
@ -324,4 +328,4 @@ function create_user($arr) {
$result['user'] = $u;
return $result;
}
}

View file

@ -1,5 +1,6 @@
<?php
/* ACL selector json backend */
require_once("include/acl_selectors.php");
function acl_init(&$a){
@ -16,7 +17,8 @@ function acl_init(&$a){
// For use with jquery.autocomplete for private mail completion
if(x($_REQUEST,'query') && strlen($_REQUEST['query'])) {
$type = 'm';
if(! $type)
$type = 'm';
$search = $_REQUEST['query'];
}
@ -62,6 +64,18 @@ function acl_init(&$a){
);
$contact_count = (int)$r[0]['c'];
}
elseif ($type == 'a') {
// autocomplete for Contacts
$r = q("SELECT COUNT(`id`) AS c FROM `contact`
WHERE `uid` = %d AND `self` = 0
AND `pending` = 0 $sql_extra2" ,
intval(local_user())
);
$contact_count = (int)$r[0]['c'];
} else {
$contact_count = 0;
}
@ -120,11 +134,19 @@ function acl_init(&$a){
dbesc(NETWORK_DIASPORA)
);
}
elseif($type == 'a') {
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact`
WHERE `uid` = %d AND `pending` = 0
$sql_extra2
ORDER BY `name` ASC ",
intval(local_user())
);
}
else
$r = array();
if($type == 'm') {
if($type == 'm' || $type == 'a') {
$x = array();
$x['query'] = $search;
$x['photos'] = array();

View file

@ -117,6 +117,9 @@ function admin_content(&$a) {
$t = get_markup_template("admin_aside.tpl");
$a->page['aside'] .= replace_macros( $t, array(
'$admin' => $aside,
'$admtxt' => t('Admin'),
'$plugadmtxt' => t('Plugin Features'),
'$logtxt' => t('Logs'),
'$h_pending' => t('User registrations waiting for confirmation'),
'$admurl'=> $a->get_baseurl(true)."/admin/"
));

View file

@ -43,6 +43,26 @@ function contacts_init(&$a) {
$a->page['aside'] .= findpeople_widget();
$a->page['aside'] .= networks_widget('contacts',$_GET['nets']);
$base = $a->get_baseurl();
$a->page['htmlhead'] .= '<script src="' . $a->get_baseurl(true) . '/library/jquery_ac/friendica.complete.js" ></script>';
$a->page['htmlhead'] .= <<< EOT
<script>$(document).ready(function() {
var a;
a = $("#contacts-search").autocomplete({
serviceUrl: '$base/acl',
minChars: 2,
width: 350,
});
a.setOptions({ params: { type: 'a' }});
});
</script>
EOT;
}
function contacts_post(&$a) {

4
mod/events.php Normal file → Executable file
View file

@ -230,8 +230,8 @@ function events_content(&$a) {
$r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`,
`item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event` LEFT JOIN `item` ON `item`.`event-id` = `event`.`id`
WHERE `event`.`uid` = %d
AND (( `adjust` = 0 AND `start` >= '%s' AND `start` <= '%s' )
OR ( `adjust` = 1 AND `start` >= '%s' AND `start` <= '%s' )) ",
AND (( `adjust` = 0 AND `finish` >= '%s' AND `start` <= '%s' )
OR ( `adjust` = 1 AND `finish` >= '%s' AND `start` <= '%s' )) ",
intval(local_user()),
dbesc($start),
dbesc($finish),

View file

@ -4,7 +4,9 @@
* @subpackage FileBrowser
* @author Fabio Comuni <fabrixxm@kirgroup.com>
*/
require_once('include/Photo.php');
/**
* @param App $a
*/
@ -43,14 +45,22 @@ function fbrowser_content($a){
$path[]=array($a->get_baseurl()."/fbrowser/image/".$a->argv[2]."/", $album);
}
$r = q("SELECT `resource-id`, `id`, `filename`, min(`scale`) AS `hiq`,max(`scale`) AS `loq`, `desc`
$r = q("SELECT `resource-id`, `id`, `filename`, type, min(`scale`) AS `hiq`,max(`scale`) AS `loq`, `desc`
FROM `photo` WHERE `uid` = %d $sql_extra
GROUP BY `resource-id` $sql_extra2",
intval(local_user())
);
function files1($rr){ global $a; return array( $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['hiq'] . '.jpg', template_escape($rr['filename']), $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['loq'] . '.jpg'); }
function files1($rr){
global $a;
$types = Photo::supportedTypes();
$ext = $types[$rr['type']];
return array(
$a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['hiq'] . '.' .$ext,
template_escape($rr['filename']),
$a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['loq'] . '.'. $ext
);
}
$files = array_map("files1", $r);
$tpl = get_markup_template("filebrowser.tpl");

View file

@ -25,6 +25,7 @@ function message_init(&$a) {
var a;
a = $("#recip").autocomplete({
serviceUrl: '$base/acl',
minChars: 2,
width: 350,
onSelect: function(value,data) {
$("#recip-complete").val(data);

View file

@ -28,7 +28,7 @@ function msearch_post(&$a) {
$results[] = array(
'name' => $rr['name'],
'url' => $a->get_baseurl() . '/profile/' . $rr['nickname'],
'photo' => $a->get_baseurl() . '/photo/avatar/' . $rr['uid'] . 'jpg',
'photo' => $a->get_baseurl() . '/photo/avatar/' . $rr['uid'] . '.jpg',
'tags' => str_replace(array(',',' '),array(' ',' '),$rr['pub_keywords'])
);
}

View file

@ -215,8 +215,11 @@ function parse_url_content(&$a) {
$i = fetch_url($image);
if($i) {
// guess mimetype from headers or filename
$type = guess_image_type($image,true);
require_once('include/Photo.php');
$ph = new Photo($i);
$ph = new Photo($i, $type);
if($ph->is_valid()) {
if($ph->getWidth() > 300 || $ph->getHeight() > 300) {
$ph->scaleImage(300);

View file

@ -1,6 +1,7 @@
<?php
require_once('include/security.php');
require_once('include/Photo.php');
function photo_init(&$a) {
@ -75,7 +76,7 @@ function photo_init(&$a) {
break;
}
$uid = str_replace('.jpg', '', $person);
$uid = str_replace(array('.jpg','.png'),array('',''), $person);
$r = q("SELECT * FROM `photo` WHERE `scale` = %d AND `uid` = %d AND `profile` = 1 LIMIT 1",
intval($resolution),
@ -83,9 +84,11 @@ function photo_init(&$a) {
);
if(count($r)) {
$data = $r[0]['data'];
$mimetype = $r[0]['type'];
}
if(! isset($data)) {
$data = file_get_contents($default);
$mimetype = 'image/jpeg';
}
}
else {
@ -95,7 +98,9 @@ function photo_init(&$a) {
*/
$resolution = 0;
$photo = str_replace('.jpg','',$photo);
foreach( Photo::supportedTypes() as $m=>$e){
$photo = str_replace(".$e",'',$photo);
}
if(substr($photo,-2,1) == '-') {
$resolution = intval(substr($photo,-1,1));
@ -119,6 +124,7 @@ function photo_init(&$a) {
if(count($r)) {
$data = $r[0]['data'];
$mimetype = $r[0]['type'];
}
else {
@ -136,6 +142,7 @@ function photo_init(&$a) {
);
if(count($r)) {
$data = file_get_contents('images/nosign.jpg');
$mimetype = 'image/jpeg';
$prvcachecontrol = true;
}
}
@ -148,12 +155,15 @@ function photo_init(&$a) {
case 4:
$data = file_get_contents('images/person-175.jpg');
$mimetype = 'image/jpeg';
break;
case 5:
$data = file_get_contents('images/person-80.jpg');
$mimetype = 'image/jpeg';
break;
case 6:
$data = file_get_contents('images/person-48.jpg');
$mimetype = 'image/jpeg';
break;
default:
killme();
@ -164,11 +174,11 @@ function photo_init(&$a) {
}
if(isset($customres) && $customres > 0 && $customres < 500) {
require_once('include/Photo.php');
$ph = new Photo($data);
$ph = new Photo($data, $mimetype);
if($ph->is_valid()) {
$ph->scaleImageSquare($customres);
$data = $ph->imageString();
$mimetype = $ph->getType();
}
}
@ -181,7 +191,7 @@ function photo_init(&$a) {
header_remove('pragma');
}
header("Content-type: image/jpeg");
header("Content-type: ".$mimetype);
if($prvcachecontrol) {

View file

@ -5,6 +5,7 @@ require_once('include/acl_selectors.php');
require_once('include/bbcode.php');
require_once('include/security.php');
function photos_init(&$a) {
@ -105,6 +106,8 @@ function photos_post(&$a) {
logger('mod_photos: REQUEST ' . print_r($_REQUEST,true), LOGGER_DATA);
logger('mod_photos: FILES ' . print_r($_FILES,true), LOGGER_DATA);
$phototypes = Photo::supportedTypes();
$can_post = false;
$visitor = 0;
@ -311,7 +314,7 @@ function photos_post(&$a) {
intval($page_owner_uid)
);
if(count($r)) {
$ph = new Photo($r[0]['data']);
$ph = new Photo($r[0]['data'], $r[0]['type']);
if($ph->is_valid()) {
$ph->rotate(270);
@ -362,6 +365,7 @@ function photos_post(&$a) {
intval($page_owner_uid)
);
if(count($p)) {
$ext = $phototypes[$p[0]['type']];
$r = q("UPDATE `photo` SET `desc` = '%s', `album` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s' WHERE `resource-id` = '%s' AND `uid` = %d",
dbesc($desc),
dbesc($albname),
@ -386,7 +390,7 @@ function photos_post(&$a) {
$title = '';
$uri = item_new_uri($a->get_hostname(),$page_owner_uid);
$arr = array();
$arr['uid'] = $page_owner_uid;
@ -412,7 +416,7 @@ function photos_post(&$a) {
$arr['origin'] = 1;
$arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $p[0]['resource-id'] . ']'
. '[img]' . $a->get_baseurl() . '/photo/' . $p[0]['resource-id'] . '-' . $p[0]['scale'] . '.jpg' . '[/img]'
. '[img]' . $a->get_baseurl() . '/photo/' . $p[0]['resource-id'] . '-' . $p[0]['scale'] . '.'. $ext . '[/img]'
. '[/url]';
$item_id = item_store($arr);
@ -581,17 +585,17 @@ function photos_post(&$a) {
$arr['inform'] = $tagged[2];
$arr['origin'] = 1;
$arr['body'] = '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]' . ' ' . t('was tagged in a') . ' ' . '[url=' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . t('photo') . '[/url]' . ' ' . t('by') . ' ' . '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]' ;
$arr['body'] .= "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . '[img]' . $a->get_baseurl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.jpg' . '[/img][/url]' . "\n" ;
$arr['body'] .= "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . '[img]' . $a->get_baseurl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ;
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $tagged[0] . '</title><id>' . $tagged[1] . '/' . $tagged[0] . '</id>';
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $tagged[1] . '" />' . "\n");
if($tagged[3])
$arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $tagged[3]['photo'] . '" />' . "\n");
$arr['object'] .= xmlify('<link rel="photo" type="'.$p[0]['type'].'" href="' . $tagged[3]['photo'] . '" />' . "\n");
$arr['object'] .= '</link></object>' . "\n";
$arr['target'] = '<target><type>' . ACTIVITY_OBJ_PHOTO . '</type><title>' . $p[0]['desc'] . '</title><id>'
. $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '</id>';
$arr['target'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '" />' . "\n" . '<link rel="preview" type="image/jpeg" href="' . $a->get_baseurl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.jpg' . '" />') . '</link></target>';
$arr['target'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '" />' . "\n" . '<link rel="preview" type="'.$p[0]['type'].'" href="' . $a->get_baseurl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>';
$item_id = item_store($arr);
if($item_id) {
@ -662,7 +666,7 @@ function photos_post(&$a) {
$str_group_deny = perms2str(((is_array($_REQUEST['group_deny'])) ? $_REQUEST['group_deny'] : explode(',',$_REQUEST['group_deny'])));
$str_contact_deny = perms2str(((is_array($_REQUEST['contact_deny'])) ? $_REQUEST['contact_deny'] : explode(',',$_REQUEST['contact_deny'])));
$ret = array('src' => '', 'filename' => '', 'filesize' => 0);
$ret = array('src' => '', 'filename' => '', 'filesize' => 0, 'type' => '');
call_hooks('photo_post_file',$ret);
@ -670,15 +674,17 @@ function photos_post(&$a) {
$src = $ret['src'];
$filename = $ret['filename'];
$filesize = $ret['filesize'];
$type = $ret['type'];
}
else {
$src = $_FILES['userfile']['tmp_name'];
$filename = basename($_FILES['userfile']['name']);
$filesize = intval($_FILES['userfile']['size']);
$type = $_FILES['userfile']['type'];
}
if ($type=="") $type=guess_image_type($filename);
logger('photos: upload: received file: ' . $filename . ' as ' . $src . ' ' . $filesize . ' bytes', LOGGER_DEBUG);
logger('photos: upload: received file: ' . $filename . ' as ' . $src . ' ('. $type . ') ' . $filesize . ' bytes', LOGGER_DEBUG);
$maximagesize = get_config('system','maximagesize');
@ -701,7 +707,7 @@ function photos_post(&$a) {
logger('mod/photos.php: photos_post(): loading the contents of ' . $src , LOGGER_DEBUG);
$imagedata = @file_get_contents($src);
$ph = new Photo($imagedata);
$ph = new Photo($imagedata, $type);
if(! $ph->is_valid()) {
logger('mod/photos.php: photos_post(): unable to process image' , LOGGER_DEBUG);
@ -771,7 +777,7 @@ function photos_post(&$a) {
$arr['origin'] = 1;
$arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo_hash . ']'
. '[img]' . $a->get_baseurl() . "/photo/{$photo_hash}-{$smallest}.jpg" . '[/img]'
. '[img]' . $a->get_baseurl() . "/photo/{$photo_hash}-{$smallest}.".$ph->getExt() . '[/img]'
. '[/url]';
$item_id = item_store($arr);
@ -814,8 +820,8 @@ function photos_content(&$a) {
notice( t('Public access denied.') . EOL);
return;
}
require_once('include/bbcode.php');
require_once('include/security.php');
require_once('include/conversation.php');
@ -825,6 +831,8 @@ function photos_content(&$a) {
return;
}
$phototypes = Photo::supportedTypes();
$_SESSION['photo_return'] = $a->cmd;
//
@ -991,7 +999,7 @@ function photos_content(&$a) {
$a->set_pager_itemspage(20);
}
$r = q("SELECT `resource-id`, `id`, `filename`, max(`scale`) AS `scale`, `desc` FROM `photo` WHERE `uid` = %d AND `album` = '%s'
$r = q("SELECT `resource-id`, `id`, `filename`, type, max(`scale`) AS `scale`, `desc` FROM `photo` WHERE `uid` = %d AND `album` = '%s'
AND `scale` <= 4 $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d",
intval($owner_uid),
dbesc($album),
@ -1038,13 +1046,15 @@ function photos_content(&$a) {
$twist = 'rotleft';
else
$twist = 'rotright';
$ext = $phototypes[$rr['type']];
$o .= replace_macros($tpl,array(
'$id' => $rr['id'],
'$twist' => ' ' . $twist . rand(2,4),
'$photolink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'],
'$phototitle' => t('View Photo'),
'$imgsrc' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.jpg',
'$imgsrc' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.' .$ext,
'$imgalt' => template_escape($rr['filename']),
'$desc'=> template_escape($rr['desc'])
));
@ -1158,9 +1168,9 @@ function photos_content(&$a) {
$prevlink = array($prevlink, '<div class="icon prev"></div>') ;
$photo = array(
'href' => $a->get_baseurl() . '/photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.jpg',
'href' => $a->get_baseurl() . '/photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
'title'=> t('View Full Size'),
'src' => $a->get_baseurl() . '/photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.jpg' . '?f=&_u=' . datetime_convert('','','','ymdhis')
'src' => $a->get_baseurl() . '/photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('','','','ymdhis')
);
if($nextlink)
@ -1449,7 +1459,7 @@ function photos_content(&$a) {
$a->set_pager_itemspage(20);
}
$r = q("SELECT `resource-id`, `id`, `filename`, `album`, max(`scale`) AS `scale` FROM `photo`
$r = q("SELECT `resource-id`, `id`, `filename`, type, `album`, max(`scale`) AS `scale` FROM `photo`
WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s'
$sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d",
intval($a->data['user']['uid']),
@ -1469,13 +1479,14 @@ function photos_content(&$a) {
$twist = 'rotleft';
else
$twist = 'rotright';
$ext = $phototypes[$rr['type']];
$photos[] = array(
'id' => $rr['id'],
'twist' => ' ' . $twist . rand(2,4),
'link' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'],
'title' => t('View Photo'),
'src' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.jpg',
'src' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.' . $ext,
'alt' => template_escape($rr['filename']),
'album' => array(
'link' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),

View file

@ -53,7 +53,7 @@ function profile_photo_post(&$a) {
$base_image = $r[0];
$im = new Photo($base_image['data']);
$im = new Photo($base_image['data'], $base_image['type']);
if($im->is_valid()) {
$im->cropImage(175,$srcX,$srcY,$srcW,$srcH);
@ -108,7 +108,9 @@ function profile_photo_post(&$a) {
$src = $_FILES['userfile']['tmp_name'];
$filename = basename($_FILES['userfile']['name']);
$filesize = intval($_FILES['userfile']['size']);
$filetype = $_FILES['userfile']['type'];
if ($filetype=="") $filetype=guess_image_type($filename);
$maximagesize = get_config('system','maximagesize');
if(($maximagesize) && ($filesize > $maximagesize)) {
@ -118,7 +120,7 @@ function profile_photo_post(&$a) {
}
$imagedata = @file_get_contents($src);
$ph = new Photo($imagedata);
$ph = new Photo($imagedata, $filetype);
if(! $ph->is_valid()) {
notice( t('Unable to process image.') . EOL );
@ -193,7 +195,7 @@ function profile_photo_content(&$a) {
goaway($a->get_baseurl() . '/profiles');
return; // NOTREACHED
}
$ph = new Photo($r[0]['data']);
$ph = new Photo($r[0]['data'], $r[0]['type']);
profile_photo_crop_ui_head($a, $ph);
// go ahead as we have jus uploaded a new photo to crop
}
@ -214,7 +216,7 @@ function profile_photo_content(&$a) {
return $o;
}
else {
$filename = $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'] . '.jpg';
$filename = $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'] . '.'.$a->config['imagecrop_ext'];
$resolution = $a->config['imagecrop_resolution'];
$tpl = get_markup_template("cropbody.tpl");
$o .= replace_macros($tpl,array(
@ -268,6 +270,7 @@ function profile_photo_crop_ui_head(&$a, $ph){
$a->config['imagecrop'] = $hash;
$a->config['imagecrop_resolution'] = $smallest;
$a->config['imagecrop_ext'] = $ph->getExt();
$a->page['htmlhead'] .= get_markup_template("crophead.tpl");
return;
}}

View file

@ -47,22 +47,30 @@ function pubsub_init(&$a) {
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 LIMIT 1",
dbesc($nick)
);
if(! count($r))
if(! count($r)) {
logger('pubsub: local account not found: ' . $nick);
hub_return(false, '');
}
$owner = $r[0];
$sql_extra = ((strlen($hub_verify)) ? sprintf(" AND `hub-verify` = '%s' ", dbesc($hub_verify)) : '');
$r = q("SELECT * FROM `contact` WHERE `poll` = '%s' AND `id` = %d AND `uid` = %d
$r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d
AND `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1",
dbesc($hub_topic),
intval($contact_id),
intval($owner['uid'])
);
if(! count($r))
if(! count($r)) {
logger('pubsub: contact not found.');
hub_return(false, '');
}
if(! link_compare($hub_topic,$r[0]['poll'])) {
logger('pubsub: hub topic ' . $hub_topic . ' != ' . $r[0]['poll']);
// should abort but let's humour them.
}
$contact = $r[0];

View file

@ -170,14 +170,28 @@ function salmon_post(&$a) {
*
*/
$r = q("SELECT * FROM `contact` WHERE `network` = 'stat' AND ( `url` = '%s' OR `alias` = '%s')
$r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s' )
AND `uid` = %d LIMIT 1",
dbesc(NETWORK_OSTATUS),
dbesc($author_link),
dbesc($author_link),
intval($importer['uid'])
);
if(! count($r)) {
logger('mod-salmon: Author unknown to us.');
if(get_pconfig($importer['uid'],'system','ostatus_autofriend')) {
require_once('include/follow.php');
$result = new_contact($importer['uid'],$author_link);
if($result['success']) {
$r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s' )
AND `uid` = %d LIMIT 1",
dbesc(NETWORK_OSTATUS),
dbesc($author_link),
dbesc($author_link),
intval($importer['uid'])
);
}
}
}
// is this a follower? Or have we ignored the person?

View file

@ -57,17 +57,20 @@ function wall_upload_post(&$a) {
if(! x($_FILES,'userfile') && ! x($_FILES,'media'))
killme();
if(x($_FILES,'userfile')) {
$src = $_FILES['userfile']['tmp_name'];
$filename = basename($_FILES['userfile']['name']);
$filesize = intval($_FILES['userfile']['size']);
}
elseif(x($_FILES,'media')) {
$src = $_FILES['media']['tmp_name'];
$filename = basename($_FILES['media']['name']);
$filesize = intval($_FILES['media']['size']);
}
if(x($_FILES,'userfile')) {
$src = $_FILES['userfile']['tmp_name'];
$filename = basename($_FILES['userfile']['name']);
$filesize = intval($_FILES['userfile']['size']);
$filetype = $_FILES['userfile']['type'];
}
elseif(x($_FILES,'media')) {
$src = $_FILES['media']['tmp_name'];
$filename = basename($_FILES['media']['name']);
$filesize = intval($_FILES['media']['size']);
$filetype = $_FILES['media']['type'];
}
if ($filetype=="") $filetype=guess_image_type($filename);
$maximagesize = get_config('system','maximagesize');
if(($maximagesize) && ($filesize > $maximagesize)) {
@ -77,7 +80,7 @@ function wall_upload_post(&$a) {
}
$imagedata = @file_get_contents($src);
$ph = new Photo($imagedata);
$ph = new Photo($imagedata, $filetype);
if(! $ph->is_valid()) {
echo ( t('Unable to process image.') . EOL);
@ -123,19 +126,19 @@ function wall_upload_post(&$a) {
/* mod Waitman Gobble NO WARRANTY */
//if we get the signal then return the image url info in BBCODE, otherwise this outputs the info and bails (for the ajax image uploader on wall post)
if ($_REQUEST['hush']!='yeah') {
if ($_REQUEST['hush']!='yeah') {
/*existing code*/
if(local_user() && intval(get_pconfig(local_user(),'system','plaintext')))
echo "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.jpg[/img][/url]\n\n";
echo "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n";
else
echo '<br /><br /><a href="' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '" ><img src="' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.jpg\" alt=\"$basename\" /></a><br /><br />";
echo '<br /><br /><a href="' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '" ><img src="' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."\" alt=\"$basename\" /></a><br /><br />";
/*existing code*/
} else {
$m = '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.jpg[/img][/url]";
$m = '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]";
return($m);
}
}
/* mod Waitman Gobble NO WARRANTY */
killme();

View file

@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1148 );
define( 'UPDATE_VERSION' , 1149 );
/**
*
@ -1283,3 +1283,9 @@ function update_1147() {
return UPDATE_SUCCESS ;
}
function update_1148() {
$r = q("ALTER TABLE photo ADD type CHAR(128) NOT NULL DEFAULT 'image/jpeg' AFTER filename");
if (!$r)
return UPDATE_FAILED;
return UPDATE_SUCCESS;
}

File diff suppressed because it is too large Load diff

View file

@ -30,11 +30,10 @@
$dirs = glob('addon/*');
foreach($dirs as $dir) {
$files = glob($dir . '/*.php');
$addon = basename($dir);
$files = glob($dir . '/' . $addon . '.php');
foreach($files as $file) {
echo $file . "\n";
if(stristr($file,'jappixmini/proxy.php'))
continue;
include_once($file);
}
}

View file

@ -10,7 +10,7 @@
});
});
</script>
<h4><a href="$admurl">Admin</a></h4>
<h4><a href="$admurl">$admtxt</a></h4>
<ul class='admin linklist'>
<li class='admin link button $admin.site.2'><a href='$admin.site.0'>$admin.site.1</a></li>
<li class='admin link button $admin.users.2'><a href='$admin.users.0'>$admin.users.1</a><span id='pending-update' title='$h_pending'></span></li>
@ -19,13 +19,15 @@
<li class='admin link button $admin.dbsync.2'><a href='$admin.dbsync.0'>$admin.dbsync.1</a></li>
</ul>
{{ if $admin.update }}
<ul class='admin linklist'>
<li class='admin link button $admin.update.2'><a href='$admin.update.0'>$admin.update.1</a></li>
<li class='admin link button $admin.update.2'><a href='https://kakste.com/profile/inthegit'>Important Changes</a></li>
</ul>
{{ endif }}
{{ if $admin.plugins_admin }}<h4>Plugins</h4>{{ endif }}
{{ if $admin.plugins_admin }}<h4>$plugadmtxt</h4>{{ endif }}
<ul class='admin linklist'>
{{ for $admin.plugins_admin as $l }}
<li class='admin link button $l.2'><a href='$l.0'>$l.1</a></li>
@ -33,7 +35,7 @@
</ul>
<h4>Logs</h4>
<h4>$logtxt</h4>
<ul class='admin linklist'>
<li class='admin link button $admin.logs.2'><a href='$admin.logs.0'>$admin.logs.1</a></li>
</ul>

View file

@ -19,8 +19,8 @@ msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: http://bugs.friendica.com/\n"
"POT-Creation-Date: 2012-06-03 10:00-0700\n"
"PO-Revision-Date: 2012-06-05 08:08+0000\n"
"POT-Creation-Date: 2012-06-05 10:00-0700\n"
"PO-Revision-Date: 2012-06-06 23:32+0000\n"
"Last-Translator: zottel <transifex@zottel.net>\n"
"Language-Team: German (http://www.transifex.net/projects/p/friendica/language/de/)\n"
"MIME-Version: 1.0\n"
@ -67,7 +67,7 @@ msgstr "Konnte den Kontakt nicht aktualisieren."
#: ../../mod/profiles.php:385 ../../mod/delegate.php:6
#: ../../mod/suggest.php:28 ../../mod/invite.php:13 ../../mod/invite.php:81
#: ../../mod/dfrn_confirm.php:53 ../../addon/facebook/facebook.php:503
#: ../../include/items.php:3297 ../../index.php:306
#: ../../include/items.php:3332 ../../index.php:306
msgid "Permission denied."
msgstr "Zugriff verweigert."
@ -141,9 +141,9 @@ msgstr "Neues Foto von dieser URL"
#: ../../mod/localtime.php:45 ../../mod/contacts.php:322
#: ../../mod/settings.php:555 ../../mod/settings.php:701
#: ../../mod/settings.php:762 ../../mod/settings.php:969
#: ../../mod/manage.php:109 ../../mod/group.php:85 ../../mod/admin.php:417
#: ../../mod/admin.php:653 ../../mod/admin.php:789 ../../mod/admin.php:988
#: ../../mod/admin.php:1075 ../../mod/profiles.php:554
#: ../../mod/manage.php:109 ../../mod/group.php:85 ../../mod/message.php:215
#: ../../mod/admin.php:417 ../../mod/admin.php:653 ../../mod/admin.php:789
#: ../../mod/admin.php:988 ../../mod/admin.php:1075 ../../mod/profiles.php:554
#: ../../mod/invite.php:119 ../../addon/facebook/facebook.php:605
#: ../../addon/yourls/yourls.php:76 ../../addon/ljpost/ljpost.php:93
#: ../../addon/nsfw/nsfw.php:57 ../../addon/planets/planets.php:158
@ -411,10 +411,10 @@ msgstr "Foto löschen"
msgid "was tagged in a"
msgstr "wurde getaggt in einem"
#: ../../mod/photos.php:583 ../../mod/like.php:127 ../../mod/tagger.php:70
#: ../../mod/photos.php:583 ../../mod/like.php:185 ../../mod/tagger.php:70
#: ../../addon/communityhome/communityhome.php:163
#: ../../view/theme/diabook/theme.php:570 ../../include/text.php:1316
#: ../../include/diaspora.php:1662 ../../include/conversation.php:53
#: ../../include/diaspora.php:1671 ../../include/conversation.php:53
#: ../../include/conversation.php:126
msgid "photo"
msgstr "Foto"
@ -554,7 +554,7 @@ msgstr "Teilen"
#: ../../mod/photos.php:1277 ../../mod/editpost.php:104
#: ../../mod/wallmessage.php:145 ../../mod/message.php:214
#: ../../mod/message.php:408 ../../include/conversation.php:371
#: ../../mod/message.php:409 ../../include/conversation.php:371
#: ../../include/conversation.php:731 ../../include/conversation.php:1008
msgid "Please wait"
msgstr "Bitte warten"
@ -652,7 +652,7 @@ msgid "Edit"
msgstr "Bearbeiten"
#: ../../mod/editpost.php:96 ../../mod/wallmessage.php:143
#: ../../mod/message.php:212 ../../mod/message.php:406
#: ../../mod/message.php:212 ../../mod/message.php:407
#: ../../include/conversation.php:990
msgid "Upload photo"
msgstr "Foto hochladen"
@ -662,7 +662,7 @@ msgid "Attach file"
msgstr "Datei anhängen"
#: ../../mod/editpost.php:98 ../../mod/wallmessage.php:144
#: ../../mod/message.php:213 ../../mod/message.php:407
#: ../../mod/message.php:213 ../../mod/message.php:408
#: ../../include/conversation.php:994
msgid "Insert web link"
msgstr "einen Link einfügen"
@ -2141,7 +2141,7 @@ msgstr "Die Adresse deines Profils lautet:"
#: ../../mod/settings.php:953
msgid "Automatically expire posts after this many days:"
msgstr "Beiträge verfallen automatisch nach dieser Anzahl von Tagen"
msgstr "Beiträge verfallen automatisch nach dieser Anzahl von Tagen:"
#: ../../mod/settings.php:953
msgid "If empty, posts will not expire. Expired posts will be deleted"
@ -2173,7 +2173,7 @@ msgstr "Fotos verfallen lassen:"
#: ../../mod/settings.php:960
msgid "Only expire posts by others:"
msgstr "Nur Beiträge anderer verfallen"
msgstr "Nur Beiträge anderer verfallen:"
#: ../../mod/settings.php:967
msgid "Account Settings"
@ -2217,7 +2217,7 @@ msgstr "Standardstandort:"
#: ../../mod/settings.php:986
msgid "Use Browser Location:"
msgstr "Verwende den Standort des Browsers:"
msgstr "Standort des Browsers verwenden:"
#: ../../mod/settings.php:989
msgid "Security and Privacy Settings"
@ -2470,17 +2470,17 @@ msgid ""
msgstr "Wenn du möchtest, dass %s dir antworten kann, überprüfe deine Privatsphären-Einstellungen und erlaube private Nachrichten von unbekannten Absendern."
#: ../../mod/wallmessage.php:133 ../../mod/message.php:200
#: ../../mod/message.php:397
#: ../../mod/message.php:398
msgid "To:"
msgstr "An:"
#: ../../mod/wallmessage.php:134 ../../mod/message.php:205
#: ../../mod/message.php:399
#: ../../mod/message.php:400
msgid "Subject:"
msgstr "Betreff:"
#: ../../mod/wallmessage.php:140 ../../mod/message.php:209
#: ../../mod/message.php:402 ../../mod/invite.php:113
#: ../../mod/message.php:403 ../../mod/invite.php:113
msgid "Your message:"
msgstr "Deine Nachricht:"
@ -2776,26 +2776,26 @@ msgstr "Registrieren"
msgid "People Search"
msgstr "Personen Suche"
#: ../../mod/like.php:127 ../../mod/tagger.php:70
#: ../../mod/like.php:185 ../../mod/like.php:259 ../../mod/tagger.php:70
#: ../../addon/facebook/facebook.php:1572
#: ../../addon/communityhome/communityhome.php:158
#: ../../addon/communityhome/communityhome.php:167
#: ../../view/theme/diabook/theme.php:565
#: ../../view/theme/diabook/theme.php:574 ../../include/diaspora.php:1662
#: ../../view/theme/diabook/theme.php:574 ../../include/diaspora.php:1671
#: ../../include/conversation.php:48 ../../include/conversation.php:57
#: ../../include/conversation.php:121 ../../include/conversation.php:130
msgid "status"
msgstr "Status"
#: ../../mod/like.php:144 ../../addon/facebook/facebook.php:1576
#: ../../mod/like.php:202 ../../addon/facebook/facebook.php:1576
#: ../../addon/communityhome/communityhome.php:172
#: ../../view/theme/diabook/theme.php:579 ../../include/diaspora.php:1678
#: ../../view/theme/diabook/theme.php:579 ../../include/diaspora.php:1687
#: ../../include/conversation.php:65
#, php-format
msgid "%1$s likes %2$s's %3$s"
msgstr "%1$s mag %2$ss %3$s"
#: ../../mod/like.php:146 ../../include/conversation.php:68
#: ../../mod/like.php:204 ../../include/conversation.php:68
#, php-format
msgid "%1$s doesn't like %2$s's %3$s"
msgstr "%1$s mag %2$ss %3$s nicht"
@ -2968,55 +2968,55 @@ msgstr "Nachricht gelöscht."
msgid "Conversation removed."
msgstr "Unterhaltung gelöscht."
#: ../../mod/message.php:245
#: ../../mod/message.php:246
msgid "No messages."
msgstr "Keine Nachrichten."
#: ../../mod/message.php:252
#: ../../mod/message.php:253
#, php-format
msgid "Unknown sender - %s"
msgstr "'Unbekannter Absender - %s"
#: ../../mod/message.php:255
#: ../../mod/message.php:256
#, php-format
msgid "You and %s"
msgstr "Du und %s"
#: ../../mod/message.php:258
#: ../../mod/message.php:259
#, php-format
msgid "%s and You"
msgstr "%s und Du"
#: ../../mod/message.php:268 ../../mod/message.php:390
#: ../../mod/message.php:269 ../../mod/message.php:391
msgid "Delete conversation"
msgstr "Unterhaltung löschen"
#: ../../mod/message.php:271
#: ../../mod/message.php:272
msgid "D, d M Y - g:i A"
msgstr "D, d. M Y - g:i A"
#: ../../mod/message.php:273
#: ../../mod/message.php:274
#, php-format
msgid "%d message"
msgid_plural "%d messages"
msgstr[0] "%d Nachricht"
msgstr[1] "%d Nachrichten"
#: ../../mod/message.php:308
#: ../../mod/message.php:309
msgid "Message not available."
msgstr "Nachricht nicht verfügbar."
#: ../../mod/message.php:373
#: ../../mod/message.php:374
msgid "Delete message"
msgstr "Nachricht löschen"
#: ../../mod/message.php:392
#: ../../mod/message.php:393
msgid ""
"No secure communications available. You <strong>may</strong> be able to "
"respond from the sender's profile page."
msgstr "Sichere Kommunikation ist nicht verfügbar. <strong>Eventuell</strong> kannst du auf der Profilseite des Absenders antworten."
#: ../../mod/message.php:396
#: ../../mod/message.php:397
msgid "Send Reply"
msgstr "Antwort senden"
@ -3858,7 +3858,7 @@ msgstr "Adresse:"
#: ../../mod/profiles.php:565
msgid "Locality/City:"
msgstr "Wohnort/Stadt:"
msgstr "Wohnort:"
#: ../../mod/profiles.php:566
msgid "Postal/Zip Code:"
@ -3898,7 +3898,7 @@ msgstr "Adresse der Homepage:"
#: ../../mod/profiles.php:575 ../../include/profile_advanced.php:50
msgid "Hometown:"
msgstr "Wohnort:"
msgstr "Heimatort:"
#: ../../mod/profiles.php:576 ../../include/profile_advanced.php:54
msgid "Political Views:"
@ -4204,7 +4204,7 @@ msgstr "Kontaktanfrage schlug fehl oder wurde zurück gezogen."
msgid "Unable to set contact photo."
msgstr "Konnte das Bild des Kontakts nicht speichern."
#: ../../mod/dfrn_confirm.php:477 ../../include/diaspora.php:507
#: ../../mod/dfrn_confirm.php:477 ../../include/diaspora.php:510
#: ../../include/conversation.php:101
#, php-format
msgid "%1$s is now friends with %2$s"
@ -6186,12 +6186,12 @@ msgstr "Beginnt:"
msgid "Finishes:"
msgstr "Endet:"
#: ../../include/delivery.php:455 ../../include/notifier.php:677
#: ../../include/delivery.php:456 ../../include/notifier.php:678
msgid "(no subject)"
msgstr "(kein Betreff)"
#: ../../include/delivery.php:462 ../../include/enotify.php:26
#: ../../include/notifier.php:684
#: ../../include/delivery.php:463 ../../include/enotify.php:26
#: ../../include/notifier.php:685
msgid "noreply"
msgstr "noreply"
@ -6346,19 +6346,14 @@ msgstr "Beitrag"
msgid "Item filed"
msgstr "Beitrag abgelegt"
#: ../../include/diaspora.php:590
#: ../../include/diaspora.php:593
msgid "Sharing notification from Diaspora network"
msgstr "Freigabe-Benachrichtigung von Diaspora"
#: ../../include/diaspora.php:1977
#: ../../include/diaspora.php:2037
msgid "Attachments:"
msgstr "Anhänge:"
#: ../../include/diaspora.php:2168
#, php-format
msgid "[Relayed] Comment authored by %s from network %s"
msgstr "[Weitergeleitet] Kommentar von %s aus dem %s Netzwerk"
#: ../../include/network.php:824
msgid "view full size"
msgstr "Volle Größe anzeigen"
@ -7111,7 +7106,7 @@ msgstr "mag ich nicht"
#: ../../include/conversation.php:557
msgid "Share this"
msgstr "Teile dieses"
msgstr "Weitersagen"
#: ../../include/conversation.php:557
msgid "share"

View file

@ -472,7 +472,7 @@ $a->strings["Permit unknown people to send you private mail?"] = "Dürfen dir Un
$a->strings["Profile is <strong>not published</strong>."] = "Profil ist <strong>nicht veröffentlicht</strong>.";
$a->strings["or"] = "oder";
$a->strings["Your Identity Address is"] = "Die Adresse deines Profils lautet:";
$a->strings["Automatically expire posts after this many days:"] = "Beiträge verfallen automatisch nach dieser Anzahl von Tagen";
$a->strings["Automatically expire posts after this many days:"] = "Beiträge verfallen automatisch nach dieser Anzahl von Tagen:";
$a->strings["If empty, posts will not expire. Expired posts will be deleted"] = "Wenn leer verfallen Beiträge nie automatisch. Verfallene Beiträge werden gelöscht.";
$a->strings["Advanced expiration settings"] = "Erweiterte Verfallseinstellungen";
$a->strings["Advanced Expiration"] = "Erweitertes Verfallen";
@ -480,7 +480,7 @@ $a->strings["Expire posts:"] = "Beiträge verfallen lassen:";
$a->strings["Expire personal notes:"] = "Persönliche Notizen verfallen lassen:";
$a->strings["Expire starred posts:"] = "Markierte Beiträge verfallen lassen:";
$a->strings["Expire photos:"] = "Fotos verfallen lassen:";
$a->strings["Only expire posts by others:"] = "Nur Beiträge anderer verfallen";
$a->strings["Only expire posts by others:"] = "Nur Beiträge anderer verfallen:";
$a->strings["Account Settings"] = "Kontoeinstellungen";
$a->strings["Password Settings"] = "Passwort-Einstellungen";
$a->strings["New Password:"] = "Neues Passwort:";
@ -491,7 +491,7 @@ $a->strings["Full Name:"] = "Kompletter Name:";
$a->strings["Email Address:"] = "E-Mail-Adresse:";
$a->strings["Your Timezone:"] = "Deine Zeitzone:";
$a->strings["Default Post Location:"] = "Standardstandort:";
$a->strings["Use Browser Location:"] = "Verwende den Standort des Browsers:";
$a->strings["Use Browser Location:"] = "Standort des Browsers verwenden:";
$a->strings["Security and Privacy Settings"] = "Sicherheits- und Privatsphäre-Einstellungen";
$a->strings["Maximum Friend Requests/Day:"] = "Maximale Anzahl von Freundschaftsanfragen/Tag:";
$a->strings["(to prevent spam abuse)"] = "(um SPAM zu vermeiden)";
@ -866,7 +866,7 @@ $a->strings["Title/Description:"] = "Titel/Beschreibung:";
$a->strings["Your Gender:"] = "Dein Geschlecht:";
$a->strings["Birthday (%s):"] = "Geburtstag (%s):";
$a->strings["Street Address:"] = "Adresse:";
$a->strings["Locality/City:"] = "Wohnort/Stadt:";
$a->strings["Locality/City:"] = "Wohnort:";
$a->strings["Postal/Zip Code:"] = "Postleitzahl:";
$a->strings["Country:"] = "Land:";
$a->strings["Region/State:"] = "Region/Bundesstaat:";
@ -876,7 +876,7 @@ $a->strings["Examples: cathy123, Cathy Williams, cathy@example.com"] = "Beispiel
$a->strings["Since [date]:"] = "Seit [Datum]:";
$a->strings["Sexual Preference:"] = "Sexuelle Vorlieben:";
$a->strings["Homepage URL:"] = "Adresse der Homepage:";
$a->strings["Hometown:"] = "Wohnort:";
$a->strings["Hometown:"] = "Heimatort:";
$a->strings["Political Views:"] = "Politische Ansichten:";
$a->strings["Religious Views:"] = "Religiöse Ansichten:";
$a->strings["Public Keywords:"] = "Öffentliche Schlüsselwörter:";
@ -1442,7 +1442,6 @@ $a->strings["post"] = "Beitrag";
$a->strings["Item filed"] = "Beitrag abgelegt";
$a->strings["Sharing notification from Diaspora network"] = "Freigabe-Benachrichtigung von Diaspora";
$a->strings["Attachments:"] = "Anhänge:";
$a->strings["[Relayed] Comment authored by %s from network %s"] = "[Weitergeleitet] Kommentar von %s aus dem %s Netzwerk";
$a->strings["view full size"] = "Volle Größe anzeigen";
$a->strings["Embedded content"] = "Eingebetteter Inhalt";
$a->strings["Embedding disabled"] = "Einbettungen deaktiviert";
@ -1621,7 +1620,7 @@ $a->strings["%d comment"] = array(
);
$a->strings["like"] = "mag ich";
$a->strings["dislike"] = "mag ich nicht";
$a->strings["Share this"] = "Teile dieses";
$a->strings["Share this"] = "Weitersagen";
$a->strings["share"] = "Teilen";
$a->strings["Bold"] = "Fett";
$a->strings["Italic"] = "Kursiv";

2
view/oembed_video.tpl Normal file → Executable file
View file

@ -1,4 +1,4 @@
<a href='$embedurl' onclick='this.innerHTML=Base64.decode("$escapedhtml"); return false;' style='float:left; margin: 1em; position: relative;'>
<img width='$tw' height='$th' src='$turl' >
<div style='position: absolute; top: 0px; left: 0px; width: $twpx; height: $thpx; background: url(images/icons/48/play.png) no-repeat center center;'></div>
<div style='position: absolute; top: 0px; left: 0px; width: $twpx; height: $thpx; background: url($baseurl/images/icons/48/play.png) no-repeat center center;'></div>
</a>

View file

@ -1,3 +1,4 @@
<a name="$item.id" />
<div class="wall-item-outside-wrapper$item.indent$item.previewing" id="wall-item-outside-wrapper-$item.id" >
<div class="wall-item-content-wrapper$item.indent" id="wall-item-content-wrapper-$item.id" >
<div class="wall-item-info" id="wall-item-info-$item.id">

View file

@ -35,5 +35,5 @@
});
});
</script>
<div id="events-reminder"></div>
<div id="events-reminder" class="$classtoday"></div>
<br>

View file

@ -13,6 +13,10 @@
background: none;
}
.widget {
/* box-shadow: 4px 4px 3px 0 #444444; */
}
.comment-edit-text-empty, .comment-edit-text-full {
border: none;
border-left: 1px solid #EEE;
@ -50,14 +54,23 @@ nav #site-location {
color: #000000;
}
.fc {
#events-reminder {
border-radius: 3px;
-moz-border-radius: 3px;
opacity: 0.3;
filter:alpha(opacity=30);
}
.fc:hover {
#events-reminder.birthday-today, #events-reminder.event-today {
opacity: 1.0;
filter:alpha(opacity=100);
box-shadow: 4px 4px 3px 0 #444444;
}
#events-reminder:hover {
opacity: 1.0;
filter:alpha(opacity=100);
box-shadow: 4px 4px 3px 0 #444444;
}
.fc-event-skin {
@ -75,7 +88,7 @@ nav #site-location {
box-shadow: 4px 4px 3px 0 #444444;
}
.contact-entry-photo img, .profile-match-photo img, #photo-photo img, .directory-photo-img, .photo-album-photo, .photo-top-photo, .fc, .profile-jot-text, .group-selected, .nets-selected, .fileas-selected, #profile-jot-submit, .categories-selected {
.contact-entry-photo img, .profile-match-photo img, #photo-photo img, .directory-photo-img, .photo-album-photo, .photo-top-photo, .profile-jot-text, .group-selected, .nets-selected, .fileas-selected, #profile-jot-submit, .categories-selected {
border-radius: 3px;
-moz-border-radius: 3px;
box-shadow: 4px 4px 3px 0 #444444;

View file

@ -1,3 +1,4 @@
<a name="$item.id" />
<div class="wall-item-outside-wrapper$item.indent$item.previewing" id="wall-item-outside-wrapper-$item.id" >
<div class="wall-item-content-wrapper$item.indent" id="wall-item-content-wrapper-$item.id" >
<div class="wall-item-info" id="wall-item-info-$item.id">

View file

@ -1,3 +1,4 @@
<a name="$item.id" />
<div class="wall-item-outside-wrapper$item.indent$item.previewing wallwall" id="wall-item-outside-wrapper-$item.id" >
<div class="wall-item-content-wrapper$item.indent" id="wall-item-content-wrapper-$item.id" >
<div class="wall-item-info wallwall" id="wall-item-info-$item.id">