[Linpha-cvs] SF.net SVN: linpha: [4778] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <bz...@us...> - 2007-11-06 11:48:34
|
Revision: 4778 http://linpha.svn.sourceforge.net/linpha/?rev=4778&view=rev Author: bzrudi Date: 2007-11-06 03:48:31 -0800 (Tue, 06 Nov 2007) Log Message: ----------- "move sql.data.php to /lib/include/ so we can savely delete the whole /install subfolder" Modified Paths: -------------- trunk/linpha2/install/manual_install.php trunk/linpha2/install/step9_createtables.php Added Paths: ----------- trunk/linpha2/lib/include/sql.data.php Modified: trunk/linpha2/install/manual_install.php =================================================================== --- trunk/linpha2/install/manual_install.php 2007-11-05 22:31:27 UTC (rev 4777) +++ trunk/linpha2/install/manual_install.php 2007-11-06 11:48:31 UTC (rev 4778) @@ -108,7 +108,7 @@ * insert data */ $str_query .= "\n\n"; - include_once(LINPHA_DIR.'/install/sql/sql.data.php'); + include_once(LINPHA_DIR.'/lib/include/sql.data.php'); foreach($sql_queries AS $value) { $str_query .= $value.";\n"; Modified: trunk/linpha2/install/step9_createtables.php =================================================================== --- trunk/linpha2/install/step9_createtables.php 2007-11-05 22:31:27 UTC (rev 4777) +++ trunk/linpha2/install/step9_createtables.php 2007-11-06 11:48:31 UTC (rev 4778) @@ -125,7 +125,7 @@ * insert data */ echo "<br />".i18n_install("Inserting Table Data...").' '; - include_once(LINPHA_DIR.'/install/sql/sql.data.php'); + include_once(LINPHA_DIR.'/lib/include/sql.data.php'); foreach($sql_queries AS $value) { $result = $linpha->db->Execute($value); Added: trunk/linpha2/lib/include/sql.data.php =================================================================== --- trunk/linpha2/lib/include/sql.data.php (rev 0) +++ trunk/linpha2/lib/include/sql.data.php 2007-11-06 11:48:31 UTC (rev 4778) @@ -0,0 +1,344 @@ +<?php +/* +* Copyright (c) 2005 Heiko Rutenbeck <bz...@tu...> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/** + * linpha installer + * @package Installation + */ + +/** + * config table + */ +$options = array( + 'sys_db_version' => '3', + + 'sys_im_bracket_support' => $_SESSION['sys_im_bracket_support'], + 'sys_im_imagemagick_path' => $_SESSION['sys_im_convert_path'], + 'sys_im_use_imagemagick' => $_SESSION['sys_im_use_convert'], + 'sys_im_video_thumbnail' => '1', + + 'sys_import_autoimport' => '1', + 'sys_import_exif' => '1', + 'sys_import_exif_autorot' => '1', + 'sys_import_use_exiftool' => '0', + 'sys_import_use_emb_thumb' => '0', + 'sys_import_exiftool_avail' => '0', + 'sys_import_files_ignored' => 'Thumbs.db,ZbThumbnail.info,_vti_cnf,_derived,Picasa.ini,Cdlabel.alb', + 'sys_import_fileext_ignored' => 'thm,doc,txt', + + 'sys_image_exif' => '1', + 'sys_image_iptc' => '0', + 'sys_image_xmp' => '0', + 'sys_lang' => $_SESSION['language'], + 'sys_lang_autolang' => '1', + 'sys_path_album_dir' => $_SESSION['album_dir'], + 'sys_path_cache_dir' => $_SESSION['cache_dir'], + 'sys_path_tmp_dir' => $_SESSION['tmp_dir'], + + 'sys_basket_mail_max_size' => (1024*1024*2), + 'sys_basket_mail_smpthost' => 'localhost', + 'sys_basket_download_limit' => '0', + + 'sys_style_datetime_dates' => '%a %m/%d/%Y', + 'sys_style_datetime_times' => '%I:%M:%S %p', + + 'sys_style_home_showbrowsebydate' => '1', + 'sys_style_home_nrrandomimages' => '4', + 'sys_style_home_newimagesnr' => '4', + 'sys_style_home_newimagesage' => '7', + 'sys_style_home_showalbums' => '1', + 'sys_style_home_usedefaultwelcometext' => '1', + 'sys_style_home_firstsortorder' => 'nameasc', + + 'sys_style_thumb_size_max' => '200', + 'sys_style_thumb_size_display' => '150', + 'sys_style_thumb_showsubfoldersseparate' => '0', + 'sys_style_thumb_selectsizes' => '50,75,100,150,200,250,300,400,500', + 'sys_style_thumb_selectnrimages' => 'auto,10,25,50,100,200,all', + 'sys_style_thumb_nojsnrrows' => '3', + 'sys_style_thumb_nojsnrcols' => '4', + + 'sys_style_image_quality' => '75', + 'sys_style_image_width' => '700', + 'sys_style_image_height' => '525', + 'sys_style_image_nrprevnextthumbs' => '3', + 'sys_style_image_useeffects' => '1', + + 'sys_style_layout_color_bodybg' => 'DDDDDD', // the blue design + 'sys_style_layout_color_elembg' => '87CEFA', + 'sys_style_layout_color_font' => '000000', + 'sys_style_layout_color_albumsbg' => 'D5FCF4', + 'sys_style_layout_color_links' => '005388', + 'sys_style_layout_color_linkshover' => '666666', + 'sys_style_layout_color_fields' => 'CCCCCC', + + 'sys_style_layout_theme' => 'default', + 'sys_style_layout_template' => 'default', + 'sys_style_layout_title' => 'Linpha 2.0', + + 'sys_style_others_sortorder' => 'nameasc', + + 'sys_user_autologin' => '1', + + + 'plugins_log_filename' => 'var/linpha.log', + 'plugins_log_syslog_enable' => '0', + 'plugins_log_syslog_add_events' => '', + 'plugins_log_email_enable' => '0', + 'plugins_log_email_add_events' => '', + 'plugins_log_email_to' => 'LinPHA Logger<log@'.$_SERVER["HTTP_HOST"].'>', + 'plugins_log_email_headers' => 'From:LinPHA Logger<noreply@'.$_SERVER["HTTP_HOST"].'>', + 'plugins_log_email_subject' => 'Linpha Log', + + 'plugins_filemanager_enable' => '0', + 'plugins_filemanager_nruploads' => '5', + + 'plugins_maps_defaultMarkerZoom' => '10', + 'plugins_maps_mapType' => 'google', + 'plugins_maps_google_key' => 'ABQIAAAAAXCMfho4_sqSSh0VqMB80xT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSfO_6bbb_ScfT_zPgcnJMKyGltOg', // key for http://localhost + +); + +$options_user_overrideable = Array( + 'sys_lang', + 'sys_lang_autolang', + 'sys_style_others_sortorder', + 'sys_style_template', + 'sys_style_home_showbrowsebydate', + 'sys_style_home_nrrandomimages', + 'sys_style_home_showalbums', + 'sys_style_home_firstsortorder', + 'sys_style_thumb_size_display', + 'sys_style_thumb_showsubfoldersseparate', + 'sys_style_thumb_nojsnrrows', + 'sys_style_thumb_nojsnrcols', + 'sys_style_image_width', + 'sys_style_image_height', + 'sys_style_image_nrprevnextthumbs' => '3', + 'sys_style_image_useeffects' => '1', + + 'sys_style_layout_color_bodybg' => 'DDDDDD', // the blue design + 'sys_style_layout_color_elembg' => '87CEFA', + 'sys_style_layout_color_font' => '000000', + 'sys_style_layout_color_albumsbg' => 'D5FCF4', + 'sys_style_layout_color_links' => '005388', + 'sys_style_layout_color_linkshover' => '666666', + 'sys_style_layout_color_fields' => 'CCCCCC', + + 'sys_style_layout_theme' => 'default', + 'sys_style_layout_template' => 'default', +); + +/** + * create sql executes for all option entries + */ +while( list($name, $value) = each($options) ) +{ + if(in_array($name,$options_user_overrideable)) { + $override = 1; + } else { + $override = 0; + } + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."config (option_name, option_value, override, user_id) " . + "VALUES ('".$name."', '".$value."', '".$override."', '0')"; +} + +/** + * groups + */ +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."groups (group_name) VALUES ('admin')"; + +/** + * permissions + */ +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (photos_id, perm_type, permission) " . + "VALUES (0, 'read', ';public;')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (photos_id, perm_type, permission) " . + "VALUES (0, 'write', ';;')"; + + +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('basket_print', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('basket_mail', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('basket_download', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('metadata_comments', ';public;')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('metadata_deletecomments', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('metadata_edit', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('watermark', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('stats', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('download', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('plugins_maps_setMarkers', '')"; + + +/** + * MetaData + * see http://linpha.sourceforge.net/wiki/index.php/Tables_linpha_meta_fields for the definition + */ + /** + * special fields + * flag_nr 1 + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('filename', 0, 1)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('imagesize', 0, 1)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('dimension', 0, 1)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('thumbnail', 0, 1)"; + + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('time_add', 0, 1)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('time_mod', 0, 1)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('time_exif', 0, 1)"; + + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('stats_numbers', 0, 1)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('stats_views', 0, 1)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('stats_downloads', 0, 1)"; + + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('first_comment', 0, 1)"; + /** + * workaround for i18n + * they wouldn't get detected otherwise... + * some are defined in linpha.metadata.php + */ + i18n("Filename"); i18n("Imagesize"); i18n("Dimension"); i18n("Thumbnail"); + + + /** + * builtin fields + * flag_nr 5 (builtin enabled) + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('description', 1, 5)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('category', 2, 5)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('persons', 2, 5)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('date', 3, 5)"; + /** + * workaround for i18n + * they wouldn't get detected otherwise... + * some are defined in linpha.metadata.php + */ + i18n("Description"); i18n("Category"); i18n("Persons"); i18n("Date"); + + + /** + * image fields + * flag_nr 10 + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_filename', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_imagesize', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_dimension', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_description', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_category', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_persons', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_time_exif', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_stats_views', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_stats_downloads', 0, 10)"; + + + /** + * video fields + * flag_nr 11 + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('??', 0, 11)"; + + /** + * album fields + * flag_nr 12 + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_time_add', 0, 12)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_stats_numbers', 0, 12)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_description', 0, 12)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_persons', 0, 12)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_first_comment', 0, 12)"; + + + /** + * thumbnails fields + * flag_nr 13 + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_thumbnail', 0, 13)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_filename', 0, 13)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_description', 0, 13)"; + + /** + * thumbnails in detail view fields + * flag_nr 14 + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_thumbnail', 0, 14)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_filename', 0, 14)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_description', 0, 14)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_imagesize', 0, 14)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_dimension', 0, 14)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('exif_datetimeoriginal', 0, 14)"; + + /** + * slideshow fields + * flag_nr 15 + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_filename', 0, 15)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_description', 0, 15)"; + +?> + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |