msg# 1
I managed to change the mylinks.php plugin into a wflinks plugin and the mydownloads plugin into a wfdownloads plugin.
However, the xcgal plugin is giving me problems. I tried taking the mylinks plugin and changing table / directory / column names in that php file, but it doesn't work.
Maybe someone could point me at what I am missing?
Votes:0
Average:0.00
msg# 1.1
xcgal_pictures table creation script:
==
CREATE TABLE `xoops_xcgal_pictures` (
`pid` int(11) NOT NULL auto_increment,
`aid` int(11) NOT NULL default '0',
`filepath` varchar(255) NOT NULL default '',
`filename` varchar(255) NOT NULL default '',
`filesize` int(11) NOT NULL default '0',
`total_filesize` int(11) NOT NULL default '0',
`pwidth` smallint(6) NOT NULL default '0',
`pheight` smallint(6) NOT NULL default '0',
`hits` int(10) NOT NULL default '0',
`mtime` int(11) NOT NULL default '0',
`ctime` int(11) NOT NULL default '0',
`owner_id` int(11) NOT NULL default '0',
`owner_name` varchar(40) NOT NULL default '',
`pic_rating` int(11) NOT NULL default '0',
`votes` int(11) NOT NULL default '0',
`title` varchar(255) NOT NULL default '',
`caption` text NOT NULL,
`keywords` varchar(255) NOT NULL default '',
`approved` enum('YES','NO') NOT NULL default 'NO',
`user1` varchar(255) NOT NULL default '',
`user2` varchar(255) NOT NULL default '',
`user3` varchar(255) NOT NULL default '',
`user4` varchar(255) NOT NULL default '',
`url_prefix` tinyint(4) NOT NULL default '0',
`randpos` int(11) NOT NULL default '0',
`ip` varchar(15) NOT NULL default '',
`sent_card` int(10) NOT NULL default '0',
PRIMARY KEY (`pid`),
KEY `pic_hits` (`hits`),
KEY `pic_rate` (`pic_rating`),
KEY `aid_approved` (`aid`,`approved`),
KEY `randpos` (`randpos`),
KEY `pic_aid` (`aid`)
) TYPE=MyISAM AUTO_INCREMENT=19 ;
==
Votes:27
Average:0.37
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
msg# 1.1.1.1
Some sample data:
==
INSERT INTO `xoops_xcgal_pictures` VALUES (4, 5, 'userpics/asdffdsaupload/', '00_De_voorbereiding_gaat_voorspoedig.jpg', 211617, 253928, 2048, 1536, 1, 1136601790, 1136601692, 1, 'Corbulo', 0, 0, '00 - De voorbereiding', 'De penningmeester, voorzitter en wedstrijdleider spannen zich in om voorbereid te zijn op het 50-jarig jubileum.', '', 'YES', '', '', '', '', 0, 0, '', 0);
INSERT INTO `xoops_xcgal_pictures` VALUES (3, 5, 'userpics/asdffdsaupload/', '02-De 50 jaar Corbulo taart staat klaar.JPG', 247103, 299880, 2048, 1536, 0, 1136601691, 1136601691, 1, 'Corbulo', 0, 0, '02 - De 50 jaar taart', 'Speciaal voor het 50 jarig jubileum hebben we een taart laten maken. Inclusief een schaakprobleem voor de liefhebbers.', '', 'YES', '', '', '', '', 0, 0, '', 0);
INSERT INTO `xoops_xcgal_pictures` VALUES (5, 5, 'userpics/asdffdsaupload/', '01-Het oudste ex-lid is van de partij.JPG', 342943, 376227, 1536, 2048, 1, 1136604250, 1136601695, 1, 'Corbulo', 0, 0, '01 - Het oudste ex-lid', 'Het oudste ex-lid is als eregast uitgenodigd. Gelukkig is hij in de gelegenheid om langs te komen.', '', 'YES', '', '', '', '', 0, 0, '', 0);
==
Enough spamming ;).
Votes:6
Average:10.00
msg# 1.1.1.1.1
A smartsection plugin was also easy. xcgal is still resisting though =(.
Votes:8
Average:0.00
msg# 1.1.1.1.1.1
Anyone have any idea on this subject? This problem is still bugging me ;)
Votes:7
Average:8.57
msg# 1.2
Guy69
From: France
Posts: 1
Hello,
I want to change the mydownloads plugin into a wfdownloads plugin but I don't know how ...
sorry for my bad english
Guy
Votes:1
Average:10.00
msg# 1.1.1.1.1.1.1
I'm sorry that I didnot read whole of your post.
Did you fail to create a piCal plugin for xcgal?
I don't know xcgal well, it is not so difficult. (perhaps)
But I'm too busy now.
If you can, contact this site.
http://voicha.sytes.net/voice/He/she made piCal plugins for ...
- newbb
- mybbs
- PukiwikiMod
- sysetm (new user)
- Xmovie
- myAds
- popnupblog
Votes:1
Average:10.00
msg# 1.2.1
wfdownloads monthly plugin:
<?php
// a plugin for mydownloads
if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
/*
$db : db instance
$myts : MyTextSanitizer instance
$this->year : year
$this->month : month
$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')
$just1gif : 0 or 1
$plugin_returns[ DATE ][]
*/
// set range (added 86400 second margin "begin" & "end")
$range_start_s = mktime(0,0,0,$this->month,0,$this->year) ;
$range_end_s = mktime(0,0,0,$this->month+1,1,$this->year) ;
// query (added 86400 second margin "begin" & "end")
$result = $db->query( "SELECT title,lid,`published`,cid FROM ".$db->prefix("wfdownloads_downloads")." WHERE `published` >= $range_start_s AND `published` < $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']}/singlefile.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 )
) ;
if( $just1gif ) {
// just 1 gif per a plugin & per a day
$plugin_returns[ $target_date ][ $plugin['dirname'] ] = $tmp_array ;
} else {
// multiple gifs allowed per a plugin & per a day
$plugin_returns[ $target_date ][] = $tmp_array ;
}
}
?>
Votes:9
Average:8.89
msg# 1.1.1.1.1.1.1.1
I contacted the site. Will post solution if I find one.
Votes:17
Average:4.71
msg# 1.1.1.1.1.1.1.1.1
As promised, here is the code for the xcgal Plugin (monthly & calendar view). Thanks to NAO8 for providing this code!
==
///xcGalCode
<?php
// a plugin for xcgal
if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
/*
$db : db instance
$myts : MyTextSanitizer instance
$this->year : year
$this->month : month
$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')
$just1gif : 0 or 1
$plugin_returns[ DATE ][]
*/
// set range (added 86400 second margin "begin" & "end")
$range_start_s = mktime(0,0,0,$this->month,0,$this->year) ;
$range_end_s = mktime(0,0,0,$this->month+1,1,$this->year) ;
// query
$result = $db->query( "SELECT title,pid,`ctime` FROM ".$db->prefix("xcgal_pictures")." WHERE
`ctime` >= $range_start_s AND `ctime` < $range_end_s" ) ;
while( list( $title , $id , $server_time ) = $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']}/displayimage.php?pid=$id" ,
'id' => $id ,
'server_time' => $server_time ,
'user_time' => $user_time ,
'name' => 'pid' ,
'title' => $myts->makeTboxData4Show( $title )
) ;
if( $just1gif ) {
// just 1 gif per a plugin & per a day
$plugin_returns[ $target_date ][ $plugin['dirname'] ] = $tmp_array ;
} else {
// multiple gifs allowed per a plugin & per a day
$plugin_returns[ $target_date ][] = $tmp_array ;
}
}
?>
///end
Edit: Added codes.
Votes:19
Average:10.00
msg# 1.1.1.1.1.1.1.1.1.1
good work
And you'd better enclose PHP codes by [ code][ /code] (remove a space just after bracket).
At a glance, the plugin misses the feature of "admission", is it enough for you?
(If you use xcgal as "photos are always admitted just by uploading", I can say it's enough)
Votes:1
Average:0.00
msg# 1.1.1.1.1.1.1.1.1.1.1
At first I didn't understand what you meant, but I now assume you mean that not yet 'admitted' photo's shouldn't be shown as new yet.
That shouldn't be a problem. Visitor upload is turned off & the only one's that add pictures are moderators --> Those pictures get admitted automatically.
--> It should be enough
.
Votes:23
Average:3.48
msg# 1.1.1.1.1.1.1.1.1.1.1.1
Any new updates for the xcGal plugin? Just curious cause my site allows registered users to post images to the galleries, not just admin.
Votes:1
Average:10.00