Excuse me for this approximative english...
I would like to know how to link an archive to a picture like it's done in the template gallery.
thx
For the link to a file under each template in the official gallery of the PhpWebGallery site, I used an external script : it reads the database for a given category and create an HTML comment for each picture in the category.
Anytime, I go to the URL http://.../update_links.php and all my file links (picture comments in fact) are updated in the database.
Offline
Sorry, I didn't find the way to do what you explained... :(
So I open phpmyadmin and put some html code in the picture's comment. It works but it's a bit long.
thx
put this file in your admin directory
<?php
/***************************************************************************
* update_links.php *
* ------------------- *
* application : PhpWebGallery 1.3 *
* author : Pierrick LE GALL <pierrick@z0rglub.com> *
* *
***************************************************************************/
$base_url = 'http://www.phpwebgallery.net/download/templates';
define( PREFIX_INCLUDE, '.' );
include( '../include/functions.inc.php' );
database_connection();
$categories = array( 6 => 'default' );
foreach ( $categories as $cat_id => $dir ) {
$query = 'SELECT id,file';
$query.= ' FROM '.PREFIX_TABLE.'images';
$query.= ' WHERE storage_category_id = '.$cat_id;
$query.= ';';
$result = mysql_query( $query );
while ( $row = mysql_fetch_array( $result ) )
{
$filewoext = get_filename_wo_extension( $row['file'] );
$comment = '<span style="font-size=16px;">';
$comment.= '[ <a href="'.$base_url.'/'.$dir.'/'.$filewoext.'.zip"';
$comment.= ' class="download">';
$comment.= $filewoext.'.zip';
$comment.= '</a> ]';
$comment.= '</span>';
$query = 'UPDATE '.PREFIX_TABLE.'images';
$query.= " SET comment = '".$comment."'";
$query.= ' WHERE id = '.$row['id'];
$query.= ';';
mysql_query( $query );
}
}
?>Offline
Should I replace the base_url parameter by mine ?
yes, and the category id to update also
Offline
I'll try it and tell you.
thx