Merge pull request #327 from fabrixxm/master

events: fix select events query
This commit is contained in:
fabrixxm 2012-06-07 08:43:55 -07:00
commit fcf8f301e5
3 changed files with 6 additions and 4 deletions

4
include/oembed.php Normal file → Executable file
View file

@ -65,7 +65,8 @@ function oembed_fetch_url($embedurl){
} }
function oembed_format_object($j){ function oembed_format_object($j){
$embedurl = $j->embedurl; $a = get_app();
$embedurl = $j->embedurl;
$jhtml = oembed_iframe($j->embedurl,(isset($j->width) ? $j->width : null), (isset($j->height) ? $j->height : null) ); $jhtml = oembed_iframe($j->embedurl,(isset($j->width) ? $j->width : null), (isset($j->height) ? $j->height : null) );
$ret="<span class='oembed ".$j->type."'>"; $ret="<span class='oembed ".$j->type."'>";
switch ($j->type) { switch ($j->type) {
@ -78,6 +79,7 @@ function oembed_format_object($j){
$th=120; $tw = $th*$tr; $th=120; $tw = $th*$tr;
$tpl=get_markup_template('oembed_video.tpl'); $tpl=get_markup_template('oembed_video.tpl');
$ret.=replace_macros($tpl, array( $ret.=replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(),
'$embedurl'=>$embedurl, '$embedurl'=>$embedurl,
'$escapedhtml'=>base64_encode($jhtml), '$escapedhtml'=>base64_encode($jhtml),
'$tw'=>$tw, '$tw'=>$tw,

4
mod/events.php Normal file → Executable file
View file

@ -230,8 +230,8 @@ function events_content(&$a) {
$r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`, $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` `item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event` LEFT JOIN `item` ON `item`.`event-id` = `event`.`id`
WHERE `event`.`uid` = %d WHERE `event`.`uid` = %d
AND (( `adjust` = 0 AND `start` >= '%s' AND `start` <= '%s' ) AND (( `adjust` = 0 AND `finish` >= '%s' AND `start` <= '%s' )
OR ( `adjust` = 1 AND `start` >= '%s' AND `start` <= '%s' )) ", OR ( `adjust` = 1 AND `finish` >= '%s' AND `start` <= '%s' )) ",
intval(local_user()), intval(local_user()),
dbesc($start), dbesc($start),
dbesc($finish), dbesc($finish),

2
view/oembed_video.tpl Normal file → Executable file
View file

@ -1,4 +1,4 @@
<a href='$embedurl' onclick='this.innerHTML=Base64.decode("$escapedhtml"); return false;' style='float:left; margin: 1em; position: relative;'> <a href='$embedurl' onclick='this.innerHTML=Base64.decode("$escapedhtml"); return false;' style='float:left; margin: 1em; position: relative;'>
<img width='$tw' height='$th' src='$turl' > <img width='$tw' height='$th' src='$turl' >
<div style='position: absolute; top: 0px; left: 0px; width: $twpx; height: $thpx; background: url(images/icons/48/play.png) no-repeat center center;'></div> <div style='position: absolute; top: 0px; left: 0px; width: $twpx; height: $thpx; background: url($baseurl/images/icons/48/play.png) no-repeat center center;'></div>
</a> </a>