PO 2.36 merged.

This commit is contained in:
Solomon Peachy 2008-08-17 14:24:45 -04:00
parent c8053245ce
commit a1945856a1
221 changed files with 6956 additions and 4908 deletions

88
CHANGES
View File

@ -6,6 +6,88 @@ For further information about Photo Organizer, see its web site at:
==========================================================================
2.36 (August 17, 2008)
[add] Allow the import 'master' prescedence to be configurable. [#368]
[fix] Fix trash emptying on postgres 8.3.x [#370]
[lang] de_DE updated.
[fix] A couple of run-time warnings.
2.36-rc2 (June 30, 2008)
[fix] Account status messages weren't always including a valid
'bulk upload' status. [#352]
[fix] Editing an existing lens/flash/filter/scanner/support failed. [#350]
[fix] Minor tweak to the installer.
[misc] Display the serial number of equipment, as users may have more
multiple cameras, lenses, etc of the same type.
[add] Support importing XMP sidecar files. [#292]
[add] Make the metadata import order into a preference. [#357]
[fix] Don't allow duplicate keywords on import.
[lang] de_DE updates (Marcus Hinz)
[fix] XMP now imports 'Description' field as 'caption' (Marcus Hinz)
[fix] Admin users weren't seeing the full manufacturer, location, and
label lists. [#361]
[fix] Tag cloud/search pages now respect the global 'masters_only'
preference. [#362]
[fix] Error in the Italian translation [#366]
[add] Link the location string to Google Maps too [#364]
[fix] Minor fix for GraphicsMagick users [#365]
[misc] Upon successful login, jump to the 'my folders' page unless
we have a better idea where to return to.
[add] Optionally use memcache to cache static data.
[fix] Fixed a suboptimal query in photo.php. Over 30x faster on my system! [#298]
2.36-rc1 (April 26, 2008)
[misc] Files on disk now include their version id in the filename.
[misc] Support a second ad script per-page, in the footer.
[misc] Allow for file count limits on volumes [#246]
[misc] Allow usernames to be specified instead of userids.
[add] Folders/Albums now have an associated 'thumbnail' image.
[add] Display the filename instead of 'no title'. [#324]
[add] 'Blackwater' theme, by Rickard Olsson. (with modifications)
[misc] Theme cleanups and fixes/tweaks to CSS rules.
[misc] Allow for a cookie path to make it easier to share installations
on the same host.
[add] Allow user to specify default copyright/web statement. [#326]
[misc] lists of focal lengths, apertures, resolutions, etc are now
configurable.
[misc] Support 'pretty URLs' for outward-facing things like images,
folders, and albums. [#302]
[misc] Move folder and user searches to their own pages.
[fix] Many bugs relating to external authentication.
[add] Another auth backend designed to tie into an external database.
[misc] Convert the select all/select none button into a 'toggle
selection' button.
[add] Configurable per-user local filesystem bulk uploads. [#319]
[misc] Unify lens, filter, flash, scanner, and support equipment
tables, allow for multiple of each type. [#171] [#204] [#328]
[fix] Made the XML import/export better match the DTD.
[misc] Removed the rather broken (and useless) XML converter.
[misc] Consolidated a few php files.
[fix] Album adding was broken. (Scott Petersen)
[fix] EXIF Focal Length detection was failing on some digicams. (Scott Petersen)
[misc] Revamp the keyword set/clear form elements.
[fix] Errors in the admin user mangling pages.
[misc] Unify all photo removal code. Make user removals two-phase.
[fix] External DB auth was getting an extra space.
[misc] Ensure all forms are submitted using UTF-8 encoding.
[add] Datebooks events now have an associated location. [#317]
[add] Allow the RAW preview image to beimproted as the master. [#336]
[fix] Album deletion was returning to the wrong page at times.
[misc] Allow guests to view technical details of an image, but not
the full exif dumps.
[misc] Remove the 'front page editor' as it's a security hole. If the
admin user doesn't have write permissions to the PO filesystem,
they shouldn't be allowed to modify the start page.
[add] Display keywords in the tooltips. [#340]
[add] Display link to Google Maps for all geolocation tags. [#337]
[fix] Advanced search on location was broken.
[add] Added a crude LDAP authentication backend. It'll need
customization before it's usable. [#331]
[add] Added a tag cloud, and easy browsing by tag/keyword. [#133]
2.35b (Aprim 26, 2008)
[fix] Photo rotation was broken.
@ -15,18 +97,18 @@ For further information about Photo Organizer, see its web site at:
[fix] Backport fix for date parsing problem on event add page. [#343]
[fix] Fix metadata xfer on bulk update regeneration [#342]
[fix] Add a warning for users that have the FunWebProducts toolbar
installed, as it sends bogus requests to the PO server.
installed, as it sends bogus requests to the PO server.
[fix] Fix mis-reporting of photos in trash.
[fix] IPTC import code was ignoring 'sub-location' field. [#348]
2.35a (February 20, 2008)
2.35a (Feburary 20, 2008)
[fix] The target folder of an import was double-listed.
[fix] Fix several bugs relating to version manipulations.
[fix] 'Install/Upgrade' button in the installer now looks like a button.
[fix] Misc HTML Validation errors.
[fix] Displayed date when viewing a date range's photos was
sometimes incorrect.
sometimes incorrect.
[fix] Theme logo was hardcoded.
[fix] Location was being clobbered on imports.
[fix] Transfer Metadata was failing on RAW files.

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -48,13 +48,6 @@ switch ($selector) {
case $admin_data['users_n_clients']['idx']:
display_users_and_clients($database, $po_user['id'], $auth_handle);
break;
case $admin_data['front_page']['idx']:
if (is_readable("index_site.php")) {
display_front_page_editor("index_site.php");
} else {
display_front_page_editor("index_site.php.dist");
}
break;
}
theme_display_navigator_box_bottom("100%");

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,9 +17,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
;
include_once "include/site.php";
include_once "include/admin.php";
include_once "include/common.php";
@ -28,77 +26,57 @@ $database = site_prolog(PO_USER_TYPE_ADMIN);
$user_id = pg_escape_string($_REQUEST['user']);
/* First we nuke the user's photos and their associated records */
$result = nuke_photos($database, FALSE, $user_id);
pg_query($database, "begin");
$photos_to_be_removed = pg_query($database, "
select path
from photo, photo_version, files
where files.version = photo_version.identifier
and photo.identifier = photo_version.photo
and photo.users = $user_id");
if ($result) {
// Nuke all photo ratings made by the user.
$result = pg_query($database, "delete from rating where users='$user_id'");
}
if ($result) {
// Nuke all albums owned by the user.
$result = pg_query($database, "delete from album where users='$user_id'");
}
if ($result) {
// Nuke all folders owned by the user.
$result = pg_query($database, "delete from folder where users='$user_id'");
}
if ($result) {
// Nuke the user's preferences.
$result = pg_query($database, "delete from user_preferences where owner='$user_id'");
}
$result = pg_query($database, "delete from rating where users='$user_id'");
if ($result) {
// Nuke all datebook events owned by the user.
$result = pg_query($database, "delete from calendar where users='$user_id'");
}
if ($result) {
// Nuke all datebooks where the user is the client.
$result = pg_query($database, "update calendar set client = null where client='$user_id'");
}
if ($result) {
// Nuke all client records where the user is the client.
$result = pg_query($database, "delete from client where users='$user_id' or client='$user_id'");
}
/* Nuke all of the user's profile/equipment/etc */
if ($result) {
$result = pg_query($database, "update location set users=null where users='$user_id'");
}
if ($result) {
$result = pg_query($database, "update paper set last_modifying_users=null where last_modifying_users='$user_id'");
}
if ($result) {
$result = pg_query($database, "delete from label where users='$user_id'");
}
if ($result) {
$result = pg_query($database, "delete from calendar where users='$user_id'");
}
if ($result) {
$result = pg_query($database, "update calendar set client = null where client='$user_id'");
}
if ($result) {
$result = pg_query($database, "delete from client where users='$user_id' or client='$user_id'");
}
if ($result) {
$result = pg_query($database, "delete from rating where photo in (select identifier from photo where users='$user_id')");
}
if ($result) {
$result = pg_query($database, "delete from files where version in (select identifier from photo_version v where v.photo in(select identifier from photo p where p.users = $user_id))");
}
if ($result) {
$result = pg_query($database, "delete from photo_keywords where photo in (select identifier from photo where users='$user_id')");
}
if ($result) {
$result = pg_query($database, "delete from photo_dupe where photo in (select identifier from photo where users='$user_id')");
}
if ($result) {
$result = pg_query($database, "delete from album_content where album in (select identifier from album where users='$user_id')");
}
if ($result) {
$result = pg_query($database, "delete from photo_version where photo in (select identifier from photo where users='$user_id')");
}
if ($result) {
$result = pg_query($database, "delete from photo_tech where photo in (select identifier from photo where users='$user_id')");
}
if ($result) {
$result = pg_query($database, "delete from album where users='$user_id'");
}
if ($result) {
$result = pg_query($database, "delete from photo where users='$user_id'");
}
if ($result) {
$result = pg_query($database, "delete from folder where users='$user_id'");
}
if ($result) {
$result = pg_query($database, "update location set users='$po_user[id]' where users='$user_id'");
}
if ($result) {
$result = pg_query($database, "delete from film where users='$user_id'");
}
if ($result) {
$result = pg_query($database, "update film_type set last_modifying_users=null where last_modifying_users='$user_id'");
}
if ($result) {
$result = pg_query($database, "delete from lens where users='$user_id'");
}
if ($result) {
$result = pg_query($database, "update lens_type set last_modifying_users=null where last_modifying_users='$user_id'");
}
if ($result) {
$result = pg_query($database, "delete from camera where users='$user_id'");
}
@ -106,52 +84,31 @@ if ($result) {
$result = pg_query($database, "update camera_type set last_modifying_users=null where last_modifying_users='$user_id'");
}
if ($result) {
$result = pg_query($database, "delete from flash where users='$user_id'");
$result = pg_query($database, "delete from equipment where users='$user_id'");
}
if ($result) {
$result = pg_query($database, "update flash_type set last_modifying_users=null where last_modifying_users='$user_id'");
}
if ($result) {
$result = pg_query($database, "delete from scanner where users='$user_id'");
}
if ($result) {
$result = pg_query($database, "update scanner_type set last_modifying_users=null where last_modifying_users='$user_id'");
}
if ($result) {
$result = pg_query($database, "delete from support where users='$user_id'");
}
if ($result) {
$result = pg_query($database, "update support_type set last_modifying_users=null where last_modifying_users='$user_id'");
}
if ($result) {
$result = pg_query($database, "delete from filter where users='$user_id'");
}
if ($result) {
$result = pg_query($database, "update filter_type set last_modifying_users=null where last_modifying_users='$user_id'");
$result = pg_query($database, "update camera_type set last_modifying_users=null where last_modifying_users='$user_id'");
}
if ($result) {
$result = pg_query($database, "update manufacturer set last_modifying_users=null where last_modifying_users='$user_id'");
}
/* Commit things */
if ($result) {
$result = pg_query($database, "delete from user_preferences where owner='$user_id'");
pg_query($database, "commit");
} else {
site_push_error($strings['errors']['db_insert_failed']);
pg_query($database, "rollback");
}
/* Finally, nuke the user user record itself */
pg_query($database, "begin");
if ($result) {
$result = pg_query($database, "delete from users where identifier='$user_id'");
}
/* Delete the actual files now */
if ($result) {
$num_of_photos_to_remove = pg_num_rows($photos_to_be_removed);
for ($i = 0; $i < $num_of_photos_to_remove; $i++) {
$photo = pg_fetch_row($photos_to_be_removed, $i);
$err = error_reporting(0);
unlink($image_repository_path . "/" . $photo[0]);
error_reporting($err);
}
}
/* Commit things */
if ($result) {
pg_query($database, "commit");
} else {

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,11 +17,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/admin.php";
include_once "include/site.php";
;
include_once "include/common.php";
$database = site_prolog(PO_USER_TYPE_ADMIN);
@ -55,7 +53,7 @@ $folders_by_user = pg_fetch_row(pg_query($database, "select count_folders_by_use
$albums_by_user = pg_fetch_row(pg_query($database, "select count_albums_by_user($user_data[0])"));
print "<tr>";
print emit_td("<a href=\"user.php?user=$user_data[0]\">$user_data[1], $user_data[2]</a>", "align=\"left\"");
print emit_td(emit_a(generate_link('user', $user_data[0]), "$user_data[1], $user_data[2]"), "align=\"left\"");
print emit_td($photos_by_user[0]);
print emit_td($folders_by_user[0] - 1);
print emit_td($albums_by_user[0] - 1);
@ -66,7 +64,7 @@ print "</tr>";
print "</table>\n";
print "<form method=\"post\" action=\"admin.user.del.2.php\">";
print "<form method=\"post\" action=\"admin.user.del.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"user\" value=\"$user_id\"/>";
print $thm_elem['button.confirm.delete'];
print $thm_elem['button.cancel'];

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,9 +17,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
;
include_once "include/mail.php";
include_once "include/site.php";
include_once "include/admin.php";
@ -34,6 +32,7 @@ $bulk_upload_enable = pg_escape_string($_REQUEST['bulk_upload_enable']);
$quota_size = pg_escape_string($_REQUEST['quota_size']);
$quota_count = pg_escape_string($_REQUEST['quota_count']);
$show_ads = pg_escape_string($_REQUEST['show_ads']);
$local_path = pg_escape_string($_REQUEST['local_path']);
$quota_size = $quota_size * 1048576;
@ -48,6 +47,8 @@ if ($result)
$result = store_user_pref($database, $user_id, 'bulk_upload_enable', $bulk_upload_enable);
if ($result)
$result = store_user_pref($database, $user_id, 'show_ads', $show_ads);
if ($result)
$result = store_user_pref($database, $user_id, 'local_bulk_upload_path', $local_path);
if ($result) {
pg_query($database, "commit");

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,11 +17,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/admin.php";
include_once "include/site.php";
;
include_once "include/common.php";
$database = site_prolog(PO_USER_TYPE_ADMIN);
@ -43,11 +41,13 @@ $user_preferences = pg_fetch_row(pg_query($database, "
select get_user_pref($user_id, 'bulk_upload_enable'),
get_user_pref($user_id, 'quota_size'),
get_user_pref($user_id, 'quota_count'),
get_user_pref($user_id, 'show_ads')"));
get_user_pref($user_id, 'show_ads'),
get_user_pref($user_id, 'local_bulk_upload_path')"));
if (!$user_preferences[2]) $user_preferences[2] = $po_options_default['quota_count'];
if (!$user_preferences[4]) $user_preferences[4] = $po_options_default['local_bulk_upload_path'];
if (!$user_preferences[3]) $user_preferences[3] = $po_options_default['show_ads'];
if (!$user_preferences[1]) $user_preferences[1] = $po_options_default['quota_size'];
if ($user_preferences[2] == '') $user_preferences[2] = $po_options_default['quota_count'];
if ($user_preferences[1] == '') $user_preferences[1] = $po_options_default['quota_size'];
if (!$user_preferences[0]) $user_preferences[0] = $po_options_default['bulk_upload_enable'];
$user_preferences[1] /= 1048576;
@ -56,7 +56,7 @@ $all_user_types = pg_query($database, "
select user_type.identifier, user_type.value
from user_type");
print "<form method=\"post\" action=\"admin.user.edit.2.php\">";
print "<form method=\"post\" action=\"admin.user.edit.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<table class=\"admin\">\n";
print "<tr>\n";
print emit_th($strings['generic']['name'], "width=\"20%\" align=\"left\"");
@ -66,10 +66,11 @@ print emit_th($strings['generic']['bulk_upload'], "width=\"8%\"");
print emit_th($strings['generic']['quota_size'], "width=\"8%\"");
print emit_th($strings['generic']['quota_count'], "width=\"8%\"");
print emit_th($strings['generic']['show_ads'], "width=\"8%\"");
print emit_th($strings['import']['local_bulk_path'], "width=\"10%\"");
print "</tr>\n";
print "<tr>";
print emit_td("<a href=\"user.php?user=$user_data[0]\">$user_data[1], $user_data[2]</a>", "align=\"left\"");
print emit_td(emit_a(generate_link('user', $user_data[0]), "$user_data[1], $user_data[2]"), "align=\"left\"");
print "<td>";
if ($po_user['id'] == $user_data[0]) {
print $strings['generic']['administrator'];
@ -83,6 +84,7 @@ print emit_td(emit_enable_disable_combo("bulk_upload_enable", $user_preferences[
print emit_td("<input align=\"right\" type=\"text\" name=\"quota_size\" value=\"$user_preferences[1]\" size=\"7\"/> MB");
print emit_td("<input align=\"right\" type=\"text\" name=\"quota_count\" value=\"$user_preferences[2]\" size=\"7\"/>");
print emit_td(emit_enable_disable_combo("show_ads", $user_preferences[3]));
print emit_td("<input align=\"right\" type=\"text\" name=\"local_path\" value=\"$user_preferences[4]\" size=\"30\"/>");
print "</tr>";
print "</table>\n";

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -46,7 +46,7 @@ site_navigator_status(emit_a("admin.php", $strings['generic']['admin'])." : ".$s
print "&nbsp;<br/>";
theme_display_navigator_box_top($admin_data['repository']['idx'], $admin_data, "100%");
print "<form action=\"admin.volume.edit.2.php\" method=\"post\">\n";
print "<form action=\"admin.volume.edit.2.php\" method=\"post\" accept-charset=\"".$strings['formats']['encoding']."\">\n";
print "<input type=\"hidden\" name=\"volume\" value=\"$volume\"/>\n";
print "<table class=\"admin\">\n";
print "<tr>\n";

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -25,7 +25,7 @@ $database = site_prolog(PO_USER_TYPE_CLIENT);
$album_caption = pg_escape_string($_REQUEST['album_caption']);
$album_description = pg_escape_string($_REQUEST['album_description']);
$album_access_rights = pg_escape_string($_REQUEST['album_access_rights']);
$album_parent = pg_escape_string($_REQUEST['parent']);
$parent_album = pg_escape_string($_REQUEST['parent']);
$password = pg_escape_string($_REQUEST['password']);
$spool_seed = pg_escape_string($_REQUEST['spool_seed']);
$event = pg_escape_string($_REQUEST['event']);
@ -33,9 +33,9 @@ if ($event != "null") $event = "'$event'";
$go = TRUE;
if ($album_parent != "null") {
if ($parent_album != "null") {
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_query($database, "select identifier from album where identifier=$album_parent and users = $po_user[id]");
$result = pg_query($database, "select identifier from album where identifier=$parent_album and users = $po_user[id]");
if (pg_num_rows($result) <= 0) {
site_push_error($strings['errors']['not_owner']);
$go = FALSE;
@ -52,7 +52,7 @@ if ($go) {
$album_id = pg_fetch_row(pg_query($database, "select nextval('album_id_sequence')"));
$result = pg_query($database, "insert into album (identifier, users, caption, description, access_rights, parent_album, password, event)
values ($album_id[0], '$po_user[id]', '$album_caption', '$album_description', '$album_access_rights', $album_parent, '$password', $event)");
values ($album_id[0], '$po_user[id]', '$album_caption', '$album_description', '$album_access_rights', $parent_album, '$password', $event)");
if ($result && ($spool_seed === 't'))
$result = pg_query($database, "insert into album_content(album, photo, version) (select $album_id[0] as album, ac2.photo, ac2.version from album_content ac2 where ac2.album = $po_user[spool_album])");
@ -60,6 +60,9 @@ if ($go) {
if ($result) {
pg_query($database, "commit");
if ($memcache) {
$memcache->delete("allalbum_$po_user[id]");
}
} else {
pg_query($database, "rollback");
site_push_error($strings['errors']['db_insert_failed']);
@ -67,10 +70,10 @@ if ($result) {
site_epilog($database);
if ($album_parent == "null") {
header("Location: user.php?user=$po_user[id]");
if ($parent_album == "null") {
header("Location: ".generate_link('user', $po_user['id'], array(), TRUE));
} else {
header("Location: album.php?album=$album_parent");
header("Location: ".generate_link('album', $parent_album, array(), TRUE));
}
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -36,12 +36,11 @@ $album_all = get_users_album($database);
site_header($strings['generic']['add_album']);
site_navigator(5);
site_navigator_status(user_disp_string($po_user['id'], $po_user['id'],
"", "")."$path_to_album : ".$strings['generic']['add_album'], "");
site_navigator_status(disp_user_string($database, $po_user['id'])." $path_to_album : ".$strings['generic']['add_album'], "");
print "&nbsp;<br/>\n";
print "<form method=\"post\" action=\"album.add.2.php\">";
print "<form method=\"post\" action=\"album.add.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<table class=\"listing\">\n";
print "<tr>";
print emit_td($strings['generic']['album_name'], "width=\"40%\"");
@ -80,6 +79,8 @@ if (photos_in_spool($database) > 0) {
print emit_td($strings['generic']['populate_from_spool']);
print emit_td(emit_yes_no_combo("spool_seed", 'f'));
print "</tr>";
} else {
print "<input type=\"hidden\" name=\"spool_seed\" value=\"f\" />";
}
print "</table>";

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,10 +17,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/site.php";
;
$album_id = pg_escape_string($_REQUEST['album']);
@ -31,29 +29,28 @@ $go = TRUE;
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_query($database, "select identifier from album where identifier='$album_id' and users = $po_user[id]");
if (pg_num_rows($result) <= 0) {
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
$go = FALSE;
site_referer_error('not_owner');
site_epilog($database);
exit();
}
}
/* Clean up sub-albums properly */
if ($go && ($album_id!="")) {
$result = pg_query($database, "begin");
if ($result) {
/* Find all albums with us as their parent... */
$result = pg_query($database, "select parent_album from album where identifier='$album_id'");
if (pg_num_rows($result)) {
$parent_album = pg_fetch_row($result);
if ($parent_album[0] = "")
$parent_album[0] = FALSE;
} else {
$parent_album = array(FALSE);
}
pg_query($database, "begin");
/* Find all albums with us as their parent... */
$result = pg_query($database, "select parent_album from album where identifier='$album_id'");
if (pg_num_rows($result)) {
$parent_album = pg_fetch_row($result);
if ($parent_album[0] == "")
$parent_album[0] = FALSE;
} else {
$parent_album = array(FALSE);
}
if ($parent_album[0] != FALSE && $result) {
if ($result && $parent_album[0] != FALSE) {
/* And make them ours! */
$result = pg_query($database, "update album set parent_album = $parent_album[0] where parent_album = $album_id");
}
@ -68,6 +65,10 @@ if ($go && ($album_id!="")) {
if ($result) {
pg_query($database, "commit");
if ($memcache) {
$memcache->delete("allalbum_$po_user[id]");
$memcache->delete("album_path_$album_id");
}
} else {
pg_query($database, "abort");
site_push_error($strings['errors']['db_insert_failed']);
@ -77,8 +78,8 @@ if ($go && ($album_id!="")) {
site_epilog($database);
if ($parent_album[0] == FALSE) {
header("Location: user.php?user=$po_user[id]");
header("Location: ".generate_link('user', $po_user['id'], array(), TRUE));
} else {
header("Location: album.php?album=$parent_album[0]");
header("Location: ".generate_link('album', $parent_album[0], array(), TRUE));
}
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,10 +17,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/site.php";
;
include_once "include/common.php";
$database = site_prolog(PO_USER_TYPE_CLIENT);
@ -34,11 +32,10 @@ $album_data = pg_fetch_row(pg_query($database, "
if (($album_data[4] != $po_user['id']) &&
($po_user['type'] != PO_USER_TYPE_ADMIN)) {
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
site_epilog($database);
exit();
}
site_referer_error('not_owner');
site_epilog($database);
exit();
}
$album_stats = pg_fetch_assoc(pg_query($database, "select count_subalbums_by_album($album_id, $po_user[id], '{".$passwords."}') as albums, count_photos_by_album($album_id, $po_user[id], '{".$passwords."}') as photos"));
@ -47,8 +44,7 @@ $path_to_album = get_path_to_album($database, $album_id);
site_header($strings['generic']['delete_album']);
site_navigator(5);
site_navigator_status(user_disp_string($po_user['id'], $po_user['id'],
"", "")."$path_to_album : " .$strings['generic']['delete_album'], "");
site_navigator_status(disp_user_string($database, $po_user['id'])." $path_to_album : ".$strings['generic']['delete_album'], "");
print "&nbsp;<br/>\n";
print "<table class=\"folder\">\n";
@ -62,7 +58,7 @@ if ($po_user['type'] > PO_USER_TYPE_CLIENT) {
}
print "</tr>";
print "<tr>";
print emit_td("<a href=\"album.php?album=$album_data[0]\">$album_data[1]</a>");
print emit_td(generate_link('album', $album_data[0]));
print emit_td($album_stats['photos']);
print emit_td($album_stats['albums']);
print emit_td(emit_date_html($album_data[2], 'date'));
@ -77,7 +73,7 @@ print "<center>\n";
if ($album_stats['albums'] > 0) {
print $thm_elem['button.back'];
} else {
print "<form method=\"post\" action=\"album.del.2.php\">";
print "<form method=\"post\" action=\"album.del.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"album\" value=\"$album_id\"/>";
print "<input type=\"hidden\" name=\"parent\" value=\"$album_data[5]\"/>";
print $thm_elem['button.confirm.delete'];

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -19,7 +19,6 @@
include_once "include/config.php";
include_once "include/site.php";
;
$album_id = pg_escape_string($_REQUEST['album']);
$album_name = pg_escape_string($_REQUEST['album_caption']);
@ -28,6 +27,8 @@ $album_access_rights = pg_escape_string($_REQUEST['album_access_rights']);
$album_parent = pg_escape_string($_REQUEST['parent']);
$password = pg_escape_string($_REQUEST['password']);
$event = pg_escape_string($_REQUEST['event']);
$keep_thumb = $_REQUEST['keep_thumb'];
if ($event != "null") $event = "'$event'";
$database = site_prolog(PO_USER_TYPE_CLIENT);
@ -42,6 +43,12 @@ if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
}
}
if ($keep_thumb != 't') {
$extra = ", thumb_ver = null ";
} else {
$extra = "";
}
if ($go && ($album_id!="") && ($album_name!="")) {
$result = pg_query($database, "
update album
@ -51,16 +58,21 @@ if ($go && ($album_id!="") && ($album_name!="")) {
parent_album=$album_parent,
password='$password',
event=$event
$extra
where identifier='$album_id'");
if (!$result) {
site_push_error($strings['errors']['db_insert_failed']);
}
if ($memcache) {
$memcache->delete("allalbum_$po_user[id]");
$memcache->delete("album_path_$album_id");
}
}
site_epilog($database);
if ($album_parent == "null") {
header("Location: user.php?user=$po_user[id]");
header("Location: ".generate_link('user', $po_user['id'], array(), TRUE));
} else {
header("Location: album.php?album=$album_parent");
header("Location: ".generate_link('album', $parent_album, array(), TRUE));
}
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,10 +17,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/site.php";
;
include_once "include/common.php";
include_once "include/contacts.php";
include_once "include/orderby.php";
@ -29,15 +27,14 @@ $database = site_prolog(PO_USER_TYPE_CLIENT);
$album_id = pg_escape_string($_REQUEST['album']);
$album_data = pg_fetch_row(pg_query($database, "select caption, date_of_creation, access_rights, description, parent_album, users, password, event from album where identifier='$album_id'"));
$album_data = pg_fetch_row(pg_query($database, "select caption, date_of_creation, access_rights, description, parent_album, users, password, event, thumb_ver from album where identifier='$album_id'"));
/* Ensure mere users don't edit an folder that isn't theirs! */
if (($po_user['id'] != $album_data[5]) &&
($po_user['type'] != PO_USER_TYPE_ADMIN)) {
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
site_epilog($database);
exit();
site_referer_error('not_owner');
site_epilog($database);
exit();
}
$album_stats = pg_fetch_assoc(pg_query($database, "select count_subalbums_by_album($album_id, $po_user[id], '{".$passwords."}') as albums, count_photos_by_album($album_id, $po_user[id], '{".$passwords."}') as photos"));
@ -48,63 +45,68 @@ $path_to_album = get_path_to_album($database, $album_id);
site_header($strings['generic']['edit_album']);
site_navigator(5);
site_navigator_status(user_disp_string($po_user['id'], $po_user['id'],
"", "")."$path_to_album : " .$strings['generic']['edit_album'], "");
site_navigator_status(disp_user_string($database, $po_user['id'])." $path_to_album : ".$strings['generic']['edit_album'], "");
print "&nbsp;<br/>\n";
print "<form method=\"post\" action=\"album.edit.2.php\">";
print "<form method=\"post\" action=\"album.edit.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"album\" value=\"$album_id\"/>";
print "<table class=\"folder\">\n";
print "<table class=\"listing\">\n";
print "<tr>";
print emit_th($strings['generic']['album_name'], "width=\"28%\"");
print emit_th($strings['generic']['parent'], "width=\"27%\"");
print emit_th($strings['generic']['subalbums'], "width=\"5%\"");
print emit_th($strings['generic']['photos'], "width=\"5%\"");
print emit_th($strings['generic']['created'], "width=\"12%\"");
if ($po_user['type'] > PO_USER_TYPE_CLIENT) {
print emit_th($strings['generic']['access'], "width=\"10%\"");
}
print emit_th($strings['generic']['password'], "width=\"10%\"");
print emit_td($strings['generic']['album_name']);
print emit_td("<input id=\"template_editor\" type=\"text\" name=\"album_caption\" value=\"$album_data[0]\"/>");
print "</tr>";
print "<tr>";
print emit_td("<input id=\"template_editor\" type=\"text\" name=\"album_caption\" value=\"$album_data[0]\" size=\"50%\"/>");
print emit_td($strings['generic']['description']);
print emit_td("<textarea rows=\"4\" cols=\"80\" name=\"album_description\">$album_data[3]</textarea>");
print "</tr>";
print "<tr>";
print emit_td($strings['generic']['parent']);
print "<td>";
display_folder_combo("parent", $album_all, $album_data[4], "null");
print "</td>\n";
print emit_td($album_stats['albums']);
print emit_td($album_stats['photos']);
print "<td>".emit_date_html($album_data[1], 'date')."</td>";
print "</tr>";
if ($po_user['type'] > PO_USER_TYPE_CLIENT) {
print "<tr>";
print emit_td($strings['generic']['access']);
print "<td>";
display_access_combo("album_access_rights", $album_data[2], "");
print "</td>\n";
print "</tr>";
} else {
print emit_td("<input type=\"hidden\" name=\"album_access_rights\" value=\"$access[private]\"/>");
}
print emit_td("<input type=\"text\" name=\"password\" value=\"$album_data[6]\">");
print "<tr>";
print emit_td($strings['generic']['password']);
print emit_td("<input type=\"text\" name=\"password\" value=\"$album_data[6]\"/>");
print "</tr>";
print "</table>";
print "&nbsp;<br/>\n";
print "<table class=\"listing\">\n";
print "<tr>";
print emit_td($strings['datebook']['event']);
print emit_td(emit_event_combo($database, "event", $po_user['id'], $album_data[7]));
print "</tr>";
print "</table>";
print "&nbsp;<br/>\n";
print "<table class=\"folder\">\n";
print "<tr>";
print emit_th($strings['generic']['description']);
print emit_td($strings['generic']['subalbums']);
print emit_td($album_stats['albums']);
print "</tr>";
print "<tr>";
print emit_td("<textarea wrap=\"physical\" rows=4 size=\"100%\" name=\"album_description\">$album_data[3]</textarea>");
print emit_td($strings['generic']['photos']);
print emit_td($album_stats['photos']);
print "</tr>";
print "<tr>";
print emit_td($strings['generic']['created']);
print "<td>".emit_date_html($album_data[1], 'date')."</td>";
print "</tr>";
if ($album_data[8]) {
print "<tr>";
print emit_td($strings['generic']['keep_thumb']);
print "<td>";
$img = "<img src=\"".generate_link('image', '', array('ver'=>$album_data[8], 'size'=>1)) ."\" alt=\"\" />&nbsp;";
print emit_a(generate_link('photo', '', array('ver'=>$album_data[8])),
$img);
print emit_yes_no_combo("keep_thumb", "t");
print "</td>";
print "</tr>";
}
print "</table>";
print "&nbsp;<br/>\n";

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -38,7 +38,7 @@ if (!$album) {
header("HTTP/1.1 404 Not found");
site_header($strings['generic']['display_album']);
site_navigator(5);
site_navigator_status(user_disp_string(0, $po_user['id'], "", ""). " : ". $strings['errors']['no_such_album'], "");
site_navigator_status(disp_user_string($database, 0). " : ". $strings['errors']['no_such_album'], "");
site_footer($database);
site_epilog($database);
exit();
@ -49,12 +49,12 @@ if ($album[6] == 'f') {
header("HTTP/1.1 403 Forbidden");
site_header($strings['generic']['display_folder']);
site_navigator(1);
site_navigator_status(user_disp_string(0, $po_user['id'], "", ""). " : ". $strings['errors']['private'], "");
site_navigator_status(disp_user_string($database, 0). " : ". $strings['errors']['private'], "");
site_footer($database);
site_epilog($database);
} else {
site_push_error($strings['errors']['protected']);
header("Location: login.php?reason=protected&orig=".urlencode("album.php?album=$album_id"));
header("Location: login.php?reason=protected&orig=".urlencode(generate_link('album', $album_id)));
}
exit();
}
@ -63,15 +63,9 @@ if ($album[6] == 'f') {
$album_name = $album[0];
$owner_id = $album[2];
$user_data = pg_fetch_row(pg_query($database, "
select last_name, first_name, users.identifier
from users
where users.identifier=$owner_id"));
site_header($album_name);
$user_display_string = user_disp_string($owner_id, $po_user['id'],
$user_data[0], $user_data[1]);
$user_display_string = disp_user_string($database, $owner_id);
if ($po_user['id'] == $owner_id) {
site_navigator(5);
@ -138,19 +132,19 @@ if ($num_of_photos == 0) {
$album_photo = get_photo_query($database, array(), $froms, $filter, $offset, $limit, $order_by);
print "<form name=\"photoList\" method=\"post\" action=\"folder.content.php\">";
print "<form name=\"photoList\" method=\"post\" action=\"folder.content.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"user\" value=\"$owner_id\"/>";
print "<input type=\"hidden\" name=\"return\" value=\"album.php?album=$album_id&amp;offset=$offset\"/>";
print "<input type=\"hidden\" name=\"return\" value=\"".generate_link('album', $album_id, array('offset'=>$offset))."\"/>";
print "<input type=\"hidden\" name=\"photo_view\" value=\"$po_options[photo_view]\"/>";
print "<input type=\"hidden\" name=\"source_album\" value=\"$album_id\"/>";
display_photo_navigator("album.php?album=$album_id", $offset, $limit, $num_of_photos);
display_photo_navigator(generate_link('album', $album_id), $offset, $limit, $num_of_photos);
if ($po_options['photo_view'] == "slide") {
$checkboxes = display_photo_slides("album", $album_id, $album_photo, 0, $items, true, true);
} else {
$checkboxes = display_photo_list("album", $album_id, $album_photo, 0, $items);
}
display_photo_navigator("album.php?album=$album_id", $offset, $limit, $num_of_photos);
display_photo_navigator(generate_link('album', $album_id), $offset, $limit, $num_of_photos);
site_navigator_status("$user_display_string $path_to_album : $album[0]", $strings['generic']['displaying'] . " " . display_photo_index_status($offset, $limit, $num_of_photos));
@ -169,7 +163,7 @@ if ($checkboxes !== FALSE) {
print "<table><tr><td>\n";
if ($checkboxes !== FALSE) {
display_list_slide_option($po_options['photo_view'], "album.php?album=$album_id&amp;offset=$offset");
display_list_slide_option($po_options['photo_view'], generate_link('album', $album_id, array('offset'=>$offset)));
}
if ($checkboxes && ($po_user['type'] >= PO_USER_TYPE_CLIENT)) {
@ -194,7 +188,7 @@ if ($checkboxes) {
display_folder_actions($folder_all, "");
}
$album_all = get_users_album($database);
if (pg_num_rows($album_all) > 0) {
if (count($album_all)) {
display_album_actions($album_all, $album_id);
}
}

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -47,8 +47,11 @@ if (!sizeof($to_update) && ($set_generate_images != 't')) {
$update_photo_sql = "";
$update_photo_tech_sql = "";
$set_keyword = "";
$clear_keyword = "";
$set_keyword = array();
$clear_keyword = array();
$set_equipment = array();
$clear_equipment = array();
foreach ($to_update as $field) {
switch ($field) {
@ -60,12 +63,6 @@ foreach ($to_update as $field) {
$set_author = pg_escape_string($_REQUEST['author']);
$update_photo_sql .= " author = '$set_author', ";
break;
case 'set_keyword':
$set_keyword = $_REQUEST['set_keywords'];
break;
case 'clear_keyword':
$clear_keyword = $_REQUEST['clear_keywords'];
break;
case 'set_headline':
$set_headline = pg_escape_string($_REQUEST['headline']);
$update_photo_sql .= " headline = '$set_headline', ";
@ -146,18 +143,10 @@ foreach ($to_update as $field) {
$set_camera_program = pg_escape_string($_REQUEST['camera_program']);
$update_photo_tech_sql .= " camera_program = $set_camera_program, ";
break;
case 'set_lens':
$set_lens = pg_escape_string($_REQUEST['lens']);
$update_photo_tech_sql .= " lens = $set_lens, ";
break;
case 'set_focal_length':
$set_focal_length = pg_escape_string($_REQUEST['focal_length']);
$update_photo_tech_sql .= " focal_length = '$set_focal_length', ";
break;
case 'set_filter':
$set_filter = pg_escape_string($_REQUEST['filter']);
$update_photo_tech_sql .= " filter = $set_filter, ";
break;
case 'set_film':
$set_film = pg_escape_string($_REQUEST['film']);
$update_photo_tech_sql .= " film = $set_film, ";
@ -182,10 +171,6 @@ foreach ($to_update as $field) {
$set_exp_diff = pg_escape_string($_REQUEST['exp_diff']);
$update_photo_tech_sql .= " ev_difference = $set_exp_diff, ";
break;
case 'set_flash':
$set_flash = pg_escape_string($_REQUEST['flash']);
$update_photo_tech_sql .= " flash = $set_flash, ";
break;
case 'set_flash_mode':
$set_flash_mode = pg_escape_string($_REQUEST['flash_mode']);
$update_photo_tech_sql .= " flash_mode = $set_flash_mode, ";
@ -194,10 +179,6 @@ foreach ($to_update as $field) {
$set_flash_comp = pg_escape_string($_REQUEST['flash_comp']);
$update_photo_tech_sql .= " flash_comp = $set_flash_comp, ";
break;
case 'set_scanner':
$set_scanner = pg_escape_string($_REQUEST['scanner']);
$update_photo_tech_sql .= " scanner = $set_scanner, ";
break;
case 'set_scan_params':
$param = pg_escape_string($_REQUEST['scan_resolution']);
$update_photo_tech_sql .= " scan_resolution = $param, ";
@ -206,10 +187,6 @@ foreach ($to_update as $field) {
$param = pg_escape_string($_REQUEST['scan_multiscan']);
$update_photo_tech_sql .= " scan_multiscan = $param, ";
break;
case 'set_support':
$set_support = pg_escape_string($_REQUEST['support']);
$update_photo_tech_sql .= " support = $set_support, ";
break;
case 'set_geo_location':
$pos = pg_escape_string(parse_latitude($_REQUEST['latitude']));
if ($pos == "") $pos = "null";
@ -224,6 +201,18 @@ foreach ($to_update as $field) {
if ($pos == "") $pos = "null";
$update_photo_tech_sql .= " direction = $pos, ";
break;
case 'add_equipment':
$set_equipment = $_REQUEST['add_equipment'];
break;
case 'delete_equipment':
$clear_equipment = $_REQUEST['delete_equipment'];
break;
case 'set_keyword':
$set_keyword = $_REQUEST['set_keywords'];
break;
case 'clear_keyword':
$clear_keyword = $_REQUEST['clear_keywords'];
break;
default:
# XXXX we should never get here!
break;
@ -269,7 +258,7 @@ switch ($type) {
/* Start the main page output here */
site_header($strings['generic']['bulk_update']);
site_navigator(10);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".$strings['generic']['bulk_update'], "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".$strings['generic']['bulk_update'], "");
print "&nbsp;<br/>";
theme_display_navigator_box_top($tools_data['bulkupdate']['idx'], $tools_data, "100%");
@ -310,15 +299,30 @@ if ($result && $update_photo_tech_sql != "") {
$result = pg_query($database,$query);
}
if ($result && $set_keyword != "") {
if (strstr($set_keyword, ";"))
$keywords = semi_string_to_array($set_keyword);
else
$keywords = space_string_to_array($set_keyword);
if ($result && $clear_equipment) {
foreach ($clear_equipment as $equip) {
$parts = explode(":", $equip);
$parts[0] = pg_escape_string($parts[0]);
$parts[1] = pg_escape_string($parts[1]);
foreach ($keywords as $keyword) {
$result = pg_query($database, "delete from photo_equipment where photo in (select p.identifier from photo p where $sql_selector) and equipment = $parts[0]");
}
}
if ($result && $set_equipment) {
foreach ($set_equipment as $equip) {
$parts = explode(":", $equip);
$parts[0] = pg_escape_string($parts[0]);
$parts[1] = pg_escape_string($parts[1]);
$result = pg_query($database, "insert into photo_equipment (photo, equipment, type) select p.identifier, $parts[0], $parts[1] from photo p where $sql_selector and not exists(select e.photo from photo_equipment e where e.photo = p.identifier and e.equipment = $parts[0])");
}
}
/* Deal with keywords */
if ($result) {
foreach ($set_keyword as $keyword) {
$keyword = strtolower(trim($keyword));
$keyword = trim($keyword, ','); /* Trailing commas */
$keyword = trim($keyword);
if ($keyword == "") continue;
$keyword = pg_escape_string($keyword);
@ -328,21 +332,15 @@ if ($result && $set_keyword != "") {
}
}
if ($result && $clear_keyword != "") {
if (strstr($clear_keyword, ";"))
$keywords = semi_string_to_array($clear_keyword);
else
$keywords = space_string_to_array($clear_keyword);
foreach ($keywords as $keyword) {
if ($result) {
foreach ($clear_keyword as $keyword) {
$keyword = strtolower(trim($keyword));
$keyword = trim($keyword, ','); /* Trailing commas */
$keyword = trim($keyword);
if ($keyword == "") continue;
$keyword = pg_escape_string($keyword);
$query = "delete from photo_keywords where keyword = '$keyword' and photo in (select p.identifier from photo p where $sql_selector)";
$result = pg_query($database, $query);
}
}
@ -356,6 +354,15 @@ if ($result) {
print err_str($strings['errors']['db_insert_failed']);
}
/* Clear the keywords from the cache */
if ($result && $memcache && (count($clear_keyword) || count($set_keyword))) {
$res = pg_query("select p.identifier from photo p where $sql_selector");
for ($i = 0 ; $i < pg_num_rows($res) ; $i++) {
$row = pg_fetch_row($res);
$memcache->delete("photo_keywords_$row[0]");
}
}
if ($result && $set_generate_images == 't') {
print "<div align=\"left\"><ul>";
@ -406,7 +413,9 @@ if ($result && $set_generate_images == 't') {
$multi_page_parameter = $mime_type[$original_file_type]['page'];
$decoder = $mime_type[$original_file_type]['decoder'];
print "<li>".$strings['tools']['regenerating_images']."<a href=\"photo.php?photo=$photo_data[photo]&amp;ver=$photo_data[version]\"># $photo_data[photo]-$photo_data[version]: $photo_data[title]</a>.<ul>";
print "<li>".$strings['tools']['regenerating_images']. emit_a(generate_link('photo', $photo_data['photo'], array('ver'=>$photo_data['version'])), "# $photo_data[photo]:$photo_data[version]");
print "<ul>";
$image_data = array();
$image_data['jpgfromraw'] = FALSE;

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -21,7 +21,6 @@ include_once "include/config.php";
include_once "include/common.php";
include_once "include/profile.php";
include_once "include/site.php";
;
$database = site_prolog(PO_USER_TYPE_USER);
$type = "camera";
@ -40,7 +39,7 @@ switch ($manufacturer_filter) {
site_header(sprintf($strings['profile']['add'], $strings['generic'][$type]));
site_navigator(6);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['add'], $strings['generic'][$type]), "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['add'], $strings['generic'][$type]), "");
theme_display_navigator_box_top($profile_data['camera']['idx'], $profile_data, "100%");
@ -52,7 +51,7 @@ if (pg_num_rows($manufacturer) == 0) {
exit;
}
print "<form method=\"post\" action=\"camera.add.2.php\">\n";
print "<form method=\"post\" action=\"camera.add.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">\n";
print "<table class=\"profile\">\n";
emit_profile_manuf_combo("camera.add.php?type=$type", $type, 4, $manufacturer, $manufacturer_filter);

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,11 +17,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
;
include_once "include/common.php";
$database = site_prolog(PO_USER_TYPE_USER);
@ -33,9 +31,8 @@ $number_of_references = pg_fetch_row(pg_query($database, "select number_of_camer
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from camera where identifier=$camera_id and users=$po_user[id]"));
if ($result[0] == 0) {
site_push_error($strings['errors']['not_owner']);
site_referer_error('not_owner');
site_epilog($database);
header("Location: login.php");
exit();
}
}
@ -43,11 +40,13 @@ if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
site_header(sprintf($strings['profile']['delete'], $strings['generic']['camera']));
site_navigator(6);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['delete'], $strings['generic']['camera']), "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['delete'], $strings['generic']['camera']), "");
theme_display_navigator_box_top($profile_data['camera']['idx'], $profile_data, "100%");
print "<form method=\"post\" action=\"profile.del.2.php?item_id=$camera_id&amp;type=camera\">";
print "<form method=\"post\" action=\"profile.del.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"item_id\" value=\"$camera_id\">";
print "<input type=\"hidden\" name=\"type\" value=\"camera\">";
print "<table class=\"profile\">\n";
print "<tr class=\"folder_top\">\n";
print "<td colspan=\"7\">".sprintf($strings['profile']['delete'], $strings['generic']['camera'])."</td>\n";

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -34,11 +34,10 @@ $camera_current_value = pg_fetch_row(pg_query($database, "select name, mode
/* Ensure the user owns it !*/
if (($po_user['id'] != $camera_current_value[9]) &&
($po_user['type'] != PO_USER_TYPE_ADMIN)) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['db_insert_failed']);
header("Location: login.php");
exit();
}
}
$camera_type_current_value = pg_fetch_row(pg_query($database, "select type from camera where identifier=$camera_id"));
@ -60,11 +59,12 @@ switch ($manufacturer_filter) {
site_header(sprintf($strings['profile']['edit'], $strings['generic'][$type]));
site_navigator(6);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['edit'], $strings['generic'][$type]), "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['edit'], $strings['generic'][$type]), "");
theme_display_navigator_box_top($profile_data['camera']['idx'], $profile_data, "100%");
print "<form method=\"post\" action=\"camera.edit.2.php?item_id=$camera_id\">";
print "<form method=\"post\" action=\"camera.edit.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"item_id\" value=\"$camera_id\">";
print "<table class=\"profile\">\n";
emit_profile_manuf_combo("camera.edit.php?type=$type&amp;item=$camera_id", $type, 4, $manufacturer, $manufacturer_filter);

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,10 +17,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/site.php";
;
$database = site_prolog(PO_USER_TYPE_CLIENT);
@ -30,12 +28,11 @@ $client_id = pg_escape_string($_REQUEST['client']);
if ($po_user['type'] < PO_USER_TYPE_USER) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from client where identifier=$client_id and users=$po_user[id]"));
if ($result[0] == 0) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
}
}
}
$result = pg_query($database, "delete from client where identifier='$client_id'");

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,10 +17,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/site.php";
;
include_once "include/common.php";
$database = site_prolog(PO_USER_TYPE_USER);
@ -32,18 +30,17 @@ $result = pg_fetch_row(pg_query($database, "select identifier, client, last_name
/* Ensure the user owns it !*/
if (($po_user['id'] != $result[6]) &&
($po_user['type'] != PO_USER_TYPE_ADMIN)) {
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
site_referer_error('not_owner');
site_epilog($database);
exit();
}
site_header($strings['user']['del_client']);
site_navigator(8);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.datebook.php", $strings['generic']['my_datebook'])." : ".$strings['user']['del_client'], "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.datebook.php", $strings['generic']['my_datebook'])." : ".$strings['user']['del_client'], "");
print "<form method=\"post\" action=\"client.del.2.php\">";
print "<form method=\"post\" action=\"client.del.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"client\" value=\"$result[0]\"/>";
print "<table class=\"profile\">\n";
@ -56,10 +53,9 @@ print emit_th($strings['generic']['reg_date'], "width=\"20%\"");
print emit_th($strings['generic']['status'], "width=\"20%\"");
print "</tr>\n";
print "<tr>\n";
print "<td>";
print "<a href=\"user.php?user=$result[1]\">$result[2], $result[3]</a></td>\n";
print "<td>".emit_date_html($result[4], 'date')."</td>\n";
print "<td>".$strings['generic'][$client_status[$result[5]]]."</td>\n";
print emit_td(emit_a(generate_link('user', $result[1]), "$result[2], $result[3]"));
print emit_td(emit_date_html($result[4], 'date'));
print emit_td($strings['generic'][$client_status[$result[5]]]);
print "</tr>\n";
print "</table>\n";

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,11 +17,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/mail.php";
include_once "include/site.php";
;
$database = site_prolog(PO_USER_TYPE_USER);
@ -33,9 +31,8 @@ $trusted = pg_escape_string($_REQUEST['trusted']);
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from client where identifier=$client_id and users=$po_user[id]"));
if ($result[0] == 0) {
site_push_error($strings['errors']['not_owner']);
site_referer_error('not_owner');
site_epilog($database);
header("Location: login.php");
exit();
}
}

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,10 +17,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/site.php";
;
include_once "include/common.php";
$database = site_prolog(PO_USER_TYPE_USER);
@ -32,18 +30,17 @@ $result = pg_fetch_row(pg_query($database, " select identifier, client, last_nam
/* Ensure the user owns it !*/
if (($po_user['id'] != $result[7]) &&
($po_user['type'] != PO_USER_TYPE_ADMIN)) {
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
}
site_referer_error('not_owner');
site_epilog($database);
exit();
}
$all_client_states = pg_query($database, " select identifier, value from client_status where identifier!=4");
site_header($strings['user']['edit_client']);
site_navigator(8);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.datebook.php", $strings['generic']['my_datebook'])." : ".$strings['user']['edit_client'], "");
print "<form method=\"post\" action=\"client.edit.2.php\">";
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.datebook.php", $strings['generic']['my_datebook'])." : ".$strings['user']['edit_client'], "");
print "<form method=\"post\" action=\"client.edit.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"client\" value=\"$result[0]\"/>";
print "<table class=\"profile\">\n";
@ -57,9 +54,8 @@ print emit_th($strings['generic']['status'], "width=\"20%\"");
print emit_th($strings['generic']['trusted'], "width=\"10%\"");
print "</tr>\n";
print "<tr>\n";
print "<td>";
print "<a href=\"user.php?user=$result[1]\">$result[2], $result[3]</a></td>\n";
print "<td>".emit_date_html($result[4], 'date')."</td>\n";
print emit_td(emit_a(generate_link('user', $result[1]), "$result[2], $result[3]"));
print emit_td(emit_date_html($result[4], 'date'));
print "<td>";
print "<select name=\"status\">";

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -49,7 +49,7 @@ switch ($type) {
site_header($strings['generic']['content_indexer']);
site_navigator(10);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".$strings['generic']['content_indexer'], "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".$strings['generic']['content_indexer'], "");
theme_display_navigator_box_top($tools_data['content_indexer']['idx'], $tools_data, "100%");

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -40,7 +40,7 @@ print $strings['generic']['license_disclaimer'];
<center>
<hr width="80%"/>
</center>
<p><b><i>Photo Organizer</i></b> is copyright &copy; 2002-2006 <a href="http://www.k-i-s.net">Balint Kis</a> (balint@k-i-s.net), 2005-2007 <a href="http://www.shaftnet.org/users/pizza">Solomon Peachy</a> (pizza@shaftnet.org).</p>
<p><b><i>Photo Organizer</i></b> is copyright &copy; 2002-2006 <a href="http://www.k-i-s.net">Balint Kis</a> (balint@k-i-s.net), 2005-2008 <a href="http://www.shaftnet.org/users/pizza">Solomon Peachy</a> (pizza@shaftnet.org).</p>
<blockquote>
<p>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
@ -113,6 +113,22 @@ GNU Library General Public License for more details. </p>
<p><i>Please note that the version in use has been heavily modified and
only bears a superficial resemblance to the original. We believe giving credit where credit is due, however.</i></p>
</blockquote>
<center>
<hr width="80%"/>
</center>
<p><b><i>wordCloud v2</i></b> is Copyright &copy; <a href="http://www.lotsofcode.com">Derek Harvey</a>.</p>
<blockquote>
<p>wordCloud v2 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.
</p>
<p>wordCloud v2 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.
</p>
</blockquote>
<?php
site_footer($database);
site_epilog($database);

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -29,10 +29,11 @@ $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';
$go = isset($_REQUEST['go']);
if ($event) {
$event_data = pg_fetch_row(pg_query($database, "select start_date, end_date, remark, users, client from calendar where identifier='$event'"));
$event_data = pg_fetch_row(pg_query($database, "select start_date, end_date, remark, users, client, location from calendar where identifier='$event'"));
$start_date = $event_data[0];
$end_date = $event_data[1];
$client = $event_data[4];
$location = $event_data[5];
$owner = $event_data[3];
$remark = $event_data[2];
$year = (int)substr($event_data[0], 0, 4);
@ -72,16 +73,17 @@ if ($go) {
$start_date = pg_escape_string($_REQUEST['start_date']);
$end_date = pg_escape_string($_REQUEST['end_date']);
$remark = pg_escape_string($_REQUEST['remark']);
$location = pg_escape_string($_REQUEST['location']);
$year = (int)substr($start_date, 0, 4);
$month = (int)substr($start_date, 5, 2);
$day = (int)substr($start_date, 8, 2);
if ($action == 'add') {
$result = pg_query($database, "insert into calendar (identifier, users, start_date, end_date, remark, client)
values (nextval('calendar_id_sequence'), '$po_user[id]', '$start_date', '$end_date', '$remark', $client)");
$result = pg_query($database, "insert into calendar (identifier, users, start_date, end_date, remark, client, location)
values (nextval('calendar_id_sequence'), '$po_user[id]', '$start_date', '$end_date', '$remark', $client, $location)");
} else {
$result = pg_query($database, "update calendar set start_date='$start_date', end_date='$end_date', remark='$remark', client = $client where identifier=$event");
$result = pg_query($database, "update calendar set start_date='$start_date', end_date='$end_date', remark='$remark', client = $client, location = $location where identifier=$event");
}
break;
@ -103,7 +105,7 @@ if ($go) {
site_header(sprintf($strings['profile'][$action], $strings['datebook']['event']));
site_navigator(8);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.datebook.php", $strings['generic']['my_datebook'])." : ".sprintf($strings['profile'][$action], $strings['datebook']['event']) , "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.datebook.php", $strings['generic']['my_datebook'])." : ".sprintf($strings['profile'][$action], $strings['datebook']['event']) , "");
print "<br/>";
switch ($action) {
@ -146,7 +148,7 @@ switch ($action) {
break;
case 'delete':
print "<form method=\"post\" action=\"event.php\">\n";
print "<form method=\"post\" action=\"event.php\" accept-charset=\"".$strings['formats']['encoding']."\">\n";
print "<input type=\"hidden\" name=\"go\" value=\"go\" />\n";
print "<input type=\"hidden\" name=\"action\" value=\"delete\" />\n";
print "<input type=\"hidden\" name=\"event\" value=\"$event\" />\n";
@ -170,7 +172,16 @@ switch ($action) {
$date = strftime($strings['formats']['date'], $timestamp);
$dayNameIndex = $date["wday"];
print "<form method=\"post\" action=\"event.php\">\n";
/* Retrieve location info */
if ($po_user['type'] != PO_USER_TYPE_ADMIN)
$location_mod = " where private is false or users=$po_user[id] ";
else
$location_mod = "";
$users_location = pg_query($database, "select identifier, country, state, city, place from view_location $location_mod order by country, state, city, place");
$values = array('location' => $location);
print "<form method=\"post\" action=\"event.php\" accept-charset=\"".$strings['formats']['encoding']."\">\n";
print "<input type=\"hidden\" name=\"go\" value=\"go\" />\n";
print "<input type=\"hidden\" name=\"action\" value=\"edit\" />\n";
print "<input type=\"hidden\" name=\"event\" value=\"$event\" />\n";
@ -182,6 +193,7 @@ switch ($action) {
print "<tr><td>".$strings['datebook']['end']."</td><td>";
print emit_date_input_form("end_date", $end_date, 'full_date', FALSE);
print "</td></tr>";
print display_form_combo_helper('location', $values, FALSE, $users_location, ',', TRUE);
print "<tr><td>".$strings['datebook']['client']."</td><td>" . generate_html_clients_combo("client", $database, $po_user['id'], $client) . "</td></tr>";
print "<tr><td>".$strings['generic']['remark']."</td><td><textarea id=\"template_editor\" name=\"remark\" rows=\"7\" cols=\"60\">$remark</textarea></td></tr>\n";
print "</table>\n";
@ -208,8 +220,19 @@ switch ($action) {
}
$start_date = sprintf("%04d-%02d-%02d 00:00:00", $year, $month, $day);
$end_date = sprintf("%04d-%02d-%02d 01:00:00", $year, $month, $day);
$location = 0;
/* Retrieve location info */
if ($po_user['type'] != PO_USER_TYPE_ADMIN)
$location_mod = " where private is false or users=$po_user[id] ";
else
$location_mod = "";
$users_location = pg_query($database, "select identifier, country, state, city, place from view_location $location_mod order by country, state, city, place");
$values = array('location' => $location);
print "<form method=\"post\" action=\"event.php\">\n";
print "<form method=\"post\" action=\"event.php\" accept-charset=\"".$strings['formats']['encoding']."\">\n";
print "<input type=\"hidden\" name=\"go\" value=\"go\" />\n";
print "<input type=\"hidden\" name=\"action\" value=\"add\" />\n";
print "<table class=\"listing\">\n";
@ -219,6 +242,7 @@ switch ($action) {
print "<tr><td>".$strings['datebook']['end']."</td><td>";
print emit_date_input_form("end_date", $end_date, 'full_date', FALSE);
print "</td></tr>";
print display_form_combo_helper('location', $values, FALSE, $users_location, ',', TRUE);
print "<tr><td>".$strings['datebook']['client']."</td><td>" . generate_html_clients_combo("client", $database, $po_user['id'], "") . "</td></tr>";
print "<tr><td>".$strings['generic']['remark']."</td><td><textarea id=\"template_editor\" name=\"remark\" rows=\"7\" cols=\"60\"></textarea></td></tr>\n";
print "</table>\n";

View File

@ -1,61 +0,0 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/common.php";
include_once "include/site.php";
$database = site_prolog(PO_USER_TYPE_USER);
$export_id = $_REQUEST['export_id'];
$export_format = $_REQUEST['export_format'];
$file_name = $tmp_volume_path . "/po.export.$export_id.$export_format";
$file = fopen($file_name , "rb");
if ($file == false) {
header("HTTP/1.1 404 Not found");
exit();
}
$stats = stat($file_name);
header("Content-Length: $stats[7]");
switch ($export_format) {
case 'tar':
header("Content-Type: application/tar");
break;
case 'zip':
header("Content-Type: application/zip");
break;
}
header("Content-Disposition: filename=po.export." . date(DATE_W3C, $stats[9]) . ".$export_format");
/* read 1M chunks */
while (!feof($file)) {
echo fread($file, 1*(1024*1024));
}
fclose($file);
unlink($file_name);
site_epilog($database);
exit();
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -31,6 +31,43 @@ $database = site_prolog(PO_USER_TYPE_USER);
$export_type = $_REQUEST['export_type'];
$export_format = $po_options['export_format'];
/* Are we asking for the tarball? */
if (isset($_REQUEST['export_id'])) {
$export_id = $_REQUEST['export_id'];
$file_name = $tmp_volume_path . "/po.export.$export_id.$export_format";
$file = fopen($file_name , "rb");
if ($file == false) {
header("HTTP/1.1 404 Not found");
exit();
}
$stats = stat($file_name);
header("Content-Length: $stats[7]");
switch ($export_format) {
case 'tar':
header("Content-Type: application/tar");
break;
case 'zip':
header("Content-Type: application/zip");
break;
}
header("Content-Disposition: filename=po.export." . date(DATE_W3C, $stats[9]) . ".$export_format");
/* read 1M chunks */
while (!feof($file)) {
echo fread($file, 1*(1024*1024));
}
fclose($file);
unlink($file_name);
site_epilog($database);
exit();
}
/* Time to generate a tarball */
$photos_in_spooler = pg_query($database, "
select photo as identifier from album_content where album = $po_user[spool_album] group by photo order by photo");
@ -94,15 +131,15 @@ for ($photos = 0; $photos < $num_photos; $photos++) {
case "photo_xml_iptc":
case "photo_iptc":
case "photo_xml":
$photo_data = pg_fetch_row(pg_query($database, "
select folder, author, title, '' as keyword, caption, copyright_statement, date_of_exposure,
location, storage_location, storage_index,
access_rights, hide_original,
camera, lens, filter, film, flash, scanner, focal_length, aperture, shutter,
$photo_data = pg_fetch_assoc(pg_query($database, "
select folder, author, title, caption, caption_writer, copyright_statement, web_statement, date_of_exposure, category, supplemental_category,
location, storage_location, storage_index, credit, source,
access_rights, hide_original, headline, instructions,
camera, film, focal_length, aperture, shutter, transmission_reference,
exposure_comp, ev_difference, camera_metering, camera_program, flash_mode, flash_comp,
scan_resolution, scan_bitdepth, scan_multiscan, iso_override, support,
latitude, longitude, altitude, img_direction, users, can_access_photo(photo.identifier, $po_user[id], '{".$passwords."}'),
store_url, photo.comments
scan_resolution, scan_bitdepth, scan_multiscan, iso_override,
latitude, longitude, altitude, img_direction, users, can_access_photo(photo.identifier, $po_user[id], '{".$passwords."}') as ok,
store_url, photo.comments as remark
from photo, photo_version, photo_tech, photo_dupe
where photo.identifier = photo_version.photo
and photo.identifier = photo_dupe.photo
@ -112,29 +149,31 @@ for ($photos = 0; $photos < $num_photos; $photos++) {
/* If we can't access the original or access the image... */
if (($photo_data[36] != $po_user['id']) &&
if (($photo_data['users'] != $po_user['id']) &&
!($po_user['type'] == PO_USER_TYPE_ADMIN)) {
if (($photo_data[37] != 't') || ($photo_data[11] != 't')) {
if (($photo_data['ok'] != 't') || ($photo_data['hide_original'] != 't')) {
continue 2;
}
}
/* Get any keywords for the photo... */
$res = pg_query($database, "select keyword from photo_keywords where photo=$photo_identifier[identifier]");
$keywords = FALSE;
$keywords = get_photo_keywords($database, $photo_id);
$res = pg_query($database, "select photo, equipment, type from photo_equipment where photo = $photo_identifier[identifier] order by photo, type");
$equipment = FALSE;
for ($i=0; $i < pg_num_rows($res); $i++) {
$dat = pg_fetch_assoc($res);
$keywords[$i] = $dat['keyword'];
$equipment[] = "$dat[equipment]:$dat[type]";
}
break;
case "photo":
default:
$photo_data = pg_fetch_row(pg_query($database, "select users, hide_original, title, can_access_photo(photo.identifier, $po_user[id], '{".$passwords."}') from photo where identifier = $photo_identifier[identifier]"));
$photo_data = pg_fetch_assoc(pg_query($database, "select users, hide_original, title, can_access_photo(photo.identifier, $po_user[id], '{".$passwords."}') as ok from photo where identifier = $photo_identifier[identifier]"));
/* Make sure we can access it! */
if (($photo_data[0] != $po_user['id']) &&
if (($photo_data['users'] != $po_user['id']) &&
!($po_user['type'] == PO_USER_TYPE_ADMIN)) {
if (($photo_data[3] != 't') || ($photo_data[1] != 't')) {
if (($photo_data['ok'] != 't') || ($photo_data['hide_original'] != 't')) {
continue 2;
}
}
@ -142,38 +181,40 @@ for ($photos = 0; $photos < $num_photos; $photos++) {
}
$photo_version_data = pg_query($database, "
select get_image_path(photo_version.identifier, 0) as original_path, original_image_name, comment, master
select get_image_path(photo_version.identifier, 0) as original_path, original_image_name, comment, master, get_image_path(photo_version.identifier, -1) as sidecar_path
from photo_version
where photo_version.photo = $photo_identifier[identifier]");
$title = $photo_data[2];
$title = $photo_data['title'];
if ($title == "")
$title = $strings['photo']['no_title'] ." - $photo_identifier[identifier]";
print "<li>" . $strings['export']['image'] . ($photos + 1) . "/$num_photos - <a href=\"photo.php?photo=$photo_identifier[identifier]\">$title</a>.";
print "<li>" . $strings['export']['image'] . ($photos + 1) . "/$num_photos - ".emit_a(generate_link('photo', $photo_identifier['identifier']), $title) .".";
/* Generate filename list */
for ($versions = 0; $versions < pg_num_rows($photo_version_data); $versions++) {
$photo_version_single = pg_fetch_row($photo_version_data, $versions);
$photo_version_single = pg_fetch_assoc($photo_version_data, $versions);
$file_name = $image_repository_path."/".$photo_version_single[0];
$original_name = $temporary_directory."/".$photo_version_single[1];
$file_name = $image_repository_path."/".$photo_version_single['original_path'];
$xmp_name = $image_repository_path."/".$photo_version_single['sidecar_path'];
$original_name = $temporary_directory."/".$photo_version_single['original_image_name'];
print "<ul>";
/* check for the source file's existence */
if (!is_file($file_name)) {
print "<li>". err_str($strings['errors']['file_not_found']) ." : ". sprintf($strings['export']['skipped'], "<a href=\"photo.php?photo=$photo_identifier[identifier]\">$title</a>") . "</li>";
print "<li>". err_str($strings['errors']['file_not_found']) ." : ". sprintf($strings['export']['skipped'],emit_a(generate_link('photo', $photo_identifier['identifier']), $title)) . "</li>";
print "</ul>";
continue;
}
/* Symlink to the original file using the proper name */
$original_name = $temporary_directory."/".$photo_version_single[1];
print "<li>".sprintf($strings['export']['adding'], $photo_version_single[1]);
print "<li>".sprintf($strings['export']['adding'], $photo_version_single['original_image_name']);
exec("ln -s \"$file_name\" \"$original_name\"", $who_cares, $retval_tar);
if (is_file($xmp_name)) {
exec("ln -s \"$xmp_name\" \"$original_name.xmp\"", $who_cares, $retval_tar);
}
/* we use "exec" instead of "system" to avoid unwanted output */
if ($retval_tar) {
print err_str($strings['generic']['failed']);
@ -192,51 +233,56 @@ for ($photos = 0; $photos < $num_photos; $photos++) {
break;
case "photo_xml":
$image_data = array ("file" => array(0 => array("name" => "", "remark" => "", "master" => "")),
"folder" => $photo_data[0],
"author" => $photo_data[1],
"title" => $photo_data[2],
"folder" => $photo_data['folder'],
"author" => $photo_data['author'],
"title" => $photo_data['title'],
"keywords" => $keywords,
"caption" => $photo_data[4],
"copyright" => $photo_data[5],
"date_of_exposure" => $photo_data[6],
"location" => $photo_data[7],
"storage_location_type" => $photo_data[8],
"storage_location_id" => $photo_data[8],
"storage_index" => $photo_data[9],
"access_rights" => $photo_data[10],
"hide_original" => $photo_data[11],
"camera" => $photo_data[12],
"lens" => $photo_data[13],
"filter" => $photo_data[14],
"film" => $photo_data[15],
"flash" => $photo_data[16],
"scanner" => $photo_data[17],
"focal_length" => $photo_data[18],
"aperture" => $photo_data[19],
"shutter" => $photo_data[20],
"exp_comp" => $photo_data[21],
"exp_diff" => $photo_data[22],
"camera_metering" => $photo_data[23],
"camera_program" => $photo_data[24],
"flash_mode" => $photo_data[25],
"flash_comp" => $photo_data[26],
"scan_resolution" => $photo_data[27],
"scan_bitdepth" => $photo_data[28],
"scan_multiscan" => $photo_data[29],
"iso_override" => $photo_data[30],
"support" => $photo_data[31],
"latitude" => $photo_data[32],
"longitude" => $photo_data[33],
"altitude" => $photo_data[34],
"direction" => $photo_data[35],
"store_url" => $photo_data[38],
"remark" => $photo_data[39]);
"caption" => $photo_data['caption'],
"caption_writer" => $photo_data['caption_writer'],
"credit" => $photo_data['credit'],
"source" => $photo_data['source'],
"headline" => $photo_data['headline'],
"instructions" => $photo_data['instructions'],
"transmission_reference" => $photo_data['transmission_reference'],
"category" => $photo_data['category'],
"supplemental_category" => $photo_data['supplemental_category'],
"copyright" => $photo_data['copyright_statement'],
"web_statement" => $photo_data['web_statement'],
"date_of_exposure" => $photo_data['date_of_exposure'],
"location" => $photo_data['location'],
"storage_location_type" => $photo_data['storage_location'],
"storage_location_id" => $photo_data['storage_location'],
"storage_index" => $photo_data['storage_index'],
"access_rights" => $photo_data['access_rights'],
"hide_original" => $photo_data['hide_original'],
"camera" => $photo_data['camera'],
"film" => $photo_data['film'],
"focal_length" => $photo_data['focal_length'],
"aperture" => $photo_data['aperture'],
"shutter" => $photo_data['shutter'],
"exp_comp" => $photo_data['exposure_comp'],
"exp_diff" => $photo_data['ev_difference'],
"camera_metering" => $photo_data['camera_metering'],
"camera_program" => $photo_data['camera_program'],
"flash_mode" => $photo_data['flash_mode'],
"flash_comp" => $photo_data['flash_comp'],
"scan_resolution" => $photo_data['scan_resolution'],
"scan_bitdepth" => $photo_data['scan_bitdepth'],
"scan_multiscan" => $photo_data['scan_multiscan'],
"iso_override" => $photo_data['iso_override'],
"latitude" => $photo_data['latitude'],
"longitude" => $photo_data['longitude'],
"altitude" => $photo_data['altitude'],
"direction" => $photo_data['img_direction'],
"store_url" => $photo_data['store_url'],
"equipment" => $equipment,
"remark" => $photo_data['remark']);
for ($versions = 0; $versions < pg_num_rows($photo_version_data); $versions++) {
$photo_version_single = pg_fetch_row($photo_version_data, $versions);
$image_data['file'][$versions]['name'] = $photo_version_single[1];
$image_data['file'][$versions]['remark'] = $photo_version_single[2];
$image_data['file'][$versions]['master'] = $photo_version_single[3];
$photo_version_single = pg_fetch_assoc($photo_version_data, $versions);
$image_data['file'][$versions]['name'] = $photo_version_single['original_image_name'];
$image_data['file'][$versions]['remark'] = $photo_version_single['comment'];
$image_data['file'][$versions]['master'] = $photo_version_single['master'];
}
fwrite($xml_file_desciptor, create_xml_folder_header($image_data['folder']));
@ -263,8 +309,6 @@ switch($export_type) {
print "<li>".$strings['export']['close_xml']."</li>";
fwrite($xml_file_desciptor, create_xml_bulkupload_footer());
fclose($xml_file_desciptor);
print "<li>".sprintf($strings['export']['adding'], $photo_version_single[1]) ."</li>";
break;
}
@ -291,7 +335,6 @@ if ($retval_tar) {
print "</li>";
}
print "<li>".sprintf($strings['import']['removing_temp_dir']);
if (!deltree($temporary_directory)) {
print err_str(" - $temporary_directory - " . $strings['generic']['failed']);
@ -303,7 +346,7 @@ print "</ul>\n";
umask($old_mask);
print "<h3>".$strings['export']['finished']."</h3>";
print sprintf($strings['export']['download'], "<a href=\"export.2.php?export_id=$export_id&amp;export_format=$export_format\">".$strings['generic']['here']."</a>");
print sprintf($strings['export']['download'], "<a href=\"export.php?export_id=$export_id&amp;export_format=$export_format\">".$strings['generic']['here']."</a>");
print "</div>\n";

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -20,7 +20,6 @@
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
;
include_once "include/common.php";
$type = 'film';
@ -41,7 +40,7 @@ switch ($manufacturer_filter) {
site_header(sprintf($strings['profile']['add'], $strings['generic'][$type]));
site_navigator(6);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['add'], $strings['generic'][$type]), "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['add'], $strings['generic'][$type]), "");
theme_display_navigator_box_top($profile_data['film']['idx'], $profile_data, "100%");
@ -53,7 +52,7 @@ if (pg_num_rows($manufacturer) == 0) {
exit;
}
print "<form method=\"post\" action=\"film.add.2.php\">\n";
print "<form method=\"post\" action=\"film.add.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">\n";
print "<table class=\"profile\">\n";
emit_profile_manuf_combo("film.add.php?type=$film", $type, 4, $manufacturer, $manufacturer_filter);

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -20,7 +20,6 @@
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
;
include_once "include/common.php";
$type = 'film';
@ -36,21 +35,22 @@ $number_of_references = pg_fetch_row(pg_query($database, "select number_of_film_
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from film where identifier=$film_id and users=$po_user[id]"));
if ($result[0] == 0) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
exit();
}
}
site_header(sprintf($strings['profile']['delete'], $strings['generic'][$type]));
site_navigator(6);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['delete'], $strings['generic'][$type]), "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['delete'], $strings['generic'][$type]), "");
theme_display_navigator_box_top($profile_data['film']['idx'], $profile_data, "100%");
print "<form method=\"post\" action=\"profile.del.2.php?&amp;item_id=$film_id&amp;type=film\">";
print "<form method=\"post\" action=\"profile.del.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"type\" value=\"$type\">";
print "<input type=\"hidden\" name=\"item_id\" value=\"$film_id\">";
print "<table class=\"profile\">\n";
print "<tr class=\"folder_top\">\n";
print emit_td($strings['generic']['delete']." ".$strings['generic'][$type], 'colspan="6"');

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,11 +17,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
;
function update_film($database, $user_id, $film_id, $film_type_id, $film_manufacturer_id,
$film_model, $film_iso, $film_format, $film_access_rights) {
@ -71,10 +69,9 @@ $film_id = pg_escape_string($_REQUEST['item_id']);
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from film where identifier=$film_id and users=$po_user[id]"));
if ($result[0] == 0) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
exit();
}
}

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -33,10 +33,9 @@ $film_id = pg_escape_string($_REQUEST['item']);
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from film where identifier=$film_id and users=$po_user[id]"));
if ($result[0] == 0) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
exit();
}
}
@ -56,11 +55,12 @@ switch ($manufacturer_filter) {
site_header(sprintf($strings['profile']['edit'], $strings['generic'][$type]));
site_navigator(6);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['edit'], $strings['generic'][$type]), "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['edit'], $strings['generic'][$type]), "");
theme_display_navigator_box_top($profile_data['film']['idx'], $profile_data, "100%");
print "<form method=\"post\" action=\"film.edit.2.php?item_id=$film_id\">";
print "<form method=\"post\" action=\"film.edit.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"item_id\" value=\"$film_id\">";
print "<table class=\"profile\">\n";
emit_profile_manuf_combo("film.edit.php?type=$type&amp;item=$film_id", $type, 4, $manufacturer, $manufacturer_filter);

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,28 +17,25 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
;
include_once "include/site.php";
$database = site_prolog(PO_USER_TYPE_USER);
$folder_parent = pg_escape_string($_REQUEST['parent']);
$parent_folder = pg_escape_string($_REQUEST['parent']);
if ($folder_parent != "null") {
if ($parent_folder != "null") {
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_query($database, "select identifier from folder where identifier=$folder_parent and users = $po_user[id]");
$result = pg_query($database, "select identifier from folder where identifier=$parent_folder and users = $po_user[id]");
if (pg_num_rows($result) <= 0) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
}
}
}
$result = add_folder($database, $po_user['id'], $folder_parent,
$result = add_folder($database, $po_user['id'], $parent_folder,
$_REQUEST['folder_access_rights'],
$_REQUEST['folder_caption'],
$_REQUEST['folder_description'],
@ -50,9 +47,9 @@ site_epilog($database);
if (!$result) {
header("Location: $_SERVER[HTTP_REFERER]");
} else if ($folder_parent == "null") {
header("Location: user.php?user=$po_user[id]");
} else if ($parent_folder == "null") {
header("Location: ".generate_link('user', $po_user['id'], array(), TRUE));
} else {
header("Location: folder.php?folder=$folder_parent");
header("Location: ".generate_link('folder', $parent_folder, array(), TRUE));
}
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -29,14 +29,15 @@ $folder_all = get_users_folder($database);
if ($folder_parent) {
$folder_data = pg_fetch_row(pg_query($database, "select caption from folder where identifier='$folder_parent'"));
$path_to_folder = get_path_to_folder($database, $folder_parent);
}
} else {
$path_to_folder = "";
}
site_header($strings['generic']['add_folder']);
site_navigator(5);
site_navigator_status(user_disp_string($po_user['id'], $po_user['id'],
"", "")." $path_to_folder : ".$strings['generic']['add_folder'], "");
site_navigator_status(disp_user_string($database, $po_user['id'])." $path_to_folder : ".$strings['generic']['add_folder'], "");
print "&nbsp;<br/>\n";
print "<form method=\"post\" action=\"folder.add.2.php\">";
print "<form method=\"post\" action=\"folder.add.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<table class=\"listing\">\n";
print "<tr>";

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -18,8 +18,6 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/search.2.php";
include_once "include/site.php";
$return_path = isset($_REQUEST['return']) ? $_REQUEST['return'] : "";
@ -109,14 +107,14 @@ if ($spool_request) {
/* Doesn't take arguments */
if ($goto_f_request && ($destination_folder != "")) {
site_epilog($database);
header("Location: folder.php?folder=$destination_folder");
header("Location: ".generate_link('folder', $destination_folder, array(), TRUE));
exit();
}
/* Doesn't take arguments */
if ($goto_a_request && ($destination_album != "")) {
site_epilog($database);
header("Location: album.php?album=$destination_album");
header("Location: ".generate_link('album', $destination_album, array(), TRUE));
exit();
}

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,39 +17,41 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/site.php";
;
$folder_id = pg_escape_string($_REQUEST['folder']);
$parent_folder = $_REQUEST['parent'];
$database = site_prolog(PO_USER_TYPE_USER);
$go = TRUE;
/* Ensure mere users don't erase an folder that isn't theirs! */
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_query($database, "select identifier from folder where identifier='$folder_id' and users = $po_user[id]");
if (pg_num_rows($result) <= 0) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
exit();
}
}
if ($folder_id!="") {
if ($go && $folder_id!="") {
$result = pg_query($database, "delete from folder where identifier='$folder_id'");
if (!$result) {
site_push_error($strings['errors']['db_insert_failed']);
}
if ($memcache) {
$memcache->delete("allfolder_$po_user[id]");
$memcache->delete("folder_path_$folder_id");
}
}
site_epilog($database);
if ($parent_folder == "") {
header("Location: user.php?user=$po_user[id]");
header("Location: ".generate_link('user', $po_user['id'], array(), TRUE));
} else {
header("Location: folder.php?folder=$parent_folder");
header("Location: ".generate_link('folder', $parent_folder, array(), TRUE));
}
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,9 +17,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
;
include_once "include/common.php";
include_once "include/site.php";
@ -31,11 +29,10 @@ $folder_data = pg_fetch_row(pg_query($database, "select caption, date_of_creatio
if (($folder_data[4] != $po_user['id']) &&
($po_user['type'] != PO_USER_TYPE_ADMIN)) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
}
exit();
}
$folder_stats = pg_fetch_assoc(pg_query($database, "select count_subfolders_by_folder($folder_id, $po_user[id], '{".$passwords."}') as folders, count_photos_by_folder($folder_id, $po_user[id], '{".$passwords."}') as photos"));
$path_to_folder = get_path_to_folder($database, $folder_id);
@ -43,8 +40,7 @@ $path_to_folder = get_path_to_folder($database, $folder_id);
site_header($strings['generic']['delete_folder']);
site_navigator(5);
site_navigator_status(user_disp_string($po_user['id'], $po_user['id'],
"", "")." $path_to_folder : " .$strings['generic']['delete_folder'], "");
site_navigator_status(disp_user_string($database, $po_user['id'])." $path_to_folder : ".$strings['generic']['delete_folder'], "");
print "&nbsp;<br/>\n";
@ -57,7 +53,7 @@ print emit_th($strings['generic']['created'], "width=\"12%\"");
print emit_th($strings['generic']['access'], "width=\"10%\"");
print "</tr>";
print "<tr>";
print "<td><a href=\"folder.php?folder=$folder_id\">$folder_data[0]</a></td>\n";
print emit_td(emit_a(generate_link('folder', $folder_id), $folder_data[0]));
print "<td>$folder_stats[folders]</td>\n";
print "<td>$folder_stats[photos]</td>\n";
print "<td>".emit_date_html($folder_data[1], 'date'). "</td>";
@ -71,7 +67,7 @@ print "<center>\n";
if (($folder_stats['folders'] > 0) || ($folder_stats['photos'] > 0)) {
print $thm_elem['button.cancel'];
} else {
print "<form method=\"post\" action=\"folder.del.2.php\">";
print "<form method=\"post\" action=\"folder.del.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"folder\" value=\"$folder_id\"/><p>";
print "<input type=\"hidden\" name=\"parent\" value=\"$folder_data[3]\"/><p>";
print $thm_elem['button.confirm.delete'];

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,10 +17,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/site.php";
;
$folder_id = pg_escape_string($_REQUEST['folder']);
$folder_name = pg_escape_string($_REQUEST['folder_caption']);
@ -28,8 +26,9 @@ $folder_description = pg_escape_string($_REQUEST['folder_description']);
$folder_access_rights = pg_escape_string($_REQUEST['folder_access_rights']);
$parent_folder = pg_escape_string($_REQUEST['parent']);
$password = pg_escape_string($_REQUEST['password']);
$event = pg_escape_string($_REQUEST['event']);
$keep_thumb = $_REQUEST['keep_thumb'];
if ($event != "null") $event = "'$event'";
$database = site_prolog(PO_USER_TYPE_USER);
@ -38,25 +37,34 @@ $database = site_prolog(PO_USER_TYPE_USER);
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_query($database, "select identifier from folder where identifier='$folder_id' and users = $po_user[id]");
if (pg_num_rows($result) <= 0) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
exit();
}
}
if ($keep_thumb != 't') {
$extra = ", thumb_ver = null ";
} else {
$extra = "";
}
if (($folder_id!="") && ($folder_name!="")) {
$result = pg_query($database, "update folder set caption='$folder_name', description='$folder_description', access_rights=$folder_access_rights, parent_folder=$parent_folder, password='$password', event=$event where identifier='$folder_id'");
$result = pg_query($database, "update folder set caption='$folder_name', description='$folder_description', access_rights=$folder_access_rights, parent_folder=$parent_folder, password='$password', event=$event $extra where identifier='$folder_id'");
if (!$result) {
site_push_error($strings['errors']['db_insert_failed']);
}
if ($memcache) {
$memcache->delete("allfolder_$po_user[id]");
$memcache->delete("folder_path_$folder_id");
}
}
site_epilog($database);
if ($parent_folder == "null") {
header("Location: user.php?user=$po_user[id]");
header("Location: ".generate_link('user', $po_user['id'], array(), TRUE));
} else {
header("Location: folder.php?folder=$parent_folder");
header("Location: ".generate_link('folder', $parent_folder, array(), TRUE));
}
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,10 +17,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/site.php";
;
include_once "include/common.php";
include_once "include/contacts.php";
include_once "include/orderby.php";
@ -29,15 +27,14 @@ $database = site_prolog(PO_USER_TYPE_USER);
$folder_id = pg_escape_string($_REQUEST['folder']);
$folder_data = pg_fetch_row(pg_query($database, "select caption, date_of_creation, access_rights, parent_folder, description, users, password, event from folder where identifier='$folder_id'"));
$folder_data = pg_fetch_row(pg_query($database, "select caption, date_of_creation, access_rights, parent_folder, description, users, password, event, thumb_ver from folder where identifier='$folder_id'"));
/* Ensure mere users don't edit an folder that isn't theirs! */
if (($po_user['id'] != $folder_data[5]) &&
($po_user['type'] != PO_USER_TYPE_ADMIN)) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
exit();
}
$folder_all = get_users_folder($database);
@ -47,59 +44,67 @@ $folder_stats = pg_fetch_assoc(pg_query($database, "select count_subfolders_by_f
$path_to_folder = get_path_to_folder($database, $folder_id);
site_header($strings['generic']['edit_folder']);
site_navigator(5);
site_navigator_status(user_disp_string($po_user['id'], $po_user['id'],
"", "")." $path_to_folder : " .$strings['generic']['edit_folder'], "");
site_navigator_status(disp_user_string($database, $po_user['id'])." $path_to_folder : ".$strings['generic']['edit_folder'], "");
print "&nbsp;<br/>\n";
print "<form method=\"post\" action=\"folder.edit.2.php\">";
print "<form method=\"post\" action=\"folder.edit.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"folder\" value=\"$folder_id\"/>";
print "<table class=\"folder\">\n";
print "<tr>";
print emit_th($strings['generic']['folder_name'], "width=\"28%\"");
print emit_th($strings['generic']['parent'], "width=\"27%\"");
print emit_th($strings['generic']['subfolders'], "width=\"5%\"");
print emit_th($strings['generic']['photos'], "width=\"5%\"");
print emit_th($strings['generic']['created'], "width=\"12%\"");
print emit_th($strings['generic']['access'], "width=\"10%\"");
print emit_th($strings['generic']['password'], "width=\"13%\"");
print "</tr>";
print "<tr>";
print "<td><input type=\"text\" name=\"folder_caption\" value=\"$folder_data[0]\"/></td>";
print "<td>";
display_folder_combo("parent", $folder_all, $folder_data[3], "null");
print "</td>\n";
print "<td>$folder_stats[folders]</td>\n";
print "<td>$folder_stats[photos]</td>\n";
print "<td>".emit_date_html($folder_data[1], 'date'). "</td>";
print "<td>"; display_access_combo("folder_access_rights", $folder_data[2], "");
print "</td>\n";
print "<td><input type=\"text\" name=\"password\" value=\"$folder_data[6]\"></td>";
print "</tr>";
print "</table>";
print "&nbsp;<br/>\n";
print "<table class=\"listing\">\n";
print "<tr>";
print emit_td($strings['datebook']['event']);
print emit_td(emit_event_combo($database, "event", $po_user['id'], $folder_data[7]));
print "</tr>";
print "</table>";
print "&nbsp;<br/>\n";
print "<table class=\"folder\">\n";
print "<tr>";
print emit_th($strings['generic']['description']);
print emit_td($strings['generic']['folder_name']);
print "<td><input type=\"text\" name=\"folder_caption\" value=\"$folder_data[0]\"/></td>";
print "</tr>";
print "<tr>";
print emit_td($strings['generic']['description']);
print "<td>";
print "<textarea name=\"folder_description\" rows=\"4\" cols=\"80\">$folder_data[4]</textarea>";
print "</td>";
print "</tr>";
print "<tr>";
print emit_td($strings['generic']['parent']);
print "<td>";
display_folder_combo("parent", $folder_all, $folder_data[3], "null");
print "</td>\n";
print "</tr>";
print "<tr>";
print emit_td($strings['generic']['access']);
print "<td>"; display_access_combo("folder_access_rights", $folder_data[2], "");
print "</td>\n";
print "</tr>";
print "<tr>";
print emit_td($strings['generic']['password']);
print "<td><input type=\"text\" name=\"password\" value=\"$folder_data[6]\" /></td>";
print "</tr>";
print "<tr>";
print emit_td($strings['datebook']['event']);
print emit_td(emit_event_combo($database, "event", $po_user['id'], $folder_data[7]));
print "</tr>";
print "<tr>";
print emit_td($strings['generic']['subfolders']);
print "<td>$folder_stats[folders]</td>\n";
print "</tr>";
print "<tr>";
print emit_td($strings['generic']['photos']);
print "<td>$folder_stats[photos]</td>\n";
print "</tr>";
print "<tr>";
print emit_td($strings['generic']['created']);
print "<td>".emit_date_html($folder_data[1], 'date'). "</td>";
print "</tr>";
if ($folder_data[8]) {
print "<tr>";
print emit_td($strings['generic']['keep_thumb']);
print "<td>";
$img = "<img src=\"".generate_link('image', '', array('ver'=>$folder_data[8], 'size'=>1)) ."\" alt=\"\" />&nbsp;";
print emit_a(generate_link('photo', '', array('ver'=>$folder_data[8])),
$img);
print emit_yes_no_combo("keep_thumb", "t");
print "</td>";
print "</tr>";
}
print "</table>";
print "&nbsp;<br/>\n";
print "<div align=\"center\">\n";
print $thm_elem['button.save.changes'];
@ -107,6 +112,7 @@ print $thm_elem['button.clear'];
print $thm_elem['button.cancel'];
print "</div>\n";
print "</form>";
site_footer($database);
site_epilog($database);
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -21,7 +21,6 @@ include_once "include/config.php";
include_once "include/common.php";
include_once "include/site.php";
include_once "include/orderby.php";
include_once "include/search.2.php";
$folder_id = pg_escape_string($_REQUEST['folder']);
$offset = pg_escape_string(isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0);
@ -39,7 +38,7 @@ if (!$folder) {
header("HTTP/1.1 404 Not found");
site_header($strings['generic']['display_folder']);
site_navigator(1);
site_navigator_status(user_disp_string(0, $po_user['id'], "", ""). " : ". $strings['errors']['no_such_folder'], "");
site_navigator_status(disp_user_string($database, 0). " : ". $strings['errors']['no_such_folder'], "");
site_footer($database);
site_epilog($database);
exit();
@ -50,12 +49,12 @@ if ($folder[5] == 'f') {
header("HTTP/1.1 403 Forbidden");
site_header($strings['generic']['display_folder']);
site_navigator(1);
site_navigator_status(user_disp_string(0, $po_user['id'], "", ""). " : ". $strings['errors']['private'], "");
site_navigator_status(disp_user_string($database, 0). " : ". $strings['errors']['private'], "");
site_footer($database);
site_epilog($database);
} else {
site_push_error($strings['errors']['protected']);
header("Location: login.php?reason=protected&orig=".urlencode("folder.php?folder=$folder_id"));
header("Location: login.php?reason=protected&orig=".urlencode(generate_link('folder', $folder_id)));
}
exit();
}
@ -64,15 +63,9 @@ if ($folder[5] == 'f') {
$folder_name = $folder[0];
$owner_id = $folder[2];
$user_data = pg_fetch_row(pg_query($database, "
select last_name, first_name, users.identifier
from users
where users.identifier=$owner_id"));
site_header($folder_name);
$user_display_string = user_disp_string($owner_id, $po_user['id'],
$user_data[0], $user_data[1]);
$user_display_string = disp_user_string($database, $owner_id);
$master = "and photo_version.master = 't'";
$froms = array('folder');
@ -129,7 +122,7 @@ if ($num_of_photos == 0) {
if (($po_user['id'] == $owner_id) &&
($folder_id != $po_user['trash_folder'])) {
print "<div align=\"center\">";
print "<form name=\"photoList\" method=\"post\" action=\"folder.content.php\">";
print "<form name=\"photoList\" method=\"post\" action=\"folder.content.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"source_folder\" value=\"$folder_id\"/>\n";
print $thm_elem['button.add.photos'];
print "</form>";
@ -152,19 +145,19 @@ if ($folder_name != 'Trash' || $folder_id != $po_user['trash_folder']) {
display_folders($database, "$folder_id", $owner_id, "with_header");
}
print "<form name=\"photoList\" method=\"post\" action=\"folder.content.php\">";
print "<form name=\"photoList\" method=\"post\" action=\"folder.content.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"user\" value=\"$owner_id\"/>";
print "<input type=\"hidden\" name=\"photo_view\" value=\"$po_options[photo_view]\"/>";
print "<input type=\"hidden\" name=\"return\" value=\"folder.php?folder=$folder_id&amp;offset=$offset\"/>";
print "<input type=\"hidden\" name=\"return\" value=\"".generate_link('folder', $folder_id, array('offset'=>$offset))."\"/>";
print "<input type=\"hidden\" name=\"source_folder\" value=\"$folder_id\"/>\n";
display_photo_navigator("folder.php?folder=$folder_id", $offset, $limit, $num_of_photos);
display_photo_navigator(generate_link('folder', $folder_id), $offset, $limit, $num_of_photos);
if ($po_options['photo_view'] == "slide") {
$checkboxes = display_photo_slides("folder", $folder_id, $folder_photo, 0, $items, true, true);
} else {
$checkboxes = display_photo_list("folder", $folder_id, $folder_photo, 0, $items);
}
display_photo_navigator("folder.php?folder=$folder_id", $offset, $limit, $num_of_photos);
display_photo_navigator(generate_link('folder', $folder_id), $offset, $limit, $num_of_photos);
site_navigator_status("$user_display_string $path_to_folder $edit_folder", $strings['generic']['displaying'] . " " . display_photo_index_status($offset, $limit, $num_of_photos));
@ -182,7 +175,7 @@ if ($checkboxes !== FALSE) {
print "<table><tr><td>\n";
if ($checkboxes !== FALSE) {
display_list_slide_option($po_options['photo_view'], "folder.php?folder=$folder_id&amp;offset=$offset");
display_list_slide_option($po_options['photo_view'], generate_link('folder', $folder_id, array('offset'=>$offset)));
}
if ($checkboxes && ($po_user['type'] >= PO_USER_TYPE_CLIENT)) {
@ -216,7 +209,7 @@ if ($checkboxes) {
display_folder_actions($folder_all, $folder_id);
}
$album_all = get_users_album($database);
if (pg_num_rows($album_all) > 0) {
if (count($album_all)) {
display_album_actions($album_all, '');
}
}

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -92,6 +92,7 @@ if ($photo_data['ok'] != 't') {
/* Special Handling */
switch ($image_size) {
case -1:
case 0: /* Originals get extra tests and a name change. */
$disposition = "attachment; ";
@ -104,7 +105,11 @@ switch ($image_size) {
}
if ($photo_data['original_image_name']) {
$original_image_name = $photo_data['original_image_name'];
$image_type = substr(strtolower(strrchr ($original_image_name, ".")), 1);
if ($image_size != -1) {
$image_type = substr(strtolower(strrchr ($original_image_name, ".")), 1);
} else {
$original_image_name .= ".xmp";
}
}
break;
case 1: /* Thumbnails don't get counters incremented. */

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -24,8 +24,7 @@ function admin_i18n_data() {
global $admin_data;
$admin_data = array("users_n_clients" => array("idx" => 1, 'link' => "admin.php?selector=1", "alt" => $strings['admin']['users_clients']),
"repository" => array("idx" => 2, 'link' => "admin.php?selector=2", "alt" => $strings['admin']['image_repository']),
"front_page" => array("idx" => 3, 'link' => "admin.php?selector=3", "alt" => $strings['admin']['front_page']));
"repository" => array("idx" => 2, 'link' => "admin.php?selector=2", "alt" => $strings['admin']['image_repository']));
}
$generate_i18n_data[] = "admin_i18n_data";
@ -163,12 +162,12 @@ function display_users_and_clients($database, $my_user_id, $auth_handle) {
$user[13] -= $user[12];
if (!$user[6]) $user[6] = $po_options_default['bulk_upload_enable'];
if (!$user[8]) $user[8] = $po_options_default['quota_count'];
if (!$user[9]) $user[9] = $po_options_default['quota_size'];
if ($user[8] == '') $user[8] = $po_options_default['quota_count'];
if ($user[9] == '') $user[9] = $po_options_default['quota_size'];
if (!$user[14]) $user[14] = $po_options_default['show_ads'];
print "<tr>\n";
print emit_td(emit_a("user.php?user=$user[0]", "$user[1], $user[2]") . "($user[10])", 'align="left"');
print emit_td(emit_a(generate_link('user', $user[0]), "$user[1], $user[2]") . "($user[10])", 'align="left"');
print emit_td($user[12] . ($user[13] > 0 ? " + $user[13]" : ""));
print emit_td("$used_storage_space MB");
print emit_td($user[4]);
@ -206,27 +205,6 @@ function display_users_and_clients($database, $my_user_id, $auth_handle) {
print "<br/>\n";
}
function display_front_page_editor($file_name) {
global $thm_elem;
global $strings;
/* Open the current front page */
$file_descriptor = fopen ($file_name, "r");
$file_content = fread($file_descriptor, filesize($file_name));
$file_content = htmlspecialchars($file_content);
fclose($file_descriptor);
print "<p></p>";
print "<form action=\"save.front.page.php\" method=\"post\" accept-charset=\"".$strings['formats']['encoding']."\">\n";
print "<textarea id=\"template_editor\" name=\"file_content\" rows=\"25\" cols=\"80\">$file_content</textarea>\n";
print $thm_elem['button.save.changes'];
print "</form>\n";
}
function register_user($database, $username, $user_type, $password, $fn, $ln, $email, $auth_handle) {
global $po_user;
global $po_options_default;

View File

@ -0,0 +1,149 @@
<?php
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
class po_auth_flyspray_db {
private $handle;
private $dbprefix = 'flyspray_';
private $admin_grp = 1;
private $user_grp = 3;
private $client_grp = 4;
function __construct() {
global $auth_db_dsn;
$this->handle = pg_pconnect($auth_db_dsn);
if ($this->handle)
pg_set_client_encoding($this->handle, 'UTF-8');
}
/* Clean up any resources obtained in the constructor */
function __destruct() {
pg_close($this->handle);
}
/* Arguments:
$username = "some_plaintext_username";
$password = "some_plaintext_password";
Returns:
FALSE if unsuccessful
username if successful
*/
function auth_user($username, $password) {
$database = $this->handle;
$password = pg_escape_string($this->passwd_transform($password, $username));
$username = pg_escape_string($username);
$res = pg_query($database, "SELECT user_name FROM ".$this->dbprefix."users WHERE user_name='$username' and user_pass = '$password' and account_enabled > 0");
if (pg_num_rows($res)) {
$row = pg_fetch_row($res);
return $row[0];
} else {
return FALSE;
}
}
/* Arguments:
$username = "some_plaintext_username";
Returns: array()
THESE ARE REQUIRED FIELDS:
'first_name' => 'firstname'
'last_name' => 'lastname'
'email' => 'email_addr'
'type' => PO_USER_TYPE
OPTIONAL FIELDS
address1, address2, city, zipcode, state, country, phone, url
*/
function user_info($username) {
$username = pg_escape_string($username);
$res = pg_fetch_assoc(pg_query($this->handle, "SELECT real_name, email_address as email, account_enabled, (select count(*) from ".$this->dbprefix."users_in_groups g where u.user_id = g.user_id and g.group_id = $this->admin_grp) as admin, (select count(*) from ".$this->dbprefix."users_in_groups g where u.user_id = g.user_id and g.group_id = $this->user_grp) as user FROM ".$this->dbprefix."users u
WHERE u.user_name='$username' "));
if ($res['admin'])
$res['type'] = PO_USER_TYPE_ADMIN;
elseif ($res['user'])
$res['type'] = PO_USER_TYPE_USER;
elseif ($res['account_enabled'])
$res['type'] = PO_USER_TYPE_CLIENT;
else
$res['type'] = PO_USER_TYPE_DISABLED;
$res['first_name'] = substr($res['real_name'], 0, strpos($res['real_name'], ' '));
$res['last_name'] = substr($res['real_name'], strpos($res['real_name'], ' ') + 1);
unset($res['admin']);
unset($res['client']);
unset($res['user']);
unset($res['account_enabled']);
unset($res['real_name']);
return $res;
}
/* Arguments:
$username = "some_plaintext_username";
$old_password = "old password, plaintext";
$new_password = "new password, plaintext";
Returns:
FALSE if failed, something else if ok.
*/
function change_pass($username, $old_password, $new_password) {
$database = $this->handle;
$username = pg_escape_string($username);
$new_password = pg_escape_string($this->passwd_transform($new_password, $username));
$old_password = pg_escape_string($this->passwd_transform($old_password, $username));
$res = pg_query($database, "update ".$this->dbprefix."users set user_pass = '$new_password' where user_name = '$username' and user_pass = '$old_password'");
return (pg_affected_rows($res) > 0);
}
function force_change_pass($username, $new_password) {
$database = $this->handle;
$username = pg_escape_string($username);
$new_password = pg_escape_string($this->passwd_transform($new_password, $username));
$res = pg_query($database, "update ".$this->dbprefix."users set user_pass = '$new_password' where user_name = '$username'");
return (pg_affected_rows($res) > 0);
}
/* Mangles the password for storage in local database */
function passwd_transform($password, $salt) {
return md5($password);
}
public $can_change_pass = TRUE;
public $username_is_email = FALSE;
public $local_register = FALSE;
public $local_userinfo = TRUE;
}
?>

135
src/include/auth-ldap.php Normal file
View File

@ -0,0 +1,135 @@
<?php
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
$auth_ldap_url = "";
$auth_ldap_dn = "";
class po_auth_ldap {
private $handle;
private $dn;
private $bound = -1; // 0 = anon, 1 = user, 2 = superuser
function __construct() {
global $auth_ldap_url;
global $auth_ldap_dn;
$this->handle = ldap_connect($auth_ldap_url);
if (!$this->handle)
return FALSE;
$this->dn = $auth_ldap_dn;
ldap_set_option($this->handle, LDAP_OPT_PROTOCOL_VERSION, 3);
# ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
if (!ldap_bind($this->handle))
return FALSE;
$this->bound = 1;
}
/* Clean up any resources obtained in the constructor */
function __destruct() {
ldap_unbind($this->handle); // closes too.
$this->bound = -1;
$this->handle = FALSE;
}
/* Arguments:
$username = "some_plaintext_username";
$password = "some_plaintext_password";
Returns:
FALSE if unsuccessful
username if successful
*/
function auth_user($username, $password) {
if (empty($password))
return FALSE;
$r = ldap_search($this->handle, $this->dn, "uid=$username");
$info = ldap_get_entries($this->handle, $r);
if (!$info || !$info['count'])
return FALSE;
$info = $info[0];
if (ldap_bind($this->handle, $info['dn'], $password)) {
$this->bound = 1;
return $username;
}
return FALSE;
}
/* Arguments:
$username = "some_plaintext_username";
Returns: array()
THESE ARE REQUIRED FIELDS:
'first_name' => 'firstname'
'last_name' => 'lastname'
'email' => 'email_addr'
'type' => PO_USER_TYPE
OPTIONAL FIELDS
address1, address2, city, zipcode, state, country, phone, url
*/
function user_info($username) {
$res = array();
if ($this->bound == -1) { // bind anonymously...
if (!ldap_bind($this->handle))
return FALSE;
}
$r = ldap_search($this->handle, $this->dn, "uid=$username");
$info = ldap_get_entries($this->handle, $r);
if (!$info || !$info['count'])
return FALSE;
$info = $info[0];
$res['last_name'] = $info['sn'][0];
$res['first_name'] = $info['givenname'][0];
$res['email'] = $info['mail'][0];
$res['type'] = 4; // XXX -- ADMIN!
return $res;
}
/* Mangles the password for storage in local database */
function passwd_transform($password, $salt) {
return $password;
}
public $can_change_pass = FALSE;
public $username_is_email = FALSE;
public $local_register = FALSE;
public $local_userinfo = TRUE;
}
?>

View File

@ -1,6 +1,6 @@
<?php
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -25,6 +25,10 @@ class po_auth_default_db {
$this->handle = $database;
}
function __destruct() {
// Do nothing in this specific case.
}
/* Arguments:
$username = "some_plaintext_username";
$password = "some_plaintext_password";
@ -69,8 +73,7 @@ class po_auth_default_db {
$database = $this->handle;
$username = pg_escape_string($username);
$res = pg_fetch_assoc(pg_query($database, "SELECT first_name, last_name, email, type,
address1, address2, city, zipcode, state, country, phone, url
$res = pg_fetch_assoc(pg_query($database, "SELECT first_name, last_name, email, type
FROM view_contact_info
WHERE username='$username'"));
return $res;
@ -128,7 +131,7 @@ class po_auth_default_db {
public $can_change_pass = TRUE;
public $username_is_email = FALSE;
public $local_register = TRUE;
public $local_userinfo = TRUE;
}
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -222,15 +222,12 @@ function emit_date_html($timestamp, $format, $special = FALSE) {
$html_string = "";
if ($link)
$html_string = "<a href=\"my.datebook.php?view=1&amp;year=$year&amp;month=$month&amp;day=$day\">";
if ($date_format) {
$html_string .= strftime($date_format, $timestamp);
}
if ($link)
$html_string .= "</a>";
if ($link)
$html_string = emit_a("my.datebook.php?view=1&amp;year=$year&amp;month=$month&amp;day=$day", $html_string);
if ($time_format) {
if ($time_format == $format) {

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -33,7 +33,10 @@ $site_url = "http://localhost/po";
// This appears in the titlebar on every page.
$site_title = "My Photo Organizer";
$pretty_urls = FALSE;
$ad_script = FALSE;
$ad_script2 = FALSE;
// A URL to the bug tracker or whatnot for this site
$bug_url = "http://bugs.shaftnet.org/";
@ -70,11 +73,15 @@ $image_repository_path = "/export/po_dev_image_repository";
$po_session_lifetime = 0; /* use default, but otherwise in seconds */
$po_session_path = "";
$po_session_handler = "";
$po_cookie_path = "/";
// Once can use memcached instead. For example:
// $po_session_path = "tcp://localhost:11211/";
// $po_session_handler = "memcache";
// If you want to use memcache to cache non-session data, set it here:
$po_memcache = "";
// absolute path to your temporary directory which
// is used to store printed files while they are converted
// and to perform bulk uploads
@ -115,9 +122,6 @@ $sys_unzip = "/usr/bin/unzip";
// zip
$sys_zip = "/usr/bin/zip";
// The path to the current theme - relative to the PO installation directory
$theme = "themes/aqua";
/* Default options */
$po_options = array(
"lang" => "en_US", /* See lang/ for your options */
@ -171,6 +175,9 @@ $po_options = array(
"hide_originals_default" => 't',
"access_default" => PO_ACCESS_PUBLIC,
"copyright_default" => '',
"web_statement_default" => '',
"import_last_master" => 't',
"ufraw_gamma" => 0.45,
"ufraw_gamma_linearity" => 0.10,
@ -179,6 +186,7 @@ $po_options = array(
"raw_bitdepth" => 24,
"raw_denoise" => 0, /* floating point, 0 = disable */
"jpgfromraw" => 't',
"jpgfromraw_master" => 'f',
"print_out" => "pdf", // "ps" or "pdf"
"start_hour" => 8,
@ -192,19 +200,32 @@ $po_options = array(
"search_engine_type" => 1,
"search_masters_only" => 't',
"export_format" => "tar" // "tar" or "zip"
"export_format" => "tar", // "tar" or "zip"
"local_bulk_upload_path" => '', // Do *not* set globally!
"import_metadata_order" => "xmp,exif,iptc"
);
/* A few more things */
$po_options['focal_lengths'] = '5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 28, 35, 40, 45, 50, 55, 60, 65,70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 180, 210, 240, 300, 400, 500, 600, 800, 1000, 1100, 1200, 1300, 1500';
$po_options['apertures'] = '0.5, 0.75, 1.0, 1.2, 1.3, 1.4, 1.8, 2.0, 2.2, 2.5, 2.8, 3.2, 3.5, 4.0, 4.5, 5.0, 5.6, 6.3, 7.1, 8, 9, 10, 11, 13, 14, 16, 18, 20, 22, 25, 28, 32, 36, 40, 45, 51, 57, 64, 72, 81, 90, 103, 115, 128';
$po_options['scan_bitdepths'] = '8, 12, 14, 15, 16, 18, 24, 32, 36, 48';
$po_options['scan_multiscans'] = '1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16';
$po_options['scan_resolutions'] = '50, 75, 90, 93, 96, 100, 103, 107, 111, 126, 120, 126, 131, 138, 145, 150, 152, 161, 170, 181, 193, 207, 223, 241, 263, 290, 300, 322, 362, 414, 483, 580, 600, 725, 800, 966, 1000, 1200, 1450, 1600, 1800, 2000, 2200, 2400, 2700, 2820, 2900, 3600, 4000, 4800, 9600';
/* We need this to track changes */
$po_options_default = array();
$po_options_default['new_user_type'] = PO_USER_TYPE_USER;
$po_options_default['volume_max_size'] = 690; // MB
$po_options_default['bulk_upload_enable'] = 't';
$po_options_default['volume_max_count'] = 0; // file count; 0 disables.
$po_options_default['bulk_upload_enable'] = 't';
$po_options_default['quota_size'] = 0; // in bytes
$po_options_default['quota_count'] = 0; // in files
$po_options_default['show_ads'] = 'f';
$po_options_default['theme'] = 'aqua'; // see themes/*
// You might want to add more forbidden keywords
$forbidden_keywords = array("a", "b", "c", "d", "e", "f", "g", "h",
@ -218,7 +239,7 @@ error_reporting(E_ALL ^ E_NOTICE);
/* Default credentials expiration time */
$default_cred_timeout = 60 * 10; // 10 minutes
$po_version = "2.35b";
$po_version = "2.36";
include_once "auth.php";
$po_auth = "po_auth_default_db";
@ -242,8 +263,8 @@ $po_options['bulk_upload_enable'] = $po_options_default['bulk_upload_enable'];
$po_options['quota_size'] = $po_options_default['quota_size'];
$po_options['quota_count'] = $po_options_default['quota_count'];
$po_options['show_ads'] = $po_options_default['show_ads'];
$po_options['theme'] = $po_options_default['theme'];
include_once "lang/en_US.php";
include_once "$theme/theme.php";
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -92,7 +92,7 @@ function display_clients($database, $my_user_id, $auth_handle) {
}
print "<tr>\n";
print emit_td(emit_a("user.php?user=$client[1]", "$client[2] $client[3]"));
print emit_td(emit_a(generate_link('user', $client[1]), "$client[2] $client[3]"));
print emit_td($strings['generic'][$client_status[$client[5]]]);
print emit_td(emit_yes_no_text($client[7]));
print emit_td(emit_date_html($client[4], 'date'));
@ -138,7 +138,7 @@ function display_protected_photographers($database, $my_user_id, $owner = FALSE)
$subscribed_user[2] = sprintf("%s,", $subscribed_user[2]);
}
print "<tr>\n";
print emit_td(emit_a("user.php?user=$subscribed_user[1]", "$subscribed_user[2] $subscribed_user[3]"));
print emit_td(emit_a(generate_link('user', $subscribed_user[1]), "$subscribed_user[2] $subscribed_user[3]"));
print emit_td($strings['generic'][$client_status[$subscribed_user[5]]]);
print emit_td(emit_date_html($subscribed_user[4], 'date'));
print emit_td(emit_a("subscription.del.php?client=$subscribed_user[0]", $strings['generic']['delete']));

View File

@ -1,44 +0,0 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
/* Simple database connection wrapper */
function po_dbconnect() {
global $db_dsn;
{ // Compatibility code...
global $db_host;
global $db_port;
global $db_name;
global $db_user;
global $db_password;
if (isset($db_host)) {
$db_dsn = "host=" . $db_host . " port=" . $db_port . " dbname=" . $db_name . " user=" . $db_user . " password=" . $db_password;
}
}
// $dbh = pg_connect($db_dsn); /* Normal */
$dbh = pg_pconnect($db_dsn); /* Persistent */
if ($dbh)
pg_set_client_encoding($dbh, 'UTF-8');
return $dbh;
}
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -200,7 +200,7 @@ function displayDayHTML($database, $user_id, $year, $month, $day, $cal_start_hou
$string = $event_data[3];
print emit_td(emit_DayEventHTML($event_data[0], $string, $event_data[1], $event_data[2], $date), "class=\"selected\" colspan=\"$event_cells\"");
print emit_td(emit_DayEventHTML($event_data[0], $string, $event_data[1], $event_data[2], $date), "colspan=\"$event_cells\"");
for ($i = $end_hour; $i < $cal_end_hour; $i ++)
print emit_td("&nbsp;");

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -150,18 +150,17 @@ function convert_exif_camera($database, $user_id, &$image_data, $camera_make, $c
function convert_exif_lens($database, $user_id, &$image_data, $lens_id) {
$lens_id = pg_escape_string($lens_id);
$lens = pg_query($database, "select lens.identifier
from lens_type, lens
where lens_type.identifier = lens.type
and exiftool_lens_id = '$lens_id'
and lens.users = $user_id");
$lens = pg_query($database, "select identifier from view_equipment
where model = '$lens_id'
and type = ".PO_EQUIPMENT_LENS ."
and users = $user_id");
if (!$lens)
return FALSE;
if (pg_num_rows($lens) > 0) {
$my_lens = pg_fetch_row($lens, 0);
$image_data['lens'] = $my_lens[0];
$image_data['equipment'][] = "$my_lens[0]:".PO_EQUIPMENT_LENS;
return TRUE;
}
@ -179,31 +178,35 @@ function photo_parse_exif_orientation_colorspace($database, $index, $user_id, $i
$exif_data = $image_data["exiftool_data_$tag"];
/* Orientation -- Map the new to the old */
switch ($exif_data["Orientation"]) {
case 'Mirror horizontal': /* 2 */
$image_data["orientation"] = "Mirrored";
break;
case 'Rotate 180': /* 3 */
$image_data["orientation"] = "Upsidedown";
break;
case 'Mirror vertical': /* 4 */
$image_data["orientation"] = "Upsidedown Mirrored";
break;
case 'Mirror horizontal and rotate 270 CW': /* 5 */
$image_data["orientation"] = "90 deg CW Mirrored";
break;
case 'Rotate 90 CW': /* 6 */
$image_data["orientation"] = "90 deg CW";
break;
case 'Mirror horizontal and rotate 90 CW': /* 7 */
$image_data["orientation"] = "90 deg CCW Mirrored";
break;
case 'Rotate 270 CW': /* 8 */
$image_data["orientation"] = "90 deg CCW";
break;
case 'Horizontal (normal)': /* 1 */
if (isset($exif_data["Orientation"])) {
switch ($exif_data["Orientation"]) {
case 'Mirror horizontal': /* 2 */
$image_data["orientation"] = "Mirrored";
break;
case 'Rotate 180': /* 3 */
$image_data["orientation"] = "Upsidedown";
break;
case 'Mirror vertical': /* 4 */
$image_data["orientation"] = "Upsidedown Mirrored";
break;
case 'Mirror horizontal and rotate 270 CW': /* 5 */
$image_data["orientation"] = "90 deg CW Mirrored";
break;
case 'Rotate 90 CW': /* 6 */
$image_data["orientation"] = "90 deg CW";
break;
case 'Mirror horizontal and rotate 90 CW': /* 7 */
$image_data["orientation"] = "90 deg CCW Mirrored";
break;
case 'Rotate 270 CW': /* 8 */
$image_data["orientation"] = "90 deg CCW";
break;
case 'Horizontal (normal)': /* 1 */
$image_data["orientation"] = "Normal (0 deg)";
break;
}
} else {
$image_data["orientation"] = "Normal (0 deg)";
break;
}
$image_data["orientation_orig"] = $image_data["orientation"];
@ -344,12 +347,17 @@ function photo_parse_exif($database, $index, $user_id, $image_data) {
/* Focal length is special */
$tmp = $exif_data["Focal Length"];
$tmp = substr($tmp, 0, strpos($tmp, 'mm'));
if(strpos($tmp, 'mm')) {
$tmp = substr($tmp, 0, strpos($tmp, 'mm'));
}
if ($exif_data["Scale Factor To 35mm Equivalent"] > 2) {
if ($exif_data["Focal Length In 35mm Format"]) {
if (isset($exif_data["Scale Factor To 35mm Equivalent"]) && $exif_data["Scale Factor To 35mm Equivalent"] > 2) {
if (isset($exif_data["Focal Length In 35mm Format"]) && $exif_data["Focal Length In 35mm Format"]) {
$tmp = $exif_data["Focal Length In 35mm Format"];
$tmp = substr($tmp, 0, strpos($tmp, 'mm'));
if(strpos($tmp, 'mm')) {
$tmp = substr($tmp, 0, strpos($tmp, 'mm'));
}
} else {
$tmp = $tmp * $exif_data["Scale Factor To 35mm Equivalent"];
}

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -278,7 +278,7 @@ function convert_xml2html($string) {
function create_xml_header() {
$xml_string = "<?xml version='1.0'?>\n";
$xml_string .= "<!DOCTYPE BULKUPLOAD SYSTEM \"http://po.shaftnet.org/_media/po.dtd/\">\n";
$xml_string .= "<!DOCTYPE BULKUPLOAD SYSTEM \"http://po.shaftnet.org/_media/po.dtd/\" \"2.36\">\n";
return $xml_string;
}
@ -299,57 +299,82 @@ function create_xml_bulkupload_footer() {
}
function create_xml_photo($image_data) {
$xml_string = "<photo";
if ($image_data['title'])
$xml_string .= " title=\"".$image_data['title']."\"";
$xml_string .= ">\n";
$xml_string = "<photo>\n";
if ($image_data['caption'])
$xml_string .= "<caption>".$image_data['caption']."</caption>\n";
if ($image_data['keywords'])
foreach($image_data['file'] as $version) {
$xml_string .= "<file";
if ($version['master'] == 't')
$xml_string .= " master=\"yes\"";
else
$xml_string .= " master=\"no\"";
$xml_string .= " name=\"".$version['name']."\"";
if ($version['remark'])
$xml_string .= " remark=\"".$version['remark']."\"";
$xml_string .= " />\n";
}
if ($image_data['author'])
$xml_string .= "<author>".$image_data['author']."</author>\n";
if (count($image_data['keywords'])) {
foreach ($image_data['keywords'] as $keyword) {
$xml_string .= "<keyword>".$keyword."</keyword>\n";
}
}
if ($image_data['caption'])
$xml_string .= "<caption>".$image_data['caption']."</caption>\n";
if ($image_data['copyright'])
$xml_string .= "<copyright>".$image_data['copyright']."</copyright>\n";
if ($image_data['author'])
$xml_string .= "<author>".$image_data['author']."</author>\n";
foreach($image_data['file'] as $version) {
$xml_string .= "<file name=\"".$version['name']."\"";
if ($version['remark'])
$xml_string .= " remark=\"".$version['remark']."\"";
if ($version['master'] == 't')
$xml_string .= " master=\"yes\"";
$xml_string .= "/>\n";
if ($image_data['web_statement'])
$xml_string .= "<web_statement>".$image_data['web_statement']."</web_statement>\n";
if ($image_data['caption_writer'])
$xml_string .= "<caption_writer>".$image_data['caption_writer']."</caption_writer>\n";
if ($image_data['supplemental_category'])
$xml_string .= "<supplemental_category>".$image_data['supplemental_category']."</supplemental_category>\n";
if ($image_data['credit'])
$xml_string .= "<credit>".$image_data['credit']."</credit>\n";
if ($image_data['source'])
$xml_string .= "<source>".$image_data['source']."</source>\n";
if ($image_data['headline'])
$xml_string .= "<headline>".$image_data['headline']."</headline>\n";
if ($image_data['instructions'])
$xml_string .= "<instructions>".$image_data['instructions']."</instructions>\n";
if ($image_data['transmission_reference'])
$xml_string .= "<transmission_reference>".$image_data['transmission_reference']."</transmission_reference>\n";
if ($image_data['remark'])
$xml_string .= "<remark>".$image_data['remark']."</remark>\n";
if ($image_data['title'])
$xml_string .= "<title>".$image_data['title']."</title>\n";
if ($image_data['store_url'] != "") {
$xml_string .= "<purchase_url>$image_data[store_url]</purchase_url>\n";
}
if ($image_data['date_of_exposure'] != "null") {
$exposure_year = substr($image_data['date_of_exposure'], 0, 4);
$exposure_month = substr($image_data['date_of_exposure'], 5, 2);
$exposure_day = substr($image_data['date_of_exposure'], 8, 2);
$exposure_hour = substr($image_data['date_of_exposure'], 11, 2);
$exposure_min = substr($image_data['date_of_exposure'], 14, 2);
$exposure_sec = substr($image_data['date_of_exposure'], 17, 2);
if ($exposure_year || $exposure_month || $exposure_day) {
$xml_string .= "<expdate";
if ($exposure_year)
$xml_string .= " year=\"$exposure_year\"";
if ($exposure_month)
$xml_string .= " month=\"$exposure_month\"";
if ($exposure_day)
$xml_string .= " day=\"$exposure_day\"";
if ($exposure_hour)
$xml_string .= " hours=\"$exposure_hour\"";
if ($exposure_min)
$xml_string .= " minutes=\"$exposure_min\"";
if ($exposure_sec)
if ($image_data['date_of_exposure'] != "null") {
$exposure_year = substr($image_data['date_of_exposure'], 0, 4);
$exposure_month = substr($image_data['date_of_exposure'], 5, 2);
$exposure_day = substr($image_data['date_of_exposure'], 8, 2);
$exposure_hour = substr($image_data['date_of_exposure'], 11, 2);
$exposure_min = substr($image_data['date_of_exposure'], 14, 2);
$exposure_sec = substr($image_data['date_of_exposure'], 17, 2);
if ($exposure_year || $exposure_month || $exposure_day) {
$xml_string .= "<expdate sqldate=\"$image_data[date_of_exposure]\" ";
if ($exposure_year)
$xml_string .= " year=\"$exposure_year\"";
if ($exposure_month)
$xml_string .= " month=\"$exposure_month\"";
if ($exposure_day)
$xml_string .= " day=\"$exposure_day\"";
if ($exposure_hour)
$xml_string .= " hours=\"$exposure_hour\"";
if ($exposure_min)
$xml_string .= " minutes=\"$exposure_min\"";
if ($exposure_sec)
$xml_string .= " seconds=\"$exposure_sec\"";
$xml_string .= " />\n";
$xml_string .= " />\n";
}
}
}
if ($image_data['location'] && $image_data['location'] != "null")
$xml_string .= "<location id=\"".$image_data['location']."\" />\n";
@ -389,13 +414,6 @@ if ($image_data['date_of_exposure'] != "null") {
$xml_string .= " />\n";
}
if ($image_data['store_url'] != "") {
$xml_string .= "<purchase url=\"$image_data[store_url]\" />\n";
}
if ($image_data['remark'] != "") {
$xml_string .= "<remark>$image_data[remark]</remark>\n";
}
if (($image_data['camera'] && $image_data['camera'] != "null") ||
($image_data['camera_metering'] && $image_data['camera_metering'] != "null") ||
@ -415,253 +433,66 @@ if ($image_data['date_of_exposure'] != "null") {
if ($image_data['exp_comp'] && $image_data['exp_comp'] != "null" && $image_data['exp_comp'] != "0.0")
$xml_string .= " comp=\"".$image_data['exp_comp']."\"";
if ($image_data['exp_diff'] && $image_data['exp_diff'] != "null" && $image_data['exp_diff'] != "0.0")
$xml_string .= " diff=\"".$image_data['exp_diff']."\"";
$xml_string .= " evdiff=\"".$image_data['exp_diff']."\"";
$xml_string .= " />\n";
}
if (($image_data['lens'] && $image_data['lens'] != "null") ||
($image_data['focal_length'] && $image_data['focal_length'] != "null") ||
($image_data['aperture'] && $image_data['aperture'] != "null")) {
$xml_string .= "<lens";
if ($image_data['lens'] && $image_data['lens'] != "null")
$xml_string .= " id=\"".$image_data['lens']."\"";
if ($image_data['focal_length'] && $image_data['focal_length'] != "null")
$xml_string .= " focal=\"".$image_data['focal_length']."\"";
if ($image_data['aperture'] && $image_data['aperture'] != "null")
$xml_string .= " apert=\"".$image_data['aperture']."\"";
$xml_string .= " />\n";
}
if ($image_data['filter'] && $image_data['filter'] != "null")
$xml_string .= "<filter id=\"".$image_data['filter']."\" />\n";
if (($image_data['film'] && $image_data['film'] != "null") ||
($image_data['iso_override'] && $image_data['iso_override'] != "null")) {
$xml_string .= "<film";
if ($image_data['film'] && $image_data['film'] != "null")
$xml_string .= " id=\"".$image_data['film']."\"";
if ($image_data['iso_override'] && $image_data['iso_override'] != "null")
$xml_string .= " override=\"".$image_data['iso_override']."\"";
$xml_string .= " iso_override=\"".$image_data['iso_override']."\"";
$xml_string .= " />\n";
}
if (($image_data['flash'] && $image_data['flash'] != "null") ||
($image_data['flash_mode'] && $image_data['flash_mode'] != "null") ||
($image_data['flash_comp'] && $image_data['flash_comp'] != "null" && $image_data['flash_comp'] != "0.0")) {
$xml_string .= "<flash";
if ($image_data['flash'] && $image_data['flash'] != "null")
$xml_string .= " id=\"".$image_data['flash']."\"";
if ($image_data['flash_mode'] && $image_data['flash_mode'] != "null")
$xml_string .= " mode=\"".$image_data['flash_mode']."\"";
if ($image_data['flash_comp'] && $image_data['flash_comp'] != "null" && $image_data['flash_comp'] != "0.0")
$xml_string .= " comp=\"".$image_data['flash_comp']."\"";
$xml_string .= " />\n";
}
foreach ($image_data['equipment'] as $item) {
$parts = explode(":", $item);
if (($image_data['scanner'] && $image_data['scanner'] != "null") ||
($image_data['scan_resolution'] && $image_data['scan_resolution'] != "null") ||
($image_data['scan_bitdepth'] && $image_data['scan_bitdepth'] != "null") ||
($image_data['scan_multiscan'] && $image_data['scan_multiscan'] != "null")) {
$xml_string .= "<scanner";
if ($image_data['scanner'] && $image_data['scanner'] != "null")
$xml_string .= " id=\"".$image_data['scanner']."\"";
if ($image_data['scan_resolution'] && $image_data['scan_resolution'] != "null")
$xml_string .= " dpi=\"".$image_data['scan_resolution']."\"";
if ($image_data['scan_bitdepth'] && $image_data['scan_bitdepth'] != "null")
$xml_string .= " bitdepth=\"".$image_data['scan_bitdepth']."\"";
if ($image_data['scan_multiscan'] && $image_data['scan_multiscan'] != "null")
$xml_string .= " pass=\"".$image_data['scan_multiscan']."\"";
$xml_string .= " />\n";
}
if ($parts[1] == PO_EQUIPMENT_FILTER) {
$xml_string .= "<filter id=\"$parts[0]\" />\n";
}
if ($image_data['support'] && $image_data['support'] != "null")
$xml_string .= "<support id=\"".$image_data['support']."\" />\n";
if ($parts[1] == PO_EQUIPMENT_SUPPORT) {
$xml_string .= "<support id=\"$parts[0]\" />\n";
}
if ($parts[1] == PO_EQUIPMENT_LENS) {
$xml_string .= "<lens id=\"$parts[0]\" ";
if ($image_data['focal_length'] && $image_data['focal_length'] != "null")
$xml_string .= " focal_length=\"".$image_data['focal_length']."\"";
if ($image_data['aperture'] && $image_data['aperture'] != "null")
$xml_string .= " aperture=\"".$image_data['aperture']."\"";
$xml_string .= " />\n";
}
if ($parts[1] == PO_EQUIPMENT_FLASH) {
$xml_string .= "<flash id=\"$parts[0]\" ";
if ($image_data['flash_mode'] && $image_data['flash_mode'] != "null")
$xml_string .= " mode=\"".$image_data['flash_mode']."\"";
if ($image_data['flash_comp'] && $image_data['flash_comp'] != "null" && $image_data['flash_comp'] != "0.0")
$xml_string .= " comp=\"".$image_data['flash_comp']."\"";
$xml_string .= " />\n";
}
if ($parts[1] == PO_EQUIPMENT_SCANNER) {
$xml_string .= "<scanner id=\"$parts[0]\" ";
if ($image_data['scan_resolution'] && $image_data['scan_resolution'] != "null")
$xml_string .= " dpi=\"".$image_data['scan_resolution']."\"";
if ($image_data['scan_bitdepth'] && $image_data['scan_bitdepth'] != "null")
$xml_string .= " bitdepth=\"".$image_data['scan_bitdepth']."\"";
if ($image_data['scan_multiscan'] && $image_data['scan_multiscan'] != "null")
$xml_string .= " passes=\"".$image_data['scan_multiscan']."\"";
$xml_string .= " />\n";
}
}
$xml_string .= "</photo>\n";
return $xml_string;
}
function read_nkn_string($fd) {
$length = fread($fd,1);
$length = ord($length);
return fread($fd, $length);
}
function convert_read_header($fd, $format) {
global $nkn_iso_table;
switch ($format):
case ".sdf":
for ($i = 0; $i < 7; $i++) {
$buffer = fgets($fd, 4096);
if ($i == 5) {
strtok($buffer," \t");
$iso = strtok(" \t");
}
}
break;
case ".txt":
for ($i = 0; $i < 6; $i++) {
$buffer = fgets($fd, 4096);
if ($i == 3) {
strtok($buffer,"\t");
$iso = strtok("\t");
}
}
break;
case ".nkn":
$header = read_nkn_string($fd);
$version = fread($fd, 2);
$timestamp = fread($fd, 4);
$roll_title = read_nkn_string($fd);
$camera_type = read_nkn_string($fd);
$iso = ord(fgetc($fd));
$iso = $nkn_iso_table[$iso];
break;
endswitch;
return array(iso => $iso);
}
function convert_read_body($fd, $format) {
global $nkn_exposure_table;
global $nkn_aperture_table;
global $nkn_camera_program_table;
global $nkn_camera_metering_table;
global $nkn_flash_mode_table;
global $nkn_focal_length_table;
global $nkn_exposure_table;
global $nkn_exposure_table;
$frames = 0;
if ($format == ".nkn") {
$storage_level = ord(fgetc($fd));
fread($fd, 3);
$total_frames = ord(fgetc($fd));
fread($fd, 1);
}
while (!feof ($fd)) {
switch ($format):
case ".sdf":
$buffer = fgets($fd, 4096);
/* do this twice */
$buffer = str_replace("\t\t", "\t \t", $buffer);
$buffer = str_replace("\t\t", "\t \t", $buffer);
$fram_number = strtok($buffer,"\t");
if (!$fram_number)
break;
$shutter = strtok("\t");
$aperture = strtok("\t");
$flash_mode = strtok("\t");
$camera_metering = strtok("\t");
$camera_program = strtok("\t");
$focal_length = strtok("\t");
$exp_comp = strtok("\t");
$minimum_aperture = strtok("\t");
$ev_diff = strtok("\t");
$day = strtok("\t");
$time = strtok("\t");
$data_imprint = strtok("\t");
$caption = strtok("\t");
break;
case ".txt":
$buffer = fgets($fd, 4096);
/* do this twice */
$buffer = str_replace("\t\t", "\t \t", $buffer);
$buffer = str_replace("\t\t", "\t \t", $buffer);
$fram_number = strtok($buffer,"\t");
if (!$fram_number)
break;
$shutter = strtok("\t");
$aperture = strtok("\t");
$camera_program = strtok("\t");
$camera_metering = strtok("\t");
$flash_mode = strtok("\t");
$focal_length = strtok("\t");
$exp_comp = strtok("\t");
$flash_comp = strtok("\t");
$caption = strtok("\t");
break;
case ".nkn":
$caption = read_nkn_string($fd);
$shutter = $nkn_exposure_table[ord(fgetc($fd))];
$aperture = $nkn_aperture_table[ord(fgetc($fd))]; /* rpCameraApertureEffective */
$camera_program = $nkn_camera_program_table[ord(fgetc($fd))]; /* rpNKN_ProgramMode */
$camera_metering = $nkn_camera_metering_table[ord(fgetc($fd))]; /* rpNKN_LightMetering */
if ($storage_level > 0x00) {
$flash_mode = $nkn_flash_mode_table[ord(fgetc($fd))]; /* rpNKN_FlashMode */
$focal_length = $nkn_focal_length_table[ord(fgetc($fd))]; /* rpCameraFocusDistance */
if ($storage_level > 0x01) {
$exp_comp = $nkn_exposure_table[ord(fgetc($fd))]; /* rpNKN_Compensation */
$flash_comp = $nkn_exposure_table[ord(fgetc($fd))]; /* rpNKN_Compensation */
}
}
break;
default:
return;
endswitch;
$shutter = strtolower($shutter);
$shutter = str_replace(" ", "", $shutter);
$shutter = str_replace("\"", "", $shutter);
$shutter = str_replace("hi", "", $shutter);
$shutter = str_replace("lo", "", $shutter);
$aperture = strtolower($aperture);
$aperture = str_replace("/", "", $aperture);
$aperture = str_replace("f", "", $aperture);
$aperture = str_replace("-", "", $aperture);
$aperture = str_replace(" ", "", $aperture);
$focal_length = str_replace("mm", "", $focal_length);
$focal_length = str_replace("-", "", $focal_length);
$focal_length = str_replace(" ", "", $focal_length);
$flash_mode = strtok($flash_mode, " ");
$flash_mode = strtolower($flash_mode);
$flash_mode = str_replace(" ", "", $flash_mode);
$flash_mode = str_replace("-", "", $flash_mode);
$camera_metering = strtok($camera_metering, " ");
$camera_metering = strtolower($camera_metering);
$camera_program = strtok($camera_program, " ");
$camera_program = strtolower($camera_program);
if ($camera_metering == "colour")
$camera_metering = "colormatrix";
if ($camera_program == "a")
$camera_program = "aperture";
elseif ($camera_program == "s")
$camera_program = "shutter";
elseif ($camera_program == "m")
$camera_program = "manual";
else
$camera_program = "auto";
$shooting_data[$frames] = array('shutter' => $shutter,
'aperture' => $aperture,
'flash_mode' => $flash_mode,
'camera_metering' => $camera_metering,
'camera_program' => $camera_program,
'focal_length' => $focal_length,
'exp_comp' => $exp_comp,
'minimum_aperture' => $minimum_aperture,
'ev_diff' => $ev_diff,
'caption' => $caption);
$frames++;
}
return array('frames' => $frames, 'data' => $shooting_data);
}
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -77,6 +77,10 @@ function get_current_volume($database, $image_file) {
if (($dir_size['size'] + $image_size/1048576) < $po_options_default['volume_max_size'])
break;
if ($po_options_default['volume_max_count'] &&
($po_options_default['volume_max_count'] < $dir_size['files']))
break;
$new_volume++;
if (($directory_handle = @opendir($image_repository_path."/".$new_volume))) {
/* if the next volume check if there is enough space */
@ -107,48 +111,13 @@ function get_current_volume($database, $image_file) {
return $new_volume;
}
function display_data_decoding_radio() {
global $strings;
print "<table id=\"metadata\">\n";
print "<tr>";
print emit_th("&nbsp;");
print emit_th($strings['generic']['skip']);
print emit_th($strings['generic']['first']);
print emit_th($strings['generic']['second']);
print emit_th($strings['generic']['third']);
print "</tr>";
print "<tr>";
print emit_td("EXIF");
print emit_td("<input type=\"radio\" name=\"decode_exif\" onclick=\"disabler1();\" value=\"0\" />");
print emit_td("<input type=\"radio\" name=\"decode_exif\" onclick=\"disabler1();\" value=\"1\" checked=\"checked\" />");
print emit_td("<input type=\"radio\" name=\"decode_exif\" onclick=\"disabler1();\" value=\"2\" />");
print emit_td("<input type=\"radio\" name=\"decode_exif\" onclick=\"disabler1();\" value=\"3\" />");
print "</tr>";
print "<tr>";
print emit_td("XMP");
print emit_td("<input type=\"radio\" name=\"decode_rdf\" onclick=\"disabler3();\" value=\"0\" />");
print emit_td("<input type=\"radio\" name=\"decode_rdf\" onclick=\"disabler3();\" value=\"1\" />");
print emit_td("<input type=\"radio\" name=\"decode_rdf\" onclick=\"disabler3();\" value=\"2\" checked=\"checked\" />");
print emit_td("<input type=\"radio\" name=\"decode_rdf\" onclick=\"disabler3();\" value=\"3\" />");
print "</tr>";
print "<tr>";
print emit_td("IPTC");
print emit_td("<input type=\"radio\" name=\"decode_iptc\" onclick=\"disabler2();\" value=\"0\" />");
print emit_td("<input type=\"radio\" name=\"decode_iptc\" onclick=\"disabler2();\" value=\"1\" />");
print emit_td("<input type=\"radio\" name=\"decode_iptc\" onclick=\"disabler2();\" value=\"2\" />");
print emit_td("<input type=\"radio\" name=\"decode_iptc\" onclick=\"disabler2();\" value=\"3\" checked=\"checked\" />");
print "</tr>";
print "</table>\n";
}
function extract_exiftool_metadata($image_data, $index, $type = "EXIF") {
global $sys_exiftool;
global $strings;
$image_data["exiftool_data_$type"] = NULL;
$exif_data = array();
$file = $image_data['file'][$index]['name_tmp'];
$exclude_args = "";
switch ($type) {
@ -160,6 +129,9 @@ function extract_exiftool_metadata($image_data, $index, $type = "EXIF") {
break;
case 'XMP' :
$exclude_args = "-xmp:all";
if (isset($image_data['sidecar'])) {
$file = $image_data['sidecar'];
}
break;
case 'ORIENT' :
$exclude_args = "-Orientation -ICCProfile -ColorSpace -ProfileClass -Make -Model";
@ -173,7 +145,7 @@ function extract_exiftool_metadata($image_data, $index, $type = "EXIF") {
return $image_data;
}
$handle = popen("$sys_exiftool $exclude_args " . escapeshellarg($image_data['file'][$index]['name_tmp']), "r");
$handle = popen("$sys_exiftool $exclude_args " . escapeshellarg($file), "r");
if ($handle === FALSE) {
print err_str($strings['errors']['exiftool_failed']) ."</li>";
@ -274,7 +246,7 @@ function photo_import($database, $index, $user_id, &$image_data) {
$target_folder = pg_fetch_row(pg_query($database, "select caption, users from folder where identifier = $image_data[folder]"));
if (($po_user['type'] != PO_USER_TYPE_ADMIN) &&
($target_folder[1] != $user_id)) {
print err_str($strings['errors']['not_folder_owner']." (".emit_a("folder.php?folder=$image_data[folder]", $target_folder[0]). ")");
print err_str($strings['errors']['not_folder_owner']." (".emit_a(generate_link('folder', $image_data['folder']), $target_folder[0]). ")");
return FALSE;
}
@ -293,7 +265,7 @@ function photo_import($database, $index, $user_id, &$image_data) {
$cleanup_files[] = $hires_name;
print "<p>".sprintf($strings['import']['importing_into_folder'], $original_name, $mime_type_name, emit_a("folder.php?folder=$image_data[folder]", "<strong>$target_folder[0]</strong>"))."</p>";
print "<p>".sprintf($strings['import']['importing_into_folder'], $original_name, $mime_type_name, emit_a(generate_link('folder', $image_data['folder']), "<strong>$target_folder[0]</strong>"))."</p>";
print "<ul class=\"import\">";
@ -325,26 +297,20 @@ function photo_import($database, $index, $user_id, &$image_data) {
if ($result) {
/* Extract any metadata */
if ($image_data['decode_exif'] == 1)
$image_data = photo_parse_exif($database, $index, $user_id, $image_data);
else if ($image_data['decode_iptc'] == 1)
$image_data = photo_parse_iptc($database, $index, $user_id, $image_data);
else if ($image_data['decode_rdf'] == 1)
$image_data = photo_parse_rdf($database, $index, $user_id, $image_data);
if ($image_data['decode_exif'] == 2)
$image_data = photo_parse_exif($database, $index, $user_id, $image_data);
else if ($image_data['decode_iptc'] == 2)
$image_data = photo_parse_iptc($database, $index, $user_id, $image_data);
else if ($image_data['decode_rdf'] == 2)
$image_data = photo_parse_rdf($database, $index, $user_id, $image_data);
if ($image_data['decode_exif'] == 3)
$image_data = photo_parse_exif($database, $index, $user_id, $image_data);
else if ($image_data['decode_iptc'] == 3)
$image_data = photo_parse_iptc($database, $index, $user_id, $image_data);
else if ($image_data['decode_rdf'] == 3)
$image_data = photo_parse_rdf($database, $index, $user_id, $image_data);
$types = explode(',', $image_data['import_metadata_order']);
foreach ($types as $type) {
switch (strtolower($type)) {
case 'exif':
$image_data = photo_parse_exif($database, $index, $user_id, $image_data);
break;
case 'xmp':
$image_data = photo_parse_rdf($database, $index, $user_id, $image_data);
break;
case 'iptc':
$image_data = photo_parse_iptc($database, $index, $user_id, $image_data);
break;
}
}
}
/* Figure out orientation and necessary transforms */
@ -386,17 +352,19 @@ function photo_import($database, $index, $user_id, &$image_data) {
}
/* Now for the keywords */
foreach ($image_data['keywords'] as $keyword) {
if ($result) {
$keyword = strtolower(trim($keyword));
$keyword = trim($keyword, ','); /* Trailing commas */
$keyword = trim($keyword);
if ($keyword == "") continue;
$keyword = pg_escape_string($keyword);
$query = "insert into photo_keywords (photo, keyword)
if ($image_data['keywords']) {
foreach ($image_data['keywords'] as $keyword) {
if ($result) {
$keyword = strtolower(trim($keyword));
$keyword = trim($keyword, ','); /* Trailing commas */
$keyword = trim($keyword);
if ($keyword == "") continue;
$keyword = pg_escape_string($keyword);
$query = "insert into photo_keywords (photo, keyword)
values ($next_index[0], '$keyword')";
$result = pg_query($database, $query);
$result = pg_query($database, $query);
}
}
}
@ -412,6 +380,24 @@ function photo_import($database, $index, $user_id, &$image_data) {
}
/* Now for the XMP sidecar, if present */
if (isset($image_data['sidecar'])) {
$xmp_file = $current_volume . "/00001/$next_index[0]_$next_version[0]_0_orig.xmp";
if (!copy($image_data['sidecar'], $xmp_file)) {
$result = FALSE;
echo "<li><b>can't copy $image_data[sidecar] to $xmp_file</b></li>";
}
if ($result) {
$cleanup_files[] = $xmp_file;
$result = import_file($database, $xmp_file, $image_repository_path, $next_version[0], -1, FALSE, "", "");
if (!$result) {
echo "<li>file import blew up</li>";
}
unlink($image_data['sidecar']);
unset($image_data['sidecar']);
}
}
if ($result) {
if ($image_data['storage_location_type'] == "null")
$image_data['storage_location_type'] = "";
@ -428,24 +414,35 @@ function photo_import($database, $index, $user_id, &$image_data) {
if ($image_data['altitude'] == "") $image_data['altitude'] = "null";
if ($image_data['direction'] == "") $image_data['direction'] = "null";
$query = "insert into photo_tech (identifier, photo, camera, lens, film, flash, scanner, filter, scan_resolution, aperture, focal_length, shutter, camera_metering, camera_program, flash_mode, exposure_comp, flash_comp, ev_difference, iso_override, support, scan_bitdepth, scan_multiscan, exif, iptc, latitude, longitude, altitude, img_direction, rdf)
values (nextval('photo_tech_id_sequence'), $next_index[0], $image_data[camera], $image_data[lens],
$image_data[film], $image_data[flash], $image_data[scanner],
$image_data[filter], $image_data[scan_resolution], $image_data[aperture],
$query = "insert into photo_tech (identifier, photo, camera, film, scan_resolution, aperture, focal_length, shutter, camera_metering, camera_program, flash_mode, exposure_comp, flash_comp, ev_difference, iso_override, scan_bitdepth, scan_multiscan, exif, iptc, latitude, longitude, altitude, img_direction, rdf)
values (nextval('photo_tech_id_sequence'), $next_index[0], $image_data[camera],
$image_data[film], $image_data[scan_resolution], $image_data[aperture],
$image_data[focal_length], $image_data[shutter], $image_data[camera_metering],
$image_data[camera_program], $image_data[flash_mode], $image_data[exp_comp],
$image_data[flash_comp], $image_data[exp_diff], $image_data[iso_override],
$image_data[support], $image_data[scan_bitdepth], $image_data[scan_multiscan],
$image_data[scan_bitdepth], $image_data[scan_multiscan],
'$image_data[exif]', '$image_data[iptc]', $image_data[latitude], $image_data[longitude], $image_data[altitude], $image_data[direction], '$image_data[rdf]')";
$result = pg_query($database, $query);
}
/* Take care of equipment tables */
if ($image_data['equipment'])
foreach ($image_data['equipment'] as $equip) {
$parts = explode(":", $equip);
$parts[0] = pg_escape_string($parts[0]);
$parts[1] = pg_escape_string($parts[1]);
if ($result) {
$query = "insert into photo_equipment (photo, equipment, type) VALUES ($next_index[0], $parts[0], $parts[1])";
$result = pg_query($database, $query);
}
}
if ($result) {
pg_query($database, "commit");
$err = error_reporting(0);
unlink($image_data['file'][$index]['name_tmp']); /* We're done with it */
error_reporting($err);
print "<li>".$strings['import']['complete']." (". emit_a("photo.php?photo=$next_index[0]", "#" . $next_index[0]) .")</li>";
print "<li>".$strings['import']['complete']." (". emit_a(generate_link('photo', $next_index[0]), "#" . $next_index[0]) .")</li>";
} else {
if ($query != "") {
$error = pg_last_error($database);
@ -481,7 +478,7 @@ function photo_import($database, $index, $user_id, &$image_data) {
$image_data_b['file'][$index]['name_tmp'] = $image_data['jpgfromraw'];
$image_data_b['file'][$index]['type'] = "jpeg";
$image_data_b['file'][$index]['remark'] = "";
$image_data_b['file'][$index]['master'] = "f";
$image_data_b['file'][$index]['master'] = $po_options['jpgfromraw_master'];
$image_data_b['orientation'] = $image_data['orientation_orig'];
$image_data_b['file'][$index]['remark'] = "Preview image extracted from RAW";
$image_data_b['replace_existing'] = 'f';
@ -542,7 +539,7 @@ function photo_version_import($database, $index, $user_id, $photo_id, $image_dat
$photo_data = pg_fetch_row(pg_query($database, "select caption, users, identifier from photo where photo.identifier = '$photo_id'"));
if (($po_user['type'] != PO_USER_TYPE_ADMIN) &&
($po_user['id'] != $photo_data[1])) {
print err_str($strings['errors']['not_owner']." (".emit_a("photo.php?photo=$photo_data[1]", "$photo_data[2] - $photo_data[0]"). ")");
print err_str($strings['errors']['not_owner']." (".emit_a(generate_link('photo', $photo_data[1]), "$photo_data[2] - $photo_data[0]"). ")");
return FALSE;
}
@ -560,7 +557,7 @@ function photo_version_import($database, $index, $user_id, $photo_id, $image_dat
$cleanup_files[] = $hires_name;
print "<p>". sprintf($strings['import']['importing_new_version'], $original_name, $mime_type_name, emit_a("photo.php?photo=$photo_id&detail_info=5", "<strong>$photo_id</strong>")) ."</p>";
print "<p>". sprintf($strings['import']['importing_new_version'], $original_name, $mime_type_name, emit_a(generate_link('photo', $photo_id, array('detail_info'=>5)), "<strong>$photo_id</strong>")) ."</p>";
print "<ul class=\"import\">";
@ -1062,8 +1059,9 @@ function import_generate_scaled($input_file_name, $output_file_name,
(($po_options[$size_key.'_color_space'] == "RGB") ? "" : " -colorspace " . escapeshellarg($po_options[$size_key.'_color_space'])) ." ".
(($po_options[$size_key.'_gamma'] == 1) ? "" : " -gamma " . escapeshellarg($po_options[$size_key.'_gamma'])) .
" -quality " . escapeshellarg($po_options[$size_key.'_quality']) ." ".
escapeshellarg($input_file_name).escapeshellarg($multi_page_parameter).
" -strip ". escapeshellarg($output_file_name);
escapeshellarg($input_file_name).escapeshellarg($multi_page_parameter) . ' ' .
($use_gm ? '' : ' -strip ') .
escapeshellarg($output_file_name);
/*
if ($verbose) {
@ -1204,7 +1202,11 @@ function import_file($database, $file_name, $base_path, $version_id,
$comments = pg_escape_string($comments);
$sha1sum = sha1_file($file_name);
$image_dimension = po_get_image_size($file_name);
if ($size_code < 0) {
$image_dimension = array(0, 0);
} else {
$image_dimension = po_get_image_size($file_name);
}
$size = filesize($file_name);
$file = substr($file_name, strlen($base_path));
if (substr($file, 0, 1) == '/') {
@ -1233,7 +1235,7 @@ function import_generate_all_scaled($input_file_name, $multi_page_parameter,
$sizes = split(",", $po_options['scaled_generate']);
foreach ($sizes as $size_key) {
$output_file_name = "$current_volume/00001/$next_index" . "_" . $po_options[$size_key."_sizecode"] ."_$size_key." . $po_options[$size_key."_format"];
$output_file_name = "$current_volume/00001/$next_index" . "_$version_id" . "_" . $po_options[$size_key."_sizecode"] ."_$size_key." . $po_options[$size_key."_format"];
$outfiles[] = $output_file_name;

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -322,7 +322,8 @@ function photo_parse_iptc($database, $index, $user_id, $image_data) {
if ($keywords != "") {
$keys = explode(", ", $keywords);
foreach ($keys as $key) {
$image_data['keywords'][] = $key;
if (!in_array($key, $image_data['keywords']))
$image_data['keywords'][] = $key;
}
}

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -233,7 +233,7 @@ function send_po_account_change_notification($database, $user_id) {
select users.first_name, users.last_name, email, user_type.identifier, value,
get_user_pref(users.identifier, 'bulk_upload_enable'),
'f' as shop_enable,
get_user_pref(users.identifier, 'quota_size'),
get_user_pref(users.identifier, 'quota_size'),
get_user_pref(users.identifier, 'quota_count')
from users, user_type
where users.type = user_type.identifier
@ -249,6 +249,9 @@ function send_po_account_change_notification($database, $user_id) {
from users
where users.type = ".PO_USER_TYPE_ADMIN));
if (!$user_data[5])
$user_data[5] = $po_options_default['bulk_upload_enable'];
if ($user_data[5]=='t')
$user_data[5] = "Enabled";
else

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -154,6 +154,7 @@ $mime_type = array (
"xcf" => array ("type" => "application", "page" => "[0]", "decoder" => "", "name" => "GIMP image"),
"xpm" => array ("type" => "image", "page" => "", "decoder" => "", "name" => "X Windows system pixmap (color)"),
"xv" => array ("type" => "image", "page" => "[0]", "decoder" => "", "name" => "Khoros Visualization image"),
"xmp" => array ("type" => "application", "page" => "[0]", "decoder" => "", "name" => "eXtensible Metadata Platform"),
"xwd" => array ("type" => "image", "page" => "", "decoder" => "", "name" => "X Windows system window dump (color)"),
"yuv" => array ("type" => "image", "page" => "", "decoder" => "", "name" => "CCIR 601 4:1:1 or 4:2:2"));
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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

View File

@ -1,7 +1,7 @@
/<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -314,29 +314,4 @@ function pdf_StreamObject($file, $title, $stream) {
$num_of_objects++;
}
$file = fopen("../tmp/test.pdf", "w");
pdf_Header($file, $x_paper, $y_paper);
$outlines_object = $num_of_objects;
pdf_Outlines($file);
$procset_object = $num_of_objects;
pdf_ProcSet($file);
$page_content_object = $num_of_objects;
$stream = pdf_DrawCode128BarCode("0091223", 1, "STORAGE 2 : 1", 200, 600, 200, 60, 10);
$stream = pdf_DrawMeteringMode(200, 200, 100);
pdf_StreamObject($file, "Sample barcode", $stream);
$content = array($page_content_object);
$page_size = array('x' => 612, 'y' => 792);
$pages_object = $num_of_objects;
pdf_Pages($file, 1, $page_size, $content, $procset_object);
$root_object = $num_of_objects;
pdf_Catalog($file, $pages_object, $outlines_object);
pdf_Footer($file, $root_object, "Labels", "Balint Kis; balint@k-i-s.net", "label printout", "PHP:2.5.C-SQL:2.3.C");
fclose($file);
print "<a href=\"../tmp/test.pdf\">test.pdf</a>"
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -37,64 +37,6 @@ function profile_i18n_data() {
$generate_i18n_data[] = "profile_i18n_data";
function display_lens($database, $viewer_id, $owner_id) {
global $access;
global $strings;
if ($viewer_id==$owner_id) {
$all_lenses = pg_query($database, "select identifier, name, model, variation, s_min_aperture, s_max_aperture, s_min_focal_length, s_max_focal_length, serial_number, date_of_purchase, purchased_new, url, access_rights, number_of_lens_references(identifier) as photos
from view_lens where users=$owner_id order by name");
} else {
$client = FALSE;
if ($viewer_id != FALSE)
$client = pg_fetch_row(pg_query ($database, "select identifier from client where users='$owner_id' and client='$viewer_id' and status=2"));
if ($client == FALSE)
$all_lenses = pg_query($database, "select identifier, name, model, variation, s_min_aperture, s_max_aperture, s_min_focal_length, s_max_focal_length, serial_number, date_of_purchase, purchased_new, url, access_rights, number_of_lens_references(identifier) as photos
from view_lens where users=$owner_id and access_rights=$access[public] order by name");
else
$all_lenses = pg_query($database, "select identifier, name, model, variation, s_min_aperture, s_max_aperture, s_min_focal_length, s_max_focal_length, serial_number, date_of_purchase, purchased_new, url, access_rights, number_of_lens_references(identifier) as photos
from view_lens where users=$owner_id and access_rights<=$access[protected] order by name");
}
$num_of_lenses = pg_num_rows($all_lenses);
if ($viewer_id != $owner_id && $num_of_lenses == 0)
return;
print "<table class=\"profile\">\n";
print "<tr>\n";
print emit_th($strings['profile']['id_no'], "width=\"5%\"");
print emit_th($strings['profile']['model'], "width=\"35%\"");
print emit_th($strings['profile']['serial'], "width=\"13%\"");
print emit_th($strings['profile']['purchased'], "width=\"16%\"");
print emit_th($strings['profile']['new'], "width=\"5%\"");
if ($viewer_id==$owner_id) {
print emit_th($strings['generic']['photos'], "width=\"5%\"");
print emit_th($strings['generic']['access'], "width=\"10%\"");
print "<th width=\"10%\" colspan=\"2\"><a href=\"lens.add.php\">".$strings['generic']['add']."</a></th>\n";
}
print "</tr>\n";
for ($i=0; $i < $num_of_lenses; $i++) {
$lens = pg_fetch_row($all_lenses, $i);
print "<tr>\n";
print "<td>$lens[0]</td>\n";
print "<td><a target=\"new\" href=\"$lens[11]\">$lens[1]</a> $lens[2] $lens[3]\n";
print emit_lens_string($lens[4], $lens[5], $lens[6], $lens[7]);
print "</td>\n";
print "<td>$lens[8]</td>\n";
print emit_td(emit_date_html($lens[9], 'date'));
print emit_td(emit_yes_no_text($lens[10]));
if ($viewer_id==$owner_id) {
print "<td>$lens[13]</td>\n";
print emit_td($strings['generic'][$access[$lens[12]]]);
print "<td><a href=\"lens.edit.php?item=$lens[0]\">".$strings['generic']['edit']."</a></td>\n";
print "<td><a href=\"lens.del.php?item=$lens[0]\">".$strings['generic']['delete']."</a></td>\n";
}
print "</tr>\n";
}
print "</table>\n";
}
function display_camera($database, $viewer_id, $owner_id) {
global $access;
global $icc_profiles;
@ -131,57 +73,42 @@ function display_camera($database, $viewer_id, $owner_id) {
print emit_th($strings['generic']['photos'], "width=\"5%\"");
print emit_th($strings['generic']['access'], "width=\"5%\"");
print emit_th($strings['profile']['icc_profile'], "width=\"10%\"");
print "<th width=\"7%\" colspan=\"2\"><a href=\"camera.add.php\">".$strings['generic']['add']."</a></th>\n";
print "<th width=\"7%\" colspan=\"2\">".emit_a("camera.add.php",$strings['generic']['add'])."</th>\n";
}
print "</tr>\n";
for ($i=0; $i < $num_of_cameras; $i++) {
$camera = pg_fetch_row($all_cameras, $i);
print "<tr>\n";
print "<td>$camera[0]</td>\n";
print "<td><a target=\"new\" href=\"$camera[7]\">$camera[1]</a> $camera[2] $camera[3]</td>\n";
print "<td>$camera[4]</td>\n";
print "<td>".emit_date_html($camera[5], 'date'). "</td>\n";
print emit_td($camera[0]);
print emit_td(emit_a($camera[7], $camera[1]) ." $camera[2] $camera[3]");
print emit_td($camera[4]);
print emit_td(emit_date_html($camera[5], 'date'));
print emit_td(emit_yes_no_text($camera[6]));
print emit_td(emit_yes_no_text($camera[11]));
if ($viewer_id==$owner_id) {
print "<td>$camera[10]</td>\n";
print emit_td($camera[10]);
print emit_td($strings['generic'][$access[$camera[8]]]);
if ($camera[9] != "")
print "<td>" . $icc_profiles[$camera[9]]['name'] . "</td>\n";
print emit_td($icc_profiles[$camera[9]]['name']);
else
print "<td></td>\n";
print "<td><a href=\"camera.edit.php?item=$camera[0]\">".$strings['generic']['edit']."</a></td>\n";
print "<td><a href=\"camera.del.php?item=$camera[0]\">".$strings['generic']['delete']."</a></td>\n";
print emit_td("");
print emit_td(emit_a("camera.edit.php?item=$camera[0]", $strings['generic']['edit']));
print emit_td(emit_a("camera.del.php?item=$camera[0]", $strings['generic']['delete']));
}
print "</tr>\n";
}
print "</table>\n";
}
/* type is: flash filter support scanner [camera film lens not yet] */
function display_profile($database, $type, $viewer_id, $owner_id) {
function display_profile($database, $type, $owner_id) {
global $access;
global $strings;
if ($viewer_id==$owner_id) {
$all = pg_query($database, "select identifier, name, model, variation, serial_number, date_of_purchase, purchased_new, url, access_rights, number_of_".$type."_references(identifier) as photos
from view_$type where users=$owner_id order by name");
} else {
$client = FALSE;
if ($viewer_id != FALSE)
$client = pg_fetch_row(pg_query ($database, "select identifier from client where users='$owner_id' and client='$viewer_id' and status=2"));
if ($client == FALSE)
$all = pg_query($database, "select identifier, name, model, variation, serial_number, date_of_purchase, purchased_new, url, access_rights
from view_$type where users=$owner_id and access_rights=$access[public] order by name");
else
$all = pg_query($database, "select identifier, name, model, variation, serial_number, date_of_purchase, purchased_new, url, access_rights
from view_$type where users=$owner_id and access_rights<=$access[protected] order by name");
}
$all = pg_query($database, "select identifier, name, model, serial, purchase_date, purchased_new, s_url, m_url, access_rights, number_of_equipment_references(identifier) as photos
from view_equipment where users=$owner_id and type = $type order by name, model");
$num_of = pg_num_rows($all);
if ($viewer_id!=$owner_id && $num_of == 0)
return;
print "<table class=\"profile\">\n";
print "<tr>\n";
@ -190,27 +117,27 @@ function display_profile($database, $type, $viewer_id, $owner_id) {
print emit_th($strings['profile']['serial'], "width=\"13%\"");
print emit_th($strings['profile']['purchased'], "width=\"16%\"");
print emit_th($strings['profile']['new'], "width=\"5%\"");
if ($viewer_id==$owner_id) {
print emit_th($strings['generic']['photos'], "width=\"5%\"");
print emit_th($strings['generic']['access'], "width=\"10%\"");
print "<th width=\"7%\" colspan=\"2\"><a href=\"profile.add.php?type=$type\">".$strings['generic']['add']."</a></th>\n";
}
print emit_th($strings['generic']['photos'], "width=\"5%\"");
print emit_th($strings['generic']['access'], "width=\"10%\"");
print "<th width=\"7%\" colspan=\"2\">".emit_a("profile.add.php?type=$type", $strings['generic']['add'])."</th>\n";
print "</tr>\n";
for ($i=0; $i < $num_of; $i++) {
$item = pg_fetch_row($all, $i);
$item = pg_fetch_assoc($all, $i);
print "<tr>\n";
print "<td>$item[0]</td>\n";
print "<td><a target=\"new\" href=\"$item[7]\">$item[1]</a> $item[2] $item[3]</td>\n";
print "<td>$item[4]</td>\n";
print "<td>".emit_date_html($item[5], 'date'). "</td>\n";
print emit_td(emit_yes_no_text($item[6]));
if ($viewer_id==$owner_id) {
print "<td>$item[9]</td>\n";
print emit_td($strings['generic'][$access[$item[8]]]);
print "<td><a href=\"profile.edit.php?type=$type&amp;item=$item[0]\">".$strings['generic']['edit']."</a></td>\n";
print "<td><a href=\"profile.del.php?type=$type&amp;item=$item[0]\">".$strings['generic']['delete']."</a></td>\n";
}
print emit_td($item['identifier']);
if ($item['m_url'])
$item['name'] = emit_a($item['m_url'], $item['name']);
if ($item['s_url'])
$item['model'] = emit_a($item['s_url'], $item['model']);
print emit_td("$item[name] $item[model]");
print emit_td($item['serial']);
print emit_td(emit_date_html($item['purchase_date'], 'date'));
print emit_td(emit_yes_no_text($item['purchased_new']));
print emit_td($item['photos']);
print emit_td($strings['generic'][$access[$item['access_rights']]]);
print emit_td(emit_a("profile.edit.php?type=$type&amp;item=$item[identifier]", $strings['generic']['edit']));
print emit_td(emit_a("profile.del.php?type=$type&amp;item=$item[identifier]", $strings['generic']['delete']));
print "</tr>\n";
}
print "</table>\n";
@ -248,112 +175,99 @@ function display_film($database, $viewer_id, $owner_id) {
if ($viewer_id==$owner_id) {
print emit_th($strings['generic']['photos'], "width=\"5%\"");
print emit_th($strings['generic']['access'], "width=\"10%\"");
print "<th width=\"10%\" colspan=\"2\"><a href=\"film.add.php\">".$strings['generic']['add']."</a></th>\n";
print "<th width=\"10%\" colspan=\"2\">".emit_a("film.add.php", $strings['generic']['add'])."</th>\n";
}
print "</tr>\n";
for ($i=0; $i < $num_of_films; $i++) {
$film = pg_fetch_row($all_films, $i);
print "<tr>\n";
print "<td>$film[0]</td>\n";
print "<td><a target=\"new\" href=\"$film[5]\">$film[1] $film[2]</a></td>\n";
print "<td>$film[3]</td>";
print "<td>$film[4]</td>\n";
print emit_td($film[0]);
print emit_td(emit_a($film[5], $film[1]) ." $film[2]");
print emit_td($film[3]);
print emit_td($film[4]);
if ($viewer_id==$owner_id) {
print "<td>$film[7]</td>\n";
print emit_td($film[7]);
print emit_td($strings['generic'][$access[$film[6]]]);
print "<td><a href=\"film.edit.php?item=$film[0]\">".$strings['generic']['edit']."</a></td>\n";
print "<td><a href=\"film.del.php?item=$film[0]\">".$strings['generic']['delete']."</a></td>\n";
print emit_td(emit_a("film.edit.php?item=$film[0]",$strings['generic']['edit']));
print emit_td(emit_a("film.del.php?item=$film[0]",$strings['generic']['delete']));
}
print "</tr>\n";
}
print "</table>\n";
}
function display_manufacturer($database, $viewer_id, $owner_id) {
function display_manufacturer($database, $show_add = TRUE) {
global $access;
global $strings;
global $po_user;
if ($owner_id == "*")
$all_manufacturers = pg_query($database, "select identifier, name, url, last_modified_date from manufacturer order by name");
else
$all_manufacturers = pg_query($database, "select identifier, name, url, last_modified_date
from manufacturer where last_modifying_users=$owner_id order by name");
$viewer_id = $po_user['id'];
$all_manufacturers = pg_query($database, "select identifier, name, url, last_modified_date, last_modifying_users from manufacturer order by name");
$num_of_manufacturers = pg_num_rows($all_manufacturers);
if ($owner_id == "*" && $num_of_manufacturers == 0)
return;
if (!$show_add && ($num_of_manufacturers == 0)) return;
print "<table class=\"profile\">\n";
if ($owner_id == "*") {
if ($show_add) {
print "<tr class=\"folder_top\">\n";
print "<td colspan=\"4\">".sprintf($strings['profile']['all'], $strings['generic']['manufacturers'])."</td>\n";
print "<td colspan=\"6\">".sprintf($strings['profile']['all'], $strings['generic']['manufacturers'])."</td>\n";
print "</tr>\n";
}
print "<tr>\n";
print emit_th($strings['profile']['id_no'], "width=\"5%\"");
print emit_th($strings['generic']['name'], "width=\"25%\"");
print emit_th($strings['user']['web'], "width=\"40%\"");
print emit_th($strings['generic']['created'], "width=\"20%\"");
if ($owner_id != "*")
print "<th width=\"10%\" colspan=\"2\"><a href=\"manufacturer.add.php\">".$strings['generic']['add']."</a></th>\n";
if ($show_add) {
print "<th width=\"10%\" colspan=\"2\">".emit_a("manufacturer.add.php", $strings['generic']['add'])."</th>\n";
} else {
print "<th></th><th></th>";
}
print "</tr>\n";
for ($i=0; $i < $num_of_manufacturers; $i++) {
$manufacturer = pg_fetch_row($all_manufacturers, $i);
print "<tr>\n";
print "<td>$manufacturer[0]</td>\n";
print "<td><a target=\"_new\" href=\"$manufacturer[2]\">$manufacturer[1]</a></td>\n";
print "<td><a target=\"_new\" href=\"$manufacturer[2]\">$manufacturer[2]</a></td>\n";
print "<td>".emit_date_html($manufacturer[3], 'date'). "</td>\n";
if ($owner_id != "*") {
print "<td><a href=\"manufacturer.edit.php?item=$manufacturer[0]\">".$strings['generic']['edit']."</a></td>\n";
print "<td><a href=\"manufacturer.del.php?item=$manufacturer[0]\">".$strings['generic']['delete']."</a></td>\n";
print emit_td($manufacturer[0]);
print emit_td($manufacturer[1]);
print emit_td(emit_a($manufacturer[2], $manufacturer[2]));
print emit_td(emit_date_html($manufacturer[3], 'date'));
if ($show_add && ($po_user['id'] == $manufacturer[4]) || ($po_user['type'] == PO_USER_TYPE_ADMIN)) {
print emit_td(emit_a("manufacturer.edit.php?item=$manufacturer[0]", $strings['generic']['edit']));
print emit_td(emit_a("manufacturer.del.php?item=$manufacturer[0]", $strings['generic']['delete']));
} else {
print "<td></td><td></td>";
}
print "</tr>\n";
}
print "</table>\n";
}
function display_label($database, $owner_id) {
function display_label($database, $show_add = TRUE) {
global $po_user;
global $strings;
$viewer_id = $po_user['id'];
if ($owner_id == "*") {
$all_labels = pg_query($database, "
$all_labels = pg_query($database, "
select label.identifier,
(select url from manufacturer where identifier=label.manufacturer),
(select name from manufacturer where identifier=label.manufacturer),
label.name, paper.name,
space_x, space_y, label.size_x, label.size_y, offset_x, offset_y,
columns, rows, date_of_creation
columns, rows, date_of_creation, users
from label, paper
where label.paper=paper.identifier
order by label.identifier");
} else {
$all_labels = pg_query($database, "
select label.identifier,
(select url from manufacturer where identifier=label.manufacturer),
(select name from manufacturer where identifier=label.manufacturer),
label.name, paper.name,
space_x, space_y, label.size_x, label.size_y, offset_x, offset_y,
columns, rows, date_of_creation
from label, paper
where label.paper=paper.identifier
and label.users=$viewer_id
order by label.identifier");
}
$num_of_labels = pg_num_rows($all_labels);
if ($owner_id == "*" && $num_of_labels == 0)
return;
if (!$show_add && ($num_of_labels == 0)) return;
print "<table class=\"profile\">\n";
if ($owner_id == "*") {
if ($show_add) {
print "<tr class=\"folder_top\">\n";
print "<td colspan=\"11\">".sprintf($strings['profile']['all'], $strings['generic']['labels'])."</td>\n";
print "<td colspan=\"13\">".sprintf($strings['profile']['all'], $strings['generic']['labels'])."</td>\n";
print "</tr>\n";
}
print "<tr>\n";
@ -368,68 +282,63 @@ function display_label($database, $owner_id) {
print emit_th($strings['label']['rows'], "width=\"5%\"");
print emit_th($strings['label']['columns'], "width=\"5%\"");
print emit_th($strings['generic']['created'], "width=\"20%\"");
if ($owner_id != "*") {
print "<th width=\"10%\" colspan=\"2\"><a href=\"label.add.php\">".$strings['generic']['add']."</a></th>\n";
if ($show_add) {
print "<th width=\"10%\" colspan=\"2\">".emit_a("label.add.php",$strings['generic']['add'])."</th>\n";
} else {
print "<th></th><th></th>";
}
print "</tr>\n";
for ($i=0; $i < $num_of_labels; $i++) {
$label = pg_fetch_row($all_labels, $i);
print "<tr>\n";
print "<td>$label[0]</td>\n";
print "<td><a target=\"_new\" href=\"$label[1]\">$label[2]</a> $label[3], $label[4]</td>\n";
print "<td>$label[5]</td>\n";
print "<td>$label[6]</td>\n";
print "<td>$label[7]</td>\n";
print "<td>$label[8]</td>\n";
print "<td>$label[9]</td>\n";
print "<td>$label[10]</td>\n";
print "<td>$label[11]</td>\n";
print "<td>$label[12]</td>\n";
print "<td>".emit_date_html($label[13], 'date'). "</td>\n";
if ($owner_id != "*") {
print "<td><a href=\"label.edit.php?item=$label[0]\">".$strings['generic']['edit']."</a></td>\n";
print "<td><a href=\"label.del.php?item=$label[0]\">".$strings['generic']['delete']."</a></td>\n";
print emit_td($label[0]);
print emit_td(emit_a($label[1], $label[2]) ." $label[3], $label[4]");
print emit_td($label[5]);
print emit_td($label[6]);
print emit_td($label[7]);
print emit_td($label[8]);
print emit_td($label[9]);
print emit_td($label[10]);
print emit_td($label[11]);
print emit_td($label[12]);
print emit_td(emit_date_html($label[13], 'date'));
if ($show_add && ($po_user['id'] == $label[4]) || ($po_user['type'] == PO_USER_TYPE_ADMIN)) {
print emit_td(emit_a("label.edit.php?item=$label[0]",$strings['generic']['edit']));
print emit_td(emit_a("label.del.php?item=$label[0]",$strings['generic']['delete']));
} else {
print "<td></td><td></td>";
}
print "</tr>\n";
}
print "</table>\n";
}
function display_location($database, $viewer_id) {
function display_location($database, $show_add = TRUE) {
global $po_user;
global $strings;
$filter = " where private is false ";
$viewer_id = '*';
if ($po_user['type'] == PO_USER_TYPE_ADMIN)
$filter = "";
else
$filter = " where private is false ";
if ($viewer_id == "*") {
$result = pg_query($database, "
$result = pg_query($database, "
select view_location.identifier, place, city, state, country,
last_modified_date, latitude, longitude,
number_of_location_references(view_location.identifier) as photos,
private
private, users
from view_location
$filter
order by country, state, city, place");
} else {
$result = pg_query($database, "
select view_location.identifier, place, city, state, country,
last_modified_date, latitude, longitude,
number_of_location_references(view_location.identifier) as photos,
private
from view_location
where users=$viewer_id
order by country, state, city, place");
}
$num = pg_num_rows($result);
print "<table class=\"profile\">\n";
if ($viewer_id == "*") {
if ($show_add) {
print "<tr class=\"folder_top\">\n";
print "<td colspan=\"7\">".sprintf($strings['profile']['all'], $strings['generic']['locations'])."</td>\n";
print "<td colspan=\"9\">".sprintf($strings['profile']['all'], $strings['generic']['locations'])."</td>\n";
print "</tr>\n";
}
print "<tr>\n";
@ -439,9 +348,11 @@ order by country, state, city, place");
print emit_th($strings['photo']['longitude'], "width=\"8%\"");
print emit_th($strings['generic']['created'], "width=\"15%\"");
print emit_th($strings['generic']['photos'], "width=\"5%\"");
if ($viewer_id != "*") {
print emit_th($strings['generic']['private'], "width=\"5%\"");
print "<th width=\"10%\" colspan=\"2\"><a href=\"location.add.php\">".$strings['generic']['add']."</a></th>\n";
print emit_th($strings['generic']['private'], "width=\"5%\"");
if ($show_add) {
print "<th width=\"10%\" colspan=\"2\">".emit_a("location.add.php", $strings['generic']['add'])."</th>\n";
} else {
print "<th></th><th></th>";
}
print "</tr>\n";
@ -457,146 +368,35 @@ order by country, state, city, place");
$r[3] = sprintf("%s,", $r[3]);
}
print "<tr>\n";
print "<td>$r[0]</td>\n";
print emit_td($r[0]);
if ($r[1] == 'Unknown') $r[1] = $strings['generic']['unknown'];
if ($r[1] == 'Unknown') {
$foo = $strings['generic']['unknown'];
} else {
$foo = "$r[1] $r[2] $r[3] $r[4]";
$foo = emit_a("http://maps.google.com/maps?q=$foo=h", $foo, "target=\"_new\"");
}
print "<td>$r[1] $r[2] $r[3] $r[4]</td>\n";
print "<td>$r[6]</td>\n";
print "<td>$r[7]</td>\n";
print "<td>".emit_date_html($r[5], 'date')."</td>\n";
print "<td>$r[8]</td>\n";
if ($viewer_id != "*") {
print emit_td(emit_yes_no_text($r[9]));
print "<td><a href=\"location.edit.php?item=$r[0]\">".$strings['generic']['edit']."</a></td>\n";
print "<td><a href=\"location.del.php?item=$r[0]\">".$strings['generic']['delete']."</a></td>\n";
print emit_td($foo);
if ($r[6] || $r[7]) {
print emit_td(emit_a("http://maps.google.com/maps?q=$r[6]+$r[7]&t=h", $r[6], "target=\"_new\""));
print emit_td(emit_a("http://maps.google.com/maps?q=$r[6]+$r[7]&t=h", $r[7], "target=\"_new\""));
} else {
print emit_td('') . emit_td('');
}
print emit_td(emit_date_html($r[5], 'date'));
print emit_td($r[8]);
print emit_td(emit_yes_no_text($r[9]));
if ($show_add && ($po_user['id'] == $r[10]) || ($po_user['type'] == PO_USER_TYPE_ADMIN)) {
print emit_td(emit_a("location.edit.php?item=$r[0]",$strings['generic']['edit']));
print emit_td(emit_a("location.del.php?item=$r[0]",$strings['generic']['delete']));
} else {
print "<td></td><td></td>";
}
print "</tr>\n";
}
print "</table>\n";
}
/* type is: flash filter camera film support scanner lens */
function profile_del_item ($database, $type, $identifier)
{
global $po_user;
global $strings;
$type = pg_escape_string($type);
$identifer = pg_escape_string($identifier);
$type_to_remove = FALSE;
if ($identifier != "") {
/* Ensure the user owns it !*/
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from $type where identifier=$identifier and users=$po_user[id]"));
if ($result[0] == 0) {
return FALSE;
}
}
pg_query($database, "begin");
$number_of_same_type = pg_fetch_row(pg_query($database, "select count(identifier) from $type where type=(select type from $type where identifier='$identifier')"));
if ($number_of_same_type[0] == 1) {
$type_to_remove = pg_fetch_row(pg_query($database, "select type from $type where identifier='$identifier'"));
}
$result = pg_query($database, "delete from $type where identifier='$identifier'");
if (!$result) {
pg_query($database, "rollback");
site_push_error($strings['errors']['db_insert_failed']);
return FALSE;
}
if ($number_of_same_type[0] == 1) {
$result = pg_query($database, "delete from ".$type."_type where identifier='$type_to_remove[0]'");
if (!$result) {
pg_query($database, "rollback");
site_push_error($strings['errors']['db_insert_failed']);
return FALSE;
}
}
pg_query($database, "commit");
}
return TRUE;
}
/* type = flash, filter, scanner, support [lens film camera won't work] */
function profile_update_item($database, $identifier, $user_id, $type,
$type_id, $manufacturer_id,
$model, $variation, $serial,
$date_of_purchase, $purchased_new,
$access_rights)
{
global $po_user;
global $strings;
$user_id = pg_escape_string($user_id);
$type = pg_escape_string($type);
$identifier = pg_escape_string($identifier);
$model = pg_escape_string($model);
$variation = pg_escape_string($variation);
$serial = pg_escape_string($serial);
$date_of_purchase = check_date_validity($date_of_purchase);
$purcahsed_new = pg_escape_string($purchased_new);
$access_rights = pg_escape_string($access_rights);
$type_to_remove = FALSE;
/* Ensure the user owns it !*/
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from $type where identifier=$identifier and users=$user_id"));
if ($result[0] == 0) {
return FALSE;
}
}
pg_query($database, "begin");
if ($type_id=='custom') {
/* type has changed */
$number_of_same_type = pg_fetch_row(pg_query($database, "select count(identifier) from $type where type=(select type from $type where identifier='$identifier')"));
if ($number_of_same_type[0] == 1) {
/* there was only one of this kind, so we have to remove it */
$type_to_remove = pg_fetch_row(pg_query($database, "select type from $type where identifier='$identifier'"));
}
/* create new type */
$new_type_id = pg_fetch_row(pg_query($database, "select nextval('".$type."_type_id_sequence')"));
$type_id = $new_type_id[0];
$result = pg_query($database, "insert into ".$type."_type (identifier, manufacturer, model, variation, last_modified_date, last_modifying_users)
values ($type_id, $manufacturer_id, '$model', '$variation', now(), $user_id)");
if (!$result) {
pg_query($database, "rollback");
site_push_error($strings['errors']['db_insert_failed']);
return FALSE;
}
}
/* add item */
$result = pg_query($database, "update $type set type=$type_id, serial_number='$serial', date_of_purchase=$date_of_purchase, purchased_new='$purchased_new', access_rights='$access_rights' where identifier='$identifier'");
if (!$result) {
pg_query($database, "rollback");
site_push_error($strings['errors']['db_insert_failed']);
return FALSE;
}
/* remove old type */
if ($type_to_remove) {
$result = pg_query($database, "delete from ".$type."_type where identifier='$type_to_remove[0]'");
if (!$result) {
pg_query($database, "rollback");
site_push_error($strings['errors']['db_insert_failed']);
return FALSE;
}
}
pg_query($database, "commit");
return TRUE;
}
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -78,7 +78,7 @@ function photo_parse_rdf($database, $index, $user_id, $image_data) {
$image_data["title"] = $value;
break;
case "Description": // this could go into caption..?
$image_data["remark"] = $value;
$image_data["caption"] = $value;
break;
case "Date Created": // and 'Create Date' and 'Date'
$image_data["date_of_exposure"] = convert_rdf2sql_timestamp($value, "00:00:00");
@ -148,34 +148,36 @@ function photo_parse_rdf($database, $index, $user_id, $image_data) {
exif_string_helper($image_data, $rdf_data, "title", "User Comment");
}
/* Focal length is special */
$tmp = $rdf_data["Focal Length"];
$tmp = substr($tmp, 0, strpos($tmp, 'mm'));
if ($rdf_data["Scale Factor To 35mm Equivalent"] > 2) {
if ($rdf_data["Focal Length In 35mm Format"]) {
$tmp = $rdf_data["Focal Length In 35mm Format"];
$tmp = substr($tmp, 0, strpos($tmp, 'mm'));
} else {
$tmp = $tmp * $rdf_data["Scale Factor To 35mm Equivalent"];
if (isset($rdf_data["Focal Length"])) {
/* Focal length is special */
$tmp = $rdf_data["Focal Length"];
$tmp = substr($tmp, 0, strpos($tmp, 'mm'));
if ($rdf_data["Scale Factor To 35mm Equivalent"] > 2) {
if ($rdf_data["Focal Length In 35mm Format"]) {
$tmp = $rdf_data["Focal Length In 35mm Format"];
$tmp = substr($tmp, 0, strpos($tmp, 'mm'));
} else {
$tmp = $tmp * $rdf_data["Scale Factor To 35mm Equivalent"];
}
}
}
if (isset($rdf_data["Focal Length"]))
$image_data["focal_length"] = $tmp;
}
/* Location */
if (($loc != "") || ($city != "") || ($state != "") || ($country != "")) {
$image_data['location'] =
convert_iptc_location($database, $user_id,
$city, $state, $country);
$loc, $city, $state, $country);
}
/* Keywords */
if ($keywords != "") {
$keys = explode(", ", $keywords);
foreach ($keys as $key) {
$image_data['keywords'][] = $key;
foreach ($keys as $key) {
if (!$image_data['keywords'] || !in_array($key, $image_data['keywords']))
$image_data['keywords'][] = $key;
}
}

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -20,7 +20,6 @@
include_once "stemming.php";
$search_interface = array();
$search_type_string = array();
function emit_date_field_combo($item_name, $value) {
global $strings;
@ -36,26 +35,25 @@ function emit_date_field_combo($item_name, $value) {
function search_i18n_data() {
global $strings;
global $search_interface;
global $search_type_string;
global $cbir_host;
global $cbir_port;
$search_type_string = array ($strings['search']['photos'],
$strings['search']['folders'],
$strings['search']['users']);
$search_interface = array("text_general" => array("idx" => 1, 'link' => "search.text.general.php", "alt" => $strings['search']['gen_text']),
"text_advanced" => array("idx" => 2, 'link' => "search.text.advanced.php", "alt" => $strings['search']['adv_text']));
$search_interface["folder"] = array("idx" => 3, 'link' => 'search.folder.php', 'alt' => $strings['search']['folders']);
$search_interface["users"] = array("idx" => 4, 'link' => 'search.users.php', 'alt' => $strings['search']['users']);
$search_interface["tags"] = array("idx" => 5, 'link' => generate_link('tag', ''), 'alt' => $strings['search']['tags']);
if ($cbir_host || $cbir_port) {
$search_interface["image_layout"] = array("idx" => 3, 'link' => "search.image.layout.php", "alt" => $strings['search']['img_layout']);
$search_interface["image_color"] = array("idx" => 4, 'link' => "search.image.color.php", "alt" => $strings['search']['img_color']);
$search_interface["image_layout"] = array("idx" => 5, 'link' => "search.image.layout.php", "alt" => $strings['search']['img_layout']);
$search_interface["image_color"] = array("idx" => 6, 'link' => "search.image.color.php", "alt" => $strings['search']['img_color']);
}
}
$generate_i18n_data[] = "search_i18n_data";
function build_itemized_search_string($search_string, $identifier, $arguments) {
function build_itemized_search_string($search_string, $identifier) {
$itemized_search_string = "";
/* translate tabs and new lines into spaces */
@ -68,7 +66,7 @@ function build_itemized_search_string($search_string, $identifier, $arguments) {
} elseif (strncmp($token, "OR", 2) == 0) {
$itemized_search_string = $itemized_search_string . "OR ";
} else {
$itemized_search_string = $itemized_search_string . "<a href=\"search.text.general.php?$arguments".$identifier."=$token\">$token</a> ";
$itemized_search_string = $itemized_search_string . emit_a("search.text.general.php?$identifier=$token", $token);
}
$token = strtok("+ \n\t");
}
@ -85,9 +83,8 @@ function validate_search_string($search_string) {
return $search_string;
}
function prepare_keyword($keyword, $enable_stemming, $search_type) {
function prepare_keyword($keyword, $enable_stemming) {
global $forbidden_keywords;
global $ignored_keywords;
if (is_numeric($keyword))
return " ILIKE '".$keyword."'";
@ -120,8 +117,7 @@ function prepare_keyword($keyword, $enable_stemming, $search_type) {
/* prune forbidden keywords */
foreach($forbidden_keywords as $forbidden_keyword) {
if (strcasecmp($forbidden_keyword, $keyword) == 0) {
$ignored_keywords = $ignored_keywords . "<a href=\"search.text.general.php?search_type=$search_type&search_string=$keyword\">$keyword</a> ";
if (!strcasecmp($forbidden_keyword, $keyword)) {
return;
}
}
@ -135,7 +131,7 @@ function prepare_keyword($keyword, $enable_stemming, $search_type) {
return " ~* '".$keyword."'";
}
function extract_keywords($search_string, $enable_stemming, $search_type) {
function extract_keywords($search_string, $enable_stemming) {
/* detect quotation marks and replace spaces with the #@# marker so */
/* that strings between quotation marks are treated as one keyword */
/* when tokenizing the search string for operators */
@ -168,7 +164,6 @@ function extract_keywords($search_string, $enable_stemming, $search_type) {
}
/* tokenize the search string based on operators and spaces */
$index = 0;
$keyword = array();
$token = strtok($search_string, "+ \n\t");
@ -176,29 +171,28 @@ function extract_keywords($search_string, $enable_stemming, $search_type) {
switch(strtolower($token)) {
case 'and':
$token = strtok("+ \n\t");
$token = prepare_keyword($token, $enable_stemming, $search_type);
$token = prepare_keyword($token, $enable_stemming);
if ($token)
$keyword[$index] = array("operator"=>"AND", "keyword"=>$token);
$keyword[] = array("operator"=>"AND", "keyword"=>$token);
break;
case 'not':
$token = strtok("+ \n\t");
$token = prepare_keyword($token, $enable_stemming, $search_type);
$token = prepare_keyword($token, $enable_stemming);
if ($token)
$keyword[$index] = array("operator"=>"NOT", "keyword"=>$token);
$keyword[] = array("operator"=>"NOT", "keyword"=>$token);
break;
case 'or':
$token = strtok("+ \n\t");
$token = prepare_keyword($token, $enable_stemming, $search_type);
$token = prepare_keyword($token, $enable_stemming);
if ($token)
$keyword[$index] = array("operator"=>"OR", "keyword"=>$token);
$keyword[] = array("operator"=>"OR", "keyword"=>$token);
break;
default:
$token = prepare_keyword($token, $enable_stemming, $search_type);
$token = prepare_keyword($token, $enable_stemming);
if ($token)
$keyword[$index] = array("operator"=>"AND", "keyword"=>$token);
$keyword[] = array("operator"=>"AND", "keyword"=>$token);
}
$token = strtok("+ \n\t");
$index ++;
}
if (!$keyword)
return false;

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -20,7 +20,17 @@
include_once "config.php";
include_once "common.php";
include_once "vars.php";
include_once "database.php";
/* Simple database connection wrapper */
function po_dbconnect() {
global $db_dsn;
$database = pg_pconnect($db_dsn); /* Persistent */
if ($database)
pg_set_client_encoding($database, 'UTF-8');
return $database;
}
function site_prolog($min_type = PO_USER_TYPE_DISABLED) {
global $po_user;
@ -30,13 +40,12 @@ function site_prolog($min_type = PO_USER_TYPE_DISABLED) {
global $po_session_lifetime;
global $po_session_path;
global $po_session_handler;
global $po_cookie_path;
global $strings;
global $theme;
global $dayNames;
global $monthNames;
global $generate_i18n_data;
global $passwords;
global $po_memcache;
global $memcache;
$sybase = FALSE;
// if magic quotes is enabled
@ -61,9 +70,15 @@ function site_prolog($min_type = PO_USER_TYPE_DISABLED) {
ini_set ('display_errors', 0);
/* Establish DB Connection */
$dbh = po_dbconnect();
$database = po_dbconnect();
if ($dbh == FALSE) return FALSE;
if ($database == FALSE) return FALSE;
/* Connect to the memcache */
if ($po_memcache) {
$memcache = new Memcache;
$memcache->connect($po_memcache);
}
/* Start up session */
if ($po_session_handler != "")
@ -104,7 +119,7 @@ function site_prolog($min_type = PO_USER_TYPE_DISABLED) {
if (($po_user['id'] != 0) &&
($po_user['last_updated'] + $default_cred_timeout) < time()) {
/* Update preferences and credentials */
refresh_user_prefs($dbh);
refresh_user_prefs($database);
}
$tmp = array_merge($po_user['passwords'], $po_options['passwords']);
@ -116,6 +131,10 @@ function site_prolog($min_type = PO_USER_TYPE_DISABLED) {
}
if (isset($_REQUEST['folder_order_by']) && isset($_REQUEST['order_by_req'])) {
$po_options['folder_order_by'] = $_REQUEST['folder_order_by'];
if ($memcache) {
$memcache->delete("allalbum_$po_user[id]");
$memcache->delete("allfolder_$po_user[id]");
}
}
if (isset($_REQUEST['photo_view'])) {
$po_options['photo_view'] = $_REQUEST['photo_view'];
@ -129,8 +148,18 @@ function site_prolog($min_type = PO_USER_TYPE_DISABLED) {
}
/* If a language tag is set, use it. */
if (isset($_REQUEST['lang']))
$po_options['lang'] = $_REQUEST['lang'];
if (isset($_REQUEST['po_lang']))
$po_options['lang'] = $_REQUEST['po_lang'];
if (isset($_REQUEST['po_theme']))
$po_options['theme'] = $_REQUEST['po_theme'];
if ($memcache) {
$user_data = array('last_name' => $po_user['last_name'],
'first_name' => $po_user['first_name'],
'username' => $po_user['username']);
$memcache->set("user_data_$po_user[id]", $user_data);
}
/* Update session details. */
site_update_session(FALSE);
@ -141,7 +170,7 @@ function site_prolog($min_type = PO_USER_TYPE_DISABLED) {
/* Sanity check in case the cookie gets screwed up */
if (($min_type == PO_USER_TYPE_DISABLED) && !$po_user['type']) {
session_start();
setcookie(session_name(), '', time()-3600);
setcookie(session_name(), '', time()-3600, $po_cookie_path);
session_destroy();
}
@ -149,37 +178,49 @@ function site_prolog($min_type = PO_USER_TYPE_DISABLED) {
if ($po_user['type'] < $min_type) {
switch ($min_type) {
case PO_USER_TYPE_ADMIN:
site_push_error($strings['errors']['admin_perm']);
site_permission_error('admin_perm');
break;
case PO_USER_TYPE_USER:
site_push_error($strings['errors']['user_perm']);
site_permission_error('user_perm');
break;
case PO_USER_TYPE_CLIENT:
site_push_error($strings['errors']['client_perm']);
site_permission_error('client_perm');
break;
default:
site_push_error($strings['errors']['insuff_perm']);
site_permission_error('insuff_perm');
break;
}
header("Location: login.php");
site_epilog($dbh);
site_epilog($database);
exit();
}
/* Set up the locale settings and whatnot */
global $dayNames;
global $monthNames;
include "lang/".$po_options['lang'].".php";
/* Set up the theme */
global $site_url;
global $site_title;
global $site_title;
global $thm_elem;
global $theme;
$theme = "themes/".$po_options['theme'];
if (!is_readable("$theme/theme.php"))
$theme = "themes/".$po_options_default['theme'];
include "$theme/theme.php";
foreach ($generate_i18n_data as $fn) {
$fn();
}
setlocale(LC_ALL, $strings['formats']['locale_names']);
$foo = localeconv();
$strings['formats']['decimal'] = $foo['decimal_point'];
$strings['formats']['thousands'] = $foo['thousands_sep'];
setlocale(LC_NUMERIC, 'POSIX', 'C');
return $dbh;
return $database;
}
function setup_user_info($database, $auth_handle, $username, $lang, $auto_login) {
@ -189,6 +230,15 @@ function setup_user_info($database, $auth_handle, $username, $lang, $auto_login)
/* Get the user info from the auth system */
$user_data = $auth_handle->user_info($username);
if ($auth_handle->local_userinfo) {
/* Now time to fetch the rest of the crap */
global $database;
$foo = pg_fetch_assoc(pg_query($database, "select address1, address2, city, zipcode, state, country, phone, url from users where username = '$username'"));
if ($foo)
$user_data = array_merge($user_data, $foo);
}
/* Assign a few more variables */
$po_user['username'] = $username;
$po_user['auto_login'] = ($auto_login != "");
@ -210,9 +260,24 @@ function setup_user_info($database, $auth_handle, $username, $lang, $auto_login)
}
/* Update local DB if the auth is external */
if ($auth_handle->local_register) {
// XXX need to escape ALL of these fields...
pg_query($database, "update users set first_name = '$po_user[first_name]', last_name = '$po_user[last_name]', email='$po_user[email]', type=$po_user[type], company='$po_user[company]', address1='$po_user[address1]', address2='$po_user[address2]', city='$po_user[city]', zipcode='$po_user[zipcode]', phone='$po_user[phone]', url='$po_user[url]' where identifier = $po_user[id]");
if (!$auth_handle->local_register) {
pg_query($database, "update users set first_name = '".pg_escape_string($po_user['first_name']).
"', last_name = '".pg_escape_string($po_user['last_name']).
"', email='".pg_escape_string($po_user['email']).
"', type=$po_user[type]
where identifier = $po_user[id]");
}
/* Update local DB if we don't use local userinfo */
if (!$auth_handle->local_userinfo) {
pg_query($database, "update users set company='".pg_escape_string($po_user['company']).
"', address1='".pg_escape_string($po_user['address1']).
"', address2='".pg_escape_string($po_user['address2']).
"', city='".pg_escape_string($po_user['city']).
"', zipcode='".pg_escape_string($po_user['zipcode']).
"', phone='".pg_escape_string($po_user['phone']).
"', url='".pg_escape_string($po_user['url']).
"' where identifier = $po_user[id]");
if ($po_user['state']) {
pg_query($database, "update users set state=(select identifier from state where value ='$po_user[state]') where identifier = $po_user[id]");
@ -237,7 +302,8 @@ function setup_user_info($database, $auth_handle, $username, $lang, $auto_login)
function site_update_session($start_sess=TRUE) {
global $po_options;
global $po_user;
global $po_cookie_path;
if ($po_user['session_id'])
session_id($po_user['session_id']);
@ -245,7 +311,7 @@ function site_update_session($start_sess=TRUE) {
session_start();
if ($po_user['auto_login']) {
$res = setcookie(session_name(), session_id(), time()+157680000);
$res = setcookie(session_name(), session_id(), time()+157680000, $po_cookie_path);
// site_push_error("auto_login = $po_user[auto_login], cookie = $res, sess = $po_user[session_id], start_sess = $start_sess");
$po_user['auto_login'] = FALSE;
}
@ -261,123 +327,7 @@ function site_epilog($database) {
pg_close($database);
}
function site_adv() {
global $ad_script;
if ($ad_script) {
print "<div class=\"banner_adv\">";
print $ad_script;
print "</div>";
}
}
function site_logo() {
global $thm_elem;
print "<div id=\"site_logo\">$thm_elem[site_logo]</div>\n";
}
function site_credit() {
global $strings;
global $po_version;
print "<div class=\"site_credit\">";
print $strings['generic']['po_powered_by'] ." v$po_version<br/>\n";
print $strings['generic']['po_copyright'];
print "</div>\n";
}
function site_head($page_title, $title_b = "") {
global $compress_pages;
global $site_title;
global $thm_elem;
global $strings;
if ($compress_pages &&
ini_get('zlib.output_compression') == '' &&
ini_get('zend_accelerator.compress_all') == '' &&
ini_get('output_handler') != 'ob_gzhandler') {
if (ob_get_level()) {
ob_end_clean();
}
ob_start('ob_gzhandler');
}
header("Content-Type: text/html; charset=".$strings['formats']['encoding']);
/*
header("Content-Type: application/xhtml+xml");
print "<?xml version=\"1.0\" encoding=\"".$strings['formats']['encoding']."\"?>\n";
*/
print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
print "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"".$strings['formats']['lang_xml']."\" lang=\"".$strings['formats']['lang_xml']."\" dir=\"".$strings['formats']['direction']."\">";
print "<head>\n";
print "<title>$site_title : $page_title". ($title_b != "" ? " : $title_b" : "") ."</title>\n";
print "<!-- compliance patch for microsoft browsers -->\n";
print "<!--[if lt IE 8]><script src=\"ie7/ie7-standard-p.js\" type=\"text/javascript\"></script><![endif]-->\n";
print "<!--[if lt IE 8]><script src=\"ie7/ie7-css-strict.js\" type=\"text/javascript\"></script><![endif]-->\n";
// print "<!--[if lt IE 8]><script src=\"javascript/firebug/firebug.js\" type=\"text/javascript\"></script><![endif]-->\n";
print "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=".$strings['formats']['encoding']."\" />";
print $thm_elem['shortcut_icon'];
print $thm_elem['stylesheets'];
print "<script type=\"text/javascript\" src=\"javascript/select.js\"></script>";
print $thm_elem['javascript'];
print "</head>\n";
}
function site_header($page_title, $title_b = "") {
global $po_user;
global $po_options;
global $install_enabled;
global $strings;
site_head($page_title, $title_b);
print "<body>\n";
print "<script type=\"text/javascript\" src=\"javascript/wz_tooltip.js\"></script>\n";
if ($install_enabled) {
site_push_error($strings['errors']['install_enabled']);
}
if (strstr($_SERVER['HTTP_USER_AGENT'], 'FunWebProducts')) {
site_push_error("You are using the FunWebProducts toolbar.
Aside from being considered spyware/adware, it hijacks your
browser and sends malformed requests to the server, resulting in 404s or
other errors. Your experience on this site (and others) will improve
considerably if you disable or uninstall this toolbar. See
http://www.tnet.com/fun-web-products.php for further details.");
}
if (isset($po_user['admin_change_password'])) {
site_push_error($strings['errors']['default_admin']);
}
site_dump_errors();
site_logo();
if ($po_options['show_ads'] != 'f') {
site_adv();
}
print "<div id=\"content\">\n";
}
function site_foot() {
print "</body></html>\n";
}
function err_str($error) {
return "<font color=\"red\">$error</font>";
}
/* Deal with errors */
function site_push_error($error) {
global $po_user;
@ -409,6 +359,159 @@ function site_dump_errors() {
session_write_close();
}
function err_str($error) {
return "<font color=\"red\">$error</font>";
}
function site_referer_error($reason) {
global $strings;
if (isset($_SERVER['HTTP_REFERER'])) {
site_push_error($strings['errors'][$reason]);
header("Location: $_SERVER[HTTP_REFERER]");
} else {
site_permission_error($reason);
}
}
function site_permission_error($reason, $url = FALSE) {
global $strings;
site_push_error($strings['errors'][$reason]);
if ($url === FALSE) {
$url = $_SERVER['REQUEST_URI'];
}
$url = urlencode($url);
header("Location: login.php?reason=$reason&orig=$url");
}
/* Stuff that spits out HTML */
function site_adv() {
global $ad_script;
if ($ad_script) {
print "<div class=\"banner_adv\">";
print $ad_script;
print "</div>";
}
}
function site_logo() {
global $thm_elem;
print "<div id=\"site_logo\">$thm_elem[site_logo]</div>\n";
}
function site_credit() {
global $strings;
global $po_version;
print "<div class=\"site_credit\">";
print $strings['generic']['po_powered_by'] ." v$po_version<br/>\n";
print $strings['generic']['po_copyright'];
print "</div>\n";
}
function site_head($page_title, $title_b = "") {
global $compress_pages;
global $site_title;
global $site_url;
global $thm_elem;
global $strings;
global $pretty_urls;
if ($compress_pages &&
ini_get('zlib.output_compression') == '' &&
ini_get('zend_accelerator.compress_all') == '' &&
ini_get('output_handler') != 'ob_gzhandler') {
if (ob_get_level()) {
ob_end_clean();
}
ob_start('ob_gzhandler');
}
header("Content-Type: text/html; charset=".$strings['formats']['encoding']);
/*
header("Content-Type: application/xhtml+xml");
print "<?xml version=\"1.0\" encoding=\"".$strings['formats']['encoding']."\"?>\n";
*/
print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
print "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"".$strings['formats']['lang_xml']."\" lang=\"".$strings['formats']['lang_xml']."\" dir=\"".$strings['formats']['direction']."\">";
print "<head>\n";
if ($pretty_urls)
print "<base href=\"$site_url\" />";
print "<title>$site_title : $page_title". ($title_b != "" ? " : $title_b" : "") ."</title>\n";
print "<!-- compliance patch for microsoft browsers -->\n";
print "<!--[if lt IE 8]><script src=\"ie7/ie7-standard-p.js\" type=\"text/javascript\"></script><![endif]-->\n";
print "<!--[if lt IE 8]><script src=\"ie7/ie7-css-strict.js\" type=\"text/javascript\"></script><![endif]-->\n";
// print "<!--[if lt IE 8]><script src=\"javascript/firebug/firebug.js\" type=\"text/javascript\"></script><![endif]-->\n";
print "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=".$strings['formats']['encoding']."\" />";
print $thm_elem['shortcut_icon'];
print $thm_elem['stylesheets'];
print $thm_elem['javascript'];
print "</head>\n";
}
function site_header($page_title, $title_b = "") {
global $po_user;
global $po_options;
global $install_enabled;
global $strings;
site_head($page_title, $title_b);
print "<body>\n";
print "<script type=\"text/javascript\" src=\"javascript/wz_tooltip.js\"></script>\n";
if ($install_enabled) {
site_push_error($strings['errors']['install_enabled']);
}
if (isset($_SERVER['HTTP_USER_AGENT']) &&
strstr($_SERVER['HTTP_USER_AGENT'], 'FunWebProducts')) {
site_push_error("You are using the FunWebProducts toolbar.
Aside from being considered spyware/adware, it hijacks your
browser and sends malformed requests to the server, resulting in 404s or
other errors. Your experience on this site (and others) will improve
considerably if you disable or uninstall this toolbar. See
http://www.tnet.com/fun-web-products.php for further details.");
}
if (isset($po_user['admin_change_password'])) {
site_push_error($strings['errors']['default_admin']);
}
site_dump_errors();
site_logo();
if ($po_options['show_ads'] != 'f') {
site_adv();
}
print "<div id=\"content\">\n";
}
function site_foot() {
global $ad_script2;
if ($ad_script2) {
print $ad_script2;
}
print "</body></html>\n";
}
function site_footer($database) {
print "</div> <!-- id=content --> \n";
@ -429,25 +532,38 @@ function site_navigator_status($left_string, $right_string) {
print "<!-- Navigator Status End -->\n";
}
function site_navigator_stand_alone($database, $sub_menu) {
site_navigator($sub_menu);
}
function site_search_entry($align, $size) {
function site_search_entry($size) {
global $strings;
global $thm_elem;
print "<form action=\"search.text.general.php\" method=\"post\" accept-charset=\"".$strings['formats']['encoding']."\" >";
print "<table align=\"center\" border=\"0\">";
print "<tr><td align=\"center\">";
print "<tr><td>";
print "<input type=\"text\" name=\"search_string\" value=\"$search_string\" size=\"$size\" title=\"".$strings['search']['search_string_prompt']."/>";
print "</td><td align=\"center\">";
print "</td><td>";
print $thm_elem['button.search'];
print "</td></tr>";
print "</table>";
print "</form>";
}
/* These are sort of meant to be called externally .. */
function site_display_photo_b($photo_id, $link = TRUE, $size = 1, $version = FALSE, $target = FALSE)
{
$image = generate_link('image', $photo_id, array('ver'=>$version, 'size'=>$size));
if (!$target) {
$target = generate_link('photo', $photo_id, array('ver'=>$version));
}
if ($link == TRUE) {
print emit_a($target, "<img src=\"$image\" alt=\"$photo_id:$version\" />", "class=\"nodecor\"");
} else {
print "<img src=\"$image\" alt=\"$photo_id:$version\" />";
}
}
function site_display_photo($database, $identifier, $framed, $version = FALSE) {
if ($version === FALSE) {
$version = "photo_version.master = 't'";
@ -465,40 +581,47 @@ function site_display_photo($database, $identifier, $framed, $version = FALSE) {
display_photo_slides("folder", "", $photo_data, 0, 1, $framed, FALSE);
}
function site_display_random_photos($database, $type, $identifier, $num_of_photos, $framed) {
function site_get_photos($database, $type, $identifier, $num_of_photos, $order) {
$sql_extra_tables = array();
switch ($type) {
case "photo":
$parts = explode(":", $identifier);
$parts[0] = pg_escape_string($parts[0]);
$sql_photo_selector = "photo.identifier = '$parts[0]' ";
if (count($parts) > 1) {
$parts[1] = pg_escape_string($parts[1]);
$sql_photo_selector .= " and photo_version.identifier = '$parts[1]'";
} else {
$sql_photo_selector .= " and photo_version.master = 't' ";
}
break;
case "user":
$sql_photo_selector = "photo.users = '$identifier' and photo_version.master = 't' ";
$display_type = "folder";
break;
case "album":
$sql_photo_selector = "photo_version.identifier = album_content.version and photo.identifier = album_content.photo and album_content.album=".$identifier;
$sql_extra_tables[] = "album_content";
$display_type = "album";
break;
default:
case "folder":
$sql_photo_selector = "photo.folder = '$identifier' and photo_version.master = 't' ";
$display_type = "folder";
break;
}
$filter = " $sql_photo_selector ";
$photo_data = get_photo_query($database, array(), $sql_extra_tables, $filter, 0, $num_of_photos, 21);
$photo_data = get_photo_query($database, array(), $sql_extra_tables, $filter, 0, $num_of_photos, $order);
return $photo_data;
}
$num_of_photos = pg_num_rows($photo_data);
display_photo_slides($display_type, $identifier, $photo_data, 0, $num_of_photos, $framed, FALSE);
function site_display_random_photos($database, $type, $identifier, $num_of_photos, $framed) {
$photo_data = site_get_random_photos($database, $type, $identifier, $num_of_photos, 21);
display_photo_slides($type, $identifier, $photo_data, 0, pg_num_rows($photo_data), $framed, FALSE);
}
function site_display_user_name($database, $identifier, $link) {
$user_name = pg_fetch_row(pg_query($database, "select first_name, last_name from users where identifier = $identifier"));
if ($link)
print "<a href=\"user.php?user=$identifier\">$user_name[0] $user_name[1]</a>";
else
print "$user_name[0] $user_name[1]";
print disp_user_string($database, $identifier, $link);
}
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -25,18 +25,16 @@ function tools_i18n_data() {
global $cbir_host;
$tools_data = array("bulkupdate" => array("idx" => 1, 'link' => "my.tools.php?selector=1", "alt" => $strings['generic']['bulk_update']),
"generator" => array("idx" => 2, 'link' => "my.tools.php?selector=2", "alt" => $strings['tools']['xml_template_generator']),
"converter" => array("idx" => 3, 'link' => "my.tools.php?selector=3", "alt" => $strings['tools']['xml_converter']));
"generator" => array("idx" => 2, 'link' => "my.tools.php?selector=2", "alt" => $strings['tools']['xml_template_generator']));
if ($cbir_host != "") {
$tools_data['content_indexer'] = array("idx" => 4, 'link' => "my.tools.php?selector=4", "alt" => $strings['tools']['content_indexer']);
$tools_data['content_indexer'] = array("idx" => 3, 'link' => "my.tools.php?selector=3", "alt" => $strings['tools']['content_indexer']);
}
}
$generate_i18n_data[] = "tools_i18n_data";
include_once "common.php";
include_once "search.2.php";
function display_xml_template_generator($database) {
global $thm_elem;
@ -71,9 +69,13 @@ function display_xml_template_generator($database) {
display_folder_combo("folder", get_users_folder($database), "", "");
print "</td></tr>\n";
display_iptc_form($database, FALSE, "", "", "", "", "", "", "", "", "",
$strings['photo']['copyright']." (c) " . date("Y") . " $po_user[first_name] $po_user[last_name]",
"", "", "", "", "", 0, "t", "t", "", "");
$values = array('copyright' => $po_options['copyright_default'],
'author' => "$po_user[first_name] $po_user[last_name]",
'web_statement' => $po_options['web_statement_default'],
'hide_original' => $po_options['hide_originals_default'],
'access_rights' => $po_options['access_default']);
display_iptc_form($database, FALSE, $values);
print "<tr><td>".$strings['import']['storage_location']."</td><td>";
display_storage_location_combo("storage_location_type", "");
@ -82,13 +84,8 @@ function display_xml_template_generator($database) {
<input type=\"text\" name=\"storage_size\" class=\"storage\" title=\"".$strings['import']['storage_location_size']."\"/>";
print "</td></tr>\n";
display_photo_tech_form($database, FALSE,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
"", "", "", "");
display_photo_tech_form($database, FALSE);
display_equipment_form($database, FALSE);
print "</table>\n";
print $thm_elem['button.submit'];
@ -148,7 +145,9 @@ function display_bulk_update($database, $url, $type, $selection) {
else
$checked = "";
print "<tr>";
print emit_td("<a href=\"album.php?album=$po_user[spool_album]\">".$strings['spool']['name']."</a> <input type=\"radio\" name=\"type\" value=\"spool\" $checked/>");
print emit_td(emit_a(generate_link('album', $po_user['spool_album']),
$strings['spool']['name']).
"<input type=\"radio\" name=\"type\" value=\"spool\" $checked/>");
print emit_td($strings['spool']['photos_in'].": $num_photos");;
print "</tr>\n";
}
@ -159,7 +158,7 @@ function display_bulk_update($database, $url, $type, $selection) {
print "<input type=\"hidden\" name=\"selection\" value=\"$selection\" />";
$array = explode(",", $selection);
foreach ($array as $item) {
print "<a href=\"photo.php?photo=$item\"># $item</a> ";
print emit_a(generate_link('photo', $item), "# $item");
}
print "</td></tr>\n";
}
@ -173,16 +172,9 @@ function display_bulk_update($database, $url, $type, $selection) {
print emit_td(emit_yes_no_combo("set_generate_images", 'f'));
print "</tr>\n";
display_iptc_form($database, TRUE, "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", 0, "", "", "", "");
display_photo_tech_form($database, TRUE,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
"", "", "", "");
display_iptc_form($database, TRUE);
display_photo_tech_form($database, TRUE);
display_equipment_form($database, TRUE);
print "</table>\n";
print $thm_elem['button.submit'];
@ -215,7 +207,9 @@ function display_content_indexer($database, $url) {
print "</td></tr>\n";
if ($num_photos > 0) {
print "<tr>";
print emit_td("<a href=\"album.php?album=$po_user[spool_album]\">".$strings['generic']['spool']."</a><input type=\"radio\" name=\"type\" value=\"spool\" $checked/>");
print emit_td(emit_a(generate_link('album', $po_user['spool_album']),
$strings['generic']['spool']).
"<input type=\"radio\" name=\"type\" value=\"spool\" $checked/>");
print emit_td($strings['spool']['photos_in'].": $num_photos");;
print "</tr>\n";
}

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -39,6 +39,14 @@ define("PO_CLIENT_PENDING", 1);
define("PO_CLIENT_ACCEPTED", 2);
define("PO_CLIENT_REJECTED", 3);
define("PO_EQUIPMENT_FILTER", 1);
define("PO_EQUIPMENT_FLASH", 2);
define("PO_EQUIPMENT_SCANNER", 3);
define("PO_EQUIPMENT_SUPPORT", 4);
define("PO_EQUIPMENT_LENS", 5);
$equipment_types = array('', 'filter', 'flash', 'scanner', 'support', 'lens');
$client_status = array("pending" => PO_CLIENT_PENDING,
"accepted" => PO_CLIENT_ACCEPTED,
"rejected" => PO_CLIENT_REJECTED,
@ -88,6 +96,7 @@ $po_user = array("id" => 0,
$strings = array();
$thm_elem = array();
$passwords = "";
$memcache = FALSE;
$strings['formats']['sql'] = '%Y-%m-%d %H:%M:%S'; /* Do not change */

View File

@ -0,0 +1,351 @@
<?php
/************************************************************\
*
* wordCloud Copyright 2007 Derek Harvey
* www.lotsofcode.com
*
* This file is part of wordCloud.
*
* wordCloud v2 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.
*
* wordCloud v2 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 wordCloud; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
\************************************************************/
class wordCloud
{
var $version = '2.0';
var $wordsArray = array();
/*
* PHP 5 Constructor
*
* @param array $words
*
* @return void
*/
function __construct($words = false)
{
// If we are trying to parse some works, in any format / type
if ($words !== false) {
// If we have a string
if (is_string($words)) {
$this->addString($words);
} elseif (count($words)) {
foreach ($words as $key => $value) {
$this->addWord($value);
}
}
}
return;
}
/*
* PHP 4 Constructor
*
* @param array $words
*
* @return void
*/
function wordCloud($words = false)
{
return $this->__construct($words);
}
/*
* Convert a string into a cloud
*
* @param string $string
* @return void
*/
function addString($string)
{
// remove all other chars apart from a-z
$string = preg_replace('[^a-z]', '', strip_tags(strtolower($string)));
$words = array();
$words = explode(' ', $string);
if (count($words)) {
foreach ($words as $key => $value) {
$this->addWord($value);
}
}
}
/*
* Display user friendly message, for debugging mainly
*
* @param string $string
* @param array $value
*
* @return bool
*/
function notify($string, $value)
{
echo '<pre>';
print_r($string);
print_r($value);
echo '</pre>';
return false;
}
/*
* Assign word to array
*
* @param string $word
*
* @return string
*/
function addWord($wordAttributes = array())
{
if (is_string($wordAttributes)) {
$wordAttributes = array('word' => $wordAttributes);
}
if (!array_key_exists('size', $wordAttributes)) {
$wordAttributes = array_merge($wordAttributes, array('size' => 1));
}
if (!array_key_exists('word', $wordAttributes)) {
return $this->notify('no word attribute', print_r($wordAttributes, true));
}
$word = strtolower($wordAttributes['word']);
if (empty($this->wordsArray[$word])) {
$this->wordsArray[$word] = array();
}
if (!empty($this->wordsArray[$word]['size']) && !empty($wordAttributes['size'])) {
$wordAttributes['size'] = ($this->wordsArray[$word]['size'] + $wordAttributes['size']);
} elseif (!empty($this->wordsArray[$word]['size'])) {
$wordAttributes['size'] = $this->wordsArray[$word]['size'];
}
$this->wordsArray[$word] = $wordAttributes;
return $this->wordsArray[$word];
}
/*
* Shuffle associated names in array
*
* @return array $this->wordsArray
*/
function shuffleCloud()
{
$keys = array_keys($this->wordsArray);
shuffle($keys);
if (count($keys) && is_array($keys)) {
$tmpArray = $this->wordsArray;
$this->wordsArray = array();
foreach ($keys as $key => $value)
$this->wordsArray[$value] = $tmpArray[$value];
}
return $this->wordsArray;
}
/*
* Get the class range using a percentage
*
* @returns int $class
*/
function getClassFromPercent($percent)
{
if ($percent >= 99)
$class = 9;
elseif ($percent >= 70)
$class = 8;
elseif ($percent >= 60)
$class = 7;
elseif ($percent >= 50)
$class = 6;
elseif ($percent >= 40)
$class = 5;
elseif ($percent >= 30)
$class = 4;
elseif ($percent >= 20)
$class = 3;
elseif ($percent >= 10)
$class = 2;
elseif ($percent >= 5)
$class = 1;
else
$class = 0;
return $class;
}
/*
* Sets a limit for the amount of clouds
*
* @param string $limit
*
* @returns string $this->limitAmount
*/
function setLimit($limit)
{
if (!empty($limit)) {
$this->limitAmount = $limit;
}
return $this->limitAmount;
}
/*
* Gets the limited amount of clouds
*
* @returns string $wordCloud
*/
function limitCloud()
{
$i = 1;
foreach ($this->wordsArray as $key => $value) {
if ($this->limitAmount < $i) {
$wordsArray[$value['word']] = $value;
}
$i++;
}
$this->wordsArray = array();
$this->wordsArray = $wordsArray;
return $this->wordsArray;
}
/*
* Finds the maximum value of an array
*
* @param string $word
*
* @returns void
*/
function removeWord($word)
{
$this->removeWords[] = strtolower($word);
}
/*
* Removes tags from the whole array
*
* @returns array $this->wordsArray
*/
function removeWords()
{
foreach ($this->wordsArray as $key => $value) {
if (!in_array($value['word'], $this->removeWords)) {
$wordsArray[$value['word']] = $value;
}
}
$this->wordsArray = array();
$this->wordsArray = $wordsArray;
return $this->wordsArray;
}
/*
* Assign the order field and order direction of the cloud
*
* @param array $field
* @param string $sortway
*
* @returns void
*/
function orderBy($field, $direction = 'ASC')
{
return $this->orderBy = array('field' => $field, 'direction' => $direction);
}
/*
* Orders the cloud by a specific field
*
* @param array $unsortedArray
* @param string $sortField
* @param string $sortWay
*
* @returns array $unsortedArray
*/
function orderCloud($unsortedArray, $sortField, $sortWay = 'SORT_ASC')
{
$sortedArray = array();
foreach ($unsortedArray as $uniqid => $row) {
foreach ($row as $key => $value) {
$sortedArray[$key][$uniqid] = strtolower($value);
}
}
if ($sortWay) {
array_multisort($sortedArray[$sortField], constant($sortWay), $unsortedArray);
}
return $unsortedArray;
}
/*
* Finds the maximum value of an array
*
* @returns string $max
*/
function getMax()
{
$max = 0;
if (!empty($this->wordsArray)) {
$p_size = 0;
foreach ($this->wordsArray as $cKey => $cVal) {
$c_size = $cVal['size'];
if ($c_size > $p_size) {
$max = $c_size; /* @Thanks Morticus */
$p_size = $c_size;
}
}
}
return $max;
}
/*
* Create the HTML code for each word and apply font size.
*
* @returns string/array $return
*/
function showCloud($returnType = 'html')
{
if (empty($this->orderBy)) {
$this->shuffleCloud();
} else {
$orderDirection = strtolower($this->orderBy['direction']) == 'desc' ? 'SORT_DESC' : 'SORT_ASC';
$this->wordsArray = $this->orderCloud($this->wordsArray, $this->orderBy['field'], $orderDirection);
}
if (!empty($this->limitAmount)) {
$this->limitCloud();
}
if (!empty($this->removeWords)) {
$this->removeWords();
}
$this->max = $this->getMax();
if (is_array($this->wordsArray)) {
$return = ($returnType == 'html' ? '' : ($returnType == 'array' ? array() : ''));
foreach ($this->wordsArray as $word => $arrayInfo) {
$sizeRange = $this->getClassFromPercent(($arrayInfo['size'] / $this->max) * 100);
$arrayInfo['range'] = $sizeRange;
if ($returnType == 'array') {
$return [$word] = $arrayInfo;
} elseif ($returnType == 'html') {
$return .= "<span class='word size{$sizeRange}'> &nbsp; {$arrayInfo['word']} &nbsp; </span>";
}
}
return $return;
}
}
}
?>

View File

@ -0,0 +1,71 @@
/************************************************************\
*
* wordCloud Copyright 2007 Derek Harvey
* www.lotsofcode.com
*
* This file is part of wordCloud.
*
* wordCloud 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.
*
* wordCloud 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 wordCloud; if not, write to the Free Software
* Foundation, Inc., 59 Tpxple Place, Suite 330, Boston, MA 02111-1307 USA
*
\************************************************************/
.word {
font-family: Verdana, Tahoma, Arial;
padding: 4px 4px 4px 4px;
letter-spacing: 3px;
text-decoration: none;
font-weight: normal;
}
.size9 {
color: #000;
font-size: 26px;
}
.size8 {
color: #111;
font-size: 24px;
}
.size7 {
color: #222;
font-size: 22px;
}
.size6 {
color: #333;
font-size: 20px;
}
.size5 {
color: #444;
font-size: 18px;
}
.size4 {
color: #555;
font-size: 16px;
}
.size3 {
color: #666;
font-size: 14px;
}
.size2 {
color: #777;
font-size: 12px;
}
.size1 {
color: #888;
font-size: 8px;
}
.size0 {
color: #999;
font-size: 6px;
}

View File

@ -9,23 +9,21 @@
<?php site_logo(); ?>
<?php site_adv(); ?>
<?php site_navigator_stand_alone($database, 0); ?>
<?php site_navigator(0); ?>
<?php site_navigator_status("Welcome to your new Photo Organizer site", "It's simply spectacular!"); ?>
<p>&nbsp;</p>
<h2 align="center">Welcome to your new Photo Organizer installation!</h2>
<blockquote>
<p>This page can be customized via the admin interface.</p>
<p>This site is running a development snapshot of the code that will
become the <i>next</i> major release (v2.36) of Photo Organizer.</p>
<p>If something doesn't appear to work, please file a <a href="http://bugs.shaftnet.org">bug ticket</a>.</p>
<p>For more information about Photo Organizer's features and releases,
see the <a href="http://po.shaftnet.org/">Photo Organizer web site</a>.</p>
</blockquote>
<p>&nbsp;</p>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -26,7 +26,7 @@
db_file_name is a sql dumpfile.
"src_ver" => array("function" => function_name)
function function_name($dbh) { ... return BOOL;}
function function_name($database) { ... return BOOL;}
*/
@ -44,11 +44,15 @@ $versions = array("(none)" => array("function" => "po_new_install"),
"2.34.E" => array("file" => "po.upgrade.2.34.d.to.2.35.a.sql"), // For people that applied a hotfix to 2.34
"2.34.D" => array("file" => "po.upgrade.2.34.d.to.2.35.a.sql"),
"2.35.A" => array("file" => "po.upgrade.2.35.a.to.2.35.b.sql"),
"2.35.B" => array("file" => "po.upgrade.2.35.b.to.2.36.a.sql"),
"2.36.A" => array("function" => "po_upgrade_236a_236b"),
"2.36.B" => array("file" => "po.upgrade.2.36.b.to.2.36.c.sql"),
"2.36.C" => array("file" => "po.upgrade.2.36.c.to.2.36.d.sql"),
);
// to prepare a dump, perform a new install + upgrade, and then do this:
// pg_dump --disable-dollar-quoting -D -O -s -U po_user po_db > /tmp/dumpfile
// perl -pni -e "s/\'2007.*?\'/now()/g;" /tmp/dumpfile
// perl -pni -e "s/\'2008.*?\'/now()/g;" /tmp/dumpfile
// you'll need to remove the 'add langage' and 'set schema' stuff too.
/* ===================== Helper Functions ====================== */
@ -63,7 +67,7 @@ function po_symlink($src, $dest) {
return ($retval == 0);
}
function po_process_db_file($dbh, $file) {
function po_process_db_file($database, $file) {
$fh = fopen($file, 'r');
if (!$fh) {
print (" can't open file $row[db_file] \n");
@ -102,7 +106,7 @@ function po_process_db_file($dbh, $file) {
if (!$quot && ($offset === (strlen($buffer)-1))) {
$buffer = substr($buffer, 0, $offset);
# print ("<pre>$buffer</pre><br/>\n");
$res = pg_query($dbh, $buffer);
$res = pg_query($database, $buffer);
if ($res === FALSE) {
print ("<pre>-- $quot -- FAILED: $buffer</pre><pre>$res</pre><br/>\n");
return FALSE;
@ -119,8 +123,8 @@ function po_process_db_file($dbh, $file) {
return TRUE;
}
function po_get_version($dbh) {
$query = pg_query($dbh, "select major, minor, variation from version");
function po_get_version($database) {
$query = pg_query($database, "select major, minor, variation from version");
if ($query != FALSE) {
$row = pg_fetch_row($query);
$version = sprintf("%d.%02d.%s", $row[0],$row[1],$row[2]);
@ -134,14 +138,14 @@ function po_get_version($dbh) {
/* iptc and exif stuff storage updated */
function po232_iptc_exif($dbh) {
function po232_iptc_exif($database) {
$trans = array("<tr><td>" => "<key>",
"</td><td>" => "</key><value>",
"</td></tr>\n" => "</value>");
print "<li>Translating EXIF/IPTC data to new format...";
$data = pg_query($dbh, "select identifier, exif, iptc from photo_tech where exif != '' or iptc != ''");
$data = pg_query($database, "select identifier, exif, iptc from photo_tech where exif != '' or iptc != ''");
for ($i=0; $i < pg_num_rows($data); $i++) {
$dat = pg_fetch_assoc($data);
@ -156,7 +160,7 @@ function po232_iptc_exif($dbh) {
$exif = pg_escape_string($exif);
$iptc = pg_escape_string($iptc);
$res = pg_query($dbh, "update photo_tech set exif = '$exif', iptc = '$iptc' where identifier = $dat[identifier]");
$res = pg_query($database, "update photo_tech set exif = '$exif', iptc = '$iptc' where identifier = $dat[identifier]");
print " $dat[identifier] ";
if (!$res) {
print "<font color=\"red\">FAILED (# $dat[identifier])</font></li>\n";
@ -180,10 +184,10 @@ function space_string_to_array($str){
return preg_replace("/^\"(.*)\"$/","$1",$results);
}
function po232_keyword_migrate($dbh) {
function po232_keyword_migrate($database) {
print "<li>Moving keyword data into a separate table...";
$data = pg_query($dbh, "select identifier, keyword from photo where keyword != ''");
$data = pg_query($database, "select identifier, keyword from photo where keyword != ''");
for ($i=0; $i < pg_num_rows($data); $i++) {
$dat = pg_fetch_assoc($data);
$photo = $dat['identifier'];
@ -199,7 +203,7 @@ function po232_keyword_migrate($dbh) {
if ($keyword == "") continue;
$keyword = pg_escape_string($keyword);
$res = pg_query($dbh, "insert into photo_keywords (photo, keyword) values ($photo, '$keyword')");
$res = pg_query($database, "insert into photo_keywords (photo, keyword) values ($photo, '$keyword')");
if (!$res) {
print "<font color=\"red\">FAILED</font></li>\n";
return FALSE;
@ -211,27 +215,27 @@ function po232_keyword_migrate($dbh) {
return TRUE;
}
function po_upgrade_233x_233y($dbh) {
$res = pg_query($dbh, "begin");
function po_upgrade_233x_233y($database) {
$res = pg_query($database, "begin");
$res = po232_keyword_migrate($dbh);
$res = po232_keyword_migrate($database);
if ($res)
$res = po232_iptc_exif($dbh);
$res = po232_iptc_exif($database);
if ($res)
$res = pg_query($dbh, "update version set minor=33, variation='Y'");
$res = pg_query($database, "update version set minor=33, variation='Y'");
if ($res) {
pg_query($dbh, "commit");
pg_query($database, "commit");
} else {
print "<li><pre>".pg_last_error($dbh)."</pre></li>";
pg_query($dbh, "rollback");
print "<li><pre>".pg_last_error($database)."</pre></li>";
pg_query($database, "rollback");
}
return $res;
}
function po_upgrade_233a_234a($dbh) {
function po_upgrade_233a_234a($database) {
global $po_options_default;
global $image_repository_path;
@ -239,7 +243,7 @@ function po_upgrade_233a_234a($dbh) {
/* Migrate the 'current volume' pref into the filesystem directly */
if (!readlink($image_repository_path."/current")) {
$system_preferences = pg_fetch_row(pg_query($dbh, "select current_volume from system_preferences"));
$system_preferences = pg_fetch_row(pg_query($database, "select current_volume from system_preferences"));
$new_volume = $system_preferences[0];
$res = po_symlink($new_volume, "$image_repository_path/current");
}
@ -251,7 +255,7 @@ function po_upgrade_233a_234a($dbh) {
print "<li>Checking for bogus files...</li>";
$bogus = array();
$files = array();
$versions = pg_query($dbh, "SELECT identifier, small_image_path, medium_image_path, large_image_path, photo FROM photo_version order by identifier");
$versions = pg_query($database, "SELECT identifier, small_image_path, medium_image_path, large_image_path, photo FROM photo_version order by identifier");
for ($i = 0 ; $i < pg_num_rows($versions) ; $i++) {
$row = pg_fetch_row($versions, $i);
@ -276,7 +280,7 @@ function po_upgrade_233a_234a($dbh) {
print "<li>";
print "<ul><li>Deleting bogus images ( $list )...</li>";
$res = pg_query($dbh, "begin");
$res = pg_query($database, "begin");
/* ... nuke them from the database ... */
$queries = array("delete from photo_keywords where photo in ($list)",
@ -290,7 +294,7 @@ function po_upgrade_233a_234a($dbh) {
"delete from photo where identifier in ($list)");
foreach ($queries as $query) {
$res = pg_query($dbh, $query);
$res = pg_query($database, $query);
if (!$res) {
print "<li><pre>$query</pre></li>";
break;
@ -305,11 +309,11 @@ function po_upgrade_233a_234a($dbh) {
unlink("$file");
}
error_reporting($err);
pg_query($dbh, "commit");
pg_query($database, "commit");
print "<li>...done.</li>";
} else {
print "<li><pre>".pg_last_error($dbh)."</pre></li>";
pg_query($dbh, "rollback");
print "<li><pre>".pg_last_error($database)."</pre></li>";
pg_query($database, "rollback");
print "<li><font color=\"red\">...FAILED!</font></li>";
}
print "</ul></li>";
@ -318,29 +322,29 @@ function po_upgrade_233a_234a($dbh) {
return $res;
/* Update the DB revision */
$res = pg_query($dbh, "update version set minor=34, variation='A'");
$res = pg_query($database, "update version set minor=34, variation='A'");
return $res;
}
function po_upgrade_234b_234c($dbh) {
$res = po234_migrateprefs($dbh);
function po_upgrade_234b_234c($database) {
$res = po234_migrateprefs($database);
if ($res)
$res = po234_migrate_photo_files($dbh);
$res = po234_migrate_photo_files($database);
return $res;
}
function po234_migrateprefs($dbh) {
function po234_migrateprefs($database) {
global $po_options_default;
$user_list = array();
print("<li><ul>");
$res = pg_query($dbh, "begin");
$res = pg_query($database, "begin");
$users = pg_query($dbh, "select identifier from users where not exists(select owner from user_preferences where owner = users.identifier) order by identifier");
$users = pg_query($database, "select identifier from users where not exists(select owner from user_preferences where owner = users.identifier) order by identifier");
while (($user = pg_fetch_row($users)) != FALSE) {
$user_list[] = $user[0];
}
@ -354,7 +358,7 @@ function po234_migrateprefs($dbh) {
$po_user = array("id" => $user);
$options = array();
$user_data = pg_fetch_row(pg_query($dbh, "select username, password, first_name, last_name, company, contact, preferences, imagemagick_options, imagemagick_composite_options, dcraw_options, type from users where identifier='$po_user[id]'"));
$user_data = pg_fetch_row(pg_query($database, "select username, password, first_name, last_name, company, contact, preferences, imagemagick_options, imagemagick_composite_options, dcraw_options, type from users where identifier='$po_user[id]'"));
print("<li>Migrating '$user_data[0]' (# $po_user[id])</li>");
@ -364,7 +368,7 @@ function po234_migrateprefs($dbh) {
$po_user['dcraw_id'] = $user_data[9];
/* Basic preferences */
$preferences = pg_fetch_row(pg_query($dbh, "
$preferences = pg_fetch_row(pg_query($database, "
select print_out, start_hour, end_hour, start_day,
folder_view, paper, label, popup_enable, popup_delay, search_enable_stemming,
search_default_mode, download_counter, download_expiry_period, shop_enable,
@ -388,7 +392,7 @@ function po234_migrateprefs($dbh) {
$options['quota_count'] = $preferences[16];
/* Raw imports */
$dcraw_options = pg_fetch_row(pg_query($dbh, "
$dcraw_options = pg_fetch_row(pg_query($database, "
select gamma, brightness, white_balance, bitdepth
from dcraw_options
where dcraw_options.identifier = $po_user[dcraw_id]"));
@ -399,7 +403,7 @@ function po234_migrateprefs($dbh) {
$options['dcraw_bitdepth'] = $dcraw_options[3];
/* Watermarking */
$imagemagick_composite_options = pg_fetch_row(pg_query($dbh, "
$imagemagick_composite_options = pg_fetch_row(pg_query($database, "
select gravity, watermark, (select photo from photo_version where identifier = imagemagick_composite_options.photo_version)
from imagemagick_composite_options
where imagemagick_composite_options.identifier=$po_user[im_composite_id]"));
@ -409,7 +413,7 @@ function po234_migrateprefs($dbh) {
$options['watermark_photo'] = $imagemagick_composite_options[2];
/* Preview & Thumbnail stuffs */
$imagemagick_options = pg_fetch_row(pg_query($dbh, "
$imagemagick_options = pg_fetch_row(pg_query($database, "
select preview_quality, preview_colorspace, preview_gamma,
preview_sharpen_radius, preview_sharpen_sigma,
preview_sharpen_amount, preview_sharpen_threshold,
@ -449,7 +453,7 @@ function po234_migrateprefs($dbh) {
$value = pg_escape_string($value);
if ($value == "") continue;
if ($po_options_default[$key] == $value) continue; // Only migrate if they're not default!
$res = pg_query($dbh, "INSERT INTO user_preferences(owner, key, value) VALUES ($po_user[id], '$key', '$value')");
$res = pg_query($database, "INSERT INTO user_preferences(owner, key, value) VALUES ($po_user[id], '$key', '$value')");
if (!$res) {
print("<pre>Can't migrate prefs: $owner, $key, $value</pre>");
break;
@ -460,10 +464,10 @@ function po234_migrateprefs($dbh) {
print "<li>All users migrated</li>";
if (!$res) {
print "<li><pre>!!!" . pg_last_error($dbh) . "</pre></li>\n";
pg_query($dbh, "rollback");
print "<li><pre>!!!" . pg_last_error($database) . "</pre></li>\n";
pg_query($database, "rollback");
} else {
pg_query($dbh, "commit");
pg_query($database, "commit");
}
print("</ul></li>");
@ -500,7 +504,7 @@ function po_get_image_size($file) {
return array($width,$height);
}
function po234_migrate_photo_files($dbh) {
function po234_migrate_photo_files($database) {
global $image_repository_path;
$res = TRUE;
@ -509,26 +513,26 @@ function po234_migrate_photo_files($dbh) {
print "<li>Migrating photo file table....</li>";
$versions = pg_query($dbh, "SELECT identifier, small_image_path, medium_image_path, large_image_path, date_changed, photo FROM photo_version WHERE identifier not in (select distinct version from files) order by identifier");
$versions = pg_query($database, "SELECT identifier, small_image_path, medium_image_path, large_image_path, date_changed, photo FROM photo_version WHERE identifier not in (select distinct version from files) order by identifier");
for ($i = 0 ; $i < pg_num_rows($versions) ; $i++) {
$row = pg_fetch_row($versions, $i);
print "<li>Migrating photo $row[5] version $row[0]</li>";
$res = pg_query($dbh, "begin");
$res = pg_query($database, "begin");
/* Small image */
$image_dimension = po_get_image_size($image_repository_path."/".$row[1]);
$size = filesize($image_repository_path."/".$row[1]);
$query = "INSERT INTO files (identifier, version, size, x_res, y_res, path, created, filesize, params, comments, watermark) VALUES ((select nextval('files_id_sequence')), $row[0], 1, $image_dimension[0], $image_dimension[1], '$row[1]', '$row[4]', $size, '', '', null)";
$res = pg_query($dbh, $query);
$res = pg_query($database, $query);
/* Preview image */
if ($res) {
$image_dimension = po_get_image_size($image_repository_path."/".$row[2]);
$size = filesize($image_repository_path."/".$row[2]);
$query = "INSERT INTO files (identifier, version, size, x_res, y_res, path, created, filesize, params, comments, watermark) VALUES ((select nextval('files_id_sequence')), $row[0], 2, $image_dimension[0], $image_dimension[1], '$row[2]', '$row[4]', $size, '', '', null)";
$res = pg_query($dbh, $query);
$res = pg_query($database, $query);
}
/* Original image */
@ -536,14 +540,14 @@ function po234_migrate_photo_files($dbh) {
$image_dimension = po_get_image_size($image_repository_path."/".$row[3]);
$size = filesize($image_repository_path."/".$row[3]);
$query = "INSERT INTO files (identifier, version, size, x_res, y_res, path, created, filesize, params, comments, watermark) VALUES ((select nextval('files_id_sequence')), $row[0], 3, $image_dimension[0], $image_dimension[1], '$row[3]', '$row[4]', $size, '', '', null)";
$res = pg_query($dbh, $query);
$res = pg_query($database, $query);
}
if ($res) {
$res = pg_query($dbh, "commit");
$res = pg_query($database, "commit");
} else {
print "<li><pre>$query</pre></li>";
pg_query($dbh, "abort");
pg_query($database, "abort");
break;
}
flush();
@ -551,19 +555,19 @@ function po234_migrate_photo_files($dbh) {
if ($res || $i == 0) {
/* Ensure we have something left */
$res = pg_query($dbh, "begin");
$res = pg_fetch_row(pg_query($dbh, "SELECT count(*) from photo_version where identifier not in (select distinct version from files)"));
$res = pg_query($database, "begin");
$res = pg_fetch_row(pg_query($database, "SELECT count(*) from photo_version where identifier not in (select distinct version from files)"));
if ($res) {
$res = pg_query($dbh, "commit");
$res = pg_query($database, "commit");
$res = TRUE;
} else {
pg_query($dbh, "abort");
pg_query($database, "abort");
$res = FALSE;
}
}
if ($res) {
$res = pg_query($dbh, "update version set minor=34, variation='C'");
$res = pg_query($database, "update version set minor=34, variation='C'");
}
print "</ul></li>";
@ -571,7 +575,173 @@ function po234_migrate_photo_files($dbh) {
return $res;
}
function po_new_install($dbh) {
/* Migrate the equipment tables */
function po_upgrade_236a_236b($database) {
$types = array('filter' => 1, 'flash' => 2, 'scanner' => 3, 'support' => 4);
print "<ul>";
foreach ($types as $type_n => $type_id) {
print "<li>Migrating $type_n<ul>";
$sku_maps = array(); // maps old id ==> new id
/* First create new equipment sku entry */
$skus = pg_query($database, "select identifier, manufacturer, model, variation from ".$type_n."_type");
if (!$skus) continue;
$res = TRUE;
pg_query($database, "begin");
for ($i = 0 ; $i < pg_num_rows($skus) ; $i++) {
$sku = pg_fetch_row($skus);
$sku_id = pg_fetch_row(pg_query($database, "select nextval('equipment_sku_id_seq')"));
$sku_id = $sku_id[0];
$sku_model = pg_escape_string("$sku[2] $sku[3]");
print "<li>Migrating $sku[0] - $sku[2] $sku[3] -> $sku_id</li>";
$res = pg_query($database, "insert into equipment_sku (identifier, type, manufacturer, model, properties, url) VALUES ($sku_id, $type_id, $sku[1], '$sku_model', null, null)");
if (!$res) break;
$sku_maps[$sku[0]] = $sku_id;
}
if ($res) {
$equip_maps = array(); // maps old id ==> new id
/* Migrate the equipment instances */
$equips = pg_query($database, "select identifier, type, users, date_of_purchase, purchased_new, access_rights, serial_number from $type_n");
for ($i = 0 ; $i < pg_num_rows($equips) ; $i++) {
$equip = pg_fetch_row($equips);
$equip_id = pg_fetch_row(pg_query($database, "select nextval('equipment_id_seq')"));
$equip_id = $equip_id[0];
if ($equip[3] == '') {
$equip[3] = 'null';
} else {
$equip[3] = "'$equip[3]'";
}
$res = pg_query($database, "insert into equipment (identifier, sku, users, purchase_date, purchased_new, access_rights, properties, serial) VALUES ($equip_id, ".$sku_maps[$equip[1]].", $equip[2], $equip[3], '$equip[4]', $equip[5], '', '$equip[6]')");
if (!$res) break;
$equip_maps[$equip[0]] = $equip_id;
}
}
if ($res) {
/* Convert all references to equipment */
foreach ($equip_maps as $key => $value) {
$res = pg_query($database, "insert into photo_equipment (photo, equipment, type) SELECT photo, $value, $type_id from photo_tech where $type_n = $key");
if (!$res) break;
}
}
if ($res) {
pg_query($database, "commit");
} else {
pg_query($database, "abort");
print "<font color=\"red\"> FAILED </font>\n";
print "<pre>" . pg_last_error($database) . "</pre>\n";
break;
}
print "</ul></li>";
}
# Lenses. More complicated.
if ($res) {
$type_n = 'lens';
$type_id = 5;
print "<li>Migrating $type_n<ul>";
$sku_maps = array(); // maps old id ==> new id
/* First create new equipment sku entry */
$skus = pg_query($database, "select identifier, manufacturer, model, variation, min_focal_length, max_focal_length, min_aperture, max_aperture, exiftool_lens_id from lens_type");
$res = TRUE;
pg_query($database, "begin");
for ($i = 0 ; $i < pg_num_rows($skus) ; $i++) {
$sku = pg_fetch_row($skus);
$sku_id = pg_fetch_row(pg_query($database, "select nextval('equipment_sku_id_seq')"));
$sku_id = $sku_id[0];
if ($sku[8]) { /* Use ExifTool ID if possible */
$sku_model = $sku[8];
} else {
$flength = $sku[4];
if ($sku[4] != $sku[5])
$flength .= "-$sku[5]";
$flength .= "mm";
$ap = $sku[6];
if ($sku[6] != $sku[7])
$ap .= "-$sku[7]";
$ap = "f/$ap";
$sku_model = "$sku[2] $sku[3] $flength $ap";
}
print "<li>Migrating $sku[0] - $sku_model -> $sku_id</li>";
$sku_model = pg_escape_string($sku_model);
$res = pg_query($database, "insert into equipment_sku (identifier, type, manufacturer, model, properties, url) VALUES ($sku_id, $type_id, $sku[1], '$sku_model', null, null)");
if (!$res) break;
$sku_maps[$sku[0]] = $sku_id;
}
if ($res) {
$equip_maps = array(); // maps old id ==> new id
/* Migrate the equipment instances */
$equips = pg_query($database, "select identifier, type, users, date_of_purchase, purchased_new, access_rights, serial_number from $type_n");
for ($i = 0 ; $i < pg_num_rows($equips) ; $i++) {
$equip = pg_fetch_row($equips);
$equip_id = pg_fetch_row(pg_query($database, "select nextval('equipment_id_seq')"));
$equip_id = $equip_id[0];
if ($equip[3] == '') {
$equip[3] = 'null';
} else {
$equip[3] = "'$equip[3]'";
}
$res = pg_query($database, "insert into equipment (identifier, sku, users, purchase_date, purchased_new, access_rights, properties, serial) VALUES ($equip_id, ".$sku_maps[$equip[1]].", $equip[2], $equip[3], '$equip[4]', $equip[5], '', '$equip[6]')");
if (!$res) break;
$equip_maps[$equip[0]] = $equip_id;
}
}
if ($res) {
/* Convert all references to equipment */
foreach ($equip_maps as $key => $value) {
$res = pg_query($database, "insert into photo_equipment (photo, equipment, type) SELECT photo, $value, $type_id from photo_tech where $type_n = $key");
if (!$res) break;
}
}
if ($res) {
pg_query($database, "commit");
} else {
pg_query($database, "abort");
print "<font color=\"red\"> FAILED </font>\n";
print "<pre>" . pg_last_error($database) . "</pre>\n";
}
print "</ul></li>";
}
if ($res) {
$res = pg_query($database, "update version set minor=36, variation='B'");
}
print "</ul>";
return $res;
}
function po_new_install($database) {
global $image_repository_path;
global $first_volume;
global $new_install;
@ -616,15 +786,15 @@ function po_new_install($dbh) {
/* Load up SQL data */
if ($res) {
print "<li>Loading initial database data...";
pg_query($dbh, "begin");
$res = po_process_db_file($dbh, "sql/po.initial.2.35.a.sql");
pg_query($database, "begin");
$res = po_process_db_file($database, "sql/po.initial.2.35.a.sql");
if ($res) {
pg_query($dbh, "commit");
pg_query($database, "commit");
print "<font color=\"green\">OK</font></li>\n";
} else {
pg_query($dbh, "rollback");
pg_query($database, "rollback");
print "<font color=\"red\">FAILED</font></li>\n";
print "<li><pre>" . pg_last_error($dbh) . "</pre></li>\n";
print "<li><pre>" . pg_last_error($database) . "</pre></li>\n";
}
}
@ -641,7 +811,7 @@ function display_db_form() {
$db_dsn = preg_replace("/password=(.*)/", "password=[hidden]", $db_dsn);
print "<h4>Configured Settings: If any of these are incorrect, edit include/config_site.php</h4>\n";
print "<form method=\"post\" action=\"install.php\">\n";
print "<form method=\"post\" action=\"install.php\" accept-charset=\"".$strings['formats']['encoding']."\">\n";
print "<table class=\"listing\">\n";
print "<tr><td>Database Connection<br/>String</td><td>$db_dsn</td></tr>\n";
print "<tr><td>Site URL</td><td>$site_url</td></tr>\n";
@ -817,16 +987,16 @@ if (!$go) {
ini_set('max_execution_time', 0); /* Unlimited execution time! */
$dbh = pg_connect($db_dsn);
$database = pg_connect($db_dsn);
if ($dbh === FALSE) {
if ($database === FALSE) {
print "<h3>Database connection failed; Are credentials valid?</h3>";
display_db_form();
print "</html>";
exit(0);
}
$pg_ver = pg_version($dbh);
$pg_ver = pg_version($database);
if ($pg_ver['server'] < "8.0") {
print "<h3>PostgreSQL 8.0 or newer is required! (Current is $pg_ver[server])</h3>";
@ -844,12 +1014,12 @@ if ($pg_ver['server'] < "8.0") {
# tell user to kick off http://site/path/install.php
# su - postgres -c "createlang plpgsql po_db"
$version = po_get_version($dbh);
$version = po_get_version($database);
print "<h3> Current Photo Organizer DB version: $version</h3>\n";
$res = TRUE;
while ($res) {
$version = po_get_version($dbh);
$version = po_get_version($database);
$row = $versions[$version];
if (!$row) {
break;
@ -859,18 +1029,18 @@ while ($res) {
if (isset($row['file'])) {
print "<li>Upgrading database structure...";
pg_query($dbh, "begin");
$res = po_process_db_file($dbh, "sql/$row[file]");
pg_query($database, "begin");
$res = po_process_db_file($database, "sql/$row[file]");
if ($res) {
pg_query($dbh, "commit");
pg_query($database, "commit");
print "<font color=\"green\">OK</font></li>\n";
} else {
pg_query($dbh, "rollback");
pg_query($database, "rollback");
print "<font color=\"red\">FAILED</font></li>\n";
print "<li><pre>" . pg_last_error($dbh) . "</pre></li>\n";
print "<li><pre>" . pg_last_error($database) . "</pre></li>\n";
}
} elseif (isset($row['function'])) {
$res = $row["function"]($dbh);
$res = $row["function"]($database);
} else {
// ... XXX should never get here!
}

View File

@ -0,0 +1,76 @@
function addEquipment(name, type, prefix) {
var ul = document.getElementById(prefix + 'equipment');
var li = document.createElement('LI');
var inp1 = document.createElement('INPUT');
var select = document.getElementsByName(prefix + name);
var val = select[0].value;
var txt = document.createTextNode(select[0].options[select[0].selectedIndex].text);
if (val == 'null')
return;
val = val + ':' + type;
// Check for (and ignore) duplicates
var fields = document.getElementsByName(prefix + 'equipment[]');
for (var i = 0 ; i < fields.length ; i++) {
if (fields[i].value == val)
return;
}
inp1.setAttribute('type', 'hidden');
inp1.setAttribute('name', prefix + 'equipment[]');
inp1.setAttribute('value', val);
li.appendChild(inp1);
li.appendChild(txt);
li.onclick = function() {
removeItem(li);
}
ul.appendChild(li);
}
function addKeyword(name, prefix) {
var ul = document.getElementById(prefix + 'keywords');
var li = document.createElement('LI');
var inp1 = document.createElement('INPUT');
var inp0 = document.getElementsByName(prefix + name)[0];
var val = inp0.value;
var txt = document.createTextNode(val);
if (val == 'null')
return;
// Check for (and ignore) duplicates
var fields = document.getElementsByName(prefix + 'keywords[]');
for (var i = 0 ; i < fields.length ; i++) {
if (fields[i].value == val)
return;
}
inp1.setAttribute('type', 'hidden');
inp1.setAttribute('name', prefix + 'keywords[]');
inp1.setAttribute('value', val);
li.appendChild(inp1);
li.appendChild(txt);
inp0.value = '';
li.onclick = function() {
removeItem(li);
}
ul.appendChild(li);
}
function removeItem(i){
i.parentNode.removeChild(i);
}

View File

@ -1,97 +0,0 @@
/*
// Copyright (C) 2002, 2003, 2004, 2005, 2006 Balint Kis (balint@k-i-s.net)
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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
function selectSkip() {
if (!document.photoAdd.decode_exif[1].checked &&
!document.photoAdd.decode_exif[2].checked &&
!document.photoAdd.decode_exif[3].checked) {
document.photoAdd.decode_exif[0].checked = true;
}
if (!document.photoAdd.decode_iptc[1].checked &&
!document.photoAdd.decode_iptc[2].checked &&
!document.photoAdd.decode_iptc[3].checked) {
document.photoAdd.decode_iptc[0].checked = true;
}
if (!document.photoAdd.decode_rdf[1].checked &&
!document.photoAdd.decode_rdf[2].checked &&
!document.photoAdd.decode_rdf[3].checked) {
document.photoAdd.decode_rdf[0].checked = true;
}
}
function disabler1() {
if (document.photoAdd.decode_exif[1].checked) {
document.photoAdd.decode_rdf[1].checked = false;
document.photoAdd.decode_iptc[1].checked = false;
selectSkip();
}
if (document.photoAdd.decode_exif[2].checked) {
document.photoAdd.decode_rdf[2].checked = false;
document.photoAdd.decode_iptc[2].checked = false;
selectSkip();
}
if (document.photoAdd.decode_exif[3].checked) {
document.photoAdd.decode_rdf[3].checked = false;
document.photoAdd.decode_iptc[3].checked = false;
selectSkip();
}
}
function disabler2() {
if (document.photoAdd.decode_iptc[1].checked) {
document.photoAdd.decode_rdf[1].checked = false;
document.photoAdd.decode_exif[1].checked = false;
selectSkip();
}
if (document.photoAdd.decode_iptc[2].checked) {
document.photoAdd.decode_rdf[2].checked = false;
document.photoAdd.decode_exif[2].checked = false;
selectSkip();
}
if (document.photoAdd.decode_iptc[3].checked) {
document.photoAdd.decode_rdf[3].checked = false;
document.photoAdd.decode_exif[3].checked = false;
selectSkip();
}
}
function disabler3() {
if (document.photoAdd.decode_rdf[1].checked) {
document.photoAdd.decode_exif[1].checked = false;
document.photoAdd.decode_iptc[1].checked = false;
selectSkip();
}
if (document.photoAdd.decode_rdf[2].checked) {
document.photoAdd.decode_exif[2].checked = false;
document.photoAdd.decode_iptc[2].checked = false;
selectSkip();
}
if (document.photoAdd.decode_rdf[3].checked) {
document.photoAdd.decode_exif[3].checked = false;
document.photoAdd.decode_iptc[3].checked = false;
selectSkip();
}
}

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -20,7 +20,6 @@
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
;
include_once "include/common.php";
$type = 'label';
@ -40,14 +39,14 @@ $rows = $_REQUEST['rows'];
site_header(sprintf($strings['profile']['add'], $strings['generic'][$type]));
site_navigator(6);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['add'], $strings['generic'][$type]), "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['add'], $strings['generic'][$type]), "");
$all_manufacturers = pg_query($database, "select identifier, name from manufacturer order by name");
$all_papers = pg_query($database, "select identifier, name from paper order by name");
theme_display_navigator_box_top($profile_data['label']['idx'], $profile_data, "100%");
print "<form method=\"post\" action=\"label.add.2.php\">";
print "<form method=\"post\" action=\"label.add.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<table class=\"profile\">\n";
print "<tr class=\"folder_top\">";
@ -72,7 +71,7 @@ print $thm_elem['button.clear'];
print $thm_elem['button.cancel'];
print "</form>";
display_label($database, "*");
display_label($database, FALSE);
theme_display_navigator_box_bottom("100%");

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -20,7 +20,6 @@
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
;
include_once "include/common.php";
$type = 'label';
@ -33,10 +32,9 @@ if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from
label where identifier=$item and users=$po_user[id]"));
if ($result[0] == 0) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
exit();
}
}
@ -53,11 +51,13 @@ $label = pg_fetch_row(pg_query($database, "
site_header(sprintf($strings['profile']['delete'], $strings['generic'][$type]));
site_navigator(6);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['delete'], $strings['generic'][$type]), "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['delete'], $strings['generic'][$type]), "");
theme_display_navigator_box_top($profile_data['label']['idx'], $profile_data, "100%");
print "<form method=\"post\" action=\"profile.del.2.php?item_id=$item&amp;type=label\">\n";
print "<form method=\"post\" action=\"profile.del.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">\n";
print "<input type=\"hidden\" name=\"type\" value=\"label\">";
print "<input type=\"hidden\" name=\"item_id\" value=\"$item\">";
print "<table class=\"profile\">\n";
print "<tr class=\"folder_top\">\n";
print emit_td($strings['generic']['delete']." ".$strings['generic'][$type], 'colspan="12"');

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,11 +17,10 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
;
$database = site_prolog(PO_USER_TYPE_USER);
$label_name = pg_escape_string($_REQUEST['label_name']);
@ -42,9 +41,8 @@ if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from
label where identifier=$item and users=$po_user[id]"));
if ($result[0] == 0) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
}
}

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -20,7 +20,6 @@
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
;
include_once "include/common.php";
$type = 'label';
@ -33,9 +32,8 @@ if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from
label where identifier=$item and users=$po_user[id]"));
if ($result[0] == 0) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
}
}
@ -50,14 +48,14 @@ $label_data = pg_fetch_row(pg_query($database, "
site_header(sprintf($strings['profile']['edit'], $strings['generic'][$type]));
site_navigator(6);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['edit'], $strings['generic'][$type]), "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['edit'], $strings['generic'][$type]), "");
$all_manufacturers = pg_query($database, "select identifier, name from manufacturer order by name");
$all_papers = pg_query($database, "select identifier, name from paper order by name");
theme_display_navigator_box_top($profile_data['label']['idx'], $profile_data, "100%");
print "<form method=\"post\" action=\"label.edit.2.php\">";
print "<form method=\"post\" action=\"label.edit.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"item\" value=\"$item\"/>";
print "<table class=\"profile\">\n";
print "<tr class=\"folder_top\">";

View File

@ -182,7 +182,7 @@ $strings['search']['gen_text'] = 'Allgemeine Textsuche';
$strings['search']['adv_text'] = 'Erweiterte Textsuche';
$strings['search']['img_layout'] = 'Bildlayout';
$strings['search']['img_color'] = 'Bildfarbe';
$strings['search']['tags'] = 'Stichwörter';
/* Actions */
$strings['generic']['go_to_f'] = 'Gehe ins Verzeichnis';
@ -471,27 +471,25 @@ $strings['generic']['access_auth_users'] = 'Zugriff nur für authentifizierte Be
$strings['generic']['access_owner_only'] = 'Zugriff auf das Original nur durch den Besitzer';
$strings['generic']['title'] = 'Titel';
$strings['generic']['author'] = 'Autor';
$strings['generic']['author'] = 'Ersteller';
$strings['generic']['caption'] = 'Beschreibung';
$strings['generic']['location'] = 'Ort';
$strings['generic']['keywords'] = 'Stichwörter';
$strings['generic']['set_keywords'] = 'Stichworte setzen';
$strings['generic']['clear_keywords'] = 'Stichworte entfernen';
$strings['generic']['headline'] = 'Überschrift';
$strings['generic']['caption_writer'] = 'Autor der Beschreibung';
$strings['generic']['caption_writer'] = 'Verfasser der Beschreibung';
$strings['generic']['exposed'] = 'Aufnahmedatum';
$strings['generic']['created'] = 'Erstellt';
$strings['generic']['changed'] = 'Letzte Änderung';
$strings['generic']['category'] = 'Kategorie';
$strings['generic']['credit'] = 'Kredit';
$strings['generic']['supp_category'] = 'Zusätzliche Kategorie';
$strings['generic']['credit'] = 'Anbieter';
$strings['generic']['copyright'] = 'Copyright';
$strings['generic']['copyright_license'] = 'Copyright & Lizenz';
$strings['generic']['web_statement'] = 'Webseite';
$strings['generic']['source'] = 'Quelle';
$strings['generic']['high_res_orig'] = 'Hochauflösendes Original';
$strings['generic']['instructions'] = 'Anweisungen';
$strings['generic']['trans_ref'] = 'Übermittlungsort';
$strings['generic']['access'] = 'Zugriff';
$strings['generic']['item'] = 'Stück';
$strings['generic']['currency'] = 'Währung';
@ -510,7 +508,6 @@ $strings['generic']['camera_metering'] = 'Kameraeinstellungen';
$strings['generic']['camera_program'] = 'Kameraprogramm';
$strings['generic']['focal_length'] = 'Brennweite';
$strings['generic']['aperture'] = 'Blende';
$strings['generic']['shutter_speed'] = 'Belichtungszeit';
$strings['generic']['iso_override'] = 'Film ISO überschreiben';
$strings['generic']['scan_parameters'] = 'Scanparameter';
$strings['generic']['flash_mode'] = 'Blitzmodus';
@ -663,14 +660,12 @@ $strings['photo']['dupe'] = 'Duplikat';
$strings['photo']['rating'] = 'Beurteilung';
$strings['photo']['myself'] = 'ich selbst';
$strings['photo']['ratings'] = 'Beurteilungen';
$strings['photo']['copyright'] = 'Copyright';
$strings['photo']['dimensions'] = 'Abmessungen';
$strings['photo']['add_version'] = 'Version hinzufügen ';
$strings['photo']['add_rating'] = 'Bildbeurteilung hinzufügen';
$strings['photo']['add_dupe'] = 'Duplikat hinzufügen';
$strings['photo']['identifier'] = 'Bildidentifier';
$strings['photo']['dupe_id'] = 'Duplikatidentifier';
$strings['photo']['store'] = 'Kauf URL';
$strings['photo']['purchase'] = 'Dieses Bild kaufen';
$strings['photo']['rating_text'] = 'Die vergebene Punktzahl ist %s.';
$strings['user']['del_client'] = 'Kunde entfernen';
@ -751,10 +746,10 @@ $strings['datebook']['blank'] = "~NICHTS EINGEGEBEN~";
$strings['import']['file'] = 'Upload Datei';
$strings['import']['folder'] = 'In Verzeichnis';
$strings['import']['metadata'] = 'Metadaten Priorität';
$strings['import']['import_last_master'] = 'Letztes Bild eines Satzes ist Master';
$strings['import']['default_props'] = 'Standard Bildeinstellungen';
$strings['import']['default_data'] = 'Standard Aufnahmedaten';
$strings['import']['max_size'] = 'Maximale Grösse des Uploads';
$strings['import']['local_path'] = 'Importieren von folgenden Serverpfad';
$strings['import']['image_to_add'] = 'Bild hinzufügen';
$strings['import']['replace_with'] = 'Bild ersetzen durch';
$strings['generic']['all_users'] = 'Alle Benutzer';
@ -771,8 +766,6 @@ $strings['generic']['label'] = 'Beschriftung';
$strings['generic']['imported'] = 'Importdatum';
$strings['generic']['version'] = 'Version';
$strings['generic']['rate'] = 'Beurteilung';
$strings['generic']['select_all'] = 'Alles auswählen';
$strings['generic']['select_none'] = 'Nichts auswählen';
$strings['generic']['hide'] = 'Verstecken';
$strings['generic']['images_here'] = 'Bilder hier';
$strings['generic']['colorspace'] = 'Farbraum';
@ -812,3 +805,14 @@ $strings['generic']['password_old'] = "Passwort (aktuell)";
$strings['generic']['view'] = 'Ansicht';
$strings['generic']['show_ads'] = 'Anzeigen zeigen';
$strings['generic']['random'] = 'Zufall';
$strings['generic']['set_thumb_f'] = 'Verzeichnisbild setzen';
$strings['generic']['set_thumb_a'] = 'Albumbild setzen';
$strings['generic']['keep_thumb'] = 'Thumbnails beibehalten';
$strings['import']['local_bulk_path'] = 'Lokaler Importpfad';
$strings['generic']['theme'] = 'Thema';
$strings['generic']['supplemental_category'] = 'Zusätzliche Kategorie';
$strings['generic']['transmission_reference'] = 'Jobkennung';
$strings['generic']['select_toggle'] = 'Auswahl umschalten';
$strings['generic']['store_url'] = 'Kauf URL';
$strings['generic']['shutter'] = 'Verschlusszeit';

View File

@ -201,7 +201,6 @@ $strings['photo']['dupe'] = 'Duplicate';
$strings['photo']['rating'] = 'Rating';
$strings['photo']['myself'] = 'Myself';
$strings['photo']['ratings'] = 'Ratings';
$strings['photo']['copyright'] = 'Copyright';
$strings['photo']['dimensions'] = 'Dimensions';
@ -211,7 +210,6 @@ $strings['photo']['add_dupe'] = 'Add Dupe';
$strings['photo']['identifier'] = 'Image Identifier';
$strings['photo']['dupe_id'] = 'Dupe Identifier';
$strings['photo']['store'] = 'Purchase URL';
$strings['photo']['purchase'] = 'Purchase this image';
@ -315,6 +313,7 @@ $strings['search']['gen_text'] = 'General Text';
$strings['search']['adv_text'] = 'Advanced Text';
$strings['search']['img_layout'] = 'Image Layout';
$strings['search']['img_color'] = 'Image Color';
$strings['search']['tags'] = 'Tags';
/* Actions */
$strings['generic']['go_to_f'] = 'Go to Folder';
@ -324,6 +323,9 @@ $strings['generic']['move_to_f'] = 'Move to Folder';
$strings['generic']['move_to_a'] = 'Move to Album';
$strings['generic']['bulk_update'] = 'Bulk Update';
$strings['generic']['content_indexer'] = 'Content Indexer';
$strings['generic']['set_thumb_f'] = 'Set Folder Image';
$strings['generic']['set_thumb_a'] = 'Set Album Image';
$strings['generic']['keep_thumb'] = 'Keep Thumbnail';
/* Spooler */
$strings['spool']['name'] = 'Spool';
@ -409,10 +411,11 @@ $strings['import']['file_selector'] = 'File Selector';
$strings['import']['file'] = 'Upload file';
$strings['import']['folder'] = 'Into Folder';
$strings['import']['metadata'] = 'Metadata precedence';
$strings['import']['import_last_master'] = 'Is the last image of a set the master?';
$strings['import']['default_props'] = 'Default image properties';
$strings['import']['default_data'] = 'Default shooting data';
$strings['import']['max_size'] = 'Maximum upload file size';
$strings['import']['local_path'] = 'Import from path on server';
$strings['import']['local_bulk_path'] = 'Local import path';
$strings['import']['storage_location'] = 'Storage location';
$strings['import']['storage_location_id'] = 'Location identifier -- incremented when the index wraps around';
@ -550,6 +553,7 @@ $strings['generic']['last'] = 'Last';
$strings['generic']['pixels'] = 'pixels';
$strings['generic']['language'] = 'Language';
$strings['generic']['theme'] = 'Theme';
$strings['generic']['tray'] = 'Tray';
$strings['generic']['cdr'] = 'CD-R';
@ -689,14 +693,14 @@ $strings['generic']['changed'] = 'Date Changed';
$strings['generic']['category'] = 'Category';
$strings['generic']['version'] = 'Version';
$strings['generic']['credit'] = 'Credit';
$strings['generic']['supp_category'] = 'Supplemental Category';
$strings['generic']['supplemental_category'] = 'Supplemental Category';
$strings['generic']['copyright'] = 'Copyright';
$strings['generic']['copyright_license'] = 'Copyright and License';
$strings['generic']['web_statement'] = 'Web Statement';
$strings['generic']['source'] = 'Source';
$strings['generic']['high_res_orig'] = 'High Resolution Original';
$strings['generic']['instructions'] = 'Instructions';
$strings['generic']['trans_ref'] = 'Transmission Reference';
$strings['generic']['transmission_reference'] = 'Transmission Reference';
$strings['generic']['access'] = 'Access';
$strings['generic']['item'] = 'Item';
$strings['generic']['currency'] = 'Currency';
@ -710,17 +714,17 @@ $strings['generic']['order_added'] = 'Order added';
$strings['generic']['search_criteria'] = 'Search criteria';
$strings['generic']['recursive'] = 'Recursive';
$strings['generic']['selection'] = 'Selection';
$strings['generic']['select_all'] = 'Select All';
$strings['generic']['select_none'] = 'Select None';
$strings['generic']['select_toggle'] = 'Toggle Selection';
$strings['generic']['action'] = 'Action';
$strings['generic']['hide'] = 'Hide';
$strings['generic']['images_here'] = 'Images Here';
$strings['generic']['store_url'] = 'Purchase URL';
$strings['generic']['camera_metering'] = 'Camera metering';
$strings['generic']['camera_program'] = 'Camera program';
$strings['generic']['focal_length'] = 'Focal length';
$strings['generic']['aperture'] = 'Aperture';
$strings['generic']['shutter_speed'] = 'Shutter speed';
$strings['generic']['shutter'] = 'Shutter speed';
$strings['generic']['iso_override'] = 'Film ISO override';
$strings['generic']['scan_parameters'] = 'Scan parameters';
$strings['generic']['dpi'] = 'dpi';

View File

@ -35,11 +35,8 @@ $strings['datebook']['blank'] = '~NON PRÉCISER~';
$strings['datebook']['client'] = 'client';
$strings['datebook']['client_remark'] = 'remarques du client';
$strings['datebook']['clients'] = 'clients';
$strings['datebook']['create_event'] = 'Créer un nouvel évènement';
$strings['datebook']['date'] = 'Date de l\'évènement';
$strings['datebook']['day'] = 'Vue par jour';
$strings['datebook']['del_event'] = 'Supprimer un évènement';
$strings['datebook']['edit_event'] = 'Modifier un évènement';
$strings['datebook']['end'] = 'Date de fin';
$strings['datebook']['event'] = 'Évènement';
$strings['datebook']['goto'] = 'aller à';

View File

@ -198,7 +198,6 @@ $strings['photo']['dupe'] = 'Duplicato';
$strings['photo']['rating'] = 'Voto';
$strings['photo']['myself'] = 'Me stesso';
$strings['photo']['ratings'] = 'Voti';
$strings['photo']['copyright'] = 'Copyright';
$strings['photo']['dimensions'] = 'Dimensioni';
@ -208,7 +207,6 @@ $strings['photo']['add_dupe'] = 'Crea duplicato';
$strings['photo']['identifier'] = 'Identificatore immagine';
$strings['photo']['dupe_id'] = 'Identificatore duplicato';
$strings['photo']['store'] = 'URL per l\'acquisto';
$strings['photo']['purchase'] = 'Acquista quest\'immagine';
@ -275,7 +273,6 @@ $strings['profile']['popup_enable'] = "Finestra info immagine";
$strings['profile']['photos_slide'] = "Immagini per pagina (vista diapositive)";
$strings['profile']['photos_list'] = "Immagini per pagina (vista elenco)";
$strings['profile']['default_view'] = "Vista presefinita";
$strings['profile']['default_sort'] = "Ordinamento predefinito";
$strings['profile']['upload_options'] = "Opzioni caricamento immagini";
$strings['profile']['thumbnail'] = "Miniature";
$strings['profile']['preview'] = "Anteprima";
@ -333,12 +330,8 @@ $strings['export']['exporting'] = 'Esportazione di %s immagini...';
$strings['export']['close_xml'] = 'Chiusura file descrizione XML';
$strings['export']['create_xml'] = 'Creazione file descrizione XML';
$strings['export']['append_xml'] = 'Scrittura dati sul file descrizione XML';
$strings['export']['add_xml'] = 'Inserimento in archivio del file descrizione XML';
$strings['export']['remove_xml'] = 'Cancellazione del file descrizione XML';
$strings['export']['image'] = 'Esportazione immagilne n°';
$strings['export']['skipped'] = 'Immagine <strong>%s</strong> tralasciata';
$strings['export']['copying'] = 'Copying file <strong>%s</strong> to staging area';
$strings['export']['archive'] = 'Inserimento del file <strong>%s</strong> in archivio';
$strings['export']['finished'] = 'Esportazione terminata';
$strings['export']['removing'] = 'Eliminazione del file temporaneo <strong>%s</strong>';
$strings['export']['download'] = 'Premi %s per ricevere le immagini che hai esportato';
@ -391,9 +384,6 @@ $strings['datebook']['this_week'] = 'Questa settimana';
$strings['datebook']['this_month'] = 'Questo mese';
$strings['datebook']['no_events'] = 'Nessun evento per questo giorno';
$strings['datebook']['event'] = 'Evento';
$strings['datebook']['create_event'] = 'Crea nuovo Evento';
$strings['datebook']['del_event'] = 'Elimina Evento';
$strings['datebook']['edit_event'] = 'Modifica Evento';
$strings['datebook']['date'] = 'Data';
$strings['datebook']['start'] = 'Ora inizio';
$strings['datebook']['end'] = 'Ora fine';
@ -413,7 +403,6 @@ $strings['import']['metadata'] = 'Precedenza metadati';
$strings['import']['default_props'] = 'Proprietà predefinite immagine';
$strings['import']['default_data'] = 'Dati di scatto predefiniti';
$strings['import']['max_size'] = 'Dimensioni massime del file';
$strings['import']['local_path'] = 'Importa da percorso sul server';
$strings['import']['storage_location'] = 'Storage location';
$strings['import']['storage_location_id'] = 'Location identifier -- incremented when the index wraps around';
@ -686,14 +675,12 @@ $strings['generic']['changed'] = 'Modificata il';
$strings['generic']['category'] = 'Categoria';
$strings['generic']['version'] = 'Versione';
$strings['generic']['credit'] = 'Credit';
$strings['generic']['supp_category'] = 'Categoria Supplementare';
$strings['generic']['copyright'] = 'Copyright';
$strings['generic']['copyright_license'] = 'Copyright e Licenza';
$strings['generic']['web_statement'] = 'Web Statement';
$strings['generic']['source'] = 'Fonte';
$strings['generic']['high_res_orig'] = 'Originale ad alta risoluzione';
$strings['generic']['instructions'] = 'Istruzioni';
$strings['generic']['trans_ref'] = 'Transmission Reference';
$strings['generic']['access'] = 'Accesso';
$strings['generic']['item'] = 'Item';
$strings['generic']['currency'] = 'Valuta';
@ -707,8 +694,6 @@ $strings['generic']['order_added'] = 'Order added';
$strings['generic']['search_criteria'] = 'Criterio di ricerca';
$strings['generic']['recursive'] = 'Ricorsivo';
$strings['generic']['selection'] = 'Selezione';
$strings['generic']['select_all'] = 'Selezione Tutti';
$strings['generic']['select_none'] = 'Annulla Selezione';
$strings['generic']['action'] = 'Azione';
$strings['generic']['hide'] = 'Nascondi';
@ -716,7 +701,6 @@ $strings['generic']['camera_metering'] = 'Camera metering';
$strings['generic']['camera_program'] = 'Camera program';
$strings['generic']['focal_length'] = 'Distanza focale';
$strings['generic']['aperture'] = 'Diaframma';
$strings['generic']['shutter_speed'] = 'Tempo di scatto';
$strings['generic']['iso_override'] = 'Film ISO override';
$strings['generic']['scan_parameters'] = 'Parametri di scansione';
$strings['generic']['dpi'] = 'dpi';
@ -754,12 +738,12 @@ $strings['generic']['license_disclaimer'] = "Il copyright e la licenza seguenti
$strings['mail']['login_info'] = '
Informazioni per l\'accesso a $site_title
Gentile $user_data[0],
Gentile $user_data[first_name] $user_data[last_name],
Ecco le tue credenziali per l\'accesso a $site_title.
Nome utente: $user_data[3]
Password: $user_data[4]
Nome utente: $user_data[username]
Password: $user_data[password]
Indirizzo:

View File

@ -82,9 +82,10 @@ $strings['errors']['file_not_found'] = "Bestand bestaat niet";
$strings['errors']['iptc_not_implemented'] = "IPTC embedding is nog niet ondersteund.";
$strings['errors']['failed_temp_file_removal'] = "Verwijderen van tijdelijk bestand mislukt";
$strings['errors']['already_rated'] = "Je hebt deze afbeelding al een oordeel gegeven.";
$strings['errors']['delete_master'] = "Je kunt een master versie niet verwijderen.";
$strings['errors']['delete_master'] = "Je kunt een orgineel versie niet verwijderen.";
$strings['errors']['illegal_name'] = "Je specificeerde een ongeldige naam voor dit object.";
$strings['errors']['xml_error'] = "XML fout: %d %s in bestand data.xml op lijn %d";
$strings['errors']['registered'] = "Gebruiker geregistreerd. Aanmelden a.u.b.";
/* Login page strings */
@ -104,6 +105,7 @@ $strings['login']['disabled_account'] = "Je accoutn is uitgeschakeld.";
$strings['login']['user_register'] = "Als je een account wilt, registreer hier:";
$strings['login']['forgot_password'] = "Als je je gebruikersnaam of wachtwoord vergeten bent, klik";
$strings['login']['email_warning'] = "Zorg ervoor dat het email adres juist is, want daarheen wordt het wachtwoord verzonden.";
/* User page */
$strings['users']['select'] = "Selecteer een gebruiker";
@ -139,6 +141,8 @@ $strings['search']['searched_for'] = "Database doorzocht op ";
$strings['search']['union'] = "UNION";
$strings['search']['intersect'] = "INTERSECT";
$strings['search']['displaying'] = 'Weergeven afbeeldingen';
$strings['search']['date_range'] = 'Datum reeks';
$strings['search']['masters_only'] = 'Gebruik alleen orgineel afbeeldingen.';
/* Admin stuff */
$strings['admin']['image_repository'] = 'Afbeeldingen bewaarplaats';
@ -186,6 +190,7 @@ $strings['photo']['from_folder'] = 'Deze afbeelding is van';
$strings['photo']['album_descr'] = 'Albumomschrijving';
$strings['photo']['folder_descr'] = 'Mapomschrijving';
$strings['photo']['album_added'] = 'Datum toevoeging aan album';
$strings['photo']['albums'] = 'Gedeelte van deze albums';
$strings['photo']['full_exif'] = 'Toon alle opgeslagen EXIF gegevens';
$strings['photo']['full_exif_dump'] = 'Genereer nieuwe EXIF gegevens dump';
@ -197,7 +202,6 @@ $strings['photo']['dupe'] = 'Duplicaat';
$strings['photo']['rating'] = 'Beoordeling';
$strings['photo']['myself'] = 'Ikzelf';
$strings['photo']['ratings'] = 'Beoordelingen';
$strings['photo']['copyright'] = 'Copyright';
$strings['photo']['dimensions'] = 'Dimensies';
@ -207,7 +211,6 @@ $strings['photo']['add_dupe'] = 'Voeg duplicaat toe';
$strings['photo']['identifier'] = 'Afbeelding identificator';
$strings['photo']['dupe_id'] = 'Duplicaat identifier';
$strings['photo']['store'] = 'Aankoop URL';
$strings['photo']['purchase'] = 'Koop deze afbeelding';
@ -253,6 +256,7 @@ $strings['profile']['icc_profile'] = "ICC Profiel";
$strings['profile']['iso'] = "ISO Snelheid";
$strings['profile']['manufacturer'] = 'Fabrikant';
$strings['profile']['view'] = "Bekijk een %s";
$strings['profile']['add'] = "Voeg toe als nieuwe %s";
$strings['profile']['edit'] = "Bewerk als %s";
$strings['profile']['delete'] = "Verwijder als %s";
@ -319,6 +323,9 @@ $strings['generic']['move_to_f'] = 'Verplaats naar Map';
$strings['generic']['move_to_a'] = 'Verplaats naar Album';
$strings['generic']['bulk_update'] = 'Bulk Bijwerken';
$strings['generic']['content_indexer'] = 'Inhoud Indexeerder';
$strings['generic']['set_thumb_f'] = 'Stel map afbeelding in';
$strings['generic']['set_thumb_a'] = 'Stel album afbeelding in';
$strings['generic']['keep_thumb'] = 'Behoud miniatuur';
/* Spooler */
$strings['spool']['name'] = 'Spoel';
@ -331,12 +338,10 @@ $strings['export']['exporting'] = 'Exporteren %s fotos...';
$strings['export']['close_xml'] = 'Sluiten XML omschrijvingsbestand';
$strings['export']['create_xml'] = 'Aanmaken XML omschrijvingsbestand';
$strings['export']['append_xml'] = 'Toevoegen gegevens aan XML omschrijvingsbestand';
$strings['export']['add_xml'] = 'Toevoegen XML omschrijvingsbestand aan archief';
$strings['export']['remove_xml'] = 'Verwijderen XML omschrijvingsbestand';
$strings['export']['image'] = 'Exporteren afbeelding #';
$strings['export']['skipped'] = 'Afbeelding %s overgeslagen';
$strings['export']['copying'] = 'Kopieren bestand naar preparatie gebied...';
$strings['export']['archive'] = 'Toevoegen van bestand <strong>%s</strong> aan archief';
$strings['export']['adding'] = 'Bestand <strong>%s</strong> wordt toegevoegd aan export lijst';
$strings['export']['creating_archive'] = 'Aanmaken archief bestand';
$strings['export']['finished'] = 'Export klaar';
$strings['export']['removing'] = 'Verwijderen van tijdelijk bestand <strong>%s</strong>';
$strings['export']['download'] = 'Klik %s om je geëxporteerde afbeelding op te halen';
@ -390,9 +395,6 @@ $strings['datebook']['this_week'] = 'Deze Week';
$strings['datebook']['this_month'] = 'Deze Maand';
$strings['datebook']['no_events'] = 'Geen gebeurtenissen voor deze dag.';
$strings['datebook']['event'] = 'Agenda Gebeurtenis';
$strings['datebook']['create_event'] = 'Maak een nieuwe gebeurtenis';
$strings['datebook']['del_event'] = 'Verwijder een gebeurtenius';
$strings['datebook']['edit_event'] = 'Verander een gebeurtenis';
$strings['datebook']['date'] = 'Geberutenis datum';
$strings['datebook']['start'] = 'Start tijd';
$strings['datebook']['end'] = 'Eind tijd';
@ -412,7 +414,7 @@ $strings['import']['metadata'] = 'Metadata voorkeur';
$strings['import']['default_props'] = 'Standaard afbeeldingseigenschappen';
$strings['import']['default_data'] = 'Standaard opnamegegevens';
$strings['import']['max_size'] = 'Maximale upload bestandsgrootte';
$strings['import']['local_path'] = 'Importeer van pad op de server';
$strings['import']['local_bulk_path'] = 'Lokaal importeer pad';
$strings['import']['storage_location'] = 'Opslag locatie';
$strings['import']['storage_location_id'] = 'Locatie identificator -- wordt verhoogd als de index omslaat naar begin';
@ -447,6 +449,7 @@ $strings['import']['image_to_add'] = 'afbeelding om toe te voegen';
$strings['import']['replace_with'] = 'vervang afbeelding met';
$strings['import']['uncompress'] = 'uitpakken';
$strings['import']['validating_xml'] = 'Valideren <b>data.xml</b>';
$strings['import']['replace_in_album'] = 'vervang oud orgineel in albums?';
/* Generic stuff */
@ -514,6 +517,7 @@ $strings['generic']['last_mod'] = 'laatst veranderd';
$strings['generic']['tools'] = 'Gereedschappen';
$strings['generic']['master'] = 'Orgineel';
$strings['generic']['view'] = 'Bekijk';
$strings['generic']['edit'] = 'Bewerk';
$strings['generic']['delete'] = 'Verwijder';
$strings['generic']['no'] = 'Nee';
@ -548,6 +552,7 @@ $strings['generic']['last'] = 'Laatste';
$strings['generic']['pixels'] = 'Beeldpunten';
$strings['generic']['language'] = 'Taal';
$strings['generic']['theme'] = 'Thema';
$strings['generic']['tray'] = 'Tray';
$strings['generic']['cdr'] = 'CD-R';
@ -612,6 +617,7 @@ $strings['generic']['bulk_upload'] = 'bulk upload';
$strings['generic']['shop'] = 'winkel';
$strings['generic']['quota_count'] = 'quota aantal';
$strings['generic']['quota_size'] = 'quota grootte';
$strings['generic']['show_ads'] = 'toon advertenties';
$strings['generic']['member_since'] = 'lid sinds';
$strings['generic']['last_login'] = 'laatste login';
$strings['generic']['default_paper'] = 'standaard papier';
@ -686,14 +692,14 @@ $strings['generic']['changed'] = 'Datum Veranderd';
$strings['generic']['category'] = 'Categorie';
$strings['generic']['version'] = 'Versie';
$strings['generic']['credit'] = 'Erkenning';
$strings['generic']['supp_category'] = 'Aanvullende Categorie';
$strings['generic']['supplemental_category'] = 'Aanvullende Categorie';
$strings['generic']['copyright'] = 'Copyright';
$strings['generic']['copyright_license'] = 'Copyright & Licentie';
$strings['generic']['web_statement'] = 'Web Verklaring';
$strings['generic']['source'] = 'Bron';
$strings['generic']['high_res_orig'] = 'Hoge Resolutie Orgineel';
$strings['generic']['instructions'] = 'Instructies';
$strings['generic']['trans_ref'] = 'Transmissie Referentie';
$strings['generic']['transmission_reference'] = 'Transmissiereferentie';
$strings['generic']['access'] = 'Toegang';
$strings['generic']['item'] = 'Item';
$strings['generic']['currency'] = 'Munt';
@ -707,17 +713,17 @@ $strings['generic']['order_added'] = 'Bestelling toegevoegd';
$strings['generic']['search_criteria'] = 'Zoek criteria';
$strings['generic']['recursive'] = 'Recursief';
$strings['generic']['selection'] = 'Selectie';
$strings['generic']['select_all'] = 'Selecteer alle';
$strings['generic']['select_none'] = 'Selecteer niets';
$strings['generic']['select_toggle'] = 'Inverteer Selektie';
$strings['generic']['action'] = 'Actie';
$strings['generic']['hide'] = 'Verberg';
$strings['generic']['images_here'] = 'Afbeeldingen hier';
$strings['generic']['store_url'] = 'Aankoop URL';
$strings['generic']['camera_metering'] = 'Camera instelling';
$strings['generic']['camera_program'] = 'Camera programma';
$strings['generic']['focal_length'] = 'Brandpuntsafstand';
$strings['generic']['aperture'] = 'Diafragma opening';
$strings['generic']['shutter_speed'] = 'Sluitertijd';
$strings['generic']['shutter'] = 'Sluitertijd';
$strings['generic']['iso_override'] = 'Film ISO onderdrukking';
$strings['generic']['scan_parameters'] = 'Scan parameters';
$strings['generic']['dpi'] = 'Dpi';
@ -744,9 +750,10 @@ $strings['generic']['southwest'] = 'Zuidwest';
$strings['generic']['south'] = 'Zuid';
$strings['generic']['automatic'] = 'Automatisch';
$strings['generic']['modify'] = 'Verander';
$strings['generic']['random'] = 'Willekeurig';
$strings['generic']['populate_from_spool'] = 'Kopieer afbeeldingen van spoel naar album';
$strings['generic']['po_powered_by'] = 'Aangedreven door <a href="http://po.shaftnet.org/">Photo Organizer</a>';
$strings['generic']['po_copyright'] = 'Copyright &copy; 2002-2006 <a href="http://www.k-i-s.net">Balint Kis</a>, &copy; 2005-2007 <a href="http://www.shaftnet.org/users/pizza">Solomon Peachy</a>, en is beschikbaar onder de voorwaarden van de <a href="copyright.php">GNU GPL</a>';
$strings['generic']['po_copyright'] = 'Copyright &copy; 2002-2006 <a href="http://www.k-i-s.net">Balint Kis</a>, &copy; 2005-2008 <a href="http://www.shaftnet.org/users/pizza">Solomon Peachy</a>, en is beschikbaar onder de voorwaarden van de <a href="copyright.php">GNU GPL</a>';
$strings['generic']['license_disclaimer'] = "De volgende copyright en licentie tekst heeft alleen betrekking op het software programma (Photo Organizer). Alle gebruikersdata beheerd door de software, inclusief maar niet beperkt tot de afbeeldingen zelf, zijn onderhevig aan copyright van hum respectievelijke eigenaren en is waarschijnlijk beschikbaar onder andere voorwaarden.";

View File

@ -1,80 +0,0 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
;
include_once "include/calendar.php";
function add_lens($database, $user_id,
$lens_type_id, $lens_manufacturer_id, $lens_model, $lens_variation,
$lens_min_aperture_id, $lens_max_aperture_id, $lens_min_focal_length_id, $lens_max_focal_length_id, $lens_serial_number,
$lens_purchase_timestamp,
$lens_purchased_new, $lens_access_rights) {
global $strings;
$lens_date_of_purchase = check_date_validity($lens_purchase_timestamp);
$lens_model = pg_escape_string($lens_model);
$lens_variation = pg_escape_string($lens_variation);
$lens_serial_number = pg_escape_string($lens_serial_number);
$result = TRUE;
pg_query($database, "begin");
if ($lens_type_id=='custom') {
$new_lens_type_id = pg_fetch_row(pg_query($database, "select nextval('lens_type_id_sequence')"));
$lens_type_id = $new_lens_type_id[0];
$result = pg_query($database, "insert into lens_type (identifier, manufacturer, model, variation, min_focal_length, max_focal_length, min_aperture, max_aperture, last_modified_date, last_modifying_users)
values ($lens_type_id, $lens_manufacturer_id, '$lens_model', '$lens_variation', '$lens_min_focal_length_id', '$lens_max_focal_length_id', '$lens_min_aperture_id', '$lens_max_aperture_id', now(), '$user_id')");
}
if ($result) {
$result = pg_query($database, "insert into lens (identifier, type, users, serial_number, date_of_purchase, purchased_new, access_rights)
values (nextval('lens_id_sequence'), '$lens_type_id', '$user_id', '$lens_serial_number', $lens_date_of_purchase, '$lens_purchased_new', '$lens_access_rights')");
}
if ($result) {
pg_query($database, "commit");
} else {
site_push_error($strings['errors']['db_insert_failed']);
pg_query($database, "rollback");
}
}
$database = site_prolog(PO_USER_TYPE_USER);
add_lens($database, $po_user['id'],
pg_escape_string($_REQUEST['lens_type_id']),
pg_escape_string($_REQUEST['manufacturer_id']),
pg_escape_string($_REQUEST['lens_model']),
pg_escape_string($_REQUEST['lens_variation']),
pg_escape_string($_REQUEST['lens_min_aperture_id']),
pg_escape_string($_REQUEST['lens_max_aperture_id']),
pg_escape_string($_REQUEST['lens_min_focal_length_id']),
pg_escape_string($_REQUEST['lens_max_focal_length_id']),
pg_escape_string($_REQUEST['lens_serial_number']),
pg_escape_string($_REQUEST['lens_purchase_timestamp']),
pg_escape_string($_REQUEST['lens_purchased_new']),
pg_escape_string($_REQUEST['lens_access_rights']));
site_epilog($database);
header("Location: my.profile.php?selector=".$profile_data['lens']['idx']);
?>

View File

@ -1,159 +0,0 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
include_once "include/common.php";
$type = 'lens';
$database = site_prolog(PO_USER_TYPE_USER);
$manufacturer_filter = pg_escape_string(isset($_REQUEST['filter']) ? $_REQUEST['filter'] : "");
$manufacturer = pg_query($database, "select identifier, name from manufacturer order by name");
switch ($manufacturer_filter) {
case 'All':
case '':
$lens_type = pg_query($database, "select identifier, name, model, variation, s_min_aperture,
s_max_aperture, s_min_focal_length, s_max_focal_length, url
from view_lens_type order by name");
break;
default:
$lens_type = pg_query($database, "select identifier, name, model, variation, s_min_aperture,
s_max_aperture, s_min_focal_length, s_max_focal_length, url
from view_lens_type where view_lens_type.name='$manufacturer_filter' order by name");
}
site_header(sprintf($strings['profile']['add'], $strings['generic'][$type]));
site_navigator(6);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['add'], $strings['generic'][$type]), "");
theme_display_navigator_box_top($profile_data['lens']['idx'], $profile_data, "100%");
if (pg_num_rows($manufacturer) == 0) {
print emit_manuf_add_needed($type);
theme_display_navigator_box_bottom("100%");
site_footer($database);
site_epilog($database);
exit;
}
print "<form method=\"post\" action=\"lens.add.2.php\">\n";
print "<table class=\"profile\">\n";
emit_profile_manuf_combo("lens.add.php?type=$type", $type, 4, $manufacturer, $manufacturer_filter);
print "<tr>\n";
print "<th width=\"4%\"></th>\n";
print emit_th($strings['profile']['manufacturer'], "width=\"20%\"");
print emit_th($strings['profile']['model'], "width=\"20%\"");
print emit_th($strings['profile']['variation'], "width=\"20%\"");
print emit_th($strings['profile']['aperture_focal'], "width=\"36%\"");
print "</tr>\n";
$num = pg_num_rows($lens_type);
if ($num > 0) {
for ($i=0; $i < $num; $i++) {
$r = pg_fetch_row($lens_type, $i);
print "<tr>\n";
print "<td><input type=\"radio\" name=\"lens_type_id\" value=\"$r[0]\"/></td>\n";
print "<td><a href=\"$r[8]\">$r[1]</a></td>\n";
print "<td>$r[2]</td>\n";
print "<td>$r[3]</td>\n";
print "<td>";
print emit_lens_string($r[4], $r[5], $r[6], $r[7]);
print "</td>\n";
print "</tr>\n";
}
} else {
print "<tr><td colspan=\"6\">".sprintf($strings['profile']['none_found'], $strings['generic'][$type])." ".$strings['generic']['types'] ."</td></tr>\n";
}
print "</table>\n";
print "<table class=\"profile\">\n";
print "<tr class=\"folder_top\">\n";
print "<tr class=\"folder_top\"><td colspan=\"6\">".sprintf($strings['profile']['specific_data'], $strings['generic'][$type])."</td></tr>\n";
print "</tr>\n";
print "<tr>\n";
print "<th width=\"4%\"></th>\n";
print emit_th($strings['profile']['manufacturer'], "width=\"20%\"");
print emit_th($strings['profile']['model'], "width=\"20%\"");
print emit_th($strings['profile']['variation'], "width=\"20%\"");
print emit_th($strings['generic']['aperture'], "width=\"18%\"");
print emit_th($strings['generic']['focal_length'], "width=\"18%\"");
print "</tr>\n";
print "<tr>\n";
print "<td>";
print "<input type=\"radio\" name=\"lens_type_id\" value=\"custom\" checked=\"checked\" />";
print "</td>\n";
print "<td>\n";
print emit_manufacturer_combo('manufacturer_id', $manufacturer, "");
print "</td>\n";
print "<td>\n";
print "<input type=\"text\" name=\"lens_model\" />\n";
print "</td>\n";
print "<td>\n";
print "<input type=\"text\" name=\"lens_variation\" />\n";
print "</td>\n";
print "<td>\n";
print emit_aperture_combo("lens_min_aperture_id", FALSE, 1);
print "-";
print emit_aperture_combo("lens_max_aperture_id", FALSE, 1);
print "</td>\n";
print "<td>\n";
print emit_focal_length_combo("lens_min_focal_length_id", FALSE, 1);
print "-";
print emit_focal_length_combo("lens_max_focal_length_id", FALSE, 1);
print "</td>\n";
print "</tr>\n";
print "</table>\n";
print "<table class=\"profile\">\n";
print "<tr class=\"folder_top\"><td colspan=\"4\">".sprintf($strings['profile']['specific_data'], $strings['generic'][$type])."</td></tr>\n";
print "<tr>\n";
print emit_th($strings['profile']['serial']);
print emit_th($strings['profile']['purchased']);
print emit_th($strings['profile']['new']);
print emit_th($strings['generic']['access']);
print "</tr>\n";
print "<tr>\n";
print "<td><input type=\"text\" name=\"lens_serial_number\" /></td>\n";
print "<td>\n";
print emit_date_input_form("lens_purchase_timestamp", "");
print "</td>\n";
print "<td>\n"; display_yes_no_combo("lens_purchased_new", "t"); print "</td>\n";
print "<td>\n"; display_access_combo("lens_access_rights", "t", ""); print "</td>\n";
print "</tr>\n";
print "</table>\n";
print $thm_elem['button.add'];
print $thm_elem['button.clear'];
print $thm_elem['button.cancel'];
print "</form>\n";
theme_display_navigator_box_bottom("100%");
site_footer($database);
site_epilog($database);
?>

View File

@ -1,95 +0,0 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
;
include_once "include/common.php";
$type = 'lens';
$database = site_prolog(PO_USER_TYPE_USER);
$lens_id = pg_escape_string($_REQUEST['item']);
/* Ensure the user owns it !*/
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from lens where identifier=$lens_id and users=$po_user[id]"));
if ($result[0] == 0) {
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
}
}
$number_of_references = pg_fetch_row(pg_query($database, "select number_of_lens_references($lens_id)"));
$lens_to_be_removed = pg_fetch_row(pg_query($database, "select name, model, variation, s_min_aperture, s_max_aperture,
s_min_focal_length, s_max_focal_length, serial_number,
date_of_purchase, purchased_new, url, access_rights
from view_lens where identifier=$lens_id"));
site_header(sprintf($strings['profile']['delete'], $strings['generic'][$type]));
site_navigator(6);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['delete'], $strings['generic'][$type]), "");
theme_display_navigator_box_top($profile_data['lens']['idx'], $profile_data, "100%");
print "<form method=\"post\" action=\"profile.del.2.php?item_id=$lens_id&type=lens\">\n";
print "<table class=\"profile\">\n";
print "<tr class=\"folder_top\">\n";
print emit_td($strings['generic']['delete']." ".$strings['generic'][$type], 'colspan="6"');
print "<tr>\n";
print emit_th($strings['profile']['model']);
print emit_th($strings['profile']['serial']);
print emit_th($strings['profile']['purchased']);
print emit_th($strings['profile']['new']);
print emit_th($strings['generic']['access']);
print emit_th($strings['generic']['refs']);
print "</tr>\n";
print "<tr>\n";
print "<td><a href=\"$lens_to_be_removed[10]\">$lens_to_be_removed[0]</a>\n";
print "&nbsp;$lens_to_be_removed[1]&nbsp;$lens_to_be_removed[2]&nbsp;";
print emit_lens_string($lens_to_be_removed[3], $lens_to_be_removed[4], $lens_to_be_removed[5], $lens_to_be_removed[6]);
print "</td>\n";
print "<td>$lens_to_be_removed[7]</td>\n";
print "<td>".emit_date_html($lens_to_be_removed[8], 'date'). "</td>\n";
print emit_td(emit_yes_no_text($lens_to_be_removed[9]));
print emit_td($strings['generic'][$access[$lens_to_be_removed[11]]]);
print "<td>$number_of_references[0]</td>\n";
print "</tr>\n";
print "</table>\n";
if ($number_of_references[0]==0) {
print $thm_elem['button.confirm.delete'];
print $thm_elem['button.cancel'];
} else {
print $thm_elem['button.back'];
}
print "</form>\n";
theme_display_navigator_box_bottom("100%");
site_footer($database);
site_epilog($database);
?>

View File

@ -1,104 +0,0 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
;
include_once "include/calendar.php";
function update_lens($database, $user_id, $lens_id, $lens_type_id, $lens_manufacturer_id, $lens_model, $lens_variation,
$lens_min_aperture_id, $lens_max_aperture_id, $lens_min_focal_length_id, $lens_max_focal_length_id,
$lens_serial_number, $lens_purchase_timestamp, $lens_purchased_new, $lens_access_rights, $exiftool_lens_id) {
global $po_user;
global $strings;
/* Ensure the user owns it !*/
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from lens where identifier=$lens_id and users=$po_user[id]"));
if ($result[0] == 0) {
site_push_error($strings['errors']['not_owner']);
return FALSE;
}
}
$lens_date_of_purchase = check_date_validity($lens_purchase_timestamp);
$lens_model = pg_escape_string($lens_model);
$lens_variation = pg_escape_string($lens_variation);
$lens_serial_number = pg_escape_string($lens_serial_number);
pg_query($database, "begin");
if ($lens_type_id=='custom') {
/* lens type has changed */
$number_of_lenses_of_same_type = pg_fetch_row(pg_query($database, "select count(identifier) from lens where type=(select type from lens where identifier='$lens_id')"));
if ($number_of_lenses_of_same_type[0] == 1) {
/* there was only one lens of this kind, so we have to remove it */
$lens_type_to_remove = pg_fetch_row(pg_query($database, "select type from lens where identifier='$lens_id'"));
}
/* create new type */
$new_lens_type_id = pg_fetch_row(pg_query($database, "select nextval('lens_type_id_sequence')"));
$lens_type_id = $new_lens_type_id[0];
$result = pg_query($database, "insert into lens_type (identifier, manufacturer, model, variation, min_focal_length, max_focal_length, min_aperture, max_aperture, last_modified_date, last_modifying_users, exiftool_lens_id)
values ($lens_type_id, $lens_manufacturer_id, '$lens_model', '$lens_variation', '$lens_min_focal_length_id', '$lens_max_focal_length_id', '$lens_min_aperture_id', '$lens_max_aperture_id', now(), '$user_id', '$exiftool_lens_id')");
}
/* add lens */
if ($result) {
$result = pg_query($database, "update lens set type='$lens_type_id', serial_number='$lens_serial_number', date_of_purchase=$lens_date_of_purchase, purchased_new='$lens_purchased_new', access_rights='$lens_access_rights' where identifier='$lens_id'");
}
/* remove old type */
if ($result && $lens_type_to_remove) {
$result = pg_query($database, "delete from lens_type where identifier='$lens_type_to_remove[0]'");
}
if ($result) {
pg_query($database, "commit");
return TRUE;
} else {
site_push_error($strings['errors']['db_insert_failed']);
pg_query($database, "rollback");
return FALSE;
}
return FALSE;
}
$database = site_prolog(PO_USER_TYPE_USER);
update_lens($database, $po_user['id'],
pg_escape_string($_REQUEST['item_id']),
pg_escape_string($_REQUEST['lens_type_id']),
pg_escape_string($_REQUEST['manufacturer_id']),
pg_escape_string($_REQUEST['lens_model']),
pg_escape_string($_REQUEST['lens_variation']),
pg_escape_string($_REQUEST['lens_min_aperture_id']),
pg_escape_string($_REQUEST['lens_max_aperture_id']),
pg_escape_string($_REQUEST['lens_min_focal_length_id']),
pg_escape_string($_REQUEST['lens_max_focal_length_id']),
pg_escape_string($_REQUEST['lens_serial_number']),
pg_escape_string($_REQUEST['lens_purchase_timestamp']),
pg_escape_string($_REQUEST['lens_purchased_new']),
pg_escape_string($_REQUEST['lens_access_rights']),
pg_escape_string($_REQUEST['exiftool_lens_id']));
site_epilog($database);
header("Location: my.profile.php?selector=".$profile_data['lens']['idx']);
?>

View File

@ -1,177 +0,0 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
include_once "include/common.php";
$type = 'lens';
$database = site_prolog(PO_USER_TYPE_USER);
$manufacturer_filter = pg_escape_string(isset($_REQUEST['filter']) ? $_REQUEST['filter'] : "");
$lens_id = pg_escape_string($_REQUEST['item']);
$lens_current_value = pg_fetch_row(pg_query($database, "select name, model, variation, s_min_aperture,
s_max_aperture, s_min_focal_length, s_max_focal_length,
serial_number, date_of_purchase, purchased_new, access_rights, users, exiftool_lens_id
from view_lens where identifier='$lens_id'"));
/* Ensure the user owns it !*/
if (($po_user['id'] != $lens_current_value[11]) &&
($po_user['type'] != PO_USER_TYPE_ADMIN)) {
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
}
$lens_type_current_value = pg_fetch_row(pg_query($database, "select type from lens where identifier='$lens_id'"));
$manufacturer = pg_query($database, "select identifier, name from manufacturer order by name");
switch ($manufacturer_filter) {
case 'All':
case '':
$lens_type = pg_query($database, "select identifier, name, model, variation, s_min_aperture,
s_max_aperture, s_min_focal_length, s_max_focal_length, url, exiftool_lens_id
from view_lens_type order by name");
break;
default:
$lens_type = pg_query($database, "select identifier, name, model, variation, s_min_aperture,
s_max_aperture, s_min_focal_length, s_max_focal_length, url, exiftool_lens_id
from view_lens_type where name='$manufacturer_filter' or identifier='$lens_type_current_value[0]' order by name");
}
site_header(sprintf($strings['profile']['edit'], $strings['generic'][$type]));
site_navigator(6);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['edit'], $strings['generic'][$type]), "");
theme_display_navigator_box_top($profile_data['lens']['idx'], $profile_data, "100%");
print "<form method=\"post\" action=\"lens.edit.2.php?item_id=$lens_id\">\n";
print "<table class=\"profile\">\n";
emit_profile_manuf_combo("lens.edit.php?type=$type&amp;item=$lens_id", $type, 5, $manufacturer, $manufacturer_filter);
print "<tr>\n";
print "<th width=\"4%\"></th>\n";
print emit_th($strings['profile']['manufacturer'], "width=\"15%\"");
print emit_th($strings['profile']['model'], "width=\10%\"");
print emit_th($strings['profile']['variation'], "width=\"10%\"");
print emit_th($strings['profile']['aperture_focal'], "width=\"20%\"");
print emit_th($strings['profile']['exiftool_id'], "width=\"30%\"");
print "</tr>\n";
$num = pg_num_rows($lens_type);
if ($num > 0) {
for ($i=0; $i < $num; $i++) {
$r = pg_fetch_row($lens_type, $i);
print "<tr>\n";
print "<td><input type=\"radio\" name=\"lens_type_id\" value=\"$r[0]\" /></td>\n";
print "<td><a target=\"_new\" href=\"$r[8]\">$r[1]</a></td>\n";
print "<td>$r[2]</td>\n";
print "<td>$r[3]</td>\n";
print "<td>";
print emit_lens_string($r[4], $r[5], $r[6], $r[7]);
print "</td>\n";
print "<td>$r[9]</td>\n";
print "</tr>\n";
}
} else {
print "<tr><td colspan=\"4\">".sprintf($strings['profile']['none_found'], $strings['generic'][$type])." ".$strings['generic']['types'] ."</td></tr>\n";
}
print "</table>\n";
print "<table class=\"profile\">\n";
print "<tr class=\"folder_top\">\n";
print "<td colspan=\"7\">".sprintf($strings['profile']['edit_type'], $strings['generic'][$type])."</td>\n";
print "</tr>\n";
print "<tr>\n";
print "<th width=\"4%\"></th>\n";
print emit_th($strings['profile']['manufacturer'], "width=\"15%\"");
print emit_th($strings['profile']['model'], "width=\"10%\"");
print emit_th($strings['profile']['variation'], "width=\"10%\"");
print emit_th($strings['generic']['aperture'], "width=\"15%\"");
print emit_th($strings['generic']['focal_length'], "width=\"15%\"");
print emit_th($strings['profile']['exiftool_id'], "width=\"15%\"");
print "</tr>\n";
print "<tr>\n";
print "<td>";
print "<input type=\"radio\" name=\"lens_type_id\" value=\"custom\" checked=\"checked\" />";
print "</td>\n";
print "<td>";
print emit_manufacturer_combo('manufacturer_id', $manufacturer, $lens_current_value[0]);
print "</td>\n";
print "<td>";
print "<input type=\"text\" name=\"lens_model\" value=\"$lens_current_value[1]\" />\n";
print "</td>\n";
print "<td>\n";
print "<input type=\"text\" name=\"lens_variation\" value=\"$lens_current_value[2]\"/>\n";
print "</td>\n";
print "<td>";
print emit_aperture_combo("lens_min_aperture_id", $lens_current_value[3], 1);
print "-";
print emit_aperture_combo("lens_max_aperture_id", $lens_current_value[4], 1);
print "</td>\n";
print "<td>";
print emit_focal_length_combo("lens_min_focal_length_id", $lens_current_value[5], 1);
print "-";
print emit_focal_length_combo("lens_max_focal_length_id", $lens_current_value[6], 1);
print "</td>\n";
print "<td>";
print "<input type=\"text\" name=\"exiftool_lens_id\" value=\"$lens_current_value[12]\"/>\n";
print "</td>\n";
print "</tr>\n";
print "</table>\n";
print "<table class=\"profile\">\n";
print "<tr class=\"folder_top\">";
print "<tr class=\"folder_top\"><td colspan=\"4\">".sprintf($strings['profile']['specific_data'], $strings['generic'][$type])."</td></tr>\n";
print "<tr>\n";
print emit_th($strings['profile']['serial']);
print emit_th($strings['profile']['purchased']);
print emit_th($strings['profile']['new']);
print emit_th($strings['generic']['access']);
print "</tr>\n";
print "<tr>\n";
print "<td><input type=\"text\" name=\"lens_serial_number\" value=\"$lens_current_value[7]\" /></td>\n";
$date_of_purchase= substr($lens_current_value[8], 0, 10);
print "<td>\n";
print emit_date_input_form("lens_purchase_timestamp", $date_of_purchase);
print "</td>\n";
print "<td>\n"; display_yes_no_combo("lens_purchased_new", $lens_current_value[9]); print "</td>\n";
print "<td>\n"; display_access_combo("lens_access_rights", $lens_current_value[10], ""); print "</td>\n";
print "</tr>\n";
print "</table>\n";
print $thm_elem['button.save.changes'];
print $thm_elem['button.clear'];
print $thm_elem['button.cancel'];
print "</form>\n";
theme_display_navigator_box_bottom("100%");
site_footer($database);
site_epilog($database);
?>

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,10 +17,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/profile.php";
;
include_once "include/common.php";
include_once "include/profile.php";
include_once "include/site.php";
@ -32,11 +29,11 @@ $all_countries = pg_query($database, "select identifier, value from country orde
site_header(sprintf($strings['profile']['add'], $strings['generic']['location']));
site_navigator(8);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php?", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['add'], $strings['generic']['location']), "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['add'], $strings['generic']['location']), "");
theme_display_navigator_box_top($profile_data['location']['idx'], $profile_data, "100%");
print "<form method=\"post\" action=\"location.add.2.php\">";
print "<form method=\"post\" action=\"location.add.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<table class=\"profile\">\n";
print "<tr>";
print emit_th($strings['generic']['location'], "width=\"30%\"");
@ -65,7 +62,7 @@ print $thm_elem['button.clear'];
print $thm_elem['button.cancel'];
print "</form>";
display_location($database, "*");
display_location($database, FALSE);
theme_display_navigator_box_bottom("100%");

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,11 +17,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
;
$location_id = pg_escape_string($_REQUEST['location']);
@ -32,9 +30,8 @@ if ($location_id!="") {
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from location where identifier=$location_id and users=$po_user[id]"));
if ($result[0] == 0) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
}
}
@ -44,6 +41,10 @@ if ($location_id!="") {
if (!$result) {
site_push_error($strings['errors']['db_insert_failed']);
}
if ($memcache) {
$memcache->delete("location_$location_id", $var);
}
}
site_epilog($database);

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,11 +17,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
;
include_once "include/common.php";
$database = site_prolog(PO_USER_TYPE_USER);
@ -31,9 +29,8 @@ $location_id = pg_escape_string($_REQUEST['item']);
if ($po_user['type'] != PO_USER_TYPE_ADMIN) {
$result = pg_fetch_row(pg_query($database, "select count(identifier) from location where identifier=$location_id and users=$po_user[id]"));
if ($result[0] == 0) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
}
}
@ -44,11 +41,11 @@ site_navigator(8);
$location = pg_fetch_row(pg_query($database, "select place, city, state, country, latitude, longitude from view_location where identifier='$location_id'"));
$number_of_references = pg_fetch_row(pg_query($database, "select number_of_location_references($location_id)"));
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['delete'], $strings['generic']['location']), "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['delete'], $strings['generic']['location']), "");
theme_display_navigator_box_top($profile_data['location']['idx'], $profile_data, "100%");
print "<form method=\"post\" action=\"location.del.2.php\">";
print "<form method=\"post\" action=\"location.del.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"location\" value=\"$location_id\" />";
print "<table class=\"profile\">\n";
print "<tr class=\"folder_top\">\n";

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -59,6 +59,10 @@ if ($location_id!="") {
if (!$result) {
site_push_error($strings['errors']['db_insert_failed']);
}
if ($memcache) {
$memcache->delete("location_$location_id", $var);
}
}
site_epilog($database);
header("Location: my.profile.php?selector=".$profile_data['location']['idx']);

View File

@ -1,7 +1,7 @@
<?php
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
// Copyright (C) 2005-2007 Solomon Peachy (pizza@shaftnet.org)
// Copyright (C) 2005-2008 Solomon Peachy (pizza@shaftnet.org)
// 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
@ -17,11 +17,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
include_once "include/config.php";
include_once "include/profile.php";
include_once "include/site.php";
;
include_once "include/common.php";
$database = site_prolog(PO_USER_TYPE_USER);
@ -35,9 +33,8 @@ $location = pg_fetch_row(pg_query($database, "select place, city, state, country
/* Ensure the user owns it !*/
if (($po_user['id'] != $location[7]) &&
($po_user['type'] != PO_USER_TYPE_ADMIN)) {
site_referer_error('not_owner');
site_epilog($database);
site_push_error($strings['errors']['not_owner']);
header("Location: login.php");
exit();
}
@ -45,11 +42,11 @@ $number_of_references = pg_fetch_row(pg_query($database, "select number_of_locat
site_header(sprintf($strings['profile']['edit'], $strings['generic']['location']));
site_navigator(8);
site_navigator_status(emit_a("user.php", $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['edit'], $strings['generic']['location']), "");
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic']['users'])." : ".emit_a("my.profile.php", $strings['generic']['my_profile'])." : ".sprintf($strings['profile']['edit'], $strings['generic']['location']), "");
theme_display_navigator_box_top($profile_data['location']['idx'], $profile_data, "100%");
print "<form method=\"post\" action=\"location.edit.2.php\">";
print "<form method=\"post\" action=\"location.edit.2.php\" accept-charset=\"".$strings['formats']['encoding']."\">";
print "<input type=\"hidden\" name=\"location\" value=\"$location_id\"/>";
print "<table class=\"profile\">\n";
print "<tr>";

Some files were not shown because too many files have changed in this diff Show More