events are still buggered and aren't anywhere close to working, but not buggered quite as much as before.
This commit is contained in:
parent
31ce6a3876
commit
da188214c3
@ -40,41 +40,6 @@ function findpeople_widget() {
|
||||
}
|
||||
|
||||
|
||||
function networks_widget($baseurl,$selected = '') {
|
||||
|
||||
$a = get_app();
|
||||
|
||||
if(! local_user())
|
||||
return '';
|
||||
|
||||
|
||||
$r = q("select distinct(network) from contact where uid = %d and self = 0",
|
||||
intval(local_user())
|
||||
);
|
||||
|
||||
$nets = array();
|
||||
if(count($r)) {
|
||||
require_once('include/contact_selectors.php');
|
||||
foreach($r as $rr) {
|
||||
if($rr['network'])
|
||||
$nets[] = array('ref' => $rr['network'], 'name' => network_to_name($rr['network']), 'selected' => (($selected == $rr['network']) ? 'selected' : '' ));
|
||||
}
|
||||
}
|
||||
|
||||
if(count($nets) < 2)
|
||||
return '';
|
||||
|
||||
return replace_macros(get_markup_template('nets.tpl'),array(
|
||||
'$title' => t('Networks'),
|
||||
'$desc' => '',
|
||||
'$sel_all' => (($selected == '') ? 'selected' : ''),
|
||||
'$all' => t('All Networks'),
|
||||
'$nets' => $nets,
|
||||
'$base' => $baseurl,
|
||||
|
||||
));
|
||||
}
|
||||
|
||||
function fileas_widget($baseurl,$selected = '') {
|
||||
$a = get_app();
|
||||
|
||||
@ -150,6 +115,7 @@ function common_friends_visitor_widget($profile_uid) {
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME
|
||||
if(! $cid) {
|
||||
if(get_my_url()) {
|
||||
$r = q("select id from contact where nurl = '%s' and uid = %d limit 1",
|
||||
|
@ -177,10 +177,10 @@ function bbtoevent($s) {
|
||||
}
|
||||
|
||||
|
||||
function sort_by_date($a) {
|
||||
|
||||
usort($a,'ev_compare');
|
||||
return $a;
|
||||
function sort_by_date($arr) {
|
||||
if(is_array($arr))
|
||||
usort($arr,'ev_compare');
|
||||
return $arr;
|
||||
}
|
||||
|
||||
|
||||
@ -212,6 +212,8 @@ function event_store($arr) {
|
||||
$arr['message_id'] = (x($arr,'message_id') ? $arr['message_id'] : get_message_id());
|
||||
$arr['private'] = ((x($arr,'private')) ? intval($arr['private']) : 0);
|
||||
|
||||
|
||||
// FIXME
|
||||
if($arr['cid'])
|
||||
$c = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||
intval($arr['cid']),
|
||||
|
@ -238,16 +238,13 @@ function events_content(&$a) {
|
||||
|
||||
|
||||
if (x($_GET,'id')){
|
||||
$r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`,
|
||||
`item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event` LEFT JOIN `item` ON `item`.`event-id` = `event`.`id`
|
||||
WHERE `event`.`uid` = %d AND `event`.`id` = %d",
|
||||
$r = q("SELECT event.*, item.* from event left join item on event.id = item.resource_id where resource_type = 'event' and event.uid = %d and event.id = %d limit 1",
|
||||
intval(local_user()),
|
||||
intval($_GET['id'])
|
||||
);
|
||||
} else {
|
||||
$r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`,
|
||||
`item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event` LEFT JOIN `item` ON `item`.`event-id` = `event`.`id`
|
||||
WHERE `event`.`uid` = %d and ignore = %d
|
||||
$r = q("SELECT event.*, item.* from event left join item on event.id = item.resource_id
|
||||
where resource_type = 'event' and event.uid = %d and event.ignore = %d
|
||||
AND (( `adjust` = 0 AND `finish` >= '%s' AND `start` <= '%s' )
|
||||
OR ( `adjust` = 1 AND `finish` >= '%s' AND `start` <= '%s' )) ",
|
||||
intval(local_user()),
|
||||
@ -262,7 +259,11 @@ function events_content(&$a) {
|
||||
$links = array();
|
||||
|
||||
if($r) {
|
||||
xchan_query($r);
|
||||
$r = fetch_post_tags($r);
|
||||
|
||||
$r = sort_by_date($r);
|
||||
|
||||
foreach($r as $rr) {
|
||||
$j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j'));
|
||||
if(! x($links,$j))
|
||||
@ -277,10 +278,9 @@ function events_content(&$a) {
|
||||
$fmt = t('l, F j');
|
||||
|
||||
if($r) {
|
||||
$r = sort_by_date($r);
|
||||
|
||||
foreach($r as $rr) {
|
||||
|
||||
|
||||
$j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j'));
|
||||
$d = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], $fmt) : datetime_convert('UTC','UTC',$rr['start'],$fmt));
|
||||
$d = day_translate($d);
|
||||
@ -296,6 +296,7 @@ function events_content(&$a) {
|
||||
$is_first = ($d !== $last_date);
|
||||
|
||||
$last_date = $d;
|
||||
// FIXME
|
||||
$edit = ((! $rr['cid']) ? array($a->get_baseurl().'/events/event/'.$rr['id'],t('Edit event'),'','') : null);
|
||||
$title = strip_tags(html_entity_decode(bbcode($rr['summary']),ENT_QUOTES,'UTF-8'));
|
||||
if(! $title) {
|
||||
|
@ -1 +1 @@
|
||||
2013-01-06.192
|
||||
2013-01-07.193
|
||||
|
@ -1,10 +0,0 @@
|
||||
<div id="nets-sidebar" class="widget">
|
||||
<h3>$title</h3>
|
||||
<div id="nets-desc">$desc</div>
|
||||
<a href="$base?nets=all" class="nets-link{{ if $sel_all }} nets-selected{{ endif }} nets-all">$all</a>
|
||||
<ul class="nets-ul">
|
||||
{{ for $nets as $net }}
|
||||
<li><a href="$base?nets=$net.ref" class="nets-link{{ if $net.selected }} nets-selected{{ endif }}">$net.name</a></li>
|
||||
{{ endfor }}
|
||||
</ul>
|
||||
</div>
|
@ -1,10 +0,0 @@
|
||||
<div id="nets-sidebar" class="widget">
|
||||
<h3>{{$title}}</h3>
|
||||
<div id="nets-desc">{{$desc}}</div>
|
||||
<a href="{{$base}}?nets=all" class="nets-link{{if $sel_all}} nets-selected{{/if}} nets-all">{{$all}}</a>
|
||||
<ul class="nets-ul">
|
||||
{{foreach $nets as $net}}
|
||||
<li><a href="{{$base}}?nets={{$net.ref}}" class="nets-link{{if $net.selected}} nets-selected{{/if}}">{{$net.name}}</a></li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
</div>
|
Reference in New Issue
Block a user