]> git.mxchange.org Git - friendica.git/commitdiff
Merge remote branch 'upstream/master'
authorzottel <github@zottel.net>
Mon, 19 Mar 2012 11:32:07 +0000 (12:32 +0100)
committerzottel <github@zottel.net>
Mon, 19 Mar 2012 11:32:07 +0000 (12:32 +0100)
include/text.php
mod/photos.php

index 89acbf9fabc3d2acc4376f2100c0a53f0c6cd1da..a0ff1600ed4bcb4a9c961e50c83b4324e831c55b 100644 (file)
@@ -694,8 +694,13 @@ function linkify($s) {
 
 if(! function_exists('smilies')) {
 function smilies($s, $sample = false) {
+
        $a = get_app();
 
+       if(intval(get_config('system','no_smilies')) 
+               || (local_user() && intval(get_pconfig(local_user(),'system','no_smilies'))))
+               return $s;
+
        $s = preg_replace_callback('/<pre>(.*?)<\/pre>/ism','smile_encode',$s);
        $s = preg_replace_callback('/<code>(.*?)<\/code>/ism','smile_encode',$s);
 
index 4406780d3de5667a35f1bfda783cac97c0bc4ac4..b294f0a666c91231d4a7f1e42cd53fdee2f48947 100755 (executable)
@@ -1069,7 +1069,7 @@ function photos_content(&$a) {
                if($can_post && ($ph[0]['uid'] == $owner_uid)) {
                        $tools = array(
                                'edit'  => array($a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? t('View photo') : t('Edit photo'))),
-                               'profile'=>array($a->get_baseurl() . '/profile_photo/use/'.$ph[0]['resource-id'] . '?form_security_token=' . get_form_security_token('profile_photo'), t('Use as profile photo')),
+                               'profile'=>array($a->get_baseurl() . '/profile_photo/use/'.$ph[0]['resource-id'], t('Use as profile photo')),
                        );
 
                        // lock
@@ -1081,6 +1081,17 @@ function photos_content(&$a) {
                        
                }
 
+               if(! $cmd !== 'edit') {
+                       $a->page['htmlhead'] .= '<script>
+                               $(document).keydown(function(event) {' . "\n";
+
+                       if($prevlink)
+                               $a->page['htmlhead'] .= 'if(event.ctrlKey && event.keyCode == 37) { event.preventDefault(); window.location.href = \'' . $prevlink . '\'; }' . "\n";
+                       if($nextlink)
+                               $a->page['htmlhead'] .= 'if(event.ctrlKey && event.keyCode == 39) { event.preventDefault(); window.location.href = \'' . $nextlink . '\'; }' . "\n";
+                       $a->page['htmlhead'] .= '});</script>';
+               }
+
                if($prevlink)
                        $prevlink = array($prevlink, '<div class="icon prev"></div>') ;