Commit e3bc3d72 authored by sylvieg's avatar sylvieg

Instant-Auto-Merge from BRANCH-1-9 to HEAD

parent d0180fe7
......@@ -2393,6 +2393,7 @@ tiki/img/flags/Ecuador.gif -text
tiki/img/flags/Egypt.gif -text
tiki/img/flags/El_Salvador.gif -text
tiki/img/flags/Estonia.gif -text
tiki/img/flags/Europe.gif -text
tiki/img/flags/Federated_States_of_Micronesia.gif -text
tiki/img/flags/Fiji.gif -text
tiki/img/flags/Finland.gif -text
......@@ -2485,6 +2486,7 @@ tiki/img/flags/Uruguay.gif -text
tiki/img/flags/Vanuatu.gif -text
tiki/img/flags/Venezuela.gif -text
tiki/img/flags/Wales.gif -text
tiki/img/flags/World.gif -text
tiki/img/flags/Yugoslavia.gif -text
tiki/img/flags/Zambia.gif -text
tiki/img/flags/Zimbabwe.gif -text
......@@ -2568,6 +2570,7 @@ tiki/img/icons/admin_general.png -text
tiki/img/icons/admin_gmap.png -text
tiki/img/icons/admin_gmap_grey.png -text
tiki/img/icons/admin_homework.png -text
tiki/img/icons/admin_i18n.png -text
tiki/img/icons/admin_imagegal.png -text
tiki/img/icons/admin_imagegal_grey.png -text
tiki/img/icons/admin_intertiki.png -text
......@@ -2834,6 +2837,7 @@ tiki/img/icons/zoom-2.gif -text
tiki/img/icons/zoom-3.gif -text
tiki/img/icons/zoom-4.gif -text
tiki/img/icons/zoom.gif -text
tiki/img/icons/zoom_equal.gif -text
tiki/img/icons2/1.gif -text
tiki/img/icons2/8.gif -text
tiki/img/icons2/admin.gif -text
......@@ -2865,6 +2869,8 @@ tiki/img/icons2/computer.gif -text
tiki/img/icons2/contact.gif -text
tiki/img/icons2/contacts.gif -text
tiki/img/icons2/corner-dots.gif -text
tiki/img/icons2/cycle_next.gif -text
tiki/img/icons2/cycle_prev.gif -text
tiki/img/icons2/delete.gif -text
tiki/img/icons2/delete2.gif -text
tiki/img/icons2/delete_all.gif -text
......@@ -2967,6 +2973,8 @@ tiki/img/icons2/reduceW.gif -text
tiki/img/icons2/reload.gif -text
tiki/img/icons2/search.gif -text
tiki/img/icons2/shim.gif -text
tiki/img/icons2/slide2first.gif -text
tiki/img/icons2/slide2last.gif -text
tiki/img/icons2/smartfolder.gif -text
tiki/img/icons2/status_closed.gif -text
tiki/img/icons2/status_closed_off.gif -text
......@@ -3518,6 +3526,7 @@ tiki/lib/htmlparser/htmlparser.inc -text
tiki/lib/htmlparser/index.php -text
tiki/lib/htmlparser/readme.eng.txt -text
tiki/lib/htmlparser/rebuildgrammar.php -text
tiki/lib/imagegals/imagegallib.js -text
tiki/lib/imagegals/imagegallib.php -text
tiki/lib/imagegals/index.php -text
tiki/lib/index.php -text
......@@ -3878,6 +3887,8 @@ tiki/lib/phpcas/source/examples/example_session_proxy.php -text
tiki/lib/phpcas/source/examples/example_session_service.php -text
tiki/lib/phpcas/source/examples/example_simple.php -text
tiki/lib/phplayers_tiki/index.php -text
tiki/lib/phplayers_tiki/lib/index.php -text
tiki/lib/phplayers_tiki/lib/layersmenu-common.inc.php -text
tiki/lib/phplayers_tiki/tiki-phplayers.php -text
tiki/lib/polls/index.php -text
tiki/lib/polls/polllib.php -text
......@@ -4032,6 +4043,7 @@ tiki/lib/smarty_tiki/prefilter.tr.php -text
tiki/lib/smarty_tiki/resource.style.php -text
tiki/lib/snoopy/README -text
tiki/lib/snoopy/Snoopy.class.inc -text
tiki/lib/snoopy/Snoopy.class.php -text
tiki/lib/snoopy/index.php -text
tiki/lib/stats/index.php -text
tiki/lib/stats/statslib.php -text
......@@ -4216,6 +4228,7 @@ tiki/lib/wiki-plugins/wikiplugin_rss.php -text
tiki/lib/wiki-plugins/wikiplugin_sf.php -text
tiki/lib/wiki-plugins/wikiplugin_sheet.php -text
tiki/lib/wiki-plugins/wikiplugin_showpages.php -text
tiki/lib/wiki-plugins/wikiplugin_skype.php -text
tiki/lib/wiki-plugins/wikiplugin_snarf.php -text
tiki/lib/wiki-plugins/wikiplugin_sort.php -text
tiki/lib/wiki-plugins/wikiplugin_split.php -text
......@@ -4226,6 +4239,7 @@ tiki/lib/wiki-plugins/wikiplugin_thumb.php -text
tiki/lib/wiki-plugins/wikiplugin_titlesearch.php -text
tiki/lib/wiki-plugins/wikiplugin_topfriends.php -text
tiki/lib/wiki-plugins/wikiplugin_tracker.php -text
tiki/lib/wiki-plugins/wikiplugin_trackerfilter.php -text
tiki/lib/wiki-plugins/wikiplugin_trackerlist.php -text
tiki/lib/wiki-plugins/wikiplugin_translated.php -text
tiki/lib/wiki-plugins/wikiplugin_usercount.php -text
......@@ -4782,6 +4796,7 @@ tiki/templates/modules/mod-directory_last_sites.tpl -text
tiki/templates/modules/mod-directory_stats.tpl -text
tiki/templates/modules/mod-directory_top_sites.tpl -text
tiki/templates/modules/mod-eph.tpl -text
tiki/templates/modules/mod-events.tpl -text
tiki/templates/modules/mod-featured_links.tpl -text
tiki/templates/modules/mod-forums_best_voted_topics.tpl -text
tiki/templates/modules/mod-forums_last_posts.tpl -text svneol=unset#application/octet-stream
......@@ -4953,6 +4968,12 @@ tiki/templates/styles/simple/modules/mod-last_images_th.tpl -text
tiki/templates/styles/simple/modules/mod-last_modif_pages.tpl -text
tiki/templates/styles/simple/modules/mod-login_box.tpl -text
tiki/templates/styles/simple/modules/mod-quick_edit.tpl -text
tiki/templates/styles/simple/modules/mod-register.tpl -text
tiki/templates/styles/simple/modules/mod-search_box.tpl -text
tiki/templates/styles/simple/modules/mod-search_new.tpl -text
tiki/templates/styles/simple/modules/mod-search_wiki_page.tpl -text
tiki/templates/styles/simple/modules/mod-search_wiki_page_new.tpl -text
tiki/templates/styles/simple/modules/mod-shoutbox.tpl -text
tiki/templates/styles/simple/modules/mod-switch_lang.tpl -text
tiki/templates/styles/simple/modules/mod-switch_lang2.tpl -text
tiki/templates/styles/simple/modules/mod-switch_theme.tpl -text
......@@ -5017,6 +5038,7 @@ tiki/templates/tiki-admin-include-freetags.tpl -text
tiki/templates/tiki-admin-include-gal.tpl -text
tiki/templates/tiki-admin-include-general.tpl -text
tiki/templates/tiki-admin-include-gmap.tpl -text
tiki/templates/tiki-admin-include-i18n.tpl -text
tiki/templates/tiki-admin-include-intertiki.tpl -text
tiki/templates/tiki-admin-include-list-sections.tpl -text
tiki/templates/tiki-admin-include-login.tpl -text
......@@ -5246,6 +5268,7 @@ tiki/templates/tiki-pagination.tpl -text
tiki/templates/tiki-pick_avatar.tpl -text
tiki/templates/tiki-plugin_poll.tpl -text
tiki/templates/tiki-plugin_sql.tpl -text
tiki/templates/tiki-plugin_trackerfilter.tpl -text
tiki/templates/tiki-plugin_trackerlist.tpl -text
tiki/templates/tiki-poll.tpl -text
tiki/templates/tiki-poll_form.tpl -text
......@@ -5357,6 +5380,7 @@ tiki/templates/tiki-workspaces_view_module.tpl -text
tiki/templates/tiki-workspaces_zones.tpl -text
tiki/templates/tiki.tpl -text
tiki/templates/translated-lang.tpl -text
tiki/templates/wiki-plugins/wikiplugin_trackerfilter.tpl -text
tiki/templates_c/.cvsignore -text
tiki/templates_c/.htaccess -text svneol=unset#application/octet-stream
tiki/templates_c/README -text
......@@ -5408,6 +5432,7 @@ tiki/tiki-admin_include_freetags.php -text
tiki/tiki-admin_include_gal.php -text
tiki/tiki-admin_include_general.php -text
tiki/tiki-admin_include_gmap.php -text
tiki/tiki-admin_include_i18n.php -text
tiki/tiki-admin_include_intertiki.php -text
tiki/tiki-admin_include_jukebox.php -text
tiki/tiki-admin_include_login.php -text
......@@ -5584,6 +5609,7 @@ tiki/tiki-image_gallery_rss.php -text
tiki/tiki-imexport_languages.php -text
tiki/tiki-import_sheet.php -text
tiki/tiki-import_structuredtext.php -text
tiki/tiki-import_tracker.php -text
tiki/tiki-index.php -text
tiki/tiki-index_p.php -text
tiki/tiki-index_raw.php -text
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/categorize_list.php,v 1.17 2006-01-21 18:51:58 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/categorize_list.php,v 1.18 2006-08-29 20:19:01 sylvieg Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -43,6 +43,9 @@ if ($feature_categories == 'y') {
if (isset($_REQUEST["cat_categories"]) && isset($_REQUEST["cat_categorize"]) && $_REQUEST["cat_categorize"] == 'on') {
if (in_array($categories[$i]["categId"], $_REQUEST["cat_categories"])) {
$categories[$i]["incat"] = 'y';
// allow to preselect categories when creating a new article
// like this: /tiki-edit_article.php?cat_categories[]=1&cat_categorize=on
$smarty->assign('categ_checked', 'y');
} else {
$categories[$i]["incat"] = 'n';
}
......
......@@ -15,7 +15,7 @@ Use the following tags to distinguish changes :
Please wrap your lines at 80 characters and indent them with spaces only.
<Version 1.10
<<<Version 1.10
<http://tikiwiki.org/ReleaseProcess110>
------------------
[MOD] added crypt-md5 and crypt-des support
......@@ -24,6 +24,17 @@ Version 1.9.5
<http://tikiwiki.org/ReleaseProcess195>
------------------
[MOD] Images galleries links simplyfied
[MOD] Images galleries controls enhanced
[FIX] Use gallery's default for image scale or sort order if none in browse and show images
[FIX] Navigation in image browsing
[FIX] Once image gallery saved , avoid double create link display
[FIX] keep menus wide open if javascript or cookies not allowed
[MOD] update to latest version of PhpLayersMenu (3.2.0-rc)
[MOD] new files (copy for Tiki for modifications) to prevent overriding of original files of the PLM package
[FIX] styles: Simple style fixes for PLM and other enhancements
[MOD] calendar: added categories support for theme control purpose
[MOD] users: added an option to make optional the optionality of recieving internal messages
[MOD] imagegal: added in admin panel a way to move images from db to filesystem
[MOD] users: added an option to have new users accept internal messages by default
[FIX] tiki-index_p.php: typo feature_wiki_usrlock
......@@ -66,7 +77,7 @@ Version 1.9.4
[FIX] Enables download of file galery 's files bigger than 2MB
>>>>>>> 1.157.2.37
>>>>>>> 1.157.2.41
Version 1.9.3.1
<http://tikiwiki.org/ReleaseProcess193>
- 04/30/2006
......
TikiWIki - CMS/Groupware
TikiWiki - CMS/Groupware
README for /db directory
========================
......@@ -9,7 +9,7 @@ This directory contains a multitude of database-releated files.
developer information
=====================
When adding, changing or removing SQL statements from Tiki, please update tiki.sql and the appropriate conversion file (e.g. tiki_1.9to1.10.sql for chhanges added between release 1.9 and 1.10 of TikiWiki.
When adding, changing or removing SQL statements from Tiki, please update tiki.sql and the appropriate conversion file (e.g. tiki_1.9to1.10.sql for changes added between release 1.9 and 1.10 of TikiWiki).
Please remember that the database schema is frozen after first official release of each major version.
......@@ -18,7 +18,7 @@ The database-specific versions of the sql files are generated automatically usin
caveats
=======
An oversight lead to an inconsistent schema for TikiWIki 1.9.0 which was fixed in 1.9.1. For all intents and purposes, 1.9.0 should be view historically as a release candidate and other 1.9.x releases declair their schema as version 1.9.1
In theory, the database structure is not supposed to change in minor releases (ex.: 1.9.1 to 1.9.2). However, some bugs were found which made it necessary to modify the database structure. And once the database structure was no longer frozen, a few more settings for features were added.
security information
......
# $Header: /cvsroot/tikiwiki/tiki/db/tiki_1.8to1.9.sql,v 1.106 2006-07-14 11:00:46 sylvieg Exp $
# $Header: /cvsroot/tikiwiki/tiki/db/tiki_1.8to1.9.sql,v 1.107 2006-08-29 20:19:03 sylvieg Exp $
# The following script will update a tiki database from verion 1.8 to 1.9
# The following script will update a tiki database from version 1.8.x to 1.9.x
# The following script will ALSO update from version 1.9.x to 1.9.y
#
# Ex.: If you upgrading from Tiki 1.9.2 to 1.9.4, you NEED to run this script.
#
# To execute this file do the following:
#
# $ mysql -f dbname < tiki_1.8to1.9.sql
......@@ -1279,3 +1282,9 @@ INSERT IGNORE INTO tiki_preferences(name,value) VALUES ('feature_cms_print','y')
# 2006-07-05 new preferences eq 'y' to keep the default - toggg
INSERT IGNORE INTO tiki_preferences(name,value) VALUES ('feature_trackbackpings','y');
INSERT IGNORE INTO tiki_preferences(name,value) VALUES ('feature_blogposts_pings','y');
# 2006-07-31 slideshow default enabled - toggg
INSERT IGNORE INTO tiki_preferences(name,value) VALUES ('feature_gal_slideshow','y');
#2006-08-14 sylvieg
ALTER TABLE tiki_tracker_item_fields ADD FULLTEXT ft (value);
<?php
// $Header: /cvsroot/tikiwiki/tiki/lib/blogs/bloglib.php,v 1.48 2006-08-29 20:19:05 sylvieg Exp $
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
......@@ -46,7 +46,7 @@ class BlogLib extends TikiLib {
$parts = parse_url($_SERVER['REQUEST_URI']);
$uri = $tikilib->httpPrefix(). str_replace('tiki-blog_post',
'tiki-view_blog_post', $parts['path']). '?postId=' . $id . '&amp;blogId=' . $post_info['blogId'];
include ("lib/snoopy/Snoopy.class.inc");
include ("lib/snoopy/Snoopy.class.php");
$snoopy = new Snoopy;
foreach ($tracks as $track) {
......
......@@ -93,10 +93,26 @@ class CalendarLib extends TikiLib {
}
function drop_calendar($calendarId) {
$query = "delete from `tiki_calendars` where `calendarId`=?";
$this->query($query,array($calendarId));
// find and remove roles for all calendar items:
$query = "select `calitemId` from `tiki_calendar_items` where `calendarId`=?";
$result = $this->query($query, array( $calendarId ) );
$allItemsFromCalendar = array();
while ($res = $result->fetchRow()) {
$allItemsFromCalendar[] = $res['calitemId'];
}
$query = "delete from `tiki_calendar_roles` where `calitemId` in (".implode(',', array_fill(0,count($allItemsFromCalendar),'?')).")";
$this->query($query,array($allItemsFromCalendar));
// remove calendar items, categories and locations:
$query = "delete from `tiki_calendar_items` where `calendarId`=?";
$this->query($query,array($calendarId));
$query = "delete from `tiki_calendar_categories` where `calendarId`=?";
$this->query($query,array($calendarId));
$query = "delete from `tiki_calendar_locations` where `calendarId`=?";
$this->query($query,array($calendarId));
// now remove the calendar itself:
$query = "delete from `tiki_calendars` where `calendarId`=?";
$this->query($query,array($calendarId));
}
/* tsart ans tstop are in user time - the data base is in server time */
......
<?php
/** \file
* $Header: /cvsroot/tikiwiki/tiki/lib/categories/categlib.php,v 1.79 2006-07-14 11:00:49 sylvieg Exp $
* $Header: /cvsroot/tikiwiki/tiki/lib/categories/categlib.php,v 1.80 2006-08-29 20:19:08 sylvieg Exp $
*
* \brief Categories support class
*
......@@ -278,6 +278,7 @@ class CategLib extends ObjectLib {
// for a type.
'article' => 'tiki_p_read_article',
'image' => 'tiki_p_view_image_gallery',
'calendar' => 'tiki_p_view_calendar',
// newsletters can't be categorized, although there's some code in tiki-admin_newsletters.php
// 'newsletter' => ?,
......@@ -690,6 +691,25 @@ class CategLib extends ObjectLib {
$this->categorize($catObjectId, $categId);
}
function categorize_calendar($calendarId, $categId) {
global $calendarlib;
// Check if we already have this object in the tiki_categorized_objects page
$catObjectId = $this->is_categorized('calendar', $calendarId);
if (!$catObjectId) {
if (!is_object($calendarlib)) {
require_once('lib/calendar/calendarlib.php');
}
// The page is not cateorized
$info = $calendarlib->get_calendar($calendarId);
$href = 'tiki-calendar.php?calId=' . $calendarId;
$catObjectId = $this->add_categorized_object('calendar', $calendarId, $info["description"], $info["calname"], $href);
}
$this->categorize($catObjectId, $categId);
}
// FUNCTIONS TO CATEGORIZE SPECIFIC OBJECTS END ////
function get_child_categories($categId) {
global $cachelib;
......@@ -908,9 +928,10 @@ class CategLib extends ObjectLib {
"survey" => "survey",
"tracker" => "tracker",
"wiki" => "wiki page",
"calendar" => "calendar",
"img" => "image"
); //get_strings tra("article");tra("blog");tra("directory");tra("faq");tra("file gallery");tra("forum");tra("image gallery");tra("newsletter");
//get_strings tra("poll");tra("quiz");tra("survey");tra("tracker");tra("wiki page");tra("image")
//get_strings tra("poll");tra("quiz");tra("survey");tra("tracker");tra("wiki page");tra("image");tra("calendar");
$typetitles = array(
"article" => "Articles",
......@@ -926,6 +947,7 @@ class CategLib extends ObjectLib {
"survey" => "Surveys",
"tracker" => "Trackers",
"wiki page" => "Wiki",
"calendar" => "Calendar",
"image" => "Image"
);
......@@ -1060,7 +1082,19 @@ class CategLib extends ObjectLib {
$query = "update `tiki_categorized_objects` set `type`= ?, `objId`= ?, `href`=? where `objId` = ?";
$this->query($query, array('article', (int)$articleId, "tiki-read_article.php?articleId=$articleId", (int)$subId));
}
/* build the portion of list join if filter by category
*/
function getSqlJoin($categId, $objType, $sqlObj, &$fromSql, &$whereSql, &$bindVars) {
$fromSql .= ",`tiki_categorized_objects` co, `tiki_category_objects` cat ";
$whereSql .= " AND co.`type`=? AND co.`objId`= $sqlObj ";
$whereSql .= " AND co.`catObjectId`=cat.`catObjectId` ";
$whereSql .= " AND cat.`categId`= ? ";
$bind = array( $objType, $categId);
if (is_array($bindVars))
$bindVars = array_merge($bindVars, $bind);
else
$bindVars = $bind;
}
}
......
......@@ -160,7 +160,8 @@ class Text_Diff_Renderer {
function _startBlock($header)
{
echo $header . "\n";
// TODO: What's this output for? It breaks XML pages
// echo $header . "\n";
}
function _endBlock()
......@@ -197,3 +198,4 @@ class Text_Diff_Renderer {
}
}
?>
\ No newline at end of file
// $Header: /cvsroot/tikiwiki/tiki/lib/imagegals/imagegallib.js,v 1.2 2006-08-29 20:19:09 sylvieg Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// Author: bertrand Gugger
/**
* Image/Slideshow handler
* You must instantiate it naming the handler the same as the id of the image to anime:
* var thepix = new Diaporama('thepix', arrPixId, options);
* - arrPixId is an array of images Id
* - options is an object with optional properties:
* - startId: the image id to start with
* - root: a document element (or document itself) or its id as string
* If given , by start its children elements of class "noslideshow" will be hidden
* and those of class "slideshow" or "slideshow_i" will be display: block or inline
* By image change , the children of class "pixurl" are updated with current image id
* - resetUrl: if set the document url will be updated with current id by slide stop
* - delay: sliding delay in milliseconds , default 3000
*/
function Diaporama(imgName, arrPixId, options)
{
this.name = imgName;
this.arrPixId = arrPixId;
this.length = arrPixId.length;
this.startId = 0;
this.delay = 3000;
this.sliding = 0;
this.backward = 0;
this.toTheEnd = 0;
for (opt in options) {
this[opt] = options[opt];
}
for (this.curPix = 0;
this.curPix < this.length && arrPixId[this.curPix] != this.startId;
this.curPix++) ;
this.curPix = this.curPix % this.length;
this.hopePix = 0;
this.thePix = null;
this.timerPix = null;
this.arrPix = new Array();
}
Diaporama.prototype.setClassStyle = function(className, prop, val){
var elts = this.root.all? this.root.all : this.root.getElementsByTagName('*');
var reg = new RegExp("(^|\\s)" + className + "(\\s|$)");
for(var i=0; i<elts.length; i++){
if(reg.test(elts[i].className)){
elts[i].style[prop] = val;
}
}
}
Diaporama.prototype.toggle = function(modPix) {
clearTimeout(this.timerPix);
switch (modPix) {
case 'stop':
this.sliding = 0;
if (this.resetUrl) {
document.location.href =
document.location.href.replace(
/imageid=\d+/i, 'imageId='+this.arrPixId[this.curPix]);
}
return;
case 'backward':
this.backward = ! this.backward;
break;
case 'toTheEnd':
this.toTheEnd = ! this.toTheEnd;
break;
}
this.sliding = 1;
if (this.root) {
if (typeof(this.root) == 'string') {
this.root = document.getElementById(this.root);
}
this.setClassStyle('noslideshow', 'display', 'none');
this.setClassStyle('slideshow', 'display', 'block');
this.setClassStyle('slideshow_i', 'display', 'inline');
}
this.thePix = document.getElementById(this.name);
this.arrPix[this.curPix] = new Image();
this.arrPix[this.curPix].src = this.thePix.src;
this.nextPix();
}
Diaporama.prototype.nextPix = function() {
this.hopePix = (this.curPix + (this.backward ? this.length -1 : 1)) % this.length;
if (!this.arrPix[this.hopePix]) {
this.arrPix[this.hopePix] = new Image();
this.arrPix[this.hopePix].src = this.thePix.src.replace(/\?id=\d+&/, '?id='+this.arrPixId[this.hopePix]+'&');
}
this.timerPix = setTimeout(this.name + '.putPix();', this.delay);
}
Diaporama.prototype.setUrlPix = function(){
var elts = this.root.all? this.root.all : this.root.getElementsByTagName('*');
var reg = new RegExp("(^|\\s)pixurl(\\s|$)");
for(var i=0; i<elts.length; i++){
if(reg.test(elts[i].className)){
if (elts[i].href) {
elts[i].href = elts[i].href.replace(/imageid=\d+/i, 'imageId='+this.arrPixId[this.curPix]);
elts[i].href = elts[i].href.replace(/edit=\d+/i, 'edit='+this.arrPixId[this.curPix]);
} else {
elts[i].innerHTML = elts[i].innerHTML.replace(/#\d+/i, '#'+this.arrPixId[this.curPix]);
}
}
}
}
Diaporama.prototype.putPix = function() {
if (!this.arrPix[this.curPix].complete) {
this.timerPix = setTimeout(this.name + '.putPix();', 100);
return;
}
this.curPix = this.hopePix;
this.thePix.src = this.arrPix[this.curPix].src;
if (this.root) {
this.setUrlPix();
}
if (!this.toTheEnd || (this.backward && this.curPix)
|| (!this.backward && ((this.curPix + 1) % this.length)) ) {
this.nextPix();
} else {
thepix.toggle('stop');
}
}
<?php
// $Header: /cvsroot/tikiwiki/tiki/lib/imagegals/imagegallib.php,v 1.78 2006-08-29 20:19:09 sylvieg Exp $
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
......@@ -320,10 +321,11 @@ class ImageGalsLib extends TikiLib {
// rescale Image, almost the same as resize, but keeps apect ratio
// bbx and bby give the boundary box
function rescaleImage($bbx, $bby) {
if (!$bbx || !$bby)
return true;
if (!isset($this->imagehandle)) {
$this->readimagefromstring();
}
if (!isset($this->xsize)) {
$this->getimageinfo();
}
......@@ -811,6 +813,9 @@ class ImageGalsLib extends TikiLib {
global $gal_use_dir;
$name = strip_tags($name);
$description = strip_tags($description);
if ($t_data && is_string($t_data)) {
$t_data = array('data' => $t_data, 'xsize' => 0, 'ysize' => 0);
}
$now = date("U");
$path = '';
......@@ -829,14 +834,14 @@ class ImageGalsLib extends TikiLib {
fwrite($fw, $data);
fclose ($fw);
if (sizeof($t_data) > 0) {
if ($t_data) {
@$fw = fopen($gal_use_dir . $fhash . '.thumb', "wb");
if (!$fw) {
return false;
}
fwrite($fw, $t_data);
fwrite($fw, $t_data['data']);
fclose ($fw);
$t_data = '';
}
......@@ -858,13 +863,13 @@ class ImageGalsLib extends TikiLib {
$result = $this->query($query,array((int)$imageId,(int)$xsize,(int)$ysize,'o',(int)$size,$filetype,$filename,$data));
// insert thumb
if (sizeof($t_data) > 1) {
$this->blob_encode($t_data);
if ($t_data) {
$this->blob_encode($t_data['data']);
$query = "insert into `tiki_images_data`(`imageId`,`xsize`,`ysize`,
`type`,`filesize`,`filetype`,`filename`,`data`)
values (?,?,?,?,?,?,?,?)";
$result = $this->query($query,array((int)$imageId,(int)$xsize,(int)$ysize,'t',(int)$size,$t_type,$filename,$t_data));
$result = $this->query($query,array((int)$imageId,(int)$t_data['xsize'],(int)$t_data['ysize'],'t',(int)$size,$t_type,$filename,$t_data['data']));
}
$query = "update `tiki_galleries` set `lastModif`=? where `galleryId`=?";
......@@ -1026,7 +1031,7 @@ class ImageGalsLib extends TikiLib {
}
function get_gallery_image($galleryId,$rule='') {
function get_gallery_image($galleryId,$rule='',$sort_mode = '') {
$query='select `imageId` from `tiki_images` where `galleryId`=? order by ';
$bindvars=array($galleryId);
switch($rule) {
......@@ -1040,26 +1045,42 @@ class ImageGalsLib extends TikiLib {
$query.=$this->convert_sortmode('created_desc');
$imageId=$this->getOne($query,$bindvars);
break;
case 'all':
case 'first':
// first image in default gallery sortorder
$query2='select `sortorder`,`sortdirection` from `tiki_galleries` where `galleryId`=?';
$result=$this->query($query2,$bindvars);
$res = $result->fetchRow();
$sort_mode=$res['sortorder'].'_'.$res['sortdirection'];
if (!$sort_mode) {
// first image in default gallery sortorder
$query2='select `sortorder`,`sortdirection` from `tiki_galleries` where `galleryId`=?';
$result=$this->query($query2,$bindvars);
$res = $result->fetchRow();
$sort_mode=$res['sortorder'].'_'.$res['sortdirection'];
}
$query.=$this->convert_sortmode($sort_mode);
$imageId=$this->getOne($query,$bindvars);
if ($rule != 'all') {
$imageId=$this->getOne($query,$bindvars);
break;
}
$result=$this->query($query,$bindvars);
$imageId=array();
while ($res = $result->fetchRow()) {
$imageId[]=reset($res);
}
break;
case 'last':
// last image in default gallery sortorder
$query2='select `sortorder`,`sortdirection` from `tiki_galleries` where `galleryId`=?';
$result=$this->query($query2,$bindvars);
$res = $result->fetchRow();
if($res['sortdirection'] == 'asc') {
$res['sortdirection']='desc';
} else {
$res['sortdirection']='asc';
if ($sort_mode) {
$invsor = explode('_', $sort_mode);