mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
* Add MIME types for file attachments
* Restore translatability to mood phrases * Prevent casting of "false" in html2plain * Allow attachments with a comma in the filename * Fix/optimize ACL img data-src jQuery search * Fix bug when uploading files with a comma in the name using Chrome/Chromium * Babel nicer output formatting * Remove obsolete "plaintext" check in mod/parse_url * Restore TinyMCE live insertion of images * Smarty conversion script: add --no-header option to suppress warning headers in Smarty template files
This commit is contained in:
parent
d62483f526
commit
74caf1a4a7
29 changed files with 75 additions and 62 deletions
|
@ -42,6 +42,10 @@ function z_mime_content_type($filename) {
|
|||
'qt' => 'video/quicktime',
|
||||
'mov' => 'video/quicktime',
|
||||
'ogg' => 'application/ogg',
|
||||
'mp4' => 'video/mp4',
|
||||
'avi' => 'video/x-msvideo',
|
||||
'wmv' => 'video/x-ms-wmv',
|
||||
'wma' => 'audio/x-ms-wma',
|
||||
|
||||
// adobe
|
||||
'pdf' => 'application/pdf',
|
||||
|
|
|
@ -877,26 +877,21 @@ function format_like($cnt,$arr,$type,$id) {
|
|||
if($cnt == 1)
|
||||
$o .= (($type === 'like') ? sprintf( t('%s likes this.'), $arr[0]) : sprintf( t('%s doesn\'t like this.'), $arr[0])) . EOL ;
|
||||
else {
|
||||
//$spanatts = 'class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');"';
|
||||
$spanatts = "class=\"fakelink\" onclick=\"openClose('{$type}list-$id');\"";
|
||||
switch($type) {
|
||||
case 'like':
|
||||
// $phrase = sprintf( t('<span %1$s>%2$d people</span> like this.'), $spanatts, $cnt);
|
||||
$mood = t('like this');
|
||||
$phrase = sprintf( t('<span %1$s>%2$d people</span> like this'), $spanatts, $cnt);
|
||||
break;
|
||||
case 'dislike':
|
||||
// $phrase = sprintf( t('<span %1$s>%2$d people</span> don\'t like this.'), $spanatts, $cnt);
|
||||
$mood = t('don\'t like this');
|
||||
$phrase = sprintf( t('<span %1$s>%2$d people</span> don\'t like this'), $spanatts, $cnt);
|
||||
break;
|
||||
}
|
||||
$tpl = get_markup_template("voting_fakelink.tpl");
|
||||
$phrase = replace_macros($tpl, array(
|
||||
'$vote_id' => $type . 'list-' . $id,
|
||||
'$count' => $cnt,
|
||||
'$people' => t('people'),
|
||||
'$vote_mood' => $mood
|
||||
$phrase .= EOL ;
|
||||
$o .= replace_macros(get_markup_template('voting_fakelink.tpl'), array(
|
||||
'$phrase' => $phrase,
|
||||
'$type' => $type,
|
||||
'$id' => $id
|
||||
));
|
||||
$o .= $phrase;
|
||||
// $o .= EOL ;
|
||||
|
||||
$total = count($arr);
|
||||
if($total >= MAX_LIKERS)
|
||||
|
|
|
@ -209,7 +209,7 @@ function html2plain($html, $wraplength = 75, $compact = false)
|
|||
if (!$compact) {
|
||||
$counter = 1;
|
||||
foreach ($urls as $id=>$url)
|
||||
if (strpos($message, $url) == false)
|
||||
if (strpos($message, $url) === false)
|
||||
$message .= "\n".$url." ";
|
||||
//$message .= "\n[".($counter++)."] ".$url;
|
||||
}
|
||||
|
|
|
@ -3732,11 +3732,11 @@ function item_getfeedtags($item) {
|
|||
|
||||
function item_getfeedattach($item) {
|
||||
$ret = '';
|
||||
$arr = explode(',',$item['attach']);
|
||||
$arr = explode('[/attach],',$item['attach']);
|
||||
if(count($arr)) {
|
||||
foreach($arr as $r) {
|
||||
$matches = false;
|
||||
$cnt = preg_match('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"\[\/attach\]|',$r,$matches);
|
||||
$cnt = preg_match('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"|',$r,$matches);
|
||||
if($cnt) {
|
||||
$ret .= '<link rel="enclosure" href="' . xmlify($matches[1]) . '" type="' . xmlify($matches[3]) . '" ';
|
||||
if(intval($matches[2]))
|
||||
|
|
|
@ -37,6 +37,7 @@ require_once('include/html2plain.php');
|
|||
* tag (in photos.php, poke.php, tagger.php)
|
||||
* tgroup (in items.php)
|
||||
* wall-new (in photos.php, item.php)
|
||||
* removeme (in Contact.php)
|
||||
*
|
||||
* and ITEM_ID is the id of the item in the database that needs to be sent to others.
|
||||
*/
|
||||
|
@ -138,14 +139,17 @@ function notifier_run(&$argv, &$argc){
|
|||
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval($item_id));
|
||||
if (! $r)
|
||||
return;
|
||||
|
||||
$user = $r[0];
|
||||
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1", intval($item_id));
|
||||
if (! $r)
|
||||
return;
|
||||
|
||||
$self = $r[0];
|
||||
$r = q("SELECT * FROM `contact` WHERE `self` = 0 AND `uid` = %d", intval($item_id));
|
||||
if(! $r)
|
||||
return;
|
||||
|
||||
require_once('include/Contact.php');
|
||||
foreach($r as $contact) {
|
||||
terminate_friendship($user, $self, $contact);
|
||||
|
|
|
@ -1041,13 +1041,13 @@ function prepare_body($item,$attach = false) {
|
|||
return $s;
|
||||
}
|
||||
|
||||
$arr = explode(',',$item['attach']);
|
||||
$arr = explode('[/attach],',$item['attach']);
|
||||
if(count($arr)) {
|
||||
$s .= '<div class="body-attach">';
|
||||
foreach($arr as $r) {
|
||||
$matches = false;
|
||||
$icon = '';
|
||||
$cnt = preg_match_all('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"\[\/attach\]|',$r,$matches, PREG_SET_ORDER);
|
||||
$cnt = preg_match_all('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"|',$r,$matches, PREG_SET_ORDER);
|
||||
if($cnt) {
|
||||
foreach($matches as $mtch) {
|
||||
$icontype = strtolower(substr($mtch[3],0,strpos($mtch[3],'/')));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue