From: <ap...@us...> - 2008-11-20 20:22:17
|
Revision: 15704 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=15704&view=rev Author: aproulx Date: 2008-11-20 20:22:08 +0000 (Thu, 20 Nov 2008) Log Message: ----------- [MOD] add checkbox categories in tiki-gallery form and updating imagegallib Modified Paths: -------------- trunk/db/tiki.sql trunk/lib/imagegals/imagegallib.php trunk/templates/tiki-browse_gallery.tpl trunk/templates/tiki-galleries.tpl trunk/tiki-browse_gallery.php trunk/tiki-galleries.php Modified: trunk/db/tiki.sql =================================================================== --- trunk/db/tiki.sql 2008-11-20 17:54:41 UTC (rev 15703) +++ trunk/db/tiki.sql 2008-11-20 20:22:08 UTC (rev 15704) @@ -1049,6 +1049,7 @@ parentgallery int(14) NOT NULL default -1, showname char(1) NOT NULL default 'y', showimageid char(1) NOT NULL default 'n', + showcategories char(1) NOT NULL default 'n', showdescription char(1) NOT NULL default 'n', showcreated char(1) NOT NULL default 'n', showuser char(1) NOT NULL default 'n', Modified: trunk/lib/imagegals/imagegallib.php =================================================================== --- trunk/lib/imagegals/imagegallib.php 2008-11-20 17:54:41 UTC (rev 15703) +++ trunk/lib/imagegals/imagegallib.php 2008-11-20 20:22:08 UTC (rev 15704) @@ -1775,7 +1775,8 @@ return $this->get_image($id, 't'); } - function replace_gallery($galleryId, $name, $description, $theme, $user, $maxRows, $rowImages, $thumbSizeX, $thumbSizeY, $public, $visible = 'y', $sortorder='created', $sortdirection='desc', $galleryimage='first',$parentgallery=-1,$showname='y',$showimageid='n',$showdescription='n',$showcreated='n',$showuser='n',$showhits='y',$showxysize='y',$showfilesize='n',$showfilename='n',$defaultscale='o',$geographic = 'n') { + function replace_gallery($galleryId, $name, $description, $theme, $user, $maxRows, $rowImages, $thumbSizeX, $thumbSizeY, $public, $visible = 'y', $sortorder='created', $sortdirection='desc', +$galleryimage='first',$parentgallery=-1,$showname='y',$showimageid='n',$showdescription='n',$showcategories='n',$showcreated='n',$showuser='n',$showhits='y',$showxysize='y',$showfilesize='n',$showfilename='n',$defaultscale='o',$geographic = 'n') { global $prefs; // if the user is admin or the user is the same user and the gallery exists then replace if not then @@ -1794,16 +1795,20 @@ $query = "update `tiki_galleries` set `name`=?,`visible`=?, `geographic`=?,`maxRows`=? , `rowImages`=?, `thumbSizeX`=?, `thumbSizeY`=?, `description`=?, `theme`=?, `lastModif`=?, `public`=?, `sortorder`=?, `sortdirection`=?, `galleryimage`=?, - `parentgallery`=?,`showname`=?,`showimageid`=?,`showdescription`=?, + `parentgallery`=?,`showname`=?,`showimageid`=?,`showcategories`=?,`showdescription`=?, `showcreated`=?,`showuser`=?,`showhits`=?,`showxysize`=?,`showfilesize`=?, `showfilename`=?,`defaultscale`=?, `user`=? where `galleryId`=?"; - $result = $this->query($query,array($name,$visible,$geographic,(int)$maxRows,(int)$rowImages,(int)$thumbSizeX,(int)$thumbSizeY,$description,$theme,(int)$this->now,$public,$sortorder,$sortdirection,$galleryimage,(int)$parentgallery,$showname,$showimageid,$showdescription,$showcreated,$showuser,$showhits,$showxysize,$showfilesize,$showfilename,$defaultscale,$user,(int)$galleryId)); + $result = +$this->query($query,array($name,$visible,$geographic,(int)$maxRows,(int)$rowImages,(int)$thumbSizeX,(int)$thumbSizeY,$description,$theme,(int)$this->now,$public,$sortorder,$sortdirection,$galleryimage,(int)$parentgallery,$showname,$showimageid,$showdescription,$showcategories,$showcreated,$showuser,$showhits,$showxysize,$showfilesize,$showfilename,$defaultscale,$user,(int)$galleryId)); } else { // Create a new record - $query = "insert into `tiki_galleries`(`name`,`description`,`theme`,`created`,`user`,`lastModif`,`maxRows`,`rowImages`,`thumbSizeX`,`thumbSizeY`,`public`,`hits`,`visible`,`sortorder`,`sortdirection`,`galleryimage`,`parentgallery`,`showname`,`showimageid`,`showdescription`,`showcreated`,`showuser`,`showhits`,`showxysize`,`showfilesize`,`showfilename`,`defaultscale`,`geographic`) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; - $bindvars=array($name,$description,$theme,(int) $this->now,$user,(int) $this->now,(int) $maxRows,(int) $rowImages,(int) $thumbSizeX,(int) $thumbSizeY,$public,0,$visible,$sortorder,$sortdirection,$galleryimage,(int)$parentgallery,$showname,$showimageid,$showdescription,$showcreated,$showuser,$showhits,$showxysize,$showfilesize,$showfilename,$defaultscale,$geographic); + $query = "insert into +`tiki_galleries`(`name`,`description`,`theme`,`created`,`user`,`lastModif`,`maxRows`,`rowImages`,`thumbSizeX`,`thumbSizeY`,`public`,`hits`,`visible`,`sortorder`,`sortdirection`,`galleryimage`,`parentgallery`,`showname`,`showimageid`,`showdescription`,`showcategories`,`showcreated`,`showuser`,`showhits`,`showxysize`,`showfilesize`,`showfilename`,`defaultscale`,`geographic`) +values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + $bindvars=array($name,$description,$theme,(int) $this->now,$user,(int) $this->now,(int) $maxRows,(int) $rowImages,(int) $thumbSizeX,(int) +$thumbSizeY,$public,0,$visible,$sortorder,$sortdirection,$galleryimage,(int)$parentgallery,$showname,$showimageid,$showdescription,$showcategories,$showcreated,$showuser,$showhits,$showxysize,$showfilesize,$showfilename,$defaultscale,$geographic); $result = $this->query($query,$bindvars); $galleryId = $this->getOne("select max(`galleryId`) from `tiki_galleries` where `name`=? and `created`=?",array($name,(int) $this->now)); Modified: trunk/templates/tiki-browse_gallery.tpl =================================================================== --- trunk/templates/tiki-browse_gallery.tpl 2008-11-20 17:54:41 UTC (rev 15703) +++ trunk/templates/tiki-browse_gallery.tpl 2008-11-20 20:22:08 UTC (rev 15704) @@ -91,6 +91,13 @@ {tr}Subgallery{/tr}: {if $showname=='y' || $showfilename=='y'}{$item.name}<br />{/if} {if $showimageid=='y'}{tr}ID{/tr}: {$item.galleryId}<br />{/if} + {if $showcategories=='y'} + {tr}Categories{/tr}: + {section name=categ loop=item.categories} + <li>{$item.categories[categ]}</li> + {/section} + </ul><br /> + {/if} {if $showdescription=='y'}{$item.description}<br />{/if} {if $showcreated=='y'}{tr}Created{/tr}: {$item.created|tiki_short_date}<br />{/if} {if $showuser=='y'}{tr}User{/tr}: {$item.user|userlink}<br />{/if} @@ -115,20 +122,19 @@ </a> {/if} <br /> - {* categories for item *} - {if $item.categories} - <span class='categories'>{tr}Categories{/tr}: - <ul class='categories'> - {section name=categ loop=$item.categories} - <li>{$item.categories[categ]}</li> - {/section} - </ul></span><br /> - {/if} - <small class="caption"> + <small class="caption"> {if $prefs.gal_image_mouseover neq 'only'} {if $showname=='y'}{$item.name}<br />{/if} {if $showfilename=='y'}{tr}Filename{/tr}: {$item.filename}<br />{/if} {if $showimageid=='y'}{tr}ID{/tr}: {$item.imageId}<br />{/if} + {if $showcategories=='y'} + {tr}Categories{/tr}: + <ul class='categories'> + {section name=categ loop=$item.categories} + <li>{$item.categories[categ]}</li> + {/section} + </ul><br /> + {/if} {if $showdescription=='y'}{$item.description}<br />{/if} {if $showcreated=='y'}{tr}Created{/tr}: {$item.created|tiki_short_date}<br />{/if} {if $showuser=='y'}{tr}User{/tr}: {$item.user|userlink}<br />{/if} Modified: trunk/templates/tiki-galleries.tpl =================================================================== --- trunk/templates/tiki-galleries.tpl 2008-11-20 17:54:41 UTC (rev 15703) +++ trunk/templates/tiki-galleries.tpl 2008-11-20 20:22:08 UTC (rev 15704) @@ -1,5 +1,5 @@ {* $Id$ *} - +{debug} {title help="Image+Galleries" admpage="gal"}{tr}Galleries{/tr}{/title} {if $tiki_p_create_galleries eq 'y'} @@ -57,6 +57,7 @@ <input type="checkbox" name="showname" value="y" {if $showname=='y'}checked="checked"{/if} />{tr}Name{/tr}<br /> <input type="checkbox" name="showimageid" value="y" {if $showimageid=='y'}checked="checked"{/if} />{tr}Image ID{/tr}<br /> <input type="checkbox" name="showdescription" value="y" {if $showdescription=='y'}checked="checked"{/if} />{tr}Description{/tr}<br /> + <input type="checkbox" name="showcategories" value="y" {if $showcategories=='y'}checked="checked"{/if} />{tr}Categories{/tr}<br /> <input type="checkbox" name="showcreated" value="y" {if $showcreated=='y'}checked="checked"{/if} />{tr}Creation Date{/tr}<br /> <input type="checkbox" name="showuser" value="y" {if $showuser=='y'}checked="checked"{/if} />{tr}User{/tr}<br /> <input type="checkbox" name="showhits" value="y" {if $showhits=='y'}checked="checked"{/if} />{tr}Hits{/tr}<br /> Modified: trunk/tiki-browse_gallery.php =================================================================== --- trunk/tiki-browse_gallery.php 2008-11-20 17:54:41 UTC (rev 15703) +++ trunk/tiki-browse_gallery.php 2008-11-20 20:22:08 UTC (rev 15704) @@ -127,6 +127,7 @@ $gal_info["description"] = 'System Gallery'; $gal_info['showname'] ='y'; $gal_info['showimageid'] ='n'; + $gal_info['showcategories'] ='n'; $gal_info['showdescription'] ='n'; $gal_info['showcreated'] ='n'; $gal_info['showuser'] ='n'; @@ -143,6 +144,7 @@ $smarty->assign_by_ref('galleryId', $_REQUEST["galleryId"]); $smarty->assign_by_ref('showname', $gal_info['showname']); $smarty->assign_by_ref('showimageid', $gal_info['showimageid']); +$smarty->assign_by_ref('showcategories', $gal_info['showcategories']); $smarty->assign_by_ref('showdescription', $gal_info['showdescription']); $smarty->assign_by_ref('showcreated', $gal_info['showcreated']); $smarty->assign_by_ref('showuser', $gal_info['showuser']); Modified: trunk/tiki-galleries.php =================================================================== --- trunk/tiki-galleries.php 2008-11-20 17:54:41 UTC (rev 15703) +++ trunk/tiki-galleries.php 2008-11-20 20:22:08 UTC (rev 15704) @@ -124,6 +124,7 @@ $smarty->assign('sortdirection','desc'); $smarty->assign('showname','y'); $smarty->assign('showimageid','n'); +$smarty->assign('showcategories','n'); $smarty->assign('showdescription','n'); $smarty->assign('showcreated','n'); $smarty->assign('showuser','n'); @@ -177,6 +178,7 @@ $smarty->assign('parentgallery',$info['parentgallery']); $smarty->assign('showname',$info['showname']); $smarty->assign('showimageid',$info['showimageid']); + $smarty->assign('showcategories',$info['showcategories']); $smarty->assign('showdescription',$info['showdescription']); $smarty->assign('showcreated',$info['showcreated']); $smarty->assign('showuser',$info['showuser']); @@ -238,7 +240,7 @@ $smarty->assign('galleryimage',$_REQUEST['galleryimage']); $smarty->assign('parentgallery',$_REQUEST['parentgallery']); $smarty->assign('defaultscale',$_REQUEST['defaultscale']); - $auxarray=array('showname','showimageid','showdescription','showcreated','showuser','showhits','showxysize','showfilesize','showfilename'); + $auxarray=array('showname','showimageid','showcategories','showdescription','showcreated','showuser','showhits','showxysize','showfilesize','showfilename'); foreach($auxarray as $key => $item) { if(!isset($_REQUEST[$item])) { $_REQUEST[$item]='n'; @@ -267,7 +269,7 @@ $gid = $imagegallib->replace_gallery($_REQUEST["galleryId"], $_REQUEST["name"], $_REQUEST["description"], '', $_REQUEST["owner"], $_REQUEST["maxRows"], $_REQUEST["rowImages"], $_REQUEST["thumbSizeX"], $_REQUEST["thumbSizeY"], $public, $visible,$_REQUEST['sortorder'],$_REQUEST['sortdirection'],$_REQUEST['galleryimage'],$_REQUEST['parentgallery'], - $_REQUEST['showname'],$_REQUEST['showimageid'],$_REQUEST['showdescription'],$_REQUEST['showcreated'], + $_REQUEST['showname'],$_REQUEST['showimageid'],$_REQUEST['showdescription'],$_REQUEST['showcategories'],$_REQUEST['showcreated'], $_REQUEST['showuser'],$_REQUEST['showhits'],$_REQUEST['showxysize'],$_REQUEST['showfilesize'],$_REQUEST['showfilename'],$_REQUEST['defaultscale'],$geographic); #add scales @@ -322,7 +324,7 @@ $smarty->assign('galleryimage',$_REQUEST['galleryimage']); $smarty->assign('parentgallery',$_REQUEST['parentgallery']); $smarty->assign('defaultscale',$_REQUEST['defaultscale']); - $auxarray=array('showname','showimageid','showdescription','showcreated','showuser','showhits','showxysize','showfilesize','showfilename'); + $auxarray=array('showname','showimageid','showdescription','showcategories','showcreated','showuser','showhits','showxysize','showfilesize','showfilename'); foreach($auxarray as $key => $item) { if(!isset($_REQUEST[$item])) { $_REQUEST[$item]='n'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |