From 59b45f7fc12027c387f04a2121ea398c1d534626 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 31 Mar 2012 16:28:39 +0200 Subject: [PATCH 001/251] Several improvements --- include/bbcode.php | 3 ++- include/html2plain.php | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index 9befbd0f79..3697f1fc5d 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -230,7 +230,8 @@ function bbcode($Text,$preserve_nl = false) { $Text); // [img=widthxheight]image source[/img] - $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '', $Text); + //$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '', $Text); + $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '', $Text); // Images // [img]pathtoimage[/img] diff --git a/include/html2plain.php b/include/html2plain.php index fe0e3326e8..7aa20500a5 100644 --- a/include/html2plain.php +++ b/include/html2plain.php @@ -83,12 +83,15 @@ function collecturls($message) { $urls = array(); foreach ($result as $treffer) { // A list of some links that should be ignored - $list = array("/user/", "/tag/", "/profile/", "/search?search=", "mailto:", "/u/", "/node/", + $list = array("/user/", "/tag/", "/group/", "/profile/", "/search?search=", "mailto:", "/u/", "/node/", "//facebook.com/profile.php?id=", "//plus.google.com/"); foreach ($list as $listitem) if (strpos($treffer[1], $listitem) !== false) $ignore = true; + if ((strpos($treffer[1], "//plus.google.com/") !== false) and (strpos($treffer[1], "/posts") !== false)) + $ignore = false; + if (!$ignore) $urls[$treffer[1]] = $treffer[1]; } From 4cf1e5aa21b3bcfac25d5ab95a2abccca48de523 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 1 Apr 2012 20:52:33 +0200 Subject: [PATCH 002/251] poller: An optional lockfile is used to check if the poller is already running --- htconfig.php | 5 ++++- include/poller.php | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/htconfig.php b/htconfig.php index 9d9c8a2c79..63a40c8090 100755 --- a/htconfig.php +++ b/htconfig.php @@ -83,5 +83,8 @@ $a->config['system']['no_regfullname'] = true; // If set to true the priority settings of ostatus contacts are used $a->config['system']['ostatus_use_priority'] = false; -// If enabled all items are cached in the given directory +// If enabled, all items are cached in the given directory $a->config['system']['itemcache'] = ""; + +// If enabled, the lockpath is used for a lockfile to check if the poller is running +$a->config['system']['lockpath'] = ""; diff --git a/include/poller.php b/include/poller.php index 90a97867c2..499483d007 100755 --- a/include/poller.php +++ b/include/poller.php @@ -25,10 +25,20 @@ function poller_run($argv, $argc){ require_once('include/Contact.php'); require_once('include/email.php'); require_once('include/socgraph.php'); + require_once('include/pidfile.php'); load_config('config'); load_config('system'); + $lockpath = get_config('system','lockpath'); + if ($lockpath != '') { + $pidfile = new pidfile($lockpath, 'poller.lck'); + if($pidfile->is_already_running()) { + logger("poller: Already running"); + exit; + } + } + $a->set_baseurl(get_config('system','url')); load_hooks(); From 5409825fe7edd926f9588057074e62c86f177f1f Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 1 Apr 2012 20:56:27 +0200 Subject: [PATCH 003/251] New script that checks if a script is running --- include/pidfile.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/pidfile.php diff --git a/include/pidfile.php b/include/pidfile.php new file mode 100644 index 0000000000..47df8d1f46 --- /dev/null +++ b/include/pidfile.php @@ -0,0 +1,32 @@ +_file = "$dir/$name.pid"; + + if (file_exists($this->_file)) { + $pid = trim(file_get_contents($this->_file)); + if (posix_kill($pid, 0)) { + $this->_running = true; + } + } + + if (! $this->_running) { + $pid = getmypid(); + file_put_contents($this->_file, $pid); + } + } + + public function __destruct() { + if ((! $this->_running) && file_exists($this->_file)) { + unlink($this->_file); + } + } + + public function is_already_running() { + return $this->_running; + } +} +?> From a39d8d3f02e5bbd711fde71594c2c787b21ef2e9 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 2 Apr 2012 00:08:49 +0200 Subject: [PATCH 004/251] The "vier"-theme is now working again. But there is still work needed --- view/theme/diabook/style-network.css | 2 +- view/theme/diabook/style-profile.css | 2 +- view/theme/diabook/style-settings.css | 2 +- view/theme/diabook/style.css | 2 +- view/theme/vier/style.css | 68 ++++++++++++++++++++++++--- 5 files changed, 66 insertions(+), 10 deletions(-) diff --git a/view/theme/diabook/style-network.css b/view/theme/diabook/style-network.css index 3042476d80..282b371614 100644 --- a/view/theme/diabook/style-network.css +++ b/view/theme/diabook/style-network.css @@ -2523,4 +2523,4 @@ list-style-type: disc; #photos-upload-newalbum-div { float: left; width: 175px; -} \ No newline at end of file +} diff --git a/view/theme/diabook/style-profile.css b/view/theme/diabook/style-profile.css index 5a91e52549..5492c18849 100644 --- a/view/theme/diabook/style-profile.css +++ b/view/theme/diabook/style-profile.css @@ -2517,4 +2517,4 @@ list-style-type: disc; #photos-upload-newalbum-div { float: left; width: 175px; -} \ No newline at end of file +} diff --git a/view/theme/diabook/style-settings.css b/view/theme/diabook/style-settings.css index 46f7e957e9..2a21795a7b 100644 --- a/view/theme/diabook/style-settings.css +++ b/view/theme/diabook/style-settings.css @@ -2516,4 +2516,4 @@ list-style-type: disc; #photos-upload-newalbum-div { float: left; width: 175px; -} \ No newline at end of file +} diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css index 956667faa3..d96d9d9895 100644 --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@ -2448,4 +2448,4 @@ list-style-type: disc; #photos-upload-newalbum-div { float: left; width: 175px; -} \ No newline at end of file +} diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css index 39f4ffea47..13b648d5c5 100644 --- a/view/theme/vier/style.css +++ b/view/theme/vier/style.css @@ -108,6 +108,7 @@ .tools { background-position: -50px -40px;} .lock { background-position: -70px -40px;} +.unlock { background-position: -90px -40px;} .video { background-position: -110px -40px;} .youtube { background-position: -130px -40px;} @@ -139,8 +140,8 @@ .icon { display: block; - width: 20px; - height: 20px; + width: 18px; + height: 18px; background-image: url('icons.png'); } @@ -415,17 +416,21 @@ code { background: #EEE; } .tool .label { - float: left; +/* float: left; */ } .tool .action { float: right; } .tool a { - color: #000; +/* color: #000; */ } .tool a:hover { - text-decoration: none; + text-decoration: underline; } +.sidebar-group-element { +/* color: #000; */ +} + /* popup notifications */ div.jGrowl div.notice { background: #511919 url("../../../images/icons/48/notice.png") no-repeat 5px center; @@ -1244,7 +1249,8 @@ section { #jot #jot-tools li.loading img { margin-top: 10px; } -#jot #jot-title { +/* #jot */ +#jot-title { border: 0px; margin: 0px; height: 20px; @@ -1272,6 +1278,56 @@ section { line-height: 20px; padding-right: 20px; } + +#profile-jot-submit { + float: right; + margin-left: 15px; +} +#profile-upload-wrapper { + float: left; + margin-left: 15px; +} +#profile-attach-wrapper { + float: left; + margin-left: 15px; +} +#profile-link-wrapper { + float: left; + margin-left: 15px; +} +#profile-video-wrapper { + float: left; + margin-left: 15px; +} +#profile-audio-wrapper { + float: left; + margin-left: 15px; +} +#profile-location-wrapper { + float: left; + margin-left: 15px; +} +#profile-nolocation-wrapper { + float: left; + margin-left: 15px; +} +#jot-perms-icon { + float: right; + margin-left: 15px; +} +#jot-preview-link { + float: right; +} +#profile-jot-end { + clear: both; +} +#profile-jot-text_tbl { + width: 800px; +} +#profile-jot-wrapper { + margin-bottom: 20px; +} + /** buttons **/ /*input[type="submit"] { border: 0px; From 581b54c974a9b9a050a8a0b9a17a19bd41b1f2f5 Mon Sep 17 00:00:00 2001 From: Michael Johnston Date: Sun, 1 Apr 2012 21:28:31 -0400 Subject: [PATCH 006/251] allow users to set categories on their posts --- boot.php | 5 ++ include/contact_widgets.php | 28 ++++++++ include/conversation.php | 2 + include/text.php | 112 ++++++++++++++++++++++++++++++ mod/editpost.php | 2 + mod/item.php | 30 ++++++-- mod/profile.php | 21 +++++- view/categories_widget.tpl | 13 ++++ view/jot.tpl | 1 + view/theme/darkzero/style.css | 8 ++- view/theme/duepuntozero/style.css | 22 +++--- 11 files changed, 226 insertions(+), 18 deletions(-) create mode 100755 view/categories_widget.tpl diff --git a/boot.php b/boot.php index 2f2e28cebd..c2690f6ef0 100755 --- a/boot.php +++ b/boot.php @@ -293,6 +293,8 @@ class App { public $nav_sel; + public $category; + private $scheme; private $hostname; private $baseurl; @@ -377,6 +379,9 @@ class App { $this->argc = count($this->argv); if((array_key_exists('0',$this->argv)) && strlen($this->argv[0])) { $this->module = str_replace(".", "_", $this->argv[0]); + if(array_key_exists('2',$this->argv)) { + $this->category = $this->argv[2]; + } } else { $this->argc = 1; diff --git a/include/contact_widgets.php b/include/contact_widgets.php index 7346b95afa..e0f37f078f 100755 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -103,3 +103,31 @@ function fileas_widget($baseurl,$selected = '') { )); } +function categories_widget($baseurl,$selected = '') { + $a = get_app(); + + $saved = get_pconfig($a->profile['profile_uid'],'system','filetags'); + if(! strlen($saved)) + return; + + $matches = false; + $terms = array(); + $cnt = preg_match_all('/<(.*?)>/',$saved,$matches,PREG_SET_ORDER); + if($cnt) { + foreach($matches as $mtch) { + $unescaped = xmlify(file_tag_decode($mtch[1])); + $terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : '')); + } + } + + return replace_macros(get_markup_template('categories_widget.tpl'),array( + '$title' => t('Categories'), + '$desc' => '', + '$sel_all' => (($selected == '') ? 'selected' : ''), + '$all' => t('Everything'), + '$terms' => $terms, + '$base' => $baseurl, + + )); +} + diff --git a/include/conversation.php b/include/conversation.php index 5a922b2b52..df92a40ed0 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -974,6 +974,8 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { '$shortnoloc' => t('clear location'), '$title' => "", '$placeholdertitle' => t('Set title'), + '$category' => "", + '$placeholdercategory' => t('Categories (comma-separated list)'), '$wait' => t('Please wait'), '$permset' => t('Permission settings'), '$shortpermset' => t('permissions'), diff --git a/include/text.php b/include/text.php index 191f4fca8a..f204e3f9b9 100644 --- a/include/text.php +++ b/include/text.php @@ -1314,6 +1314,118 @@ function file_tag_file_query($table,$s,$type = 'file') { return " AND " . (($table) ? dbesc($table) . '.' : '') . "file regexp '" . dbesc($str) . "' "; } +// ex. given music,video return