]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch 'master' of https://github.com/erikl/friendika into erikl-master
authorFriendika <info@friendika.com>
Thu, 24 Mar 2011 11:06:01 +0000 (04:06 -0700)
committerFriendika <info@friendika.com>
Thu, 24 Mar 2011 11:06:01 +0000 (04:06 -0700)
46 files changed:
addon/facebook/facebook.php
boot.php
database.sql
images/audio.gif [new file with mode: 0644]
images/remote-link.gif
images/share.gif [new file with mode: 0644]
images/video.gif [new file with mode: 0644]
include/bbcode.php
include/dba.php
include/expire.php [new file with mode: 0644]
include/fcontact.php [new file with mode: 0644]
include/items.php
include/notifier.php
include/poller.php
index.php
mod/directory.php
mod/display.php
mod/item.php
mod/network.php
mod/photos.php
mod/profile.php
mod/profile_photo.php
mod/profiles.php
mod/register.php
mod/search.php
mod/settings.php
mod/share.php [new file with mode: 0644]
update.php
view/de/jot-header.tpl
view/de/profile_edit.tpl
view/de/settings.tpl
view/en/jot-header.tpl
view/en/profile_edit.tpl
view/en/settings.tpl
view/fr/jot-header.tpl
view/fr/profile_edit.tpl
view/fr/settings.tpl
view/fr/strings.php
view/it/jot-header.tpl
view/it/profile_edit.tpl
view/it/settings.tpl
view/jot.tpl
view/like.tpl
view/like_noshare.tpl [new file with mode: 0644]
view/theme/duepuntozero/style.css
view/theme/loozah/style.css

index edfc5a374cc354b4ba7e7af18ea7a1b01ea72552..e1ea6673be807d3d3a1be281f6aa6e790d8ce17f 100644 (file)
@@ -225,7 +225,7 @@ function facebook_post_hook(&$a,&$b) {
 
                                // make links readable before we strip the code
 
-                               $msg = preg_replace("/\[url=(.+?)\](.+?)\[\/url\]/is",'$2 [$1]',$msg);
+                               $msg = preg_replace("/\[url=(.+?)\](.+?)\[\/url\]/is",'$2 $1',$msg);
 
                                $msg = preg_replace("/\[img\](.+?)\[\/img\]/is", t('Image: ') . '$1',$msg);
 
index 4c3a923dcea2e52644dea55e826aface43047192..389ea93a97cacb5a4bc403e8e4a42c643702a4d7 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2,9 +2,9 @@
 
 set_time_limit(0);
 
-define ( 'FRIENDIKA_VERSION',      '2.1.913' );
+define ( 'FRIENDIKA_VERSION',      '2.1.921' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.1'  );
-define ( 'DB_UPDATE_VERSION',      1040   );
+define ( 'DB_UPDATE_VERSION',      1043   );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
@@ -2423,11 +2423,19 @@ function get_birthdays() {
        );
 
        if($r && count($r)) {
-               $o .= '<div id="birthday-wrapper"><div id="birthday-title">' . t('Birthdays this week:') . '</div>'; 
+               $total = 0;
+               foreach($r as $rr)
+                       if(strlen($rr['name']))
+                               $total ++;
+
+               $o .= '<div id="birthday-notice" class="birthday-notice fakelink" onclick=openClose(\'birthday-wrapper\'); >' . t('Birthday Reminders') . ' ' . '(' . $total . ')' . '</div>'; 
+               $o .= '<div id="birthday-wrapper" style="display: none;" ><div id="birthday-title">' . t('Birthdays this week:') . '</div>'; 
                $o .= '<div id="birthday-adjust">' . t("\x28Adjusted for local time\x29") . '</div>';
                $o .= '<div id="birthday-title-end"></div>';
 
                foreach($r as $rr) {
+                       if(! strlen($rr['name']))
+                               continue;
                        $now = strtotime('now');
                        $today = (((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now)) ? true : false); 
 
@@ -2437,7 +2445,7 @@ function get_birthdays() {
                        . '</div>' ;
                }
 
-               $o .= '</div>';
+               $o .= '</div></div>';
        }
 
   return $o;
index f47a5967eabf047394750c8c434524742f80d232..0ecf0ea200e006e842a2bba5d562e77a3ed5ed5b 100644 (file)
@@ -297,7 +297,8 @@ CREATE TABLE IF NOT EXISTS `profile` (
   `sexual` char(255) NOT NULL,
   `politic` char(255) NOT NULL,
   `religion` char(255) NOT NULL,
-  `keywords` text NOT NULL,
+  `pub_keywords` text NOT NULL,
+  `prv_keywords` text NOT NULL,
   `about` text NOT NULL,
   `summary` char(255) NOT NULL,
   `music` text NOT NULL,
@@ -378,6 +379,7 @@ CREATE TABLE IF NOT EXISTS `user` (
   `page-flags` int(11) unsigned NOT NULL DEFAULT '0',
   `pwdreset` char(255) NOT NULL,
   `maxreq` int(11) NOT NULL DEFAULT '10',
+  `expire` int(11) unsigned NOT NULL DEFAULT '0',
   `allow_cid` mediumtext NOT NULL, 
   `allow_gid` mediumtext NOT NULL,
   `deny_cid` mediumtext NOT NULL, 
@@ -479,3 +481,19 @@ CREATE TABLE IF NOT EXISTS `cache` (
  `v` TEXT NOT NULL,
  `updated` DATETIME NOT NULL
 ) ENGINE = MYISAM DEFAULT CHARSET=utf8;
+
+
+CREATE TABLE IF NOT EXISTS `fcontact` (
+`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`url` CHAR( 255 ) NOT NULL ,
+`name` CHAR( 255 ) NOT NULL ,
+`photo` CHAR( 255 ) NOT NULL
+) ENGINE = MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `ffinder` (
+`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`uid` INT UNSIGNED NOT NULL ,
+`cid` INT UNSIGNED NOT NULL ,
+`fid` INT UNSIGNED NOT NULL
+) ENGINE = MYISAM DEFAULT CHARSET=utf8;
+
diff --git a/images/audio.gif b/images/audio.gif
new file mode 100644 (file)
index 0000000..4be9771
Binary files /dev/null and b/images/audio.gif differ
index 008397fe8d957604ef4be8ec2ab96f4f1b6805b0..1224e3db5fb7f8c72353b5291029ef1ef965dbd3 100644 (file)
Binary files a/images/remote-link.gif and b/images/remote-link.gif differ
diff --git a/images/share.gif b/images/share.gif
new file mode 100644 (file)
index 0000000..035fa2e
Binary files /dev/null and b/images/share.gif differ
diff --git a/images/video.gif b/images/video.gif
new file mode 100644 (file)
index 0000000..e4d5e8c
Binary files /dev/null and b/images/video.gif differ
index 978b4af692bdafd87c0d8337afc8d33743a0e3da..4caf187666852b26739f815366e86453b2cc89ce 100644 (file)
@@ -90,7 +90,7 @@ function bbcode($Text) {
        $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.+?)\[\/img\]/", '<img src="$3" height="$2" width="$1">', $Text);
 
        // Youtube extensions
-        $Text = preg_replace("/\[youtube\]http:\/\/www.youtube.com\/watch\?v\=(.+?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); 
+        $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.+?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); 
        $Text = preg_replace("/\[youtube\](.+?)\[\/youtube\]/", '<object width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/$1" ><param name="movie" value="http://www.youtube.com/v/$1"></param><!--[if IE]><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350" /><![endif]--></object>', $Text);
 
        // oembed tag
index d75ed560ab7eb30f7f1d98fc44fa6a073b403205..e2f369f199fd2252a78a00c28b69e73e03567401 100644 (file)
@@ -19,6 +19,23 @@ class dba {
        public  $connected = false;
 
        function __construct($server,$user,$pass,$db,$install = false) {
+
+               $server = trim($server);
+               $user = trim($user);
+               $pass = trim($pass);
+               $db = trim($db);
+
+               if($install) {
+                       if(strlen($server) && ($server !== 'localhost') && ($server !== '127.0.0.1')) {
+                               if(! dns_get_record($server, DNS_A + DNS_CNAME + DNS_PTR)) {
+                                       notice( sprintf( t('Cannot locate DNS info for database server \'%s\'',$server)));
+                                       $this->connected = false;
+                                       $this->db = null;
+                                       return;
+                               }
+                       }
+               }
+
                $this->db = @new mysqli($server,$user,$pass,$db);
                if(! mysqli_connect_errno()) {
                        $this->connected = true;
@@ -61,7 +78,7 @@ class dba {
                }
                else {
 
-                       /*
+                       /**
                         * If dbfail.out exists, we will write any failed calls directly to it,
                         * regardless of any logging that may or may nor be in effect.
                         * These usually indicate SQL syntax errors that need to be resolved.
diff --git a/include/expire.php b/include/expire.php
new file mode 100644 (file)
index 0000000..3c30e01
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+
+require_once("boot.php");
+
+function expire_run($argv, $argc){
+       global $a, $db;
+
+       if(is_null($a)) {
+               $a = new App;
+       }
+  
+       if(is_null($db)) {
+           @include(".htconfig.php");
+       require_once("dba.php");
+           $db = new dba($db_host, $db_user, $db_pass, $db_data);
+       unset($db_host, $db_user, $db_pass, $db_data);
+       };
+
+       require_once('session.php');
+       require_once('datetime.php');
+       require_once('simplepie/simplepie.inc');
+       require_once('include/items.php');
+       require_once('include/Contact.php');
+
+       $a->set_baseurl(get_config('system','url'));
+
+
+       logger('expire: start');
+       
+       $r = q("SELECT `uid`,`username`,`expire` FROM `user` WHERE `expire` != 0");
+       if(count($r)) {
+               foreach($r as $rr) {
+                       logger('Expire: ' . $rr['username'] . ' interval: ' . $rr['expire'], LOGGER_DEBUG);
+                       item_expire($rr['uid'],$rr['expire']);
+               }
+       }
+
+       return;
+}
+
+if (array_search(__file__,get_included_files())===0){
+  expire_run($argv,$argc);
+  killme();
+}
diff --git a/include/fcontact.php b/include/fcontact.php
new file mode 100644 (file)
index 0000000..8821a98
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+
+
+
+function fcontact_store($url,$name,$photo) {
+
+       $nurl = str_replace(array('https:','//www.'), array('http:','//'), $url);
+
+       $r = q("SELECT `id` FROM `fcontact` WHERE `url` = '%s' LIMIT 1",
+               dbesc($nurl)
+       );
+
+       if(count($r))
+               return $r[0]['id'];
+
+       $r = q("INSERT INTO `fcontact` ( `url`, `name`, `photo` ) VALUES ( '%s', '%s', '%s' ) ",
+               dbesc($nurl),
+               dbesc($name),
+               dbesc($photo)
+       );
+
+       if($r) {
+               $r = q("SELECT `id` FROM `fcontact` WHERE `url` = '%s' LIMIT 1",
+                       dbesc($nurl)
+               );
+               if(count($r))
+                       return $r[0]['id'];
+       }
+
+       return 0;
+}
+
+function ffinder_store($uid,$cid,$fid) {
+       $r = q("INSERT INTO `ffinder` ( `uid`, `cid`, `fid` ) VALUES ( %d, %d, %d ) ",
+               intval($uid),
+               intval($cid),
+               intval($fid)
+       );
+       return $r;
+}
+
index e930ab5d25532de4bfc2be4fcbe1308a3bfb0639..05165932183b8871bee966462d1f9794185bc326 100644 (file)
@@ -401,6 +401,17 @@ function get_atom_elements($feed,$item) {
                $res['edited'] = $item->get_date('c');
 
 
+       // Disallow time travelling posts
+
+       $d1 = strtotime($res['created']);
+       $d2 = strtotime($res['edited']);
+       $d3 = strtotime('now');
+
+       if($d1 > $d3)
+               $res['created'] = datetime_convert();
+       if($d2 > $d3)
+               $res['edited'] = datetime_convert();
+
        $rawowner = $item->get_item_tags(NAMESPACE_DFRN, 'owner');
        if($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])
                $res['owner-name'] = unxmlify($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']);
@@ -702,6 +713,18 @@ function item_store($arr,$force_parent = false) {
                intval($current_post)
        );
 
+       /**
+        * If this is now the last-child, force all _other_ children of this parent to *not* be last-child
+        */
+
+       if($arr['last-child']) {
+               $r = q("UPDATE `item` SET `last-child` = 0 WHERE `parent-uri` = '%s' AND `uid` = %d AND `id` != %d",
+                       dbesc($arr['uri']),
+                       intval($arr['uid']),
+                       intval($current_post)
+               );
+       }
+
        return $current_post;
 }
 
@@ -1484,3 +1507,49 @@ function atom_entry($item,$type,$author,$owner,$comment = false) {
        return $o;
 }
        
+function item_expire($uid,$days) {
+
+       if((! $uid) || (! $days))
+               return;
+
+       $r = q("SELECT * FROM `item` 
+               WHERE `uid` = %d 
+               AND `created` < UTC_TIMESTAMP() - INTERVAL %d DAY 
+               AND `id` = `parent` 
+               AND `deleted` = 0",
+               intval($uid),
+               intval($days)
+       );
+
+       if(! count($r))
+               return;
+       logger('expire: # items=' . count($r) );
+
+       foreach($r as $item) {
+
+               // Only expire posts, not photos and photo comments
+
+               if(strlen($item['resource-id']))
+                       continue;
+
+               $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `id` = %d LIMIT 1",
+                       dbesc(datetime_convert()),
+                       dbesc(datetime_convert()),
+                       intval($item['id'])
+               );
+
+               // kill the kids
+
+               $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d ",
+                       dbesc(datetime_convert()),
+                       dbesc(datetime_convert()),
+                       dbesc($item['parent-uri']),
+                       intval($item['uid'])
+               );
+
+       }
+
+       proc_run('php',"include/notifier.php","expire","$uid");
+
+}
\ No newline at end of file
index 648a07062c02aa0104ffd6571fc4c76f2ea1cbe4..ca2304845ed276655aa009c8d7717e72b3b31e65 100644 (file)
@@ -40,6 +40,7 @@ function notifier_run($argv, $argc){
                        break;
        }
 
+       $expire = false;
        $top_level = false;
        $recipients = array();
        $url_recipients = array();
@@ -57,6 +58,17 @@ function notifier_run($argv, $argc){
                $item = $message[0];
 
        }
+       elseif($cmd === 'expire') {
+               $expire = true;
+               $items = q("SELECT * FROM `item` WHERE `uid` = %d AND `wall` = 1 
+                       AND `deleted` = 1 AND `changed` > UTC_TIMESTAMP - INTERVAL 10 MINUTE",
+                       intval($item_id)
+               );
+               $uid = $item_id;
+               $item_id = 0;
+               if(! count($items))
+                       return;
+       }
        else {
 
                // find ancestors
@@ -76,11 +88,10 @@ function notifier_run($argv, $argc){
                        intval($parent_id)
                );
 
-               if(! count($items)){
+               if(! count($items)) {
                        return;
                }
 
-
                // avoid race condition with deleting entries
 
                if($items[0]['deleted']) {
@@ -98,11 +109,11 @@ function notifier_run($argv, $argc){
                intval($uid)
        );
 
-       if(count($r))
-               $owner = $r[0];
-       else {
+       if(! count($r))
                return;
-       }
+
+       $owner = $r[0];
+
        $hub = get_config('system','huburl');
 
        // If this is a public conversation, notify the feed hub
@@ -117,7 +128,7 @@ function notifier_run($argv, $argc){
 
                $parent = $items[0];
 
-               if($parent['type'] === 'remote') {
+               if($parent['type'] === 'remote' && (! $expire)) {
                        // local followup to remote post
                        $followup = true;
                        $notify_hub = false; // not public
@@ -235,6 +246,7 @@ function notifier_run($argv, $argc){
                }
                else {
                        foreach($items as $item) {
+
                                if(! $item['parent'])
                                        continue;
 
@@ -242,9 +254,9 @@ function notifier_run($argv, $argc){
                                if(! $contact)
                                        continue;
 
-                               $atom   .= atom_entry($item,'text',$contact,$owner,true);
+                               $atom .= atom_entry($item,'text',$contact,$owner,true);
 
-                               if(($top_level) && ($notify_hub) && ($item['author-link'] === $item['owner-link'])) 
+                               if(($top_level) && ($notify_hub) && ($item['author-link'] === $item['owner-link']) && (! $expire)
                                        $slaps[] = atom_entry($item,'html',$contact,$owner,true);
                        }
                }
@@ -319,7 +331,7 @@ function notifier_run($argv, $argc){
                                                // only send salmon if public - e.g. if it's ok to notify
                                                // a public hub, it's ok to send a salmon
 
-                                               if(count($slaps) && $notify_hub) {
+                                               if((count($slaps)) && ($notify_hub) && (! $expire)) {
                                                        logger('notifier: slapdelivery: ' . $contact['name']);
                                                        foreach($slaps as $slappy) {
                                                                if($contact['notify']) {
@@ -350,7 +362,7 @@ function notifier_run($argv, $argc){
                
        // send additional slaps to mentioned remote tags (@foo@example.com)
 
-       if($slap && count($url_recipients) && $followup && $notify_hub) {
+       if($slap && count($url_recipients) && $followup && $notify_hub && (! $expire)) {
                foreach($url_recipients as $url) {
                        if($url) {
                                logger('notifier: urldelivery: ' . $url);
index a093190a60e9b1f02784f5f6b288e404938ca119..8619697d9661d3697f1f20e5ed00d0b7e013208b 100644 (file)
@@ -29,6 +29,17 @@ function poller_run($argv, $argc){
 
        proc_run('php',"include/queue.php");
        
+       // once daily run expire in background
+
+       $d1 = get_config('system','last_expire_day');
+       $d2 = intval(datetime_convert('UTC','UTC','now','d'));
+
+       if($d2 != intval($d1)) {
+               set_config('system','last_expire_day',$d2);
+               proc_run('php','include/expire.php');
+       }
+
+
        // clear old cache
        q("DELETE FROM `cache` WHERE `updated` < '%s'",
                dbesc(datetime_convert('UTC','UTC',"now - 30 days")));
index 01d8eb2a1333b3670eba575961df4338d9b6952f..ab722df2aa3533ff5a99058473213ee771a6281e 100644 (file)
--- a/index.php
+++ b/index.php
@@ -31,10 +31,17 @@ $install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false
  *
  * Get the language setting directly from system variables, bypassing get_config()
  * as database may not yet be configured.
+ * 
+ * If possible, we use the value from the browser.
  *
  */
 
-$lang = ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
+if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+       $langs = preg_split("/[,-]/",$_SERVER['HTTP_ACCEPT_LANGUAGE'],2);
+       $lang = $langs[0];
+} else {
+       $lang = ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
+}
        
 load_translation_table($lang);
 
@@ -102,8 +109,9 @@ if(! x($_SESSION,'sysmsg'))
        $_SESSION['sysmsg'] = '';
 
 /*
- * check_config() is responible for running update scripts. These automatically 
- * update the DB schema whenever  we push a new one out. 
+ * check_config() is responsible for running update scripts. These automatically 
+ * update the DB schema whenever we push a new one out. It also checks to see if
+ * any plugins have been added or removed and reacts accordingly. 
  */
 
 
@@ -122,7 +130,7 @@ $a->apps = $arr['app_menu'];
 
 /**
  *
- * We have already parsed the server path into $->argc and $a->argv
+ * We have already parsed the server path into $a->argc and $a->argv
  *
  * $a->argv[0] is our module name. We will load the file mod/{$a->argv[0]}.php
  * and use it for handling our URL request.
@@ -130,7 +138,7 @@ $a->apps = $arr['app_menu'];
  * and in the following order:
  * 
  * "module"_init
- * "module"_post (only if there are $_POST variables)
+ * "module"_post (only called if there are $_POST variables)
  * "module"_afterpost
  * "module"_content - the string return of this function contains our page body
  *
@@ -140,15 +148,42 @@ $a->apps = $arr['app_menu'];
  */
 
 if(strlen($a->module)) {
+
+       /**
+        *
+        * We will always have a module name.
+        * First see if we have a plugin which is masquerading as a module.
+        *
+        */
+
        if(is_array($a->plugins) && in_array($a->module,$a->plugins) && file_exists("addon/{$a->module}/{$a->module}.php")) {
                include_once("addon/{$a->module}/{$a->module}.php");
                if(function_exists($a->module . '_module'))
                        $a->module_loaded = true;
        }
+
+       /**
+        * If not, next look for a 'standard' program module in the 'mod' directory
+        */
+
        if((! $a->module_loaded) && (file_exists("mod/{$a->module}.php"))) {
-               include("mod/{$a->module}.php");
+               include_once("mod/{$a->module}.php");
                $a->module_loaded = true;
        }
+
+       /**
+        *
+        * The URL provided does not resolve to a valid module.
+        *
+        * On Dreamhost sites, quite often things go wrong for no apparent reason and they send us to '/internal_error.html'. 
+        * We don't like doing this, but as it occasionally accounts for 10-20% or more of all site traffic - 
+        * we are going to trap this and redirect back to the requested page. As long as you don't have a critical error on your page
+        * this will often succeed and eventually do the right thing.
+        *
+        * Otherwise we are going to emit a 404 not found.
+        *
+        */
+
        if(! $a->module_loaded) {
                if((x($_SERVER,'QUERY_STRING')) && ($_SERVER['QUERY_STRING'] === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
                        logger('index.php: dreamhost_error_hack invoked. Original URI =' . $_SERVER['REQUEST_URI']);
@@ -199,7 +234,7 @@ if($a->module_loaded) {
 
 }
 
-// let javascript take you home
+// If you're just visiting, let javascript take you home
 
 if(x($_SESSION,'visitor_home'))
        $homebase = $_SESSION['visitor_home'];
index 0504ac321c1e80d667538895f0e3728dd420d948..825e2a375f7e59509f54507e0e3c5e552b2350a3 100644 (file)
@@ -40,7 +40,7 @@ function directory_content(&$a) {
 
        if($search)
                $search = dbesc($search);
-       $sql_extra = ((strlen($search)) ? " AND MATCH (`profile`.`name`, `user`.`nickname`, `pdesc`, `locality`,`region`,`country-name`,`gender`,`marital`,`sexual`,`about`,`romance`,`work`,`education`,`keywords` ) AGAINST ('$search' IN BOOLEAN MODE) " : "");
+       $sql_extra = ((strlen($search)) ? " AND MATCH (`profile`.`name`, `user`.`nickname`, `pdesc`, `locality`,`region`,`country-name`,`gender`,`marital`,`sexual`,`about`,`romance`,`work`,`education`,`pub_keywords`,`prv_keywords` ) AGAINST ('$search' IN BOOLEAN MODE) " : "");
 
        $publish = ((get_config('system','publish_all')) ? '' : " AND `publish` = 1 " );
 
index 096ea16c9b7d432b3de449008866e7c8ddd0d482..059952adca8e11b89112ebadc9880e6dd2d6472d 100644 (file)
@@ -104,7 +104,7 @@ function display_content(&$a) {
 
 
        $cmnt_tpl = load_view_file('view/comment_item.tpl');
-       $like_tpl = load_view_file('view/like.tpl');
+       $like_tpl = load_view_file('view/like_noshare.tpl');
        $tpl = load_view_file('view/wall_item.tpl');
        $wallwall = load_view_file('view/wallwall_item.tpl');
 
@@ -155,6 +155,7 @@ function display_content(&$a) {
                                                '$id' => $item['id'],
                                                '$likethis' => t("I like this \x28toggle\x29"),
                                                '$nolike' => t("I don't like this \x28toggle\x29"),
+                                               '$share' => t('Share'),
                                                '$wait' => t('Please wait') 
                                        ));
                                }
index 5989d096745422dc0cf9c238d3efd53256944a38..6e6e822d0cfe1ac9d973f864141837499be8f6f1 100644 (file)
@@ -212,6 +212,8 @@ function item_post(&$a) {
        if(count($tags)) {
                foreach($tags as $tag) {
                        if(strpos($tag,'#') === 0) {
+                               if(strpos($tag,'[url='))
+                                       continue;
                                $basetag = str_replace('_',' ',substr($tag,1));
                                $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
                                if(strlen($str_tags))
@@ -220,6 +222,8 @@ function item_post(&$a) {
                                continue;
                        }
                        if(strpos($tag,'@') === 0) {
+                               if(strpos($tag,'[url='))
+                                       continue;
                                $stat = false;
                                $name = substr($tag,1);
                                if((strpos($name,'@')) || (strpos($name,'http://'))) {
@@ -532,7 +536,7 @@ function item_content(&$a) {
 
        require_once('include/security.php');
 
-       $uid = $_SESSION['uid'];
+       $uid = local_user();
 
        if(($a->argc == 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) {
 
index 32c7216d44e62638a2bda53f6916e22a17cb65a7..abdf59c4869fc6ae0d268c3fd7dfeedb6b733f6c 100644 (file)
@@ -92,6 +92,8 @@ function network_content(&$a, $update = 0) {
                        '$upload' => t('Upload photo'),
                        '$weblink' => t('Insert web link'),
                        '$youtube' => t('Insert YouTube video'),
+                       '$video' => t('Insert Vorbis [.ogg] video'),
+                       '$audio' => t('Insert Vorbis [.ogg] audio'),
                        '$setloc' => t('Set your location'),
                        '$noloc' => t('Clear browser location'),
                        '$wait' => t('Please wait'),
@@ -217,6 +219,7 @@ function network_content(&$a, $update = 0) {
 
        $cmnt_tpl = load_view_file('view/comment_item.tpl');
        $like_tpl = load_view_file('view/like.tpl');
+       $noshare_tpl = load_view_file('view/like_noshare.tpl');
        $tpl = load_view_file('view/wall_item.tpl');
        $wallwall = load_view_file('view/wallwall_item.tpl');
 
@@ -360,10 +363,11 @@ function network_content(&$a, $update = 0) {
 
                        $likebuttons = '';
                        if($item['id'] == $item['parent']) {
-                               $likebuttons = replace_macros($like_tpl,array(
+                               $likebuttons = replace_macros((($item['private']) ? $noshare_tpl : $like_tpl),array(
                                        '$id' => $item['id'],
                                        '$likethis' => t("I like this \x28toggle\x29"),
                                        '$nolike' => t("I don't like this \x28toggle\x29"),
+                                       '$share' => t('Share'),
                                        '$wait' => t('Please wait') 
                                ));
                        }
index 854c6ee1418f2f81e62c12f6ab4f6d8ea04d5786..4bb6e3eab47b6a96e2759d886f831aafec9bd6bb 100644 (file)
@@ -909,6 +909,32 @@ function photos_content(&$a) {
                        return;
                }
 
+               $prevlink = '';
+               $nextlink = '';
+
+               $prvnxt = q("SELECT `resource-id` FROM `photo` WHERE `album` = '%s' AND `uid` = %d AND `scale` = 0 
+                       $sql_extra ORDER BY `created` DESC ",
+                       dbesc($ph[0]['album']),
+                       intval($owner_uid)
+               ); 
+
+               if(count($prvnxt)) {
+                       for($z = 0; $z < count($prvnxt); $z++) {
+                               if($prvnxt[$z]['resource-id'] == $ph[0]['resource-id']) {
+                                       $prv = $z - 1;
+                                       $nxt = $z + 1;
+                                       if($prv < 0)
+                                               $prv = count($prvnxt) - 1;
+                                       if($nxt >= count($prvnxt))
+                                               $nxt = 0;
+                                       break;
+                               }
+                       }
+                       $prevlink = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] ;
+                       $nextlink = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] ;
+               }
+
+
                if(count($ph) == 1)
                        $hires = $lores = $ph[0];
                if(count($ph) > 1) {
@@ -938,11 +964,18 @@ function photos_content(&$a) {
                        $o .= '</div>';
                }
 
+               if($prevlink)
+                       $o .= '<div id="photo-prev-link"><a href="' . $prevlink .'">' . t('<< Prev') . '</a></div>' ;
 
-               $o .= '<a href="' . $a->get_baseurl() . '/photo/' 
+               $o .= '<div id="photo-photo"><a href="' . $a->get_baseurl() . '/photo/' 
                        . $hires['resource-id'] . '-' . $hires['scale'] . '.jpg" title="' 
                        . t('View Full Size') . '" ><img src="' . $a->get_baseurl() . '/photo/' 
-                       . $lores['resource-id'] . '-' . $lores['scale'] . '.jpg' . '" /></a>';
+                       . $lores['resource-id'] . '-' . $lores['scale'] . '.jpg' . '" /></a></div>';
+
+               if($nextlink)
+                       $o .= '<div id="photo-next-link"><a href="' . $nextlink .'">' . t('Next >>') . '</a></div>';
+
+               $o .= '<div id="photo-photo-end"></div>';
 
 
                // Do we have an item for this photo?
@@ -1040,7 +1073,7 @@ function photos_content(&$a) {
                        $tpl = load_view_file('view/photo_item.tpl');
                        $return_url = $a->cmd;
 
-                       $like_tpl = load_view_file('view/like.tpl');
+                       $like_tpl = load_view_file('view/lik_noshare.tpl');
 
                        $likebuttons = '';
 
@@ -1049,6 +1082,7 @@ function photos_content(&$a) {
                                        '$id' => $item['id'],
                                        '$likethis' => t("I like this \x28toggle\x29"),
                                        '$nolike' => t("I don't like this \x28toggle\x29"),
+                                       '$share' => t('Share'),
                                        '$wait' => t('Please wait') 
                                ));
                        }
index 5615573b952be9850f98b20d69339cf6c34c9eb4..c0989bd28a253dc43a17aeeb462b4b3c7b457098 100644 (file)
@@ -28,6 +28,11 @@ function profile_init(&$a) {
                $a->page['htmlhead'] .= '<link rel="openid.delegate" href="' . $delegate . '" />' . "\r\n";
        }
 
+       $keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : '');
+       $keywords = str_replace(array(',',' ',',,'),array(' ',',',','),$keywords);
+       if(strlen($keywords))
+               $a->page['htmlhead'] .= '<meta name="keywords" content="' . $keywords . '" />' . "\r\n" ;
+
        $a->page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . (($a->profile['net-publish']) ? 'true' : 'false') . '" />' . "\r\n" ;
        $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/dfrn_poll/' . $which .'" />' . "\r\n" ;
        $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : ''));
@@ -152,6 +157,8 @@ function profile_content(&$a, $update = 0) {
                                '$upload' => t('Upload photo'),
                                '$weblink' => t('Insert web link'),
                                '$youtube' => t('Insert YouTube video'),
+                               '$video' => t('Insert Vorbis [.ogg] video'),
+                               '$audio' => t('Insert Vorbis [.ogg] audio'),
                                '$setloc' => t('Set your location'),
                                '$noloc' => t('Clear browser location'),
                                '$wait' => t('Please wait'),
@@ -260,6 +267,7 @@ function profile_content(&$a, $update = 0) {
        $cmnt_tpl = load_view_file('view/comment_item.tpl');
 
        $like_tpl = load_view_file('view/like.tpl');
+       $noshare_tpl = load_view_file('view/like_noshare.tpl');
 
        $tpl = load_view_file('view/wall_item.tpl');
 
@@ -302,10 +310,11 @@ function profile_content(&$a, $update = 0) {
 
                        if(can_write_wall($a,$a->profile['profile_uid'])) {
                                if($item['id'] == $item['parent']) {
-                                       $likebuttons = replace_macros($like_tpl,array(
+                                       $likebuttons = replace_macros((($item['private']) ? $noshare_tpl : $like_tpl),array(
                                                '$id' => $item['id'],
                                                '$likethis' => t("I like this \x28toggle\x29"),
                                                '$nolike' => t("I don't like this \x28toggle\x29"),
+                                               '$share' => t('Share'),
                                                '$wait' => t('Please wait') 
                                        ));
                                }
index 0f84a85c9235b529214c2f2d87fe933d9bb6ea15..5365aa3b878b4b79209a8f8cfe0159a1d739efcd 100644 (file)
@@ -87,7 +87,7 @@ function profile_photo_post(&$a) {
                                );
 
                                // Update global directory in background
-                               $url = $_SESSION['my_url'];
+                               $url = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
                                if($url && strlen(get_config('system','directory_submit_url')))
                                        proc_run('php',"include/directory.php","$url");
                        }
index 409999a3e86785dbc570847169e066488cd842c0..434f58adf990d487c6fae8013f6a87025afcaaac 100644 (file)
@@ -55,7 +55,8 @@ function profiles_post(&$a) {
                $region = notags(trim($_POST['region']));
                $postal_code = notags(trim($_POST['postal_code']));
                $country_name = notags(trim($_POST['country_name']));
-               $keywords = notags(trim($_POST['keywords']));
+               $pub_keywords = notags(trim($_POST['pub_keywords']));
+               $prv_keywords = notags(trim($_POST['prv_keywords']));
                $marital = notags(trim($_POST['marital']));
                if($marital != $orig[0]['marital'])
                        $maritalchanged = true;
@@ -147,7 +148,8 @@ function profiles_post(&$a) {
                        `homepage` = '%s',
                        `politic` = '%s',
                        `religion` = '%s',
-                       `keywords` = '%s',
+                       `pub_keywords` = '%s',
+                       `prv_keywords` = '%s',
                        `about` = '%s',
                        `interest` = '%s',
                        `contact` = '%s',
@@ -176,7 +178,8 @@ function profiles_post(&$a) {
                        dbesc($homepage),
                        dbesc($politic),
                        dbesc($religion),
-                       dbesc($keywords),
+                       dbesc($pub_keywords),
+                       dbesc($prv_keywords),
                        dbesc($about),
                        dbesc($interest),
                        dbesc($contact),
@@ -383,7 +386,8 @@ function profiles_content(&$a) {
                        '$homepage' => $r[0]['homepage'],
                        '$politic' => $r[0]['politic'],
                        '$religion' => $r[0]['religion'],
-                       '$keywords' => $r[0]['keywords'],
+                       '$pub_keywords' => $r[0]['pub_keywords'],
+                       '$prv_keywords' => $r[0]['prv_keywords'],
                        '$music' => $r[0]['music'],
                        '$book' => $r[0]['book'],
                        '$tv' => $r[0]['tv'],
index 13d770fdab2926d6f8c1b73696e40c1f6fd8aabd..fdf488b1a75e96a01e1e56ab4270406fc1963b4c 100644 (file)
@@ -401,7 +401,9 @@ function register_content(&$a) {
                $oidlabel = t("Your OpenID \x28optional\x29: ");
        }
 
-       $realpeople = t('Members of this network prefer to communicate with real people who use their real names.');
+       // I set this and got even more fake names than before...
+
+       $realpeople = ''; // t('Members of this network prefer to communicate with real people who use their real names.');
 
        if(get_config('system','publish_all')) {
                $profile_publish_reg = '<input type="hidden" name="profile_publish_reg" value="1" />';
index 561bb6c620e58a4f026b164e0552a125bfe5e95b..db7279fb5609987846fdf34656cf8328deeb15cf 100644 (file)
@@ -51,7 +51,7 @@ function search_content(&$a) {
                $a->set_pager_total($r[0]['total']);
 
        if(! $r[0]['total']) {
-               notice('No results.');
+               notice( t('No results.') . EOL);
                return $o;
        }
 
@@ -134,13 +134,6 @@ function search_content(&$a) {
                }
        }
 
-
-       if(! $r[0]['total']) {
-               notice('No results.');
-               return $o;
-       }
-
-
        $o .= paginate($a);
 
        return $o;
index ebe07612eb1fa152a0a5d6c74ec60ec15e8c73cf..85029b3d729fd2d16391b4b62741cece0c881daf 100644 (file)
@@ -63,6 +63,7 @@ function settings_post(&$a) {
        $defloc           = ((x($_POST,'defloc'))     ? notags(trim($_POST['defloc']))       : '');
        $openid           = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url']))   : '');
        $maxreq           = ((x($_POST,'maxreq'))     ? intval($_POST['maxreq'])             : 0);
+       $expire           = ((x($_POST,'expire'))     ? intval($_POST['expire'])             : 0);
 
        $allow_location   = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0);
        $publish          = (((x($_POST,'profile_in_directory')) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0);
@@ -139,7 +140,7 @@ function settings_post(&$a) {
                        $openidserver = '';
        }
 
-       $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s',  `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s', `maxreq` = %d, `openidserver` = '%s'  WHERE `uid` = %d LIMIT 1",
+       $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s',  `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s', `maxreq` = %d, `expire` = %d, `openidserver` = '%s'  WHERE `uid` = %d LIMIT 1",
                        dbesc($username),
                        dbesc($email),
                        dbesc($openid),
@@ -154,6 +155,7 @@ function settings_post(&$a) {
                        intval($allow_location),
                        dbesc($theme),
                        intval($maxreq),
+                       intval($expire),
                        dbesc($openidserver),
                        intval(local_user())
        );
@@ -238,6 +240,7 @@ function settings_content(&$a) {
        $defloc   = $a->user['default-location'];
        $openid   = $a->user['openid'];
        $maxreq   = $a->user['maxreq'];
+       $expire   = ((intval($a->user['expire'])) ? $a->user['expire'] : '');
 
        if(! strlen($a->user['timezone']))
                $timezone = date_default_timezone_get();
@@ -358,6 +361,7 @@ function settings_content(&$a) {
                '$sel_notify4' => (($notify & NOTIFY_COMMENT) ? ' checked="checked" ' : ''),
                '$sel_notify5' => (($notify & NOTIFY_MAIL)    ? ' checked="checked" ' : ''),
                '$maxreq' => $maxreq,
+               '$expire' => $expire,
                '$theme' => $theme_selector,
                '$pagetype' => $pagetype
        ));
diff --git a/mod/share.php b/mod/share.php
new file mode 100644 (file)
index 0000000..8a8229e
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+
+require_once('bbcode.php');
+
+function share_init(&$a) {
+
+       $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
+       if((! $post_id) || (! local_user()))
+               killme();
+
+       $r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
+               intval($post_id)
+       );
+       if(! count($r) || $r[0]['private'])
+               killme();
+
+       $o = '';
+
+       $o .= '&#x2672; <a href="' . $r[0]['author-link'] . '">' . $r[0]['author-name'] . '</a><br />';
+       $o .= prepare_body($r[0]);
+       echo $o . '<br />';
+       killme();  
+}
\ No newline at end of file
index fe8052b00ff9106bcc141bb6276e755f9601530a..0be919f3f1f3fe75664f3a44d2cd2629d97c11c2 100644 (file)
@@ -326,7 +326,7 @@ function update_1033() {
                `k` CHAR( 255 ) NOT NULL PRIMARY KEY ,
                `v` TEXT NOT NULL,
                `updated` DATETIME NOT NULL
-               ) ENGINE = MYISAM DEFAULT CHARSET=utf8;");
+               ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ");
 }
 
 
@@ -377,3 +377,33 @@ function update_1038() {
 function update_1039() {
        q("ALTER TABLE `addon` ADD `timestamp` BIGINT NOT NULL DEFAULT '0'");
 }
+
+
+function update_1040() {
+
+       q("CREATE TABLE IF NOT EXISTS `fcontact` (
+       `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+       `url` CHAR( 255 ) NOT NULL ,
+       `name` CHAR( 255 ) NOT NULL ,
+       `photo` CHAR( 255 ) NOT NULL
+       ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ");
+
+       q("CREATE TABLE IF NOT EXISTS `ffinder` (
+       `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+       `uid` INT UNSIGNED NOT NULL ,
+       `cid` INT UNSIGNED NOT NULL ,
+       `fid` INT UNSIGNED NOT NULL
+       ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ");
+
+}
+
+function update_1041() {
+       q("ALTER TABLE `profile` CHANGE `keywords` `prv_keywords` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ");
+       q("ALTER TABLE `profile` ADD `pub_keywords` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `religion` ");
+}
+
+function update_1042() {
+       q("ALTER TABLE `user` ADD `expire` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `maxreq` ");
+}
+
+
index 58403f1ba65739d9268eb5349adf3cd9a25f9e53..62fbe84e481fc6c79bd6e12d43c3422e3530c7ee 100644 (file)
@@ -104,6 +104,20 @@ tinyMCE.init({
                }
        }
 
+       function jotVideoURL() {
+               reply = prompt("Please enter a video(.ogg) link/URL:");
+               if(reply && reply.length) {
+                       tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
+               }
+       }
+
+       function jotAudioURL() {
+               reply = prompt("Please enter an audio(.ogg) link/URL:");
+               if(reply && reply.length) {
+                       tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
+               }
+       }
+
        function jotGetLocation() {
                reply = prompt("Wo bist du im Moment?", $('#jot-location').val());
                if(reply && reply.length) {
@@ -111,6 +125,16 @@ tinyMCE.init({
                }
        }
 
+       function jotShare(id) {
+               $('#like-rotator-' + id).show();
+               $.get('share/' + id, function(data) {
+                       tinyMCE.execCommand('mceInsertRawHTML',false,data);
+                       $('#like-rotator-' + id).hide();
+                       $(window).scrollTop(0);
+               });
+       }
+
+
 
        function linkdropper(event) {
                var linkFound = event.dataTransfer.types.contains("text/uri-list");
index 09a76102304104d7baae48146768f08e19eef2dc..840597ddcc7e400db14a6be30176c0903098ac20 100644 (file)
@@ -134,11 +134,17 @@ $sexual
 </div>
 <div id="profile-edit-religion-end"></div>
 
-<div id="profile-edit-keywords-wrapper" >
-<label id="profile-edit-keywords-label" for="profile-edit-keywords" >Keywords: </label>
-<input type="text" size="32" name="keywords" id="profile-edit-keywords" title="Example: fishing photography software" value="$keywords" />
-</div><div id="profile-edit-keywords-desc">(Used for searching public profiles, never shown to others)</div>
-<div id="profile-edit-keywords-end"></div>
+<div id="profile-edit-pubkeywords-wrapper" >
+<label id="profile-edit-pubkeywords-label" for="profile-edit-pubkeywords" >Public Keywords: </label>
+<input type="text" size="32" name="pubkeywords" id="profile-edit-pubkeywords" title="Example: fishing photography software" value="$pub_keywords" />
+</div><div id="profile-edit-pubkeywords-desc">(Used for suggesting potential friends, can be seen by others)</div>
+<div id="profile-edit-pubkeywords-end"></div>
+
+<div id="profile-edit-prvkeywords-wrapper" >
+<label id="profile-edit-prvkeywords-label" for="profile-edit-prvkeywords" >Private Keywords: </label>
+<input type="text" size="32" name="prvkeywords" id="profile-edit-prvkeywords" title="Example: fishing photography software" value="$prv_keywords" />
+</div><div id="profile-edit-prvkeywords-desc">(Used for searching profiles, never shown to others)</div>
+<div id="profile-edit-prvkeywords-end"></div>
 
 
 <div class="profile-edit-submit-wrapper" >
index 0ef50546f457c28397d5b554218ff74cc1fd98ac..675ef675f581b022941ebce27c1ab6d3404ebe0e 100644 (file)
@@ -78,7 +78,7 @@ $profile_in_net_dir
 
 
 <div id="settings-default-perms" class="settings-default-perms" >
-       <div id="settings-default-perms-menu" class="fakelink" onClick="openClose('settings-default-perms-select');" >&#x21e9; $permissions</div>
+       <div id="settings-default-perms-menu" class="fakelink" onClick="openClose('settings-default-perms-select');" >$permissions</div>
        <div id="settings-default-perms-menu-end"></div>
 
        <div id="settings-default-perms-select" style="display: none;" >
@@ -89,6 +89,10 @@ $profile_in_net_dir
 </div>
 <div id="settings-default-perms-end"></div>
 
+<div id="settings-expire-desc">Automatically expire (delete) posts older than <input type="text" size="3" name="expire" value="$expire" /> days</div>
+<div id="settings-expire-end"></div>
+
+
 <div class="settings-submit-wrapper" >
 <input type="submit" name="submit" class="settings-submit" value="Submit" />
 </div>
index fe818410e5e3319e6c03af968f2dcd318ecd09b1..d73fe7d629186060d22b22e2c4a0891cf6a0e938 100644 (file)
@@ -104,6 +104,21 @@ tinyMCE.init({
                }
        }
 
+       function jotVideoURL() {
+               reply = prompt("Please enter a video(.ogg) link/URL:");
+               if(reply && reply.length) {
+                       tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
+               }
+       }
+
+       function jotAudioURL() {
+               reply = prompt("Please enter an audio(.ogg) link/URL:");
+               if(reply && reply.length) {
+                       tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
+               }
+       }
+
+
        function jotGetLocation() {
                reply = prompt("Where are you right now?", $('#jot-location').val());
                if(reply && reply.length) {
@@ -111,6 +126,14 @@ tinyMCE.init({
                }
        }
 
+       function jotShare(id) {
+               $('#like-rotator-' + id).show();
+               $.get('share/' + id, function(data) {
+                       tinyMCE.execCommand('mceInsertRawHTML',false,data);
+                       $('#like-rotator-' + id).hide();
+                       $(window).scrollTop(0);
+               });
+       }
 
        function linkdropper(event) {
                var linkFound = event.dataTransfer.types.contains("text/uri-list");
index b0d4850d0db55b3c0e9dcf436d9903610a0ff9e0..6c7d74dafc4344bb18b72fda9109de5d4bc88186 100644 (file)
@@ -134,11 +134,17 @@ $sexual
 </div>
 <div id="profile-edit-religion-end"></div>
 
-<div id="profile-edit-keywords-wrapper" >
-<label id="profile-edit-keywords-label" for="profile-edit-keywords" >Keywords: </label>
-<input type="text" size="32" name="keywords" id="profile-edit-keywords" title="Example: fishing photography software" value="$keywords" />
-</div><div id="profile-edit-keywords-desc">(Used for searching public profiles, never shown to others)</div>
-<div id="profile-edit-keywords-end"></div>
+<div id="profile-edit-pubkeywords-wrapper" >
+<label id="profile-edit-pubkeywords-label" for="profile-edit-pubkeywords" >Public Keywords: </label>
+<input type="text" size="32" name="pub_keywords" id="profile-edit-pubkeywords" title="Example: fishing photography software" value="$pub_keywords" />
+</div><div id="profile-edit-pubkeywords-desc">(Used for suggesting potential friends, can be seen by others)</div>
+<div id="profile-edit-pubkeywords-end"></div>
+
+<div id="profile-edit-prvkeywords-wrapper" >
+<label id="profile-edit-prvkeywords-label" for="profile-edit-prvkeywords" >Private Keywords: </label>
+<input type="text" size="32" name="prv_keywords" id="profile-edit-prvkeywords" title="Example: fishing photography software" value="$prv_keywords" />
+</div><div id="profile-edit-prvkeywords-desc">(Used for searching profiles, never shown to others)</div>
+<div id="profile-edit-prvkeywords-end"></div>
 
 
 <div class="profile-edit-submit-wrapper" >
index 97d67cbf61679d07f8303bc6df2f27e452560bbf..39b18c12621e55bb67dde4155f841888d7921be4 100644 (file)
@@ -76,9 +76,8 @@ $profile_in_dir
 $profile_in_net_dir
 
 
-
 <div id="settings-default-perms" class="settings-default-perms" >
-       <div id="settings-default-perms-menu" class="fakelink" onClick="openClose('settings-default-perms-select');" >&#x21e9; $permissions</div>
+       <div id="settings-default-perms-menu" class="fakelink" onClick="openClose('settings-default-perms-select');" >$permissions</div>
        <div id="settings-default-perms-menu-end"></div>
 
        <div id="settings-default-perms-select" style="display: none;" >
@@ -89,6 +88,10 @@ $profile_in_net_dir
 </div>
 <div id="settings-default-perms-end"></div>
 
+<div id="settings-expire-desc">Automatically expire (delete) posts older than <input type="text" size="3" name="expire" value="$expire" /> days</div>
+<div id="settings-expire-end"></div>
+
+
 <div class="settings-submit-wrapper" >
 <input type="submit" name="submit" class="settings-submit" value="Submit" />
 </div>
index ff7e543a5ed9928d38bfb45f931e92085aeac3ad..b1b6dacf0171441a430073f442b4a9cdee0d3169 100644 (file)
@@ -103,6 +103,20 @@ tinyMCE.init({
                }
        }
 
+       function jotVideoURL() {
+               reply = prompt("Please enter a video(.ogg) link/URL:");
+               if(reply && reply.length) {
+                       tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
+               }
+       }
+
+       function jotAudioURL() {
+               reply = prompt("Please enter an audio(.ogg) link/URL:");
+               if(reply && reply.length) {
+                       tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
+               }
+       }
+
        function jotGetLocation() {
                reply = prompt("Where are you right now?", $('#jot-location').val());
                if(reply && reply.length) {
@@ -110,6 +124,15 @@ tinyMCE.init({
                }
        }
 
+       function jotShare(id) {
+               $('#like-rotator-' + id).show();
+               $.get('share/' + id, function(data) {
+                       tinyMCE.execCommand('mceInsertRawHTML',false,data);
+                       $('#like-rotator-' + id).hide();
+                       $(window).scrollTop(0);
+               });
+       }
+
 
        function linkdropper(event) {
                var linkFound = event.dataTransfer.types.contains("text/uri-list");
index beff3b8bd582b88fc0aa3742e6c71840436fa3be..b282551884a23c812918e936f607149d2acb57c6 100644 (file)
@@ -134,11 +134,17 @@ $sexual
 </div>
 <div id="profile-edit-religion-end"></div>
 
-<div id="profile-edit-keywords-wrapper" >
-<label id="profile-edit-keywords-label" for="profile-edit-keywords" >Keywords: </label>
-<input type="text" size="32" name="keywords" id="profile-edit-keywords" title="Example: fishing photography software" value="$keywords" />
-</div><div id="profile-edit-keywords-desc">(Used for searching public profiles, never shown to others)</div>
-<div id="profile-edit-keywords-end"></div>
+<div id="profile-edit-pubkeywords-wrapper" >
+<label id="profile-edit-pubkeywords-label" for="profile-edit-pubkeywords" >Public Keywords: </label>
+<input type="text" size="32" name="pub_keywords" id="profile-edit-pubkeywords" title="Example: fishing photography software" value="$pub_keywords" />
+</div><div id="profile-edit-pubkeywords-desc">(Used for suggesting potential friends, can be seen by others)</div>
+<div id="profile-edit-pubkeywords-end"></div>
+
+<div id="profile-edit-prvkeywords-wrapper" >
+<label id="profile-edit-prvkeywords-label" for="profile-edit-prvkeywords" >Private Keywords: </label>
+<input type="text" size="32" name="prv_keywords" id="profile-edit-prvkeywords" title="Example: fishing photography software" value="$prv_keywords" />
+</div><div id="profile-edit-prvkeywords-desc">(Used for searching profiles, never shown to others)</div>
+<div id="profile-edit-prvkeywords-end"></div>
 
 
 <div class="profile-edit-submit-wrapper" >
index 97d67cbf61679d07f8303bc6df2f27e452560bbf..eb386579f0b72aaa9c7af9655f3a9381861acd2a 100644 (file)
@@ -78,7 +78,7 @@ $profile_in_net_dir
 
 
 <div id="settings-default-perms" class="settings-default-perms" >
-       <div id="settings-default-perms-menu" class="fakelink" onClick="openClose('settings-default-perms-select');" >&#x21e9; $permissions</div>
+       <div id="settings-default-perms-menu" class="fakelink" onClick="openClose('settings-default-perms-select');" >$permissions</div>
        <div id="settings-default-perms-menu-end"></div>
 
        <div id="settings-default-perms-select" style="display: none;" >
@@ -89,6 +89,9 @@ $profile_in_net_dir
 </div>
 <div id="settings-default-perms-end"></div>
 
+<div id="settings-expire-desc">Automatically expire (delete) posts older than <input type="text" size="3" name="expire" value="$expire" /> days</div>
+<div id="settings-expire-end"></div>
+
 <div class="settings-submit-wrapper" >
 <input type="submit" name="submit" class="settings-submit" value="Submit" />
 </div>
index 423645c86262b905feae626792b5cbdfc1e8efab..d177c07b8996cf197d1215c1409f604848a5236f 100644 (file)
@@ -16,14 +16,14 @@ $a->strings['last'] = 'last';
 $a->strings['next'] = 'next';
 $a->strings[' likes this.'] = ' aime ça.';
 $a->strings[' doesn\'t like this.'] = ' n\'aime pas ça.';
-$a->strings['people'] = 'personne(s)';
-$a->strings['like this.'] = 'aime(nt) ça.';
-$a->strings['don\'t like this.'] = 'n\'aime(nt) pas ça.';
+$a->strings['people'] = 'personnes';
+$a->strings['like this.'] = 'aiment ça.';
+$a->strings['don\'t like this.'] = 'n\'aiment pas ça.';
 $a->strings['and'] = 'et';
 $a->strings[', and '] = ', et ';
-$a->strings[' other people'] = ' autre(s) personne(s)';
-$a->strings[' like this.'] = ' aime(nt) ça.';
-$a->strings[' don\'t like this.'] = ' n\'aime(nt) pas ça.';
+$a->strings[' other people'] = ' autres personnes';
+$a->strings[' like this.'] = ' aiment ça.';
+$a->strings[' don\'t like this.'] = ' n\'aiment pas ça.';
 $a->strings['No contacts'] = 'Aucun contact';
 $a->strings['Contacts'] = 'Contacts';
 $a->strings['View Contacts'] = 'Voir les contacts';
index 117cd1651195a4ce140bb82ce0aa6fd41bf6d46b..8ca5a07174181641fb1bf21be0df2a092e1b3c9e 100644 (file)
@@ -104,6 +104,20 @@ tinyMCE.init({
                }
        }
 
+       function jotVideoURL() {
+               reply = prompt("Please enter a video(.ogg) link/URL:");
+               if(reply && reply.length) {
+                       tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
+               }
+       }
+
+       function jotAudioURL() {
+               reply = prompt("Please enter an audio(.ogg) link/URL:");
+               if(reply && reply.length) {
+                       tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
+               }
+       }
+
        function jotGetLocation() {
                reply = prompt("Dove ti trovi ora?", $('#jot-location').val());
                if(reply && reply.length) {
@@ -111,6 +125,15 @@ tinyMCE.init({
                }
        }
 
+       function jotShare(id) {
+               $('#like-rotator-' + id).show();
+               $.get('share/' + id, function(data) {
+                       tinyMCE.execCommand('mceInsertRawHTML',false,data);
+                       $('#like-rotator-' + id).hide();
+                       $(window).scrollTop(0);
+               });
+       }
+
 
        function linkdropper(event) {
                var linkFound = event.dataTransfer.types.contains("text/uri-list");
index efdb5d44836b92bc6627856ef20c0401c9a9efcc..9f2a13790741812058106694d0ba82d7ca416736 100644 (file)
@@ -134,11 +134,17 @@ $sexual
 </div>
 <div id="profile-edit-religion-end"></div>
 
-<div id="profile-edit-keywords-wrapper" >
-<label id="profile-edit-keywords-label" for="profile-edit-keywords" >Parole chiave: </label>
-<input type="text" size="32" name="keywords" id="profile-edit-keywords" title="Esempio: pescare fotografia software" value="$keywords" />
-</div><div id="profile-edit-keywords-desc">(Usati per la ricerca dei profili pubblci, mai mostrati agli altri)</div>
-<div id="profile-edit-keywords-end"></div>
+<div id="profile-edit-pubkeywords-wrapper" >
+<label id="profile-edit-pubkeywords-label" for="profile-edit-pubkeywords" >[Public] Parole chiave: </label>
+<input type="text" size="32" name="pub_keywords" id="profile-edit-pubkeywords" title="Esempio: pescare fotografia software" value="$pub_keywords" />
+</div><div id="profile-edit-pubkeywords-desc">(Used for suggesting potential friends, can be seen by others)</div>
+<div id="profile-edit-pubkeywords-end"></div>
+
+<div id="profile-edit-prvkeywords-wrapper" >
+<label id="profile-edit-prvkeywords-label" for="profile-edit-prvkeywords" >Parole chiave: </label>
+<input type="text" size="32" name="prv_keywords" id="profile-edit-prvkeywords" title="Esempio: pescare fotografia software" value="$prv_keywords" />
+</div><div id="profile-edit-prvkeywords-desc">(Usati per la ricerca dei profili, mai mostrati agli altri)</div>
+<div id="profile-edit-prvkeywords-end"></div>
 
 
 <div class="profile-edit-submit-wrapper" >
index 3b68923cf45ba470a53cf2eb4a7860b3f3716426..87f40f26fc57f42f22f10011d80980655a66f4e6 100644 (file)
@@ -79,7 +79,7 @@ $profile_in_net_dir
 
 
 <div id="settings-default-perms" class="settings-default-perms" >
-       <div id="settings-default-perms-menu" class="fakelink" onClick="openClose('settings-default-perms-select');" >&#x21e9; $permissions</div>
+       <div id="settings-default-perms-menu" class="fakelink" onClick="openClose('settings-default-perms-select');" >$permissions</div>
        <div id="settings-default-perms-menu-end"></div>
 
        <div id="settings-default-perms-select" style="display: none;" >
@@ -90,6 +90,9 @@ $profile_in_net_dir
 </div>
 <div id="settings-default-perms-end"></div>
 
+<div id="settings-expire-desc">Automatically expire (delete) posts older than <input type="text" size="3" name="expire" value="$expire" /> days</div>
+<div id="settings-expire-end"></div>
+
 <div class="settings-submit-wrapper" >
 <input type="submit" name="submit" class="settings-submit" value="Aggiorna" />
 </div>
index 68139ddc01f9f1bb4cf21b32c2a137eb146db7ed..fd85b9267ed9461e441fa8578d3081ebbf4fea04 100644 (file)
                <img id="profile-link" src="images/link-icon.gif" alt="$weblink" title="$weblink" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink();" />
        </div> 
        <div id="profile-youtube-wrapper" style="display: $visitor;" >
-               <img id="profile-video" src="images/youtube_icon.gif" alt="$youtube" title="$youtube" onclick="jotGetVideo();" />
+               <img id="profile-youtube" src="images/youtube_icon.gif" alt="$youtube" title="$youtube" onclick="jotGetVideo();" />
+       </div> 
+       <div id="profile-video-wrapper" style="display: $visitor;" >
+               <img id="profile-video" src="images/video.gif" alt="$video" title="$video" onclick="jotVideoURL();" />
+       </div> 
+       <div id="profile-audio-wrapper" style="display: $visitor;" >
+               <img id="profile-audio" src="images/audio.gif" alt="$audio" title="$audio" onclick="jotAudioURL();" />
        </div> 
        <div id="profile-location-wrapper" style="display: $visitor;" >
                <img id="profile-location" src="images/globe.gif" alt="$setloc" title="$setloc" onclick="jotGetLocation();" />
index e36a624a4196b072f923c0627a663ff041650896..4f530407e1d6420bc6e57f0a165c80e07d4ef7ca 100644 (file)
@@ -1,5 +1,6 @@
 <div class="wall-item-like-buttons" id="wall-item-like-buttons-$id">
                                <img src="images/like.gif" alt="$likethis" title="$likethis" onclick="dolike($id,'like');" />
                                <img src="images/dislike.gif" alt="$nolike" title="$nolike" onclick="dolike($id,'dislike');" />
+                               <img src="images/share.gif" alt="$share" title="$share" class="wall-item-share-buttons" onclick="jotShare($id);" />
                                <img id="like-rotator-$id" class="like-rotator" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" />
                        </div>
diff --git a/view/like_noshare.tpl b/view/like_noshare.tpl
new file mode 100644 (file)
index 0000000..e36a624
--- /dev/null
@@ -0,0 +1,5 @@
+<div class="wall-item-like-buttons" id="wall-item-like-buttons-$id">
+                               <img src="images/like.gif" alt="$likethis" title="$likethis" onclick="dolike($id,'like');" />
+                               <img src="images/dislike.gif" alt="$nolike" title="$nolike" onclick="dolike($id,'dislike');" />
+                               <img id="like-rotator-$id" class="like-rotator" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" />
+                       </div>
index d4643b20a6450f9c42efde232297606eabd5c45d..ce75655fb9dd38e0721bcfba37fdb48f1c9f6748 100644 (file)
@@ -206,8 +206,10 @@ div.wall-item-content-wrapper.shiny {
 /* from default */
 #jot-perms-icon, 
 #profile-location,
-#profile-nolocation, 
+#profile-nolocation,
+#profile-youtube, 
 #profile-video, 
+#profile-audio,
 #profile-link, 
 #wall-image-upload,
 #profile-upload-wrapper,
@@ -373,6 +375,10 @@ input#dfrn-url {
        margin-bottom: 30px;
 }
 
+#settings-expire-end {
+       margin-bottom: 30px;
+}
+
 #settings-username-end,
 #settings-email-end,
 #settings-nick-end,
@@ -624,7 +630,8 @@ input#dfrn-url {
 #profile-edit-sexual-label,
 #profile-edit-politic-label,
 #profile-edit-religion-label,
-#profile-edit-keywords-label,
+#profile-edit-pubkeywords-label,
+#profile-edit-prvkeywords-label,
 #profile-edit-homepage-label {
        float: left;
        width: 175px;
@@ -644,7 +651,8 @@ input#dfrn-url {
 #sexual-select,
 #profile-edit-politic,
 #profile-edit-religion,
-#profile-edit-keywords,
+#profile-edit-pubkeywords,
+#profile-edit-prvkeywords,
 #profile-in-dir-yes,
 #profile-in-dir-no,
 #profile-in-netdir-yes,
@@ -698,7 +706,8 @@ input#dfrn-url {
 
 
 #profile-edit-pdesc-desc,
-#profile-edit-keywords-desc {
+#profile-edit-pubkeywords-desc,
+#profile-edit-prvkeywords-desc {
        float: left;
        margin-left: 20px;
 }
@@ -741,7 +750,8 @@ input#dfrn-url {
 #profile-edit-sexual-end,
 #profile-edit-politic-end,
 #profile-edit-religion-end,
-#profile-edit-keywords-end,
+#profile-edit-pubkeywords-end,
+#profile-edit-prvkeywords-end,
 #profile-edit-homepage-end,
 #profile-in-dir-break,
 #profile-in-dir-end,
@@ -913,6 +923,10 @@ input#dfrn-url {
        cursor: pointer;
 }
 
+.wall-item-share-buttons {
+       margin-left: 10px;
+}
+
 .wall-item-links-wrapper {
        float: left;
 }
@@ -1044,6 +1058,14 @@ input#dfrn-url {
        float: left;
        margin-left: 20px;
 }
+#profile-video-wrapper {
+       float: left;
+       margin-left: 20px;
+}
+#profile-audio-wrapper {
+       float: left;
+       margin-left: 20px;
+}
 #profile-location-wrapper {
        float: left;
        margin-left: 20px;
@@ -1055,7 +1077,7 @@ input#dfrn-url {
 
 #profile-jot-perms {
        float: left;
-       margin-left: 200px;
+       margin-left: 150px;
        font-weight: bold;
        font-size: 1.2em;
 }
@@ -2094,3 +2116,16 @@ a.mail-list-link {
        margin-top: 20px;
 }
 
+#photo-prev-link, #photo-next-link {
+       padding: 10px;
+       float: left;
+}
+
+#photo-photo {
+       float: left;
+}
+
+#photo-photo-end {
+       clear: both;
+}
+
index ffd352c5aa9401483ea87d4fa62489b5d81dffed..1c378793ad77269429027c4c59a3bdee4ec8ca2c 100644 (file)
@@ -107,8 +107,10 @@ blockquote:before {
 
 #jot-perms-icon, 
 #profile-location,
-#profile-nolocation, 
-#profile-video, 
+#profile-nolocation,
+#profile-youtube, 
+#profile-video,
+#profile-audio, 
 #profile-link, 
 #wall-image-upload,
 #profile-upload-wrapper,
@@ -506,6 +508,10 @@ input#dfrn-url {
        margin-bottom: 30px;
 }
 
+#settings-expire-end {
+       margin-bottom: 30px;
+}
+
 #settings-username-end,
 #settings-email-end,
 #settings-nick-end,
@@ -755,7 +761,8 @@ input#dfrn-url {
 #profile-edit-sexual-label,
 #profile-edit-politic-label,
 #profile-edit-religion-label,
-#profile-edit-keywords-label,
+#profile-edit-pubkeywords-label,
+#profile-edit-prvkeywords-label,
 #profile-edit-homepage-label {
        float: left;
        width: 175px;
@@ -775,7 +782,8 @@ input#dfrn-url {
 #sexual-select,
 #profile-edit-politic,
 #profile-edit-religion,
-#profile-edit-keywords,
+#profile-edit-pubkeywords,
+#profile-edit-prvkeywords,
 #profile-in-dir-yes,
 #profile-in-dir-no,
 #profile-in-netdir-yes,
@@ -806,7 +814,8 @@ input#dfrn-url {
        margin-left: 20px;
 }
 
-#profile-edit-keywords-desc {
+#profile-edit-pubkeywords-desc,
+#profile-edit-prvkeywords-desc {
        float: left;
        margin-left: 20px;
 }
@@ -864,7 +873,8 @@ input#dfrn-url {
 #profile-edit-sexual-end,
 #profile-edit-politic-end,
 #profile-edit-religion-end,
-#profile-edit-keywords-end,
+#profile-edit-pubkeywords-end,
+#profile-edit-prvkeywords-end,
 #profile-edit-homepage-end,
 #profile-in-dir-break,
 #profile-in-dir-end,
@@ -985,6 +995,10 @@ input#dfrn-url {
     border-right: 2px solid #fff;
 }
 
+.wall-item-share-buttons {
+       margin-left: 5px;
+}
+
 .wall-item-links-wrapper {
     float: left;
 }
@@ -1113,6 +1127,14 @@ padding: 5px 10px 0px;
        float: left;
        margin-left: 20px;
 }
+#profile-video-wrapper {
+       float: left;
+       margin-left: 20px;
+}
+#profile-audio-wrapper {
+       float: left;
+       margin-left: 20px;
+}
 #profile-location-wrapper {
        float: left;
        margin-left: 20px;
@@ -1124,7 +1146,7 @@ padding: 5px 10px 0px;
 
 #profile-jot-perms {
        float: left;
-       margin-left: 200px;
+       margin-left: 150px;
        font-weight: bold;
        font-size: 1.2em;
 }
@@ -2126,3 +2148,17 @@ a.mail-list-link {
        margin-top: 20px;
 }
 
+
+#photo-prev-link, #photo-next-link {
+       padding: 10px;
+       float: left;
+}
+
+#photo-photo {
+       float: left;
+}
+
+#photo-photo-end {
+       clear: both;
+}
+