diff options
-rw-r--r-- | assets/home.html | 4 | ||||
-rwxr-xr-x | include/diaspora.php | 10 | ||||
-rw-r--r-- | include/network.php | 24 | ||||
-rwxr-xr-x | mod/events.php | 5 | ||||
-rw-r--r-- | mod/item.php | 1 | ||||
-rw-r--r-- | mod/ping.php | 6 | ||||
-rw-r--r-- | version.inc | 2 | ||||
-rw-r--r-- | view/css/mod_events.css | 4 | ||||
-rw-r--r-- | view/js/mod_events.js | 14 | ||||
-rw-r--r-- | view/theme/redbasic/css/style.css | 2 | ||||
-rwxr-xr-x | view/tpl/event_form.tpl | 111 | ||||
-rwxr-xr-x | view/tpl/event_head.tpl | 4 |
12 files changed, 158 insertions, 29 deletions
diff --git a/assets/home.html b/assets/home.html index d6f3b4da3..036f9bcc9 100644 --- a/assets/home.html +++ b/assets/home.html @@ -1,7 +1,7 @@ <style> section { position: relative; margin-left: 15px;} nav { z-index: 9999; position: fixed; width: 100%; top: 0; left: 0; } -header { z-index: 10000; } +header { z-index: 10000; } .tr { clear: both; @@ -30,7 +30,7 @@ body::after { right: 0; position: absolute; opacity: 0.5; - z-index: -1; + z-index: -1; } </style> diff --git a/include/diaspora.php b/include/diaspora.php index 736be4f08..22574f9f8 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -772,7 +772,6 @@ function diaspora_request($importer,$xml) { - function diaspora_post($importer,$xml,$msg) { $a = get_app(); @@ -898,8 +897,8 @@ function diaspora_post($importer,$xml,$msg) { } - // this won't work for Friendica or Redmatrix but it's probably the best we can do. - $plink = 'https://'.substr($diaspora_handle,strpos($diaspora_handle,'@')+1).'/posts/'.$guid; + $plink = service_plink($contact,$guid); + $datarray['uid'] = $importer['channel_id']; @@ -1116,8 +1115,7 @@ function diaspora_reshare($importer,$xml,$msg) { } } - // This won't work on redmatrix - $plink = 'https://'.substr($diaspora_handle,strpos($diaspora_handle,'@')+1).'/posts/'.$guid; + $plink = service_plink($contact,$guid); $datarray['uid'] = $importer['channel_id']; $datarray['mid'] = $datarray['parent_mid'] = $guid; @@ -1198,7 +1196,7 @@ function diaspora_asphoto($importer,$xml,$msg) { return; } - $plink = 'https://'.substr($diaspora_handle,strpos($diaspora_handle,'@')+1).'/posts/'.$guid; + $plink = service_plink($contact,$guid); $datarray = array(); diff --git a/include/network.php b/include/network.php index 224d9d5e1..366ac0d24 100644 --- a/include/network.php +++ b/include/network.php @@ -1523,3 +1523,27 @@ function scrape_feed($url) { return $ret; } + + +function service_plink($contact, $guid) { + + $plink = ''; + + $m = parse_url($contact['xchan_url']); + if($m) { + $url = $scheme . '://' . $m['host'] . (($m['port']) ? ':' . $m['port'] : ''); + } + else + $url = 'https://' . substr($contact['xchan_addr'],strpos($contact['xchan_addr'],'@')+1); + + $handle = substr($contact['xchan_addr'], 0, strpos($contact['xchan_addr'],'@')); + + if($contact['xchan_network'] === 'diaspora') + $plink = $url . '/posts/' . $guid; + if($contact['xchan_network'] === 'friendica-over-diaspora') + $plink = $url . '/display/' . $handle . '/' . $guid; + if($contact['xchan_network'] === 'zot') + $plink = $url . '/channel/' . $handle . '?f=&mid=' . $guid; + + return $plink; +} diff --git a/mod/events.php b/mod/events.php index 233447cb1..a34aa62ab 100755 --- a/mod/events.php +++ b/mod/events.php @@ -242,7 +242,7 @@ function events_content(&$a) { $mode = 'view'; $y = 0; $m = 0; - $ignored = ((x($_REQUEST,'ignored')) ? intval($_REQUEST['ignored']) : 0); + $ignored = ((x($_REQUEST,'ignored')) ? " and ignored = " . intval($_REQUEST['ignored']) . " " : ''); if(argc() > 1) { if(argc() > 2 && argv(1) == 'event') { @@ -338,11 +338,10 @@ function events_content(&$a) { $r = q("SELECT event.*, item.plink, item.item_flags, item.author_xchan, item.owner_xchan from event left join item on event_hash = resource_id - where resource_type = 'event' and event.uid = %d and event.ignore = %d + where resource_type = 'event' and event.uid = %d $ignored AND (( `adjust` = 0 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' ) OR ( `adjust` = 1 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' )) ", intval(local_channel()), - intval($ignored), dbesc($start), dbesc($finish), dbesc($adjust_start), diff --git a/mod/item.php b/mod/item.php index d8cbeadc7..6ae02b510 100644 --- a/mod/item.php +++ b/mod/item.php @@ -516,6 +516,7 @@ function item_post(&$a) { * First protect any url inside certain bbcode tags so we don't double link it. */ + $body = preg_replace_callback('/\[code(.*?)\[\/(code)\]/ism','red_escape_codeblock',$body); $body = preg_replace_callback('/\[url(.*?)\[\/(url)\]/ism','red_escape_codeblock',$body); $body = preg_replace_callback('/\[zrl(.*?)\[\/(zrl)\]/ism','red_escape_codeblock',$body); diff --git a/mod/ping.php b/mod/ping.php index c69f42a6f..6a89ad5cf 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -173,8 +173,10 @@ function ping_init(&$a) { ); break; case 'all_events': - $r = q("update event set `ignore` = 1 where `ignore` = 0 and uid = %d", - intval(local_channel()) + $r = q("update event set `ignore` = 1 where `ignore` = 0 and uid = %d AND start < '%s' AND start > '%s' ", + intval(local_channel()), + dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now + ' . intval($evdays) . ' days')), + dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now - 1 days')) ); break; case 'notify': diff --git a/version.inc b/version.inc index f8cfd0a25..62703f886 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2015-02-06.937 +2015-02-08.939 diff --git a/view/css/mod_events.css b/view/css/mod_events.css index a029440cb..e2439e844 100644 --- a/view/css/mod_events.css +++ b/view/css/mod_events.css @@ -33,3 +33,7 @@ #event-nofinish-break { margin-bottom: 10px; } + +#event-desc-text, #event-location-text, .event-form-location-end { + margin-top: 15px; +}
\ No newline at end of file diff --git a/view/js/mod_events.js b/view/js/mod_events.js index d4dc9b585..fc25e4331 100644 --- a/view/js/mod_events.js +++ b/view/js/mod_events.js @@ -1,14 +1,12 @@ $(document).ready( function() { showHideFinishDate(); }); -function showHideFinishDate() { - if( $('#id_nofinish').is(':checked')) - $('#event-finish-wrapper').hide(); - else - $('#event-finish-wrapper').show(); -} - - + function showHideFinishDate() { + if( $('#id_nofinish').is(':checked')) + $('#event-finish-wrapper').hide(); + else + $('#event-finish-wrapper').show(); + } function eventGetStart() { //reply = prompt("{{$expirewhen}}", $('#jot-expire').val()); diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 1aa7cc729..451c3b3ee 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1221,7 +1221,7 @@ nav .acpopup { } #event-desc-text, #event-location-text { - margin-top: 10px; + margin-top: 15px; margin-bottom: 5px; } #event-submit { diff --git a/view/tpl/event_form.tpl b/view/tpl/event_form.tpl index 444e77df7..5ade55870 100755 --- a/view/tpl/event_form.tpl +++ b/view/tpl/event_form.tpl @@ -55,18 +55,121 @@ <div id="event-desc-text">{{$d_text}}</div> -<textarea id="event-desc-textarea" name="desc">{{$d_orig}}</textarea> +<textarea id="comment-edit-text-desc" class="comment-edit-text-full" name="desc" >{{$d_orig}}</textarea> +<div class="clear"></div> +<div id="comment-tools-desc" class="comment-tools" style="display: block;" > + <div id="comment-edit-bb-desc" class="btn-toolbar pull-left"> + <div class='btn-group'> + <button class="btn btn-default btn-xs" title="{{$edbold}}" onclick="insertbbcomment('{{$comment}}','b', 'desc'); return false;"> + <i class="icon-bold comment-icon"></i> + </button> + <button class="btn btn-default btn-xs" title="{{$editalic}}" onclick="insertbbcomment('{{$comment}}','i', 'desc'); return false;"> + <i class="icon-italic comment-icon"></i> + </button> + <button class="btn btn-default btn-xs" title="{{$eduline}}" onclick="insertbbcomment('{{$comment}}','u', 'desc'); return false;"> + <i class="icon-underline comment-icon"></i> + </button> + <button class="btn btn-default btn-xs" title="{{$edquote}}" onclick="insertbbcomment('{{$comment}}','quote','desc'); return false;"> + <i class="icon-quote-left comment-icon"></i> + </button> + <button class="btn btn-default btn-xs" title="{{$edcode}}" onclick="insertbbcomment('{{$comment}}','code', 'desc'); return false;"> + <i class="icon-terminal comment-icon"></i> + </button> + </div> + + <div class='btn-group'> + <button class="btn btn-default btn-xs" title="{{$edimg}}" onclick="insertbbcomment('{{$comment}}','img', 'desc'); return false;"> + <i class="icon-camera comment-icon"></i> + </button> + <button class="btn btn-default btn-xs" title="{{$edurl}}" onclick="insertbbcomment('{{$comment}}','url', 'desc'); return false;"> + <i class="icon-link comment-icon"></i> + </button> + <button class="btn btn-default btn-xs" title="{{$edvideo}}" onclick="insertbbcomment('{{$comment}}','video', 'desc'); return false;"> + <i class="icon-facetime-video comment-icon"></i> + </button> + </div> + + </div> + +<!-- <div class="btn-group pull-right" id="comment-edit-submit-wrapper-desc"> + {{if $preview}} + <button id="comment-edit-submit-desc" class="btn btn-default btn-xs" onclick="preview_comment(desc); return false;" title="{{$preview}}"> + <i class="icon-eye-open comment-icon" ></i> + </button> + {{/if}} +--> +</div> + +<div class="clear"></div> <div id="event-location-text">{{$l_text}}</div> -<textarea id="event-location-textarea" name="location">{{$l_orig}}</textarea> + +<textarea id="comment-edit-text-loc" class="comment-edit-text-full" name="location">{{$l_orig}}</textarea> + +<div class="clear"></div> +<div id="comment-tools-loc" class="comment-tools" style="display: block;" > + <div id="comment-edit-bb-loc" class="btn-toolbar pull-left"> + <div class='btn-group'> + <button class="btn btn-default btn-xs" title="{{$edbold}}" onclick="insertbbcomment('{{$comment}}','b', 'loc'); return false;"> + <i class="icon-bold comment-icon"></i> + </button> + <button class="btn btn-default btn-xs" title="{{$editalic}}" onclick="insertbbcomment('{{$comment}}','i', 'loc'); return false;"> + <i class="icon-italic comment-icon"></i> + </button> + <button class="btn btn-default btn-xs" title="{{$eduline}}" onclick="insertbbcomment('{{$comment}}','u', 'loc'); return false;"> + <i class="icon-underline comment-icon"></i> + </button> + <button class="btn btn-default btn-xs" title="{{$edquote}}" onclick="insertbbcomment('{{$comment}}','quote','loc'); return false;"> + <i class="icon-quote-left comment-icon"></i> + </button> + <button class="btn btn-default btn-xs" title="{{$edcode}}" onclick="insertbbcomment('{{$comment}}','code', 'loc'); return false;"> + <i class="icon-terminal comment-icon"></i> + </button> + </div> + + <div class='btn-group'> + <button class="btn btn-default btn-xs" title="{{$edimg}}" onclick="insertbbcomment('{{$comment}}','img', 'loc'); return false;"> + <i class="icon-camera comment-icon"></i> + </button> + <button class="btn btn-default btn-xs" title="{{$edurl}}" onclick="insertbbcomment('{{$comment}}','url', 'loc'); return false;"> + <i class="icon-link comment-icon"></i> + </button> + <button class="btn btn-default btn-xs" title="{{$edvideo}}" onclick="insertbbcomment('{{$comment}}','video', 'loc'); return false;"> + <i class="icon-facetime-video comment-icon"></i> + </button> + </div> + + </div> + +<!-- <div class="btn-group pull-right" id="comment-edit-submit-wrapper-loc"> + {{if $preview}} + <button id="comment-edit-submit-loc" class="btn btn-default btn-xs" onclick="preview_comment(loc); return false;" title="{{$preview}}"> + <i class="icon-eye-open comment-icon" ></i> + </button> + {{/if}} +--> +</div> + + + <br /> +<div class="clear event-form-location-end"></div> + + + <div class='field checkbox'> + <label class="mainlabel" for='id_share'>{{$sh_text}}</label> + <div><input type="checkbox" name='share' id='id_share' value="1" {{$sh_checked}} > + <label class="switchlabel" for='id_share'> <span class="onoffswitch-inner" data-on='' data-off='' ></span> + <span class="onoffswitch-switch"></span> </label></div><span class='field_help'></span> + </div> + -<input type="checkbox" name="share" value="1" id="event-share-checkbox" {{$sh_checked}} /> <div id="event-share-text">{{$sh_text}}</div> <div id="event-share-break"></div> + <button id="event-permissions-button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#aclModal" onclick="return false;">{{$permissions}}</button> - {{$acl}} +{{$acl}} <div class="clear"></div> <input id="event-submit" type="submit" name="submit" value="{{$submit}}" /> diff --git a/view/tpl/event_head.tpl b/view/tpl/event_head.tpl index 830347555..11dba2f9d 100755 --- a/view/tpl/event_head.tpl +++ b/view/tpl/event_head.tpl @@ -118,9 +118,9 @@ $(document).ready(function() { - $('#event-share-checkbox').change(function() { + $('#id_share').change(function() { - if ($('#event-share-checkbox').is(':checked')) { + if ($('#id_share').is(':checked')) { $('#event-permissions-button').show(); } else { |