Is anybody even reading this? I could write poems and stuff here.
Or why not even use this functionality as my daily blog. There are
dozens of means to not get heard.
You're reading this? Well. Have a nice weekend. :-)
through serendipity_admin_image_selector.php?serendipity[image]=X
- Integrate imageselectorplus plugin options for giving a target
to links
-
- TODO:
- New option for image_Selector to save a specific sized version
- (?fid=XXX&targetSize=XX)
- - Track referrers by image selector and store as property
+ (?serendipity[image]=X&serendipity[step]=showItem
+ &serendipity[resizeWidth]=X&serendipity[resizeHeight]=Y
+ - Track referrers by image selector and show them on detail
+ page
+ TODO:
- Move/rename images/directories (browse serendipity_entries to
fix up image paths [using <img src="..." />]. Also move ALL
images of a directory, like when moving s9y installations. Put
function serendipity_fetchReferences($id) {
global $serendipity;
- $query = "SELECT name,link FROM {$serendipity['dbPrefix']}references WHERE entry_id = '" . (int)$id . "'";
+ $query = "SELECT name,link FROM {$serendipity['dbPrefix']}references WHERE entry_id = '" . (int)$id . "' AND type = ''";
return serendipity_db_query($query);
}
serendipity_db_query("DELETE FROM {$serendipity["dbPrefix"]}entrycat WHERE entryid=$id");
serendipity_db_query("DELETE FROM {$serendipity["dbPrefix"]}entryproperties WHERE entryid=$id");
serendipity_db_query("DELETE FROM {$serendipity["dbPrefix"]}comments WHERE entry_id=$id");
- serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}references WHERE entry_id='$id'");
+ serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}references WHERE entry_id='$id' AND type = ''");
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}permalinks WHERE entry_id='$id'");
}
* @param string The directory to the image file
* @param string The target size of the thumbnail (2-dimensional array width,height)
* @param string Name of the thumbnail
+ * @param bool Store thumbnail in temporary place?
+ * @param bool Force enlarging of small images?
* @return array The result size of the thumbnail
*/
-function serendipity_makeThumbnail($file, $directory = '', $size = false, $thumbname = false) {
+function serendipity_makeThumbnail($file, $directory = '', $size = false, $thumbname = false, $is_temporary = false, $force_resize = false) {
global $serendipity;
if ($size === false) {
$infile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $directory . $file;
- $outfile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $directory . $f . '.' . $thumbname . '.' . $suf;
+ if ($is_temporary) {
+ $temppath = dirname($thumbname);
+ if (!is_dir($temppath)) {
+ @mkdir($temppath);
+ }
+ $outfile = $thumbname;
+ } else {
+ $outfile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $directory . $f . '.' . $thumbname . '.' . $suf;
+ }
$fdim = @serendipity_getimagesize($infile, '', $suf);
if (isset($fdim['noimage'])) {
$r = array(0, 0);
} else {
if ($serendipity['magick'] !== true) {
- $r = serendipity_resize_image_gd($infile, $outfile, $size);
+ if (is_array($size)) {
+ $r = serendipity_resize_image_gd($infile, $outfile, $size['width'], $size['height']);
+ } else {
+ $r = serendipity_resize_image_gd($infile, $outfile, $size);
+ }
} else {
- $r = array($size, $size);
- $newSize = $size . 'x' . $size;
+ if (is_array($size)) {
+ $r = $size;
+ } else {
+ $r = array('width' => $size, 'height' => $size);
+ }
+ $newSize = $r['width'] . 'x' . $r['height'];
if ($fdim['mime'] == 'application/pdf') {
$cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -flatten -scale '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile) .' '. serendipity_escapeshellarg($outfile . '.png');
} else {
- if ( serendipity_ini_bool(ini_get('safe_mode')) === false ) {
+ if (!$force_resize && serendipity_ini_bool(ini_get('safe_mode')) === false) {
$newSize .= '>'; // Tell imagemagick to not enlarge small images, only works if safe_mode is off (safe_mode turns > in to \>)
}
$cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -resize '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile) .' '. serendipity_escapeshellarg($outfile);
}
exec($cmd, $output, $result);
- if ( $result != 0 ) {
+ if ($result != 0) {
echo '<div class="serendipityAdminMsgError">'. sprintf(IMAGICK_EXEC_ERROR, $cmd, $output[0], $result) .'</div>';
$r = false; // return failure
} else {
$newheight = $newsizes[1];
}
+ if (is_null($newwidth)) {
+ $newsizes = serendipity_calculate_aspect_size($width, $height, null, $newheight);
+ $newwidth = $newsizes[0];
+ $newheight = $newsizes[1];
+ }
+
$out = imagecreatetruecolor($newwidth, $newheight);
/* Attempt to copy transparency information, this really only works for PNG */
* @param int Target width
* @return int Target height
*/
-function serendipity_calculate_aspect_size($width, $height, $newwidth) {
+function serendipity_calculate_aspect_size($width, $height, $orig_newwidth, $orig_newheight = null) {
// calculate aspect ratio
- $div_width = $width / $newwidth;
- $div_height = $height / $newwidth;
+ if (!is_null($orig_newheight)) {
+ $div_width = $width / $orig_newheight;
+ $div_height = $height / $orig_newheight;
+ } else {
+ $div_width = $width / $orig_newwidth;
+ $div_height = $height / $orig_newwidth;
+ }
if ($div_width <= 1 && $div_height <= 1) {
// do not scale small images where both sides are smaller than the thumbnail dimensions
$newheight = $height;
$newwidth = $width;
- } elseif ($div_width >= $div_height) {
+ } elseif (is_null($orig_newheight) && $div_width >= $div_height) {
// max width - calculate height, keep width as scaling base
$newheight = round($height / $div_width);
// make sure the height is at least 1 pixel for extreme images
$newheight = ($newheight >= 1 ? $newheight : 1);
- } else {
+ $newwidth = $orig_newwidth;
+ } elseif (is_null($orig_newwidth) && $div_width >= $div_height) {
+ // max width - calculate height, keep width as scaling base
+ $newwidth = round($width / $div_height);
+ // make sure the height is at least 1 pixel for extreme images
+ $newwidth = ($newwidth >= 1 ? $newwidth : 1);
+ $newheight = $orig_newheight;
+ } elseif (is_null($orig_newheight)) {
// max height - calculate width, keep height as scaling base
- $newheight = $newwidth;
+ $newheight = $orig_newwidth;
$newwidth = round($width / $div_height);
// make sure the width is at least 1 pixel for extreme images
$newwidth = ($newwidth >= 1 ? $newwidth : 1);
+ } else {
+ // max height - calculate width, keep height as scaling base
+ $newwidth = $orig_newheight;
+ $newheight = round($height / $div_width);
+ // make sure the width is at least 1 pixel for extreme images
+ $newheight = ($newheight >= 1 ? $newheight : 1);
}
return array($newwidth, $newheight);
$keywords = explode(';', $serendipity['mediaKeywords']);
}
+ $media['references'] = serendipity_db_query("SELECT link, name
+ FROM {$serendipity['dbPrefix']}references
+ WHERE entry_id = " . $media['id'] . "
+ AND type = 'media'
+ ORDER BY name DESC
+ LIMIT 15", false, 'assoc');
+ if (!is_array($media['references'])) {
+ $media['references'] = false;
+ }
+
foreach($dprops AS $prop) {
$type = 'input';
$parts = explode(':', trim($prop));
$query = "SELECT COUNT(id) FROM {$serendipity['dbPrefix']}references
WHERE entry_id = '". (int)$tmpid ."'
- AND link = '" . serendipity_db_escape_string($locations[$i]) . "'";
+ AND link = '" . serendipity_db_escape_string($locations[$i]) . "'
+ AND type = ''";
$row = serendipity_db_query($query, true, 'num');
if ($row[0] > 0) {
$checked_locations[$locations[$i]] = true; // Store trackbacked link so that no further trackbacks will be sent to the same link
}
}
- serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}references WHERE entry_id='" . (int)$tmpid . "'");
+ serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}references WHERE entry_id='" . (int)$tmpid . "' AND type = ''");
for ($i = 0; $i < $j; ++$i) {
$query = "INSERT INTO {$serendipity['dbPrefix']}references (entry_id, name, link) VALUES(";
'permission' => 'siteConfiguration',
'default' => true),
+ array('var' => 'dynamicResize',
+ 'title' => MEDIA_DYN_RESIZE,
+ 'description' => MEDIA_DYN_RESIZE_DESC,
+ 'type' => 'bool',
+ 'permission' => 'siteConfiguration',
+ 'default' => false),
+
array('var' => 'mediaExif',
'title' => MEDIA_EXIF,
'description' => MEDIA_EXIF_DESC,
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_cn.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_cn.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
/* vim: set sts=4 ts=4 expandtab : */
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_cs.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_cs.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translation (c) 2005 Josef Klimosz <ok2wo@centrum.cz>
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_cz.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_cz.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translation (c) 2004 Josef Klimosz <ok2wo@centrum.cz>
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_da.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_da.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translation (c) by Tom Sommer, <ts@dreamcoder.dk>
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_de.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_de.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translation (c) Jannis Hermanns, Garvin Hicking and others
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_en.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_en.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
/* vim: set sts=4 ts=4 expandtab : */
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_es.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_es.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translation (c) by Luis Cervantes <LuisCervantes@ono.com>,
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_fa.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_fa.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# this translation, translated by Omid Mottaghi <http://oxygenws.com>
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_fi.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_fi.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translation by Mauri Sahlberg <mos@iki.fi>
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_fr.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_fr.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translation by Sebastian Mordziol <argh@php-tools.net>
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_is.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_is.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translation by Örn Arnarson <orn@arnarson.net>
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_ja.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_ja.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translation (c) Tadashi Jokagi <elf2000@users.sourceforge.net>, 2004-2005.
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_ko.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_ko.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translated by: Wesley Hwang-Chung <wesley96@gmail.com>
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_nl.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_nl.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translation (c) by Christiaan Heerze <webmaster@heimp.nl>
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_no.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_no.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translation (c) by Jo Christian Oterhals <oterhals@gmail.com>
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_pt.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_pt.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translation (c) by Agner Olson <agner@agner.net>
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_ru.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_ru.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translation by Nightly <nightly@reys.net>
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_tn.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_tn.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translated by CapriSkye <admin@capriskye.com>
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_tw.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_tw.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
# Translated by CapriSkye <admin@capriskye.com>
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-<?php # $Id: serendipity_lang_zh.inc.php 1122 2006-04-19 11:07:47Z garvinhicking $
+<?php # $Id: serendipity_lang_zh.inc.php 1139 2006-04-21 10:56:07Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
/* vim: set sts=4 ts=4 expandtab : */
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
-@define('MEDIA_TARGET', 'Target for this link');
-@define('MEDIA_TARGET_JS', 'Popup window (via JavaScript, adaptive size)');
-@define('MEDIA_ENTRY', 'Isolated Entry');
-@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
+@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
+@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
+
if (empty($serendipity['encodeExitsCallback_entry_id'])) {
$this->links = array();
} else {
- $this->links = serendipity_db_query("SELECT id, link FROM {$serendipity['dbPrefix']}references WHERE entry_id = {$serendipity['encodeExitsCallback_entry_id']}", false, 'both', false, 'link', 'id');
+ $this->links = serendipity_db_query("SELECT id, link FROM {$serendipity['dbPrefix']}references WHERE entry_id = {$serendipity['encodeExitsCallback_entry_id']} AND type = ''", false, 'both', false, 'link', 'id');
}
foreach ($this->markup_elements as $temp) {
$is_out = (stristr($buffer[0], 'onmouseout=') !== false ? true : false);
$link = '<a%shref="%sexit.php?url%s=%s%s" ' . (!$is_title ? 'title="%s" ' : '%s') . (!$is_over ? ' onmouseover="window.status=\'%s\';return true;" ' : '%s') . (!$is_out ? 'onmouseout="window.status=\'\';return true;"' : '') . '%s>';
-
+
if (is_array($this->links) && !empty($this->links[$url])) {
return sprintf(
$link,
}
}
- $references = serendipity_db_query("SELECT link, max(name) as name FROM {$serendipity['dbPrefix']}references WHERE entry_id = " . $id . " GROUP BY link");
+ $references = serendipity_db_query("SELECT link, max(name) as name FROM {$serendipity['dbPrefix']}references WHERE entry_id = " . $id . " AND type = '' GROUP BY link");
if (is_array($references)) {
$links = '<ul style="margin: 5px; padding: 10px; text-align: left">';
foreach($references AS $key => $row) {
break;
case 'showItem':
+ serendipity_plugin_api::hook_event('frontend_media_showitem_init', $media);
+
+ if ($media['perm_denied']) {
+ break;
+ }
$media['case'] = 'showitem';
$file = serendipity_fetchImageFromDatabase((int)$serendipity['GET']['image']);
$media['file'] = &$file;
serendipity_prepareMedia($file);
+ $showfile = null;
+ if (($serendipity['GET']['resizeWidth'] || $serendipity['GET']['resizeHeight']) && $serendipity['dynamicResize'] && $media['file']['is_image']) {
+ $width = (int)$serendipity['GET']['resizeWidth'];
+ $height = (int)$serendipity['GET']['resizeHeight'];
+ if (empty($width)) {
+ $width = NULL;
+ }
+ if (empty($height)) {
+ $height = NULL;
+ }
+
+ $showfile = $serendipity['serendipityPath'] . PATH_SMARTY_COMPILE . '/mediacache/cache_img' . (int)$serendipity['GET']['image'] . '_' . $width . '_' . $height;
+
+ if (!file_exists($cachefile)) {
+ serendipity_makeThumbnail(
+ $media['file']['realname'],
+ $media['file']['path'],
+ array(
+ 'width' => $width,
+ 'height' => $height
+ ),
+ $showfile,
+ true
+ );
+ }
+ }
+
+ $hit = serendipity_db_query("SELECT id
+ FROM {$serendipity['dbPrefix']}references
+ WHERE link = '" . serendipity_db_escape_string($_SERVER['HTTP_REFERER']) . "'
+ AND entry_id = " . (int)$serendipity['GET']['image'] . "
+ AND type = 'media'", true, 'assoc');
+ if (!is_array($hit) || !isset($hit['id'])) {
+ serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}references
+ (entry_id, link, name, type)
+ VALUES (" . (int)$serendipity['GET']['image'] . ", '" . serendipity_db_escape_string($_SERVER['HTTP_REFERER']) . "', 1, 'media')");
+ } else {
+ serendipity_db_query("UPDATE {$serendipity['dbPrefix']}references
+ SET name = name + 1
+ WHERE id = " . (int)$hit['id']);
+ }
+
+ $curl = ($_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . ($_SERVER['HTTP_PORT'] != 80 ? ':' . $_SERVER['HTTP_PORT'] : '');
+ switch($serendipity['GET']['show']) {
+ case 'redirect':
+ header('Location: ' . $curl . $file['links']['imagelinkurl']);
+ exit;
+ break;
+
+ case 'redirectThumb':
+ header('Location: ' . $curl . $file['show_thumb']);
+ exit;
+ break;
+
+ case 'full':
+ $showfile = $file['realfile'];
+ break;
+
+ case 'thumb':
+ $showfile = $file['location'];
+ break;
+ }
+
+ if (!empty($showfile) && file_exists($showfile)) {
+ header('Content-Type: ' . $file['displaymime']);
+ header('Content-Length: ' . filesize($showfile));
+ $fp = fopen($showfile, 'rb');
+ fpassthru($fp);
+ exit;
+ }
+
$media['file']['props'] =& serendipity_fetchMediaProperties((int)$serendipity['GET']['image']);
serendipity_plugin_api::hook_event('media_getproperties_cached', $media['file']['props']['base_metadata'], $media['file']['realfile']);
{/foreach}
</dl>
</div>
+
+ {if $file.references}
+ <h3>{$CONST.REFERER}</h3>
+ <ul>
+ {foreach from=$file.references item="ref"}
+ <li>({$ref.name|@escape}) <a rel="nofollow" href="{$ref.link|@escape}">{$ref.link|@default:$CONST.NONE|@escape}</a></li>
+ {/foreach}
+ </ul>
+ {/if}
{/if}
{if $media.enclose AND (($smarty.foreach.mediafiles.iteration % $media.lineBreak) == 0)}
</dl>
</div>
{/if}
+
+ {if $media.file.references}
+ <h3>{$CONST.REFERER}</h3>
+ <ul>
+ {foreach from=$media.file.references item="ref"}
+ <li>({$ref.name|@escape}) <a rel="nofollow" href="{$ref.link|@escape}">{$ref.link|@default:$CONST.NONE|@escape}</a></li>
+ {/foreach}
+ </ul>
+ {/if}
</div>
</div>
</div>