Most recent edit on 2008-07-13 09:01:42 by BovieRtral [http://patrickprestrid.freeweb7.com/20080405-adolfos-house.htm]
Additions:
[adolfos house|http://patrickprestrid.freeweb7.com/20080405-adolfos-house.htm∞] adolfos house∞ [http://patrickprestrid.freeweb7.com/20080405-adolfos-house.htm|adolfos∞ house] ((http://patrickprestrid.freeweb7.com/20080405-adolfos-house.htm∞ adolfos house)) | adolfos house∞ "adolfos house":http://patrickprestrid.freeweb7.com/20080405-adolfos-house.htm∞ [average colorado rainfall|http://patrickprestrid.freeweb7.com/20080405-average-colorado.htm∞] average colorado rainfall∞ [http://patrickprestrid.freeweb7.com/20080405-average-colorado.htm|average∞ colorado rainfall] ((http://patrickprestrid.freeweb7.com/20080405-average-colorado.htm∞ average colorado rainfall)) | average colorado rainfall∞ "average colorado rainfall":http://patrickprestrid.freeweb7.com/20080405-average-colorado.htm∞ [with you jessica simpson|http://patrickprestrid.freeweb7.com/20080405-with-you-jessica.htm∞] with you jessica simpson∞ [http://patrickprestrid.freeweb7.com/20080405-with-you-jessica.htm|with∞ you jessica simpson] ((http://patrickprestrid.freeweb7.com/20080405-with-you-jessica.htm∞ with you jessica simpson)) | with you jessica simpson∞ "with you jessica simpson":http://patrickprestrid.freeweb7.com/20080405-with-you-jessica.htm∞ [constellation map zodiac|http://patrickprestrid.freeweb7.com/20080412-constellation.htm∞] constellation map zodiac∞ [http://patrickprestrid.freeweb7.com/20080412-constellation.htm|constellation∞ map zodiac] ((http://patrickprestrid.freeweb7.com/20080412-constellation.htm∞ constellation map zodiac)) | constellation map zodiac∞ "constellation map zodiac":http://patrickprestrid.freeweb7.com/20080412-constellation.htm∞ [hoodia slim|http://patrickprestrid.freeweb7.com/20080407-hoodia-slim.htm∞] hoodia slim∞ [http://patrickprestrid.freeweb7.com/20080407-hoodia-slim.htm|hoodia∞ slim] ((http://patrickprestrid.freeweb7.com/20080407-hoodia-slim.htm∞ hoodia slim)) | hoodia slim∞ "hoodia slim":http://patrickprestrid.freeweb7.com/20080407-hoodia-slim.htm∞
InsÃÂérer une miniature plutot qu'une image
Il est parfois utile d'insÃÂérer une miniature dans un texte, plutot qu'une image complÃÂète. C'est possible en modifiant la fonction line_file dans le fichier manager/xmedia.php
La fonction modifiÃÂée insÃÂère une nouvelle icÃÂône pour chaque image (basÃÂée sur ico_image.png)
CrÃÂéer automatiquement un lien vers l'original
Une miniature est gÃÂénÃÂéralement utilisÃÂée afin de pouvoir crÃÂéer un lien vers l'image en grande taille. Pour nous simplifier la vie, nous allons faire en sorte que ce lien soit automatiquement insÃÂérÃÂé dans l'article lorsque l'on dÃÂécide d'utiliser la miniature.
Puis, dans la nouvelle fonction line_file du fichier modifiÃÂé /manager/xmedia.php/ nous devons changer une ligne.
Deletions:
Insérer une miniature plutot qu'une image
Il est parfois utile d'insérer une miniature dans un texte, plutot qu'une image complète. C'est possible en modifiant la fonction line_file dans le fichier manager/xmedia.php
La fonction modifiée insère une nouvelle icône pour chaque image (basée sur ico_image.png)
Créer automatiquement un lien vers l'original
Une miniature est généralement utilisée afin de pouvoir créer un lien vers l'image en grande taille. Pour nous simplifier la vie, nous allons faire en sorte que ce lien soit automatiquement inséré dans l'article lorsque l'on décide d'utiliser la miniature.
Puis, dans la nouvelle fonction line_file du fichier modifié /manager/xmedia.php/ nous devons changer une ligne.
Edited on 2008-07-11 02:01:28 by BovieRtral [troclidelli]
Additions:
monlitr
Insérer une miniature plutot qu'une image
Il est parfois utile d'insérer une miniature dans un texte, plutot qu'une image complète. C'est possible en modifiant la fonction line_file dans le fichier manager/xmedia.php
La fonction modifiée insère une nouvelle icône pour chaque image (basée sur ico_image.png)
Créer automatiquement un lien vers l'original
Une miniature est généralement utilisée afin de pouvoir créer un lien vers l'image en grande taille. Pour nous simplifier la vie, nous allons faire en sorte que ce lien soit automatiquement inséré dans l'article lorsque l'on décide d'utiliser la miniature.
Puis, dans la nouvelle fonction line_file du fichier modifié /manager/xmedia.php/ nous devons changer une ligne.
Deletions:
Insérer une miniature plutot qu'une image
Il est parfois utile d'insérer une miniature dans un texte, plutot qu'une image complète. C'est possible en modifiant la fonction line_file dans le fichier manager/xmedia.php
La fonction modifiée insère une nouvelle icône pour chaque image (basée sur ico_image.png)
Créer automatiquement un lien vers l'original
Une miniature est généralement utilisée afin de pouvoir créer un lien vers l'image en grande taille. Pour nous simplifier la vie, nous allons faire en sorte que ce lien soit automatiquement inséré dans l'article lorsque l'on décide d'utiliser la miniature.
Puis, dans la nouvelle fonction line_file du fichier modifié /manager/xmedia.php/ nous devons changer une ligne.
Edited on 2007-11-10 20:25:21 by DelelTvare
Additions:
ererbas
Insérer une miniature plutot qu'une image
Il est parfois utile d'insérer une miniature dans un texte, plutot qu'une image complète. C'est possible en modifiant la fonction line_file dans le fichier manager/xmedia.php
La fonction modifiée insère une nouvelle icône pour chaque image (basée sur ico_image.png)
Créer automatiquement un lien vers l'original
Une miniature est généralement utilisée afin de pouvoir créer un lien vers l'image en grande taille. Pour nous simplifier la vie, nous allons faire en sorte que ce lien soit automatiquement inséré dans l'article lorsque l'on décide d'utiliser la miniature.
Puis, dans la nouvelle fonction line_file du fichier modifié /manager/xmedia.php/ nous devons changer une ligne.
Deletions:
Insérer une miniature plutot qu'une image
Il est parfois utile d'insérer une miniature dans un texte, plutot qu'une image complète. C'est possible en modifiant la fonction line_file dans le fichier manager/xmedia.php
La fonction modifiée insère une nouvelle icône pour chaque image (basée sur ico_image.png)
Créer automatiquement un lien vers l'original
Une miniature est généralement utilisée afin de pouvoir créer un lien vers l'image en grande taille. Pour nous simplifier la vie, nous allons faire en sorte que ce lien soit automatiquement inséré dans l'article lorsque l'on décide d'utiliser la miniature.
Puis, dans la nouvelle fonction line_file du fichier modifié /manager/xmedia.php/ nous devons changer une ligne.
Edited on 2007-07-01 14:56:40 by LuigiBrosse
Additions:
.'<p class="legend action">'.$send_thumb.' '.$create_thumb.' '.$delete_link.'</p>'
Deletions:
.'<p class="legend action">'.$create_thumb.' '.$delete_link.'</p>'
Edited on 2007-06-26 13:21:06 by LuigiBrosse [Update to work with 1.2]
Additions:
global $mode, $up_dir, $_PX_website_config, $m,
$px_gd_version, $env, $_px_theme;
$is_image = isImage($name);
$is_file = !$is_image;
$ext = getFileExtension($name);
break;
$is_dir = true;
break;
$is_updir = true;
break;
contains the height/width of the image or the size of
the file, nothing if an image and impossible to get the size
$file_size =
;
$send_thumb=;
insertThumbnailModification
$url2=; insertThumbnailModification
$action_link2=;
insertThumbnailModification
$icons_dir = config::f('manager_path').'/themes/'
.$_px_theme.'/images/icons/';
$delete_link = '<a href="xmedia.php?dir='.rawurlencode($current_dir)
.'&file='.rawurlencode($current_dir.$name).'&del=1&mode='
.$mode.'&env='.$env.'" title="'. ('Delete')
.'" onclick="return window.confirm(\
. ('Are you sure you want to delete this file?')
.'\')"><img src="themes/'.$_px_theme.'/images/delete.png" alt="'
.('Delete').'" /></a>';
$siz = @getimagesize(config::f('xmedia_root').'/'.$current_dir.$name);
if ($siz ! false && 'html'
$m->user->getPref('content_format')) {
HTML format
$file_size = ('<strong>size</strong>:').' '.$siz[3];
} elseif ($siz !
false) {
wiki format
$file_size = ('<strong>size</strong>:').' '.$siz[0].'x'.$siz[1];
size in kb
$file_size = ('<strong>size</strong>:').' '
.prettySize(filesize(config::f('xmedia_root').'/'
.$current_dir.$name));
call from the popup
$act = ($is_image) ? 'img' : 'file';
$action_link = '<a href="#" '
.'onclick="insertImage(window.opener.document,\.$url
.'\',\.$act.'\',\
.addslashes(('Title of the file or image:')).'\'); '
.'window.close(); return false;">%s</a>';
$action_link = '<a href="xmedia.php?dir='.$current_dir.$slash
.'&mode='.$mode.'">%s</a>';
call from the "normal" list of files page
$action_link = '<a href="http://'.config::f('domain').$url.'">%s</a>';
if (file_exists($up_dir.'/thumb/'.md5($current_dir.$name).'.jpg')) {
thumbnail exists
$th = sprintf($action_link,
'<img class="thumbnail" src="'
.www::getManagedWebsiteUrl()
.config::f('rel_url_files')
.'/thumb/'.md5($current_dir.$name).'.jpg" alt= />'
);
if ($mode == 'popup') { //insertThumbnailModification
$url2=config::f('rel_url_files').'/thumb/'.md5($current_dir.$name).'.jpg'; //insertThumbnailModification
$action_link2 = '%s'; //insertThumbnailModification
$send_thumb= sprintf($action_link2,'
'); //insertThumbnailModification
}
} elseif ($is_image && $px_gd_version) {
//image without thumbnail
if (file_exists($icons_dir.$ext.'-dist.png')) {
$img = 'themes/'.$_px_theme.'/images/icons/'.$ext.'-dist.png';
} else {
$img = 'themes/'.$_px_theme.'/images/icons/default-dist.png';
}
$th = sprintf($action_link,
'
/>');
$create_thumb = '<a href="xmedia.php?dir='
.rawurlencode($current_dir).'&file='
.rawurlencode($current_dir.$name).'&thumb=1&mode='
.$mode.'&env='.$env.'" title="'
.('Try to create the thumbnail').'"><img src="themes/'
.$_px_theme.'/images/ico_createthumb.png" alt="'
.('Try to create the thumbnail').'" /></a>';
normal file
$ext = getFileExtension($name);
if (file_exists($icons_dir.$ext.'-dist.png')) {
$img = 'themes/'.$_px_theme.'/images/icons/'.$ext.'-dist.png';
} else {
$img = 'themes/'.$_px_theme.'/images/icons/default-dist.png';
}
$th = sprintf($action_link,
'<img class="thumbnailicon" src="'.$img
.'" alt= />');
$res = ''."\n"
.'
'.$create_thumb.' '.$delete_link.'
'
."\n".'
'.$th.'
'."\n".'
'
.sprintf($action_link,$name).'
'."\n".$file_size.'
'."\n"
.'
'."\n"; //insertThumbnailModification
$ico = ($is_dir) ? 'ico_folder.png' : 'ico_folder_up.png';
$img = 'themes/'.$_px_theme.'/images/'.$ico;
$th = sprintf($action_link,
'
/>');
$res = '<div class="icon">'."\n"
.'<p class="icon">'.$th.'</p>'."\n"
.'<p class="legend">'.sprintf($action_link,$name).'</p>'."\n"
.'</div>'."\n";
if (tb && format != 'wiki') {
tb.syncContents('iframe');
if (tb && format != 'wiki') {
tb.syncContents('textarea');
Deletions:
global $mode, $up_dir, $_PX_website_config, $m, $px_gd_version, $env, $_px_theme;
$is_image = isImage($name);
$is_file = !$is_image;
$ext = getFileExtension($name);
break;
$is_dir = true;
break;
$is_updir = true;
break;
$file_size = ; contains the height/width of the image or the size of the file, nothing
if an image and impossible to get the size
$send_thumb=;
$url2=;
$action_link2=;
$icons_dir = $GLOBALS['_PX_config']['manager_path'] . '/themes/'.$_px_theme.'/images/icons/';
$delete_link = '<a href="xmedia.php?dir='.rawurlencode($current_dir).'&file='.rawurlencode($current_dir.$name).'&del=1&mode='.$mode.'&env='.$env.'" '.
'title="'. ('Delete').'" onclick="return window.confirm(\. ('Are you sure you want to delete this file?').'\')"><img src="themes/'.$_px_theme.'/images/delete.png" alt="'. ('Delete').'" /></a>';
$siz = @getimagesize($_PX_website_config['xmedia_root'].'/'.$current_dir.$name);
if ($siz !
false && 'html'
$m->user->getPref('content_format')) {
HTML format
$file_size = ('<strong>size</strong>:') .' '.$siz[3];
} elseif ($siz !
false) {
wiki format
$file_size = ('<strong>size</strong>:') .' '.$siz[0].'x'.$siz[1];
}
size in kb
$file_size = ('<strong>size</strong>:') .' '.prettySize(filesize($_PX_website_config['xmedia_root'].'/'.$current_dir.$name));
call from the popup
$act = ($is_image) ? 'img' : 'file';
$action_link = '<a href="#" '.
'onclick="insertImage(window.opener.document,\.$url.'\',\.$act.'\',\.addslashes( ('Title of the file or image:')).'\'); '.
'window.close(); return false;">%s</a>';
$action_link = '<a href="xmedia.php?dir='.$current_dir.$slash.'&mode='.$mode.'">%s</a>';
call from the "normal" list of files page
$action_link = '<a href="http://'.$_PX_website_config['domain'].$url.'">%s</a>';
if (file_exists($up_dir.'/thumb/'.md5($current_dir.$name).'.jpg')) {
thumbnail exists
$th = sprintf($action_link,
'<img class="thumbnail" '.
'src="
.'.jpg)
" alt= />');
if ($mode == 'popup') {
$url2=$_PX_website_config['rel_url_files'].'/thumb/'.md5($current_dir.$name).'.jpg';
$action_link2 = '
%s';
$send_thumb= sprintf($action_link2,'

');
}
} elseif ($is_image && $px_gd_version) {
//image without thumbnail
if (file_exists($icons_dir.$ext.'-dist.png')) {
$img = 'themes/'.$_px_theme.'/images/icons/'.$ext.'-dist.png';
} else {
$img = 'themes/'.$_px_theme.'/images/icons/default-dist.png';
}
$th = sprintf($action_link, '

/>');
$create_thumb = '<a href="xmedia.php?dir='.rawurlencode($current_dir).'&file='.rawurlencode($current_dir.$name).
'&thumb=1&mode='.$mode.'&env='.$env.'" title="'.('Try to create the thumbnail').'"><img src="themes/'.$_px_theme.'/images/ico_createthumb.png" alt="'.
('Try to create the thumbnail').'" /></a>';
} else {
normal file
$ext = getFileExtension($name);
if (file_exists($icons_dir.$ext.'-dist.png')) {
$img = 'themes/'.$_px_theme.'/images/icons/'.$ext.'-dist.png';
} else {
$img = 'themes/'.$_px_theme.'/images/icons/default-dist.png';
}
$th = sprintf($action_link, '<img class="thumbnailicon" src="'.$img.'" alt= />');
}
$res = ''."\n".
'
'.$send_thumb.' '.$create_thumb.' '.$delete_link.'
'."\n".
'
'.$th.'
'."\n".
'
'.sprintf($action_link,$name).'
'."\n".
$file_size.'
'."\n".
'
'."\n";
$ico = ($is_dir) ? 'ico_folder.png' : 'ico_folder_up.png';
$img = 'themes/'.$_px_theme.'/images/'.$ico;
$th = sprintf($action_link, '
/>');
$res = '<div class="icon">'."\n".
'<p class="icon">'.$th.'</p>'."\n".
'<p class="legend">'.sprintf($action_link,$name).'</p>'."\n".
'</div>'."\n";
Edited on 2007-06-24 06:10:11 by LuigiBrosse [Page distroyed - reuse oldest correct version]
Additions:
$delete_link = '<a href="xmedia.php?dir='.rawurlencode($current_dir).'&file='.rawurlencode($current_dir.$name).'&del=1&mode='.$mode.'&env='.$env.'" '.
'title="'. ('Delete').'" onclick="return window.confirm(\. ('Are you sure you want to delete this file?').'\')"><img src="themes/'.$_px_theme.'/images/delete.png" alt="'. ('Delete').'" /></a>';
Get size of the file in $file_size format ready to be displayed
if ($is_image) {
$siz = @getimagesize($_PX_website_config['xmedia_root'].'/'.$current_dir.$name);
if ($siz !
false && 'html'
$m->user->getPref('content_format')) {
HTML format
$file_size = ('<strong>size</strong>:') .' '.$siz[3];
} elseif ($siz !
false) {
wiki format
$file_size = ('<strong>size</strong>:') .' '.$siz[0].'x'.$siz[1];
}
} elseif ($is_file) {
size in kb
$file_size = ('<strong>size</strong>:') .' '.prettySize(filesize($_PX_website_config['xmedia_root'].'/'.$current_dir.$name));
if ($mode
'popup' && ($is_image || $is_file)) {
call from the popup
$act = ($is_image) ? 'img' : 'file';
$action_link = '<a href="#" '.
'onclick="insertImage(window.opener.document,\.$url.'\',\.$act.'\',\.addslashes( ('Title of the file or image:')).'\'); '.
'window.close(); return false;">%s</a>';
} elseif ($is_dir || $is_updir) {
$slash = ($is_dir) ? '/' : ;
$action_link = '<a href="xmedia.php?dir='.$current_dir.$slash.'&mode='.$mode.'">%s</a>';
} else {
call from the "normal" list of files page
$action_link = '<a href="http://'.$_PX_website_config['domain'].$url.'">%s</a>';
create the thumbnail link
if ($is_file || $is_image) {
if (file_exists($up_dir.'/thumb/'.md5($current_dir.$name).'.jpg')) {
thumbnail exists
$th = sprintf($action_link,
'<img class="thumbnail" '.
'src="
.'.jpg)
" alt= />');
if ($mode == 'popup') {
$url2=$_PX_website_config['rel_url_files'].'/thumb/'.md5($current_dir.$name).'.jpg';
$action_link2 = '
%s';
$send_thumb= sprintf($action_link2,'

');
}
} elseif ($is_image && $px_gd_version) {
//image without thumbnail
if (file_exists($icons_dir.$ext.'-dist.png')) {
$img = 'themes/'.$_px_theme.'/images/icons/'.$ext.'-dist.png';
} else {
$img = 'themes/'.$_px_theme.'/images/icons/default-dist.png';
}
$th = sprintf($action_link, '

/>');
$create_thumb = '<a href="xmedia.php?dir='.rawurlencode($current_dir).'&file='.rawurlencode($current_dir.$name).
'&thumb=1&mode='.$mode.'&env='.$env.'" title="'.('Try to create the thumbnail').'"><img src="themes/'.$_px_theme.'/images/ico_createthumb.png" alt="'.
('Try to create the thumbnail').'" /></a>';
} else {
normal file
$ext = getFileExtension($name);
if (file_exists($icons_dir.$ext.'-dist.png')) {
$img = 'themes/'.$_px_theme.'/images/icons/'.$ext.'-dist.png';
} else {
$img = 'themes/'.$_px_theme.'/images/icons/default-dist.png';
}
$th = sprintf($action_link, '<img class="thumbnailicon" src="'.$img.'" alt= />');
}
$res = ''."\n".
'
'.$send_thumb.' '.$create_thumb.' '.$delete_link.'
'."\n".
'
'.$th.'
'."\n".
'
'.sprintf($action_link,$name).'
'."\n".
$file_size.'
'."\n".
'
'."\n";
} elseif ($is_dir || $is_updir) {
$ico = ($is_dir) ? 'ico_folder.png' : 'ico_folder_up.png';
$img = 'themes/'.$_px_theme.'/images/'.$ico;
$th = sprintf($action_link, '
/>');
$res = '<div class="icon">'."\n".
'<p class="icon">'.$th.'</p>'."\n".
'<p class="legend">'.sprintf($action_link,$name).'</p>'."\n".
'</div>'."\n";
return $res;
}
=====Automatically link the thumbnail to the original picture=====
A thumbnail is generally used in order to create a link to the picture at the original size. To make the edition of a ressource easier, this link will be automatically inserted in the form while we use the thumbnail.
=====Créer automatiquement un lien vers l'original=====
Une miniature est généralement utilisée afin de pouvoir créer un lien vers l'image en grande taille. Pour nous simplifier la vie, nous allons faire en sorte que ce lien soit automatiquement inséré dans l'article lorsque l'on décide d'utiliser la miniature.
First, we have to modify the file ///manager/tools.js/// and add the function //insertThumbLinked//
Pour cela, nous devons tout d'abord modifier le fichier ///manager/tools.js/// et ajouter la fonction //insertThumbLinked//
function insertThumbLinked(origine,urlThumb,url,text,textLink)
form = origine.forms['formPost'];
if (form.n_content_format) format = form.n_content_format.value;
else if (form.a_description_format) format = form.a_description_format.value;
else if (form.a_page_content_format) format = form.a_page_content_format.value;
else if (form.c_format) format = form.c_format.value;
title = window.prompt(text);
if (format == 'wiki')
{
if (title != '') {
image = '[(('+urlThumb+'|'+title+'))|'+url+'||'+textLink+']';
} else {
image = '[(('+urlThumb+'))|'+url+'||'+textLink+']';
}
else
{
image = '<p><a href="'+url+'" title="'+textLink+'"><img src="'+urlThumb+'" alt="'+title+'" /></a></p>';
image = "\n\n"+image;
if (form.n_content) form.n_content.value += image;
else if (form.a_description) form.a_description.value += image;
else if (form.a_page_content) form.a_page_content.value += image;
else if (form.c_description) form.c_description.value += image;
}
Then, in the new function line_file of the modified file /manager/xmedia.php/ we have to change one line.
Puis, dans la nouvelle fonction line_file du fichier modifié /manager/xmedia.php/ nous devons changer une ligne.
Original Line :
'onclick="insertImage(window.opener.document,\.$url2.'\',\
.$act.'\',\.addslashes( ('Title of the file or image:')).'\'); '.
''Modified Line :''
'onclick="insertThumbLinked(window.opener.document,\''.$url2.'\',\''.$url.'\',\''.addslashes( __('Title of the file or image:')).'\',\''.addslashes( __('Enlarge the image')).'\'); '.
You will have to add a translation for "Enlarge the image
" in translation file.
Il faut ajouter la traduction pour "Enlarge the image
" dans le fichier de traduction.
code original par Damdam et Josselin
Deletions:
$delete_link = '<a href="xmedia.php?dir='.rawurlencode($current_dir).'
Edited on 2007-04-19 20:52:36 by ShqDwq
Additions:
$delete_link = '<a href="xmedia.php?dir='.rawurlencode($current_dir).'
Deletions:
$delete_link = '<a href="xmedia.php?dir='.rawurlencode($current_dir).'&file='.rawurlencode($current_dir.$name).'&del=1&mode='.$mode.'&env='.$env.'" '.
'title="'. ('Delete').'" onclick="return window.confirm(\. ('Are you sure you want to delete this file?').'\')"><img src="themes/'.$_px_theme.'/images/delete.png" alt="'. ('Delete').'" /></a>';
Get size of the file in $file_size format ready to be displayed
if ($is_image) {
$siz = @getimagesize($_PX_website_config['xmedia_root'].'/'.$current_dir.$name);
if ($siz !
false && 'html'
$m->user->getPref('content_format')) {
HTML format
$file_size = ('<strong>size</strong>:') .' '.$siz[3];
} elseif ($siz !
false) {
wiki format
$file_size = ('<strong>size</strong>:') .' '.$siz[0].'x'.$siz[1];
}
} elseif ($is_file) {
size in kb
$file_size = ('<strong>size</strong>:') .' '.prettySize(filesize($_PX_website_config['xmedia_root'].'/'.$current_dir.$name));
if ($mode
'popup' && ($is_image || $is_file)) {
call from the popup
$act = ($is_image) ? 'img' : 'file';
$action_link = '<a href="#" '.
'onclick="insertImage(window.opener.document,\.$url.'\',\.$act.'\',\.addslashes( ('Title of the file or image:')).'\'); '.
'window.close(); return false;">%s</a>';
} elseif ($is_dir || $is_updir) {
$slash = ($is_dir) ? '/' : ;
$action_link = '<a href="xmedia.php?dir='.$current_dir.$slash.'&mode='.$mode.'">%s</a>';
} else {
call from the "normal" list of files page
$action_link = '<a href="http://'.$_PX_website_config['domain'].$url.'">%s</a>';
create the thumbnail link
if ($is_file || $is_image) {
if (file_exists($up_dir.'/thumb/'.md5($current_dir.$name).'.jpg')) {
thumbnail exists
$th = sprintf($action_link,
'<img class="thumbnail" '.
'src="
.'.jpg)
" alt= />');
if ($mode == 'popup') {
$url2=$_PX_website_config['rel_url_files'].'/thumb/'.md5($current_dir.$name).'.jpg';
$action_link2 = '
%s';
$send_thumb= sprintf($action_link2,'

');
}
} elseif ($is_image && $px_gd_version) {
//image without thumbnail
if (file_exists($icons_dir.$ext.'-dist.png')) {
$img = 'themes/'.$_px_theme.'/images/icons/'.$ext.'-dist.png';
} else {
$img = 'themes/'.$_px_theme.'/images/icons/default-dist.png';
}
$th = sprintf($action_link, '

/>');
$create_thumb = '<a href="xmedia.php?dir='.rawurlencode($current_dir).'&file='.rawurlencode($current_dir.$name).
'&thumb=1&mode='.$mode.'&env='.$env.'" title="'.('Try to create the thumbnail').'"><img src="themes/'.$_px_theme.'/images/ico_createthumb.png" alt="'.
('Try to create the thumbnail').'" /></a>';
} else {
normal file
$ext = getFileExtension($name);
if (file_exists($icons_dir.$ext.'-dist.png')) {
$img = 'themes/'.$_px_theme.'/images/icons/'.$ext.'-dist.png';
} else {
$img = 'themes/'.$_px_theme.'/images/icons/default-dist.png';
}
$th = sprintf($action_link, '<img class="thumbnailicon" src="'.$img.'" alt= />');
}
$res = ''."\n".
'
'.$send_thumb.' '.$create_thumb.' '.$delete_link.'
'."\n".
'
'.$th.'
'."\n".
'
'.sprintf($action_link,$name).'
'."\n".
$file_size.'
'."\n".
'
'."\n";
} elseif ($is_dir || $is_updir) {
$ico = ($is_dir) ? 'ico_folder.png' : 'ico_folder_up.png';
$img = 'themes/'.$_px_theme.'/images/'.$ico;
$th = sprintf($action_link, '
/>');
$res = '<div class="icon">'."\n".
'<p class="icon">'.$th.'</p>'."\n".
'<p class="legend">'.sprintf($action_link,$name).'</p>'."\n".
'</div>'."\n";
return $res;
}
=====Automatically link the thumbnail to the original picture=====
A thumbnail is generally used in order to create a link to the picture at the original size. To make the edition of a ressource easier, this link will be automatically inserted in the form while we use the thumbnail.
=====Créer automatiquement un lien vers l'original=====
Une miniature est généralement utilisée afin de pouvoir créer un lien vers l'image en grande taille. Pour nous simplifier la vie, nous allons faire en sorte que ce lien soit automatiquement inséré dans l'article lorsque l'on décide d'utiliser la miniature.
First, we have to modify the file ///manager/tools.js/// and add the function //insertThumbLinked//
Pour cela, nous devons tout d'abord modifier le fichier ///manager/tools.js/// et ajouter la fonction //insertThumbLinked//
function insertThumbLinked(origine,urlThumb,url,text,textLink)
form = origine.forms['formPost'];
if (form.n_content_format) format = form.n_content_format.value;
else if (form.a_description_format) format = form.a_description_format.value;
else if (form.a_page_content_format) format = form.a_page_content_format.value;
else if (form.c_format) format = form.c_format.value;
title = window.prompt(text);
if (format == 'wiki')
{
if (title != '') {
image = '[(('+urlThumb+'|'+title+'))|'+url+'||'+textLink+']';
} else {
image = '[(('+urlThumb+'))|'+url+'||'+textLink+']';
}
else
{
image = '<p><a href="'+url+'" title="'+textLink+'"><img src="'+urlThumb+'" alt="'+title+'" /></a></p>';
image = "\n\n"+image;
if (form.n_content) form.n_content.value += image;
else if (form.a_description) form.a_description.value += image;
else if (form.a_page_content) form.a_page_content.value += image;
else if (form.c_description) form.c_description.value += image;
}
Then, in the new function line_file of the modified file /manager/xmedia.php/ we have to change one line.
Puis, dans la nouvelle fonction line_file du fichier modifié /manager/xmedia.php/ nous devons changer une ligne.
Original Line :
'onclick="insertImage(window.opener.document,\.$url2.'\',\
.$act.'\',\.addslashes( ('Title of the file or image:')).'\'); '.
''Modified Line :''
'onclick="insertThumbLinked(window.opener.document,\''.$url2.'\',\''.$url.'\',\''.addslashes( __('Title of the file or image:')).'\',\''.addslashes( __('Enlarge the image')).'\'); '.
You will have to add a translation for "Enlarge the image
" in translation file.
Il faut ajouter la traduction pour "Enlarge the image
" dans le fichier de traduction.
code original par Damdam et Josselin
Edited on 2006-02-05 09:44:41 by RobbyBuffy
Deletions:
(testé OK sur Plume v1.0.2 par robby nekodesign.net∞)
Edited on 2005-05-28 04:38:27 by RobbyBuffy
Additions:
code original par Damdam et Josselin
Edited on 2005-05-28 04:36:47 by RobbyBuffy
Additions:
(testé OK sur Plume v1.0.2 par robby nekodesign.net∞)
Deletions:
(testé OK sur Plume v1.0.2 par "robby")
Edited on 2005-05-28 04:30:11 by RobbyBuffy
Additions:
(testé OK sur Plume v1.0.2 par "robby")
Edited on 2005-05-12 10:32:25 by JosselinJaffres
Additions:
A thumbnail is generally used in order to create a link to the picture at the original size. To make the edition of a ressource easier, this link will be automatically inserted in the form while we use the thumbnail.
Deletions:
A thumbnail is generally used in order to create a link to the picture at the original size. To simplify the edition of a ressource, this link will be automatically inserted in the form while we use the thumbnail.
Edited on 2005-04-19 10:30:45 by CedricArrabie [Ajout de la coloration syntaxique]
Additions:
/* Line to display a file */
(php)
Original Line :
''Modified Line :''
(php)
Deletions:
%%/* Line to display a file */
Original Line :
Modified Line :
Edited on 2005-04-19 08:14:06 by JosselinJaffres
Additions:
Automatically link the thumbnail to the original picture
A thumbnail is generally used in order to create a link to the picture at the original size. To simplify the edition of a ressource, this link will be automatically inserted in the form while we use the thumbnail.
Créer automatiquement un lien vers l'original
Une miniature est généralement utilisée afin de pouvoir créer un lien vers l'image en grande taille. Pour nous simplifier la vie, nous allons faire en sorte que ce lien soit automatiquement inséré dans l'article lorsque l'on décide d'utiliser la miniature.
First, we have to modify the file /manager/tools.js/ and add the function insertThumbLinked
Pour cela, nous devons tout d'abord modifier le fichier /manager/tools.js/ et ajouter la fonction insertThumbLinked
function insertThumbLinked(origine,urlThumb,url,text,textLink)
form = origine.forms['formPost'];
if (form.n_content_format) format = form.n_content_format.value;
else if (form.a_description_format) format = form.a_description_format.value;
else if (form.a_page_content_format) format = form.a_page_content_format.value;
else if (form.c_format) format = form.c_format.value;
title = window.prompt(text);
if (format
'wiki')
{
if (title != ) {
image = '[(('+urlThumb+'|'+title+'))|'+url+'||'+textLink+']';
} else {
image = '[(('+urlThumb+'))|'+url+'||'+textLink+']';
}
else
{
image = '<p><a href="'+url+'" title="'+textLink+'"><img src="'+urlThumb+'" alt="'+title+'" /></a></p>';
image = "\n\n"+image;
if (form.n_content) form.n_content.value += image;
else if (form.a_description) form.a_description.value += image;
else if (form.a_page_content) form.a_page_content.value += image;
else if (form.c_description) form.c_description.value += image;
Then, in the new function line_file of the modified file /manager/xmedia.php/ we have to change one line.
Puis, dans la nouvelle fonction line_file du fichier modifié /manager/xmedia.php/ nous devons changer une ligne.
Original Line :
'onclick="insertImage(window.opener.document,\.$url2.'\',\
.$act.'\',\.addslashes(
('Title of the file or image:')).'\'); '.
Modified Line :
'onclick="insertThumbLinked(window.opener.document,\.$url2.'\',\.$url.'\',\.addslashes( ('Title of the file or image:')).'\',\.addslashes(
('Enlarge the image')).'\'); '.
You will have to add a translation for "Enlarge the image" in translation file.
Il faut ajouter la traduction pour "Enlarge the image" dans le fichier de traduction.
Edited on 2005-04-15 01:53:59 by ClaireRoubey [broutilles (2, le retour ;-)]
Additions:
Sometimes you want to insert a thumbnail in a text, rather than the full picture. It is possible by modifying the function line_file in the file manager/xmedia.php
Il est parfois utile d'insérer une miniature dans un texte, plutot qu'une image complète. C'est possible en modifiant la fonction line_file dans le fichier manager/xmedia.php
Deletions:
Sometimes you want to insert a thumbnail in a text, rather than the full picture. It is possible by modifying the function line_file in the file xmedia.php
Il est parfois utile d'insérer une miniature dans un texte, plutot qu'une image complète. C'est possible en modifiant la fonction line_file dans le fichier xmedia.php
Edited on 2005-04-15 01:50:45 by ClaireRoubey [broutilles (2, le retour ;-)]
Additions:
You will have to add a translation for "Send the thumbnail" in translation file.
La fonction modifiée insère une nouvelle icône pour chaque image (basée sur ico_image.png)
Il faut ajouter la traduction pour "Send the thumbnail" dans le fichier de traduction.
Deletions:
You will have to add a translation for "Send the thumbnail" in translation file
La fonction modifiée insère un nouvel icone pour chaque image (basé sur ico_image.png)
Il faut ajouter la traduction pour "Send the thumbnail" dans le fichier de traduction
Edited on 2005-04-12 01:42:02 by DamDam
Additions:
$url2=$_PX_website_config['rel_url_files'].'/thumb/'.md5($current_dir.$name).'.jpg';
Deletions:
$url2='
;
Edited on 2005-04-11 07:28:28 by DamDam
Additions:
if ($mode 'popup') {
$url2='
.'.jpg')
;
$action_link2 = '<a href="#" title="'.
('Send the thumbnail').'" '.
'onclick="insertImage(window.opener.document,\.$url2.'\',\.$act.'\',\.addslashes( ('Title of the file or image:')).'\'); '.
'window.close(); return false;">%s</a>';
$send_thumb= sprintf($action_link2,'<img src="themes/'.$_px_theme.'/images/ico_image.png" alt="'.('Send the thumbnail').'" />');
Deletions:
$url2='
;
$action_link2 = '<a href="#" title="'.
('Send the thumbnail').'" '.
'onclick="insertImage(window.opener.document,\.$url2.'\',\.$act.'\',\.addslashes( ('Title of the file or image:')).'\'); '.
'window.close(); return false;">%s</a>';
$send_thumb= sprintf($action_link2,'<img src="themes/'.$_px_theme.'/images/ico_image.png" alt="'.('Send the thumbnail').'" />');
Oldest known version of this page was edited on 2005-04-11 03:08:33 by DamDam []
Page view:
Insert a thumbnail rather than a picture
Sometimes you want to insert a thumbnail in a text, rather than the full picture. It is possible by modifying the function line_file in the file xmedia.php
The modified function inserts a new icon (actually ico_image.png) for each picture available.
You will have to add a translation for "Send the thumbnail" in translation file
Insérer une miniature plutot qu'une image
Il est parfois utile d'insérer une miniature dans un texte, plutot qu'une image complète. C'est possible en modifiant la fonction line_file dans le fichier xmedia.php
La fonction modifiée insère un nouvel icone pour chaque image (basé sur ico_image.png)
Il faut ajouter la traduction pour "Send the thumbnail" dans le fichier de traduction
/* Line to display a file */
function line_file($data,$i)
{
global $mode, $up_dir, $_PX_website_config, $m, $px_gd_version, $env, $_px_theme;
// 4 kinds of entry: "up" folder, folder, image and normal file
// 2 modes: popup and normal
$is_dir = false;
$is_file = false;
$is_image = false;
$is_updir = false;
$url = $data['url'];
$name = $data['name'];
$current_dir = $data['current_dir'];
switch ($data['type']) {
case 'file':
$is_image = isImage($name);
$is_file = !$is_image;
$ext = getFileExtension($name);
break;
case 'dir':
$is_dir = true;
break;
case 'updir':
$is_updir = true;
break;
}
$res = ''; //final string to be displayed.
$file_size = ''; //contains the height/width of the image or the size of the file, nothing
// if an image and impossible to get the size
$create_thumb = ''; //link to create the thumbnail
$send_thumb='';
$url2='';
$action_link2='';
$icons_dir = $GLOBALS['_PX_config']['manager_path'] . '/themes/'.$_px_theme.'/images/icons/';
$delete_link = '<a href="xmedia.php?dir='.rawurlencode($current_dir).'&file='.rawurlencode($current_dir.$name).'&del=1&mode='.$mode.'&env='.$env.'" '.
'title="'. __('Delete').'" onclick="return window.confirm(\''. __('Are you sure you want to delete this file?').'\')"><img src="themes/'.$_px_theme.'/images/delete.png" alt="'. __('Delete').'" /></a>';
// Get size of the file in $file_size format ready to be displayed
if ($is_image) {
$siz = @getimagesize($_PX_website_config['xmedia_root'].'/'.$current_dir.$name);
if ($siz !== false && 'html' == $m->user->getPref('content_format')) {
//HTML format
$file_size = __('<strong>size</strong>:') .' '.$siz[3];
} elseif ($siz !== false) {
//wiki format
$file_size = __('<strong>size</strong>:') .' '.$siz[0].'x'.$siz[1];
}
} elseif ($is_file) {
//size in kb
$file_size = __('<strong>size</strong>:') .' '.prettySize(filesize($_PX_website_config['xmedia_root'].'/'.$current_dir.$name));
}
if ($mode == 'popup' && ($is_image || $is_file)) {
//call from the popup
$act = ($is_image) ? 'img' : 'file';
$action_link = '<a href="#" '.
'onclick="insertImage(window.opener.document,\''.$url.'\',\''.$act.'\',\''.addslashes( __('Title of the file or image:')).'\'); '.
'window.close(); return false;">%s</a>';
} elseif ($is_dir || $is_updir) {
$slash = ($is_dir) ? '/' : '';
$action_link = '<a href="xmedia.php?dir='.$current_dir.$slash.'&mode='.$mode.'">%s</a>';
} else {
//call from the "normal" list of files page
$action_link = '<a href="http://'.$_PX_website_config['domain'].$url.'">%s</a>';
}
// create the thumbnail link
if ($is_file || $is_image) {
if (file_exists($up_dir.'/thumb/'.md5($current_dir.$name).'.jpg')) {
//thumbnail exists
$th = sprintf($action_link,
'<img class="thumbnail" '.
'src="http://'.$_PX_website_config['domain'].$_PX_website_config['rel_url_files'].'/thumb/'.md5($current_dir.$name).'.jpg" alt="" />');
$url2='http://'.$_PX_website_config['domain'].$_PX_website_config['rel_url_files'].'/thumb/'.md5($current_dir.$name).'.jpg';
$action_link2 = '<a href="#" title="'.__('Send the thumbnail').'" '.
'onclick="insertImage(window.opener.document,\''.$url2.'\',\''.$act.'\',\''.addslashes( __('Title of the file or image:')).'\'); '.
'window.close(); return false;">%s</a>';
$send_thumb= sprintf($action_link2,'<img src="themes/'.$_px_theme.'/images/ico_image.png" alt="'.__('Send the thumbnail').'" />');
} elseif ($is_image && $px_gd_version) {
//image without thumbnail
if (file_exists($icons_dir.$ext.'-dist.png')) {
$img = 'themes/'.$_px_theme.'/images/icons/'.$ext.'-dist.png';
} else {
$img = 'themes/'.$_px_theme.'/images/icons/default-dist.png';
}
$th = sprintf($action_link, '<img class="thumbnailicon" src="'.$img.'" alt="" />');
$create_thumb = '<a href="xmedia.php?dir='.rawurlencode($current_dir).'&file='.rawurlencode($current_dir.$name).
'&thumb=1&mode='.$mode.'&env='.$env.'" title="'.__('Try to create the thumbnail').'"><img src="themes/'.$_px_theme.'/images/ico_createthumb.png" alt="'.__('Try to create the thumbnail').'" /></a>';
} else {
//normal file
$ext = getFileExtension($name);
if (file_exists($icons_dir.$ext.'-dist.png')) {
$img = 'themes/'.$_px_theme.'/images/icons/'.$ext.'-dist.png';
} else {
$img = 'themes/'.$_px_theme.'/images/icons/default-dist.png';
}
$th = sprintf($action_link, '<img class="thumbnailicon" src="'.$img.'" alt="" />');
}
$res = '<div class="icon">'."\n".
'<p class="legend action">'.$send_thumb.' '.$create_thumb.' '.$delete_link.'</p>'."\n".
'<p class="icon">'.$th.'</p>'."\n".
'<p class="legend">'.sprintf($action_link,$name).'<br />'."\n".
$file_size.'</p>'."\n".
'</div>'."\n";
} elseif ($is_dir || $is_updir) {
$ico = ($is_dir) ? 'ico_folder.png' : 'ico_folder_up.png';
$img = 'themes/'.$_px_theme.'/images/'.$ico;
$th = sprintf($action_link, '<img class="thumbnailicon" src="'.$img.'" alt="" />');
$res = '<div class="icon">'."\n".
'<p class="icon">'.$th.'</p>'."\n".
'<p class="legend">'.sprintf($action_link,$name).'</p>'."\n".
'</div>'."\n";
}
return $res;
}