Pagina 1 van 1

album

Geplaatst: 10 apr 2003, 08:41
door doc
hey ik heb bij mij de foto album mod staan he , nu neemt die enkel maar jpg , gif en png extenties aan ...dit terwijl vele foto's jpeg en tif zijn ?? kan ik die extenties ook ergens toevoegen of hoe kan dit probleem worden verholpen ??

Geplaatst: 10 apr 2003, 22:27
door doc
heb ondertussen al wa meer kunnen forceren maar die extenties krijg ik er niet bij ??

ook heb ik een probleem ...als ik vb een jpg upload dan krijg ik steevast de mededeling dat de foto te groot of corrupted is ???

Geplaatst: 11 apr 2003, 10:18
door John_de_Vries
Het spreekt vanzelf als er gezegd wordt dat het bestand te groot is dit dan ook zo is. :wink:
De bestandsgrote kan je echter instellen in het adminpaneel

Maximale bestandsgrote (bytes)

John

Geplaatst: 11 apr 2003, 12:41
door Leipo
John_de_Vries schreef:Het spreekt vanzelf als er gezegd wordt dat het bestand te groot is dit dan ook zo is. :wink:
De bestandsgrote kan je echter instellen in het adminpaneel

Maximale bestandsgrote (bytes)

John
Klopt..
Had Git ook het probleem van..staat nu iets van 5300 bytes ofzo iets..
Is dus maar 5300:1024= 5.13KB..Dus maak gewoon van 5300 -> 10.000.000 ofzo..
Verder .jpeg en .jpg worden gezien als het zelfde dus ik denk dat er geen problemen mee moeten zijn..
Heb je het trouwens al uitgeprobeerd om .jpeg te uploaden..
En extensie enzo moet je denk ik in je .php file van je album aanpassen..

Geplaatst: 11 apr 2003, 14:54
door John_de_Vries
Van die jpg lijkt mij ook dat dat hetzelfde is en verders voor geen probleem mag zorgen.
Wat die tif betreft, dit is geen gangbare extensie voor gebruik op het internet.
PNG, Gif en JPG wel.

Geplaatst: 11 apr 2003, 16:59
door doc
hola ...jullie uitleg klopt nie helemaal zenne ...mijn bestandsgroote staat op 10.000.000 ...dus das wel groot he ??? en nog krijg ik die strontmededeling he ... hoe klein we de foto ook nemen ...het blijft hetzelfde ........snap er geen yota van :shock:

Geplaatst: 11 apr 2003, 17:46
door Stylo
uuh misschien is het niet alleen het aantal kb dat er toedoet, maar ook de pixels?

Geplaatst: 11 apr 2003, 18:21
door doc
ook deze heb ik supergroot gemaakt hoor ... zot word ik er van :shock:

Geplaatst: 11 apr 2003, 19:49
door Stylo
dang...dat is vaag..ik denk er nog ff overna...laat het je nog weten

Geplaatst: 11 apr 2003, 20:08
door doc
ff bijvermelden dat het uploaden van gewone gifs via die album mod wel kan ?? maar foto's niet ???

dit is de bewuste mod : Photo Album Addon 2.0.51

Geplaatst: 11 apr 2003, 20:14
door Stylo
Kan je ff de php code hie rneer flikkeren, schieten we misschien wat meer mee op :)

Geplaatst: 11 apr 2003, 20:59
door doc
ge hebt het maar te vragen he :P


<?php
/***************************************************************************
* album.php
* -------------------
* begin : Tuesday, February 04, 2003
* copyright : (C) 2003 Smartor
* email : smartor_xp@hotmail.com
*
* $Id: album.php,v 2.0.7 2003/03/15 10:16:30 ngoctu Exp $
*
***************************************************************************/

/***************************************************************************
*
* 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.
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
$album_root_path = $phpbb_root_path . 'album_mod/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);


//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_ALBUM);
init_userprefs($userdata);
//
// End session management
//

//
// Get general album information
//
include($album_root_path . 'album_common.'.$phpEx);


/*
+----------------------------------------------------------
| Build Categories Index
+----------------------------------------------------------
*/

$sql = "SELECT c.*, COUNT(p.pic_id) AS count
FROM ". ALBUM_CAT_TABLE ." AS c
LEFT JOIN ". ALBUM_TABLE ." AS p ON c.cat_id = p.pic_cat_id
WHERE cat_id <> 0
GROUP BY cat_id
ORDER BY cat_order ASC";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);
}

$catrows = array();

while( $row = $db->sql_fetchrow($result) )
{
$album_user_access = album_user_access($row['cat_id'], $row, 1, 0, 0, 0, 0, 0); // VIEW
if ($album_user_access['view'] == 1)
{
$catrows[] = $row;
}
}

$allowed_cat = ''; // For Recent Public Pics below

//
// $catrows now stores all categories which this user can view. Dump them out!
//
for ($i = 0; $i < count($catrows); $i++)
{
// --------------------------------
// Build allowed category-list (for recent pics after here)
// --------------------------------

$allowed_cat .= ($allowed_cat == '') ? $catrows[$i]['cat_id'] : ',' . $catrows[$i]['cat_id'];


// --------------------------------
// Build moderators list
// --------------------------------

$l_moderators = '';
$moderators_list = '';

$grouprows= array();

if( $catrows[$i]['cat_moderator_groups'] != '')
{
// We have usergroup_ID, now we need usergroup name
$sql = "SELECT group_id, group_name
FROM " . GROUPS_TABLE . "
WHERE group_single_user <> 1
AND group_type <> ". GROUP_HIDDEN ."
AND group_id IN (". $catrows[$i]['cat_moderator_groups'] .")
ORDER BY group_name ASC";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not obtain usergroups data', '', __LINE__, __FILE__, $sql);
}

while( $row = $db->sql_fetchrow($result) )
{
$grouprows[] = $row;
}
}

if( count($grouprows) > 0 )
{
$l_moderators = $lang['Moderators'];

for ($j = 0; $j < count($grouprows); $j++)
{
$group_link = '<a href="'. append_sid("groupcp.$phpEx?". POST_GROUPS_URL .'='. $grouprows[$j]['group_id']) .'">'. $grouprows[$j]['group_name'] .'</a>';

$moderators_list .= ($moderators_list == '') ? $group_link : ', ' . $group_link;
}
}


// ------------------------------------------
// Get Last Pic of this Category
// ------------------------------------------

if ($catrows[$i]['count'] == 0)
{
//
// Oh, this category is empty
//
$last_pic_info = $lang['No_Pics'];
$u_last_pic = '';
$last_pic_title = '';
}
else
{
// ----------------------------
// Check Pic Approval
// ----------------------------

if(($catrows[$i]['cat_approval'] == ALBUM_ADMIN) or ($catrows[$i]['cat_approval'] == ALBUM_MOD))
{
$pic_approval_sql = 'AND p.pic_approval = 1'; // Pic Approval ON
}
else
{
$pic_approval_sql = ''; // Pic Approval OFF
}


// ----------------------------
// OK, we may do a query now...
// ----------------------------

$sql = "SELECT p.pic_id, p.pic_title, p.pic_user_id, p.pic_username, p.pic_time, p.pic_cat_id, u.user_id, u.username
FROM ". ALBUM_TABLE ." AS p LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id
WHERE p.pic_cat_id = '". $catrows[$i]['cat_id'] ."' $pic_approval_sql
ORDER BY p.pic_time DESC
LIMIT 1";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not get last pic information', '', __LINE__, __FILE__, $sql);
}
$lastrow = $db->sql_fetchrow($result);


// ----------------------------
// Write the Date
// ----------------------------

$last_pic_info = create_date($board_config['default_dateformat'], $lastrow['pic_time'], $board_config['board_timezone']);

$last_pic_info .= '<br />';


// ----------------------------
// Write username of last poster
// ----------------------------

if( ($lastrow['user_id'] == ALBUM_GUEST) or ($lastrow['username'] == '') )
{
$last_pic_info .= ($lastrow['pic_username'] == '') ? $lang['Guest'] : $lastrow['pic_username'];
}
else
{
$last_pic_info .= $lang['Poster'] .': <a href="'. append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $lastrow['user_id']) .'">'. $lastrow['username'] .'</a>';
}


// ----------------------------
// Write the last pic's title.
// Truncate it if it's too long
// ----------------------------

if( !isset($album_config['last_pic_title_length']) )
{
$album_config['last_pic_title_length'] = 25;
}

$lastrow['pic_title'] = $lastrow['pic_title'];

if (strlen($lastrow['pic_title']) > $album_config['last_pic_title_length'])
{
$lastrow['pic_title'] = substr($lastrow['pic_title'], 0, $album_config['last_pic_title_length']) . '...';
}

$last_pic_info .= '<br />'. $lang['Pic_Title'] .': <a href="';

$last_pic_info .= ($album_config['fullpic_popup']) ? append_sid("album_pic.$phpEx?pic_id=". $lastrow['pic_id']) .'" target="_blank">' : append_sid("album_page.$phpEx?pic_id=". $lastrow['pic_id']) .'">' ;

$last_pic_info .= $lastrow['pic_title'] .'</a>';
}
// END of Last Pic


// ------------------------------------------
// Parse to template the info of the current Category
// ------------------------------------------

$template->assign_block_vars('catrow', array(
'U_VIEW_CAT' => append_sid("album_cat.$phpEx?cat_id=". $catrows[$i]['cat_id']),
'CAT_TITLE' => $catrows[$i]['cat_title'],
'CAT_DESC' => $catrows[$i]['cat_desc'],
'L_MODERATORS' => $l_moderators,
'MODERATORS' => $moderators_list,
'PICS' => $catrows[$i]['count'],
'LAST_PIC_INFO' => $last_pic_info)
);
}
// END of Categories Index


/*
+----------------------------------------------------------
| Recent Public Pics
+----------------------------------------------------------
*/

if ($allowed_cat != '')
{
$sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments
FROM ". ALBUM_TABLE ." AS p
LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id
LEFT JOIN ". ALBUM_CAT_TABLE ." AS ct ON p.pic_cat_id = ct.cat_id
LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id
LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id
WHERE p.pic_cat_id IN ($allowed_cat) AND ( p.pic_approval = 1 OR ct.cat_approval = 0 )
GROUP BY p.pic_id
ORDER BY pic_time DESC
LIMIT ". $album_config['cols_per_page'];
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query recent pics information', '', __LINE__, __FILE__, $sql);
}

$recentrow = array();

while( $row = $db->sql_fetchrow($result) )
{
$recentrow[] = $row;
}


if (count($recentrow) > 0)
{
for ($i = 0; $i < count($recentrow); $i += $album_config['cols_per_page'])
{
$template->assign_block_vars('recent_pics', array());

for ($j = $i; $j < ($i + $album_config['cols_per_page']); $j++)
{
if( $j >= count($recentrow) )
{
break;
}

if(!$recentrow[$j]['rating'])
{
$recentrow[$j]['rating'] = $lang['Not_rated'];
}
else
{
$recentrow[$j]['rating'] = round($recentrow[$j]['rating'], 2);
}

$template->assign_block_vars('recent_pics.recent_col', array(
'U_PIC' => ($album_config['fullpic_popup']) ? append_sid("album_pic.$phpEx?pic_id=". $recentrow[$j]['pic_id']) : append_sid("album_page.$phpEx?pic_id=". $recentrow[$j]['pic_id']),
'THUMBNAIL' => append_sid("album_thumbnail.$phpEx?pic_id=". $recentrow[$j]['pic_id']),
'DESC' => $recentrow[$j]['pic_desc']
)
);

if( ($recentrow[$j]['user_id'] == ALBUM_GUEST) or ($recentrow[$j]['username'] == '') )
{
$recent_poster = ($recentrow[$j]['pic_username'] == '') ? $lang['Guest'] : $recentrow[$j]['pic_username'];
}
else
{
$recent_poster = '<a href="'. append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $recentrow[$j]['user_id']) .'">'. $recentrow[$j]['username'] .'</a>';
}

$template->assign_block_vars('recent_pics.recent_detail', array(
'TITLE' => $recentrow[$j]['pic_title'],
'POSTER' => $recent_poster,
'TIME' => create_date($board_config['default_dateformat'], $recentrow[$j]['pic_time'], $board_config['board_timezone']),

'VIEW' => $recentrow[$j]['pic_view_count'],

'RATING' => ($album_config['rate'] == 1) ? ( '<a href="'. append_sid("album_rate.$phpEx?pic_id=". $recentrow[$j]['pic_id']) . '">' . $lang['Rating'] . '</a>: ' . $recentrow[$j]['rating'] . '<br />') : '',

'COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="'. append_sid("album_comment.$phpEx?pic_id=". $recentrow[$j]['pic_id']) . '">' . $lang['Comments'] . '</a>: ' . $recentrow[$j]['comments'] . '<br />') : '',

'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($recentrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip($recentrow[$j]['pic_user_ip']) .'</a><br />' : ''
)
);
}
}
}
else
{
//
// No Pics Found
//
$template->assign_block_vars('no_pics', array());
}
}
else
{
//
// No Cats Found
//
$template->assign_block_vars('no_pics', array());
}


/*
+----------------------------------------------------------
| Start output the page
+----------------------------------------------------------
*/

$page_title = $lang['Album'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

$template->set_filenames(array(
'body' => 'album_index_body.tpl')
);

$template->assign_vars(array(
'L_CATEGORY' => $lang['Category'],
'L_PICS' => $lang['Pics'],
'L_LAST_PIC' => $lang['Last_Pic'],

'U_YOUR_PERSONAL_GALLERY' => append_sid("album_personal.$phpEx?user_id=". $userdata['user_id']),
'L_YOUR_PERSONAL_GALLERY' => $lang['Your_Personal_Gallery'],

'U_USERS_PERSONAL_GALLERIES' => append_sid("album_personal_index.$phpEx"),
'L_USERS_PERSONAL_GALLERIES' => $lang['Users_Personal_Galleries'],

'S_COLS' => $album_config['cols_per_page'],
'S_COL_WIDTH' => (100/$album_config['cols_per_page']) . '%',
'TARGET_BLANK' => ($album_config['fullpic_popup']) ? 'target="_blank"' : '',
'L_RECENT_PUBLIC_PICS' => $lang['Recent_Public_Pics'],
'L_NO_PICS' => $lang['No_Pics'],
'L_PIC_TITLE' => $lang['Pic_Title'],
'L_VIEW' => $lang['View'],
'L_POSTER' => $lang['Poster'],
'L_POSTED' => $lang['Posted'],
'L_PUBLIC_CATS' => $lang['Public_Categories'])
);

//
// Generate the page
//
$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);


// +------------------------------------------------------+
// | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor |
// +------------------------------------------------------+

?>


is da lang genoeg :P

Geplaatst: 11 apr 2003, 21:01
door Stylo
holy f*ck, hier moet ff de tijd voor nemen...geef me ff de tijd

Geplaatst: 11 apr 2003, 21:06
door Stylo
Uhm ligt het aan mij of mis ik het gedeelte waar je de instellingen voor een pic instelt?

Geplaatst: 11 apr 2003, 21:06
door doc
awel dat antwoord verwachte ik se :P :lol:

Geplaatst: 11 apr 2003, 21:18
door Stylo
Stylo schreef:Uhm ligt het aan mij of mis ik het gedeelte waar je de instellingen voor een pic instelt?
toch?

Geplaatst: 11 apr 2003, 21:22
door doc
hey stylo ...ge hebt de php code gevraagd he niet de rest van die mod he manneke :lol: maar dan komt ge met 1 blad nie toe zenne ...

allee hier hedde de pic se :P

<?php
/***************************************************************************
* album_pic.php
* -------------------
* begin : Wednesday, February 05, 2003
* copyright : (C) 2003 Smartor
* email : smartor_xp@hotmail.com
*
* $Id: album_pic.php,v 2.0.5 2003/02/28 14:33:12 ngoctu Exp $
*
***************************************************************************/

/***************************************************************************
*
* 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.
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
$album_root_path = $phpbb_root_path . 'album_mod/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_ALBUM);
init_userprefs($userdata);
//
// End session management
//


//
// Get general album information
//
include($album_root_path . 'album_common.'.$phpEx);


// ------------------------------------
// Check the request
// ------------------------------------

if( isset($HTTP_GET_VARS['pic_id']) )
{
$pic_id = intval($HTTP_GET_VARS['pic_id']);
}
else if( isset($HTTP_POST_VARS['pic_id']) )
{
$pic_id = intval($HTTP_POST_VARS['pic_id']);
}
else
{
die('No pics specified');
}


// ------------------------------------
// Get this pic info
// ------------------------------------

$sql = "SELECT *
FROM ". ALBUM_TABLE ."
WHERE pic_id = '$pic_id'";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql);
}
$thispic = $db->sql_fetchrow($result);

$cat_id = $thispic['pic_cat_id'];
$user_id = $thispic['pic_user_id'];

$pic_filetype = substr($thispic['pic_filename'], strlen($thispic['pic_filename']) - 4, 4);
$pic_filename = $thispic['pic_filename'];
$pic_thumbnail = $thispic['pic_thumbnail'];

if( empty($thispic) or !file_exists(ALBUM_UPLOAD_PATH . $pic_filename) )
{
die($lang['Pic_not_exist']);
}


// ------------------------------------
// Get the current Category Info
// ------------------------------------

if ($cat_id != PERSONAL_GALLERY)
{
$sql = "SELECT *
FROM ". ALBUM_CAT_TABLE ."
WHERE cat_id = '$cat_id'";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql);
}

$thiscat = $db->sql_fetchrow($result);
}
else
{
$thiscat = init_personal_gallery_cat($user_id);
}

if (empty($thiscat))
{
die($lang['Category_not_exist']);
}


// ------------------------------------
// Check the permissions
// ------------------------------------

$album_user_access = album_user_access($cat_id, $thiscat, 1, 0, 0, 0, 0, 0); // VIEW
if ($album_user_access['view'] == 0)
{
die($lang['Not_Authorised']);
}


// ------------------------------------
// Check Pic Approval
// ------------------------------------

if ($userdata['user_level'] != ADMIN)
{
if( ($thiscat['cat_approval'] == ADMIN) or (($thiscat['cat_approval'] == MOD) and !$album_user_access['moderator']) )
{
if ($thispic['pic_approval'] != 1)
{
die($lang['Not_Authorised']);
}
}
}


// ------------------------------------
// Check hotlink
// ------------------------------------

if( ($album_config['hotlink_prevent'] == 1) and (isset($HTTP_SERVER_VARS['HTTP_REFERER'])) )
{
$check_referer = explode('?', $HTTP_SERVER_VARS['HTTP_REFERER']);
$check_referer = trim($check_referer[0]);

$good_referers = array();

if ($album_config['hotlink_allowed'] != '')
{
$good_referers = explode(',', $album_config['hotlink_allowed']);
}

$good_referers[] = $board_config['server_name'] . $board_config['script_path'];

$errored = TRUE;

for ($i = 0; $i < count($good_referers); $i++)
{
$good_referers[$i] = trim($good_referers[$i]);

if( (strstr($check_referer, $good_referers[$i])) and ($good_referers[$i] != '') )
{
$errored = FALSE;
}
}

if ($errored)
{
die($lang['Not_Authorised']);
}
}


/*
+----------------------------------------------------------
| Main work here...
+----------------------------------------------------------
*/


// ------------------------------------
// Increase view counter
// ------------------------------------

$sql = "UPDATE ". ALBUM_TABLE ."
SET pic_view_count = pic_view_count + 1
WHERE pic_id = '$pic_id'";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update pic information', '', __LINE__, __FILE__, $sql);
}


// ------------------------------------
// Okay, now we can send image to the browser
// ------------------------------------

switch ( $pic_filetype )
{
case '.png':
header('Content-type: image/png');
break;
case '.gif':
header('Content-type: image/gif');
break;
case '.jpg':
header('Content-type: image/jpeg');
break;
default:
die('The filename data in the DB was corrupted');
}

readfile(ALBUM_UPLOAD_PATH . $thispic['pic_filename']);

exit;


// +------------------------------------------------------+
// | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor |
// +------------------------------------------------------+

?>

zou ik nie beter die gehele mod in zip doorsturen ??

Geplaatst: 11 apr 2003, 22:58
door Stylo
het spijt me zeer, maar hoe kom ik ook niet uit..jij misschien Leipo?