Autor Zpráva
Milky
Profil
Dobrý den, mám takový zapeklitý problém a to ten že potřebuji do webu generovat náhled a odkaz na nejlepší obrázek z fotogalerie coppermine v php se moc nevyznám tak vám sem přikládám kódy dvou souborů a odkaz na stránku ze které chci vygenerovat obrázek
Milky
Profil
soubor thumbnail.php

<?php

/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2007 Coppermine Dev Team
v1.1 originally written by Gregory DEMAR

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
********************************************
Coppermine version: 1.4.12
$Source$
$Revision: 3636 $
$Author: gaugau $
$Date: 2007-06-29 11:35:30 +0200 (Fr, 29 Jun 2007) $
**********************************************/

/**
* Coppermine Photo Gallery 1.4.11 thumbnails.php
*
* This file generates the data of thumbnails for all the albums and metalbums,
* the actual display is handled by the display_thumbnails and then in-turn
* theme_display_thumbnail function
*
* @copyright 2002-2006 Gregory DEMAR, Coppermine Dev Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License V2
* @package Coppermine
* @version $Id: thumbnails.php 3636 2007-06-29 09:35:30Z gaugau $
*/

/**
*
* @ignore
*/
define('IN_COPPERMINE', true);

define('THUMBNAILS_PHP', true);

/**
*
* @ignore
*/
define('INDEX_PHP', true);

require('include/init.inc.php');

if (!USER_ID && $CONFIG['allow_unlogged_access'] == 0) {
$redirect = $redirect . "login.php";
header("Location: $redirect");
exit();
}

if ($CONFIG['enable_smilies']) include("include/smilies.inc.php");

function thumb_get_subcat_data($parent, &$album_set_array, $level)
{
global $CONFIG;

$result = cpg_db_query("SELECT cid, name, description FROM {$CONFIG['TABLE_CATEGORIES']} WHERE parent = '$parent'");
if (mysql_num_rows($result) > 0) {
$rowset = cpg_db_fetch_rowset($result);
foreach ($rowset as $subcat) {
$result = cpg_db_query("SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = {$subcat['cid']}");
$album_count = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
$album_set_array[] = $row['aid'];
} // while
}
if ($level > 1) thumb_get_subcat_data($subcat['cid'], $album_set_array, $level -1);
}
}

/**
* Main code
*/

if (isset($_GET['sort'])) $USER['sort'] = $_GET['sort'];
if (isset($_GET['cat'])) $cat = (int)$_GET['cat'];
if (isset($_GET['album'])) $album = $_GET['album'];

if (isset($_POST['search'])) {
// find out if a parameter has been submitted at all
$allowed = array('title', 'caption', 'keywords', 'owner_name', 'filename', 'pic_raw_ip', 'pic_hrd_ip', 'user1', 'user2', 'user3', 'user4');
foreach ($allowed as $key) {
if (isset($_POST[$key]) == TRUE) {
$_POST['params'][$key] = $_POST[$key];
}
}
$USER['search'] = $_POST;
$album = 'search';
}
if (isset($_GET['search'])) {
$USER['search'] = array('search' => $_GET['search']);
}

if (isset($_GET['page'])) {
$page = max((int)$_GET['page'], 1);
} else {
$page = 1;
}

$breadcrumb = '';
$breadcrumb_text = '';
$cat_data = array();
$lang_meta_album_names['lastupby'] = $lang_meta_album_names['lastup'];
$lang_meta_album_names['lastcomby'] = $lang_meta_album_names['lastcom'];

if (is_numeric($album)) {
$result = cpg_db_query("SELECT category, title, aid, keyword, description, alb_password_hint FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='$album'");
if (mysql_num_rows($result) > 0) {
$CURRENT_ALBUM_DATA = mysql_fetch_array($result);
$actual_cat = $CURRENT_ALBUM_DATA['category'];
$CURRENT_ALBUM_KEYWORD = $CURRENT_ALBUM_DATA['keyword'];
breadcrumb($actual_cat, $breadcrumb, $breadcrumb_text);
$cat = - $album;
}
} elseif (isset($cat) && $cat) { // Meta albums, we need to restrict the albums to the current category
if ($cat < 0) {
$result = cpg_db_query("SELECT category, title, aid, keyword, description, alb_password_hint FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='" . (- $cat) . "'");
if (mysql_num_rows($result) > 0) {
$CURRENT_ALBUM_DATA = mysql_fetch_array($result);
$actual_cat = $CURRENT_ALBUM_DATA['category'];
$CURRENT_ALBUM_KEYWORD = $CURRENT_ALBUM_DATA['keyword'];
}

$ALBUM_SET = 'AND aid IN (' . (- $cat) . ') ' . $ALBUM_SET;
breadcrumb($actual_cat, $breadcrumb, $breadcrumb_text);
$CURRENT_CAT_NAME = $CURRENT_ALBUM_DATA['title'];
$CURRENT_ALBUM_KEYWORD = $CURRENT_ALBUM_DATA['keyword'];
} else {
$album_set_array = array();
if ($cat == USER_GAL_CAT)
$where = 'category > ' . FIRST_USER_CAT;
else
$where = "category = '$cat'";

$result = cpg_db_query("SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE $where");
while ($row = mysql_fetch_array($result)) {
$album_set_array[] = $row['aid'];
} // while
if ($cat >= FIRST_USER_CAT) {
$user_name = get_username($cat - FIRST_USER_CAT);
$CURRENT_CAT_NAME = sprintf($lang_list_categories['xx_s_gallery'], $user_name);
} else {
$result = cpg_db_query("SELECT name FROM {$CONFIG['TABLE_CATEGORIES']} WHERE cid = '$cat'");
if (mysql_num_rows($result) == 0) cpg_die(CRITICAL_ERROR, $lang_errors['non_exist_cat'], __FILE__, __LINE__);
$row = mysql_fetch_array($result);
$CURRENT_CAT_NAME = $row['name'];
}
thumb_get_subcat_data($cat, $album_set_array, $CONFIG['subcat_level']);
// Treat the album set
if (count($album_set_array)) {
$set = '';
foreach ($album_set_array as $album_id) $set .= ($set == '') ? $album_id : ',' . $album_id;
$ALBUM_SET .= "AND aid IN ($set) ";
}
breadcrumb($cat, $breadcrumb, $breadcrumb_text);
}
}

pageheader(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album]);
if ($breadcrumb) {
if (!(strpos($CONFIG['main_page_layout'], "breadcrumb") === false)) {
theme_display_breadcrumb($breadcrumb, $cat_data);
}
theme_display_cat_list($breadcrumb, $cat_data, '');
}

/**
* Function to draw the password box if the album is password protected
*/
function form_albpw()
{
global $lang_thumb_view, $CURRENT_ALBUM_DATA;
$login_falied =
starttable('-1', $lang_thumb_view['enter_alb_pass'], 2);
if (isset($_POST['validate_album'])) {
$login_failed = '<tr><td class="tableh2" colspan="2" align="center">
<span style="color:red">'.$lang_thumb_view['invalid_pass'].'</span></td></tr >
';
}
if (!empty($CURRENT_ALBUM_DATA['alb_password_hint'])) {
echo <<<EOT
<tr>
<td colspan="2" align="center" class="tableb">{$CURRENT_ALBUM_DATA['alb_password_hint']}</td>
</tr>
EOT;
}
echo <<<EOT
$login_failed
<tr>
<form method="post" action="">
<input type="hidden" name="validate_album" value="validate_album"/>
<td class="tableb" width="40%">{$lang_thumb_view['pass']}: </td>
<td class="tableb" width="60%"><input type="password" class="textinput" name="password" /></td>
</tr>
<tr>
<td class="tablef" colspan="2" align="center"><input type="submit" class="button" name="submit" value={$lang_thumb_view['submit']} />
</
Milky
Profil
Soubor displayimage.php

<?php

/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2007 Coppermine Dev Team
v1.1 originally written by Gregory DEMAR

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
********************************************
Coppermine version: 1.4.12
$Source$
$Revision: 3636 $
$Author: gaugau $
$Date: 2007-06-29 11:35:30 +0200 (Fr, 29 Jun 2007) $
**********************************************/

define('IN_COPPERMINE', true);
define('DISPLAYIMAGE_PHP', true);
define('INDEX_PHP', true);
//define('SMILIES_PHP', true);

require('include/init.inc.php');

if (!USER_ID && $CONFIG['allow_unlogged_access'] == 0) {
$redirect = $redirect . "login.php";
header("Location: $redirect");
exit();
}

if ($CONFIG['enable_smilies']) include("include/smilies.inc.php");

$breadcrumb = '';
$breadcrumb_text = '';
$cat_data = array();

if($CONFIG['read_exif_data'] ){
include("include/exif_php.inc.php");
}
if($CONFIG['read_iptc_data'] ){
include("include/iptc.inc.php");
}


/**
* Local functions definition
*/

# Sanitize the data - to fix the XSS vulnerability - Aditya
function sanitize_data(&$value, $key)
{
if (is_array($value)) {
array_walk($value, 'sanitize_data');
} else {
# sanitize against sql/html injection; trim any nongraphical non-ASCII character:
$value = trim(htmlentities(strip_tags(trim($value,"x7f..xffx0..x1f")),ENT_Q UOTES));
}
}
function html_picture_menu()
{
global $lang_display_image_php, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $CONFIG;

$mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']);
$picmenu = '';

if (false) { //(!($mime_content['content']=='image')) {
$picmenu = <<<EOT
<a href="#" onclick="return MM_openBrWindow('setplayer.php?={$mime_content['extension']}','Set_Pla yer','scrollbars=no,toolbar=no,status=no,resizable=no')" class="admin_menu" >{$lang_display_image_php['set_player']}</a>
EOT;
}

if ((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) {
$picmenu .= <<<EOT
<a href="javascript:;" onclick="return MM_openBrWindow('picEditor.php?id={$CURRENT_PIC_DATA['pid']}','Crop_Pi cture','scrollbars=yes,toolbar=no,status=yes,resizable=yes')" class="admin_menu" >{$lang_display_image_php['crop_pic']}</a> <a href="editOnePic.php?id={$CURRENT_PIC_DATA['pid']}&amp;what=picture" class="admin_menu">{$lang_display_image_php['edit_pic']}</a> <a href="delete.php?id={$CURRENT_PIC_DATA['pid']}&amp;what=picture" class="admin_menu" onclick="return confirm('{$lang_display_image_php['confirm_del']}'); return false; ">{$lang_display_image_php['del_pic']}</a>
EOT;
}

return $picmenu;
}

// Display picture information
function html_picinfo()
{
global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $THEME_DIR, $FAVPICS, $REFERER;
global $album, $lang_picinfo, $lang_display_image_php, $lang_byte_units, $lastup_date_fmt;

if ($CURRENT_PIC_DATA['owner_id'] && $CURRENT_PIC_DATA['owner_name']) {
$owner_link = '<a href ="profile.php?uid=' . $CURRENT_PIC_DATA['owner_id'] . '">' . $CURRENT_PIC_DATA['owner_name'] . '</a> ';
} else {
$owner_link = '';
}

if (GALLERY_ADMIN_MODE && $CURRENT_PIC_DATA['pic_raw_ip']) {
if ($CURRENT_PIC_DATA['pic_hdr_ip']) {
$ipinfo = ' (' . $CURRENT_PIC_DATA['pic_hdr_ip'] . '[' . $CURRENT_PIC_DATA['pic_raw_ip'] . ']) / ';
} else {
$ipinfo = ' (' . $CURRENT_PIC_DATA['pic_raw_ip'] . ') / ';
}
} else {
if ($owner_link) {
$ipinfo = '/ ';
} else {
$ipinfo = '';
}
}

$info[$lang_picinfo['Filename']] = htmlspecialchars($CURRENT_PIC_DATA['filename']);
$info[$lang_picinfo['Album name']] = '<span class="alblink">' . $owner_link . $ipinfo . '<a href="thumbnails.php?album=' . $CURRENT_PIC_DATA['aid'] . '">' . $CURRENT_ALBUM_DATA['title'] . '</a></span>';

if ($CURRENT_PIC_DATA['votes'] > 0) {
if (defined('THEME_HAS_RATING_GRAPHICS')) {
$prefix = $THEME_DIR;
} else {
$prefix = '';
}
if (GALLERY_ADMIN_MODE) {
$width = 800;
$height = 500;
} else {
$width = 400;
$height = 250;
}

$detailsLink = $CONFIG['vote_details'] ? ' (<a href="#" onclick="MM_openBrWindow('stat_details.php?type=vote&amp;pid='.$CURREN T_PIC_DATA['pid'].'&amp;sort=sdate&amp;dir=&amp;sdate=1&amp;ip=1&amp;r ating=1&amp;referer=1&amp;browser=1&amp;os=1','','resizable=yes,width= '.$width.',height='.$height.',top=50,left=50,scrollbars=yes'); return false;">'.$lang_picinfo['details'].'</a>)' : '';
$info[sprintf($lang_picinfo['Rating'], $CURRENT_PIC_DATA['votes'])] = '<img src="' . $prefix . 'images/rating' . round($CURRENT_PIC_DATA['pic_rating'] / 2000) . '.gif" align="middle" alt="" />'.$detailsLink;
}

if ($CURRENT_PIC_DATA['keywords'] != "") {
$info[$lang_picinfo['Keywords']] = '<span class="alblink">' . preg_replace("/(S+)/", "<a href="thumbnails.php?album=search&amp;search=\1">\1</a>" , $CURRENT_PIC_DATA['keywords']) . '</span>';
}

for ($i = 1; $i <= 4; $i++) {
if ($CONFIG['user_field' . $i . '_name']) {
if ($CURRENT_PIC_DATA['user' . $i] != "") {
$info[$CONFIG['user_field' . $i . '_name']] = make_clickable($CURRENT_PIC_DATA['user' . $i]);
}
}
}

$info[$lang_picinfo['File Size']] = ($CURRENT_PIC_DATA['filesize'] > 10240 ? ($CURRENT_PIC_DATA['filesize'] >> 10) . '&nbsp;' . $lang_byte_units[1] : $CURRENT_PIC_DATA['filesize'] . '&nbsp;' . $lang_byte_units[0]);
$info[$lang_picinfo['File Size']] = '<span dir="ltr">' . $info[$lang_picinfo['File Size']] . '</span>';
$info[$lang_picinfo['Date Added']] = localised_date($CURRENT_PIC_DATA['ctime'],$lastup_date_fmt);
$info[$lang_picinfo['Dimensions']] = sprintf($lang_display_image_php['size'], $CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']);
$detailsLink = ($CURRENT_PIC_DATA['hits'] && $CONFIG['hit_details'] && GALLERY_ADMIN_MODE) ? ' (<a href="#" onclick="MM_openBrWindow('stat_details.php?type=hits&amp;pid='.$CURREN T_PIC_DATA['pid'].'&amp;sort=sdate&amp;dir=&amp;sdate=1&amp;ip=1&amp;s earch_phrase=1&amp;referer=1&amp;browser=1&amp;os=1','','resizable=yes ,width=800,height=500,top=50,left=50,scrollbars=yes'); return false;">'.$lang_picinfo['details'].'</a>)' : '';
$info[$lang_picinfo['Displayed']] = sprintf($lang_display_image_php['views'], $CURRENT_PIC_DATA['hits']);
$info[$lang_picinfo['Displayed']] .= $detailsLink;

$path_to_pic = $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'];

if ($CONFIG['read_exif_data']) $exif = exif_parse_file($path_to_pic);

if (isset($exif) && is_array($exif)) {
array_walk($exif, 'sanitize_data');
$info = array_merge(
Milky
Profil
někde v těchto souborech by mělo být něco na to vygenerování ale moc se v tom nevyznám a potřeboval bych z toho vytahnout kód který bych vložil do iframu na webu aby se na webu zobrazil jen náhled na první fotografii z galerie a odkázal na fotografii. Odkaz na stránku galerie je ZDE

potřeboval bych aby se na web hodil ten obsah prvního rámečku s fotografií klidně bez toho popisu a hodnocení ale aby se na webu ukázala fotografie na kterou když kliknu aby mě to odkázalo na stránku té fotografie.
Doufám že si na to někdo udělá čas a poradí mi, předem díky

koukám že se sem ty zdrojáky nevešli celý tak se kdyžtak ozvěte na icq:220-899-203 kdyby ty kusy nestačili
temistokles
Profil
<ot>Som zvedavy, komu sa to bude chciet citat ;)</ot>

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0