Re: xcgal Plugin for PiCal
List posts in the topic
Re: xcgal Plugin for PiCal
msg# 1.1.1
Table name: xoops_xcgal_pictures
Directory: xcgal
My attempt (at modifying mylinks.php).
I changed:
- lid --> pid
- date --> ctime
- cid --> aid
I also tried modifying some of the things in the while loop, but nothing seems to make a difference.
==
<?php
// a plugin for mylinks
if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
/*
$db : db instance
$myts : MyTextSanitizer instance
$this->year : year
$this->month : month
$this->date : date
$this->week_start : sunday:0 monday:1
$this->user_TZ : user's timezone (+1.5 etc)
$this->server_TZ : server's timezone (-2.5 etc)
$tzoffset_s2u : the offset from server to user
$now : the result of time()
$plugin = array('dirname'=>'dirname','name'=>'name','dotgif'=>'*.gif')
$plugin_returns[ DATE ][]
*/
// set range (added 86400 second margin "begin" & "end")
$wtop_date = $this->date - ( $this->day - $this->week_start + 7 ) % 7 ;
$range_start_s = mktime(0,0,0,$this->month,$wtop_date-1,$this->year) ;
$range_end_s = mktime(0,0,0,$this->month,$wtop_date+8,$this->year) ;
// query (added 86400 second margin "begin" & "end")
$result = $db->query( "SELECT title,pid,`ctime`,aid FROM ".$db->prefix("xcgal_pictures")." WHERE `ctime` >= $range_start_s AND `ctime` < $range_end_s AND `status` > 0" ) ;
while( list( $title , $id , $server_time , $cid ) = $db->fetchRow( $result ) ) {
$user_time = $server_time + $tzoffset_s2u ;
// if( date( 'n' , $user_time ) != $this->month ) continue ;
$target_date = date('j',$user_time) ;
$tmp_array = array(
'dotgif' => $plugin['dotgif'] ,
'dirname' => $plugin['dirname'] ,
'link' => XOOPS_URL."/modules/{$plugin['dirname']}/singlelink.php?lid=$id&cid=$cid&caldate={$this->year}-{$this->month}-$target_date" ,
'id' => $id ,
'server_time' => $server_time ,
'user_time' => $user_time ,
'name' => 'lid' ,
'title' => $myts->makeTboxData4Show( $title )
) ;
// multiple gifs allowed per a plugin & per a day
$plugin_returns[ $target_date ][] = $tmp_array ;
}
?>
==
Also note that obviously singlelink.php won't work, but that should really not be relevant for 'just' showing the dots ;).
Votes:10
Average:0.00
Posts tree