Ik gebruik dit modje om de meest recente foto van smartors photo-album op m'n html pagina te tonen:
Code:
##############################################################
## MOD Title: Latest pics on any page
## for Photo Album Addon v2 for phpBB2
## MOD Author: I'm not admitting to writing this one either.
## MOD Description:
##
## Show latest pics on any page you like including non php.
##
## Tested with: phpBB 2.0.8 - PHP4.3.3
## MySQL 3.23.x and Smartor's Photo Album Addon v2 for phpBB2
##
## MOD Version:
##
## Installation Level: easy
## Installation Time: 2 minutes
##
## Files To Edit: 2
## album_thumbnail.php
## album_pic.php
##
###############################################################
## Before Adding This MOD To Your Photo Album,
## You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]-------------------------------------------------------
#
album_pic.php
#
#-----[ FIND ]----------------------------------------
#
//
// Get general album information
//
include($album_root_path . 'album_common.'.$phpEx);
#
#-----[ AFTER ADD ]----------------------------------------
#
//
// Latest pic mod by Nuffmon 13-12-2003
//
if( $HTTP_GET_VARS['pic_id'] == "latest" )
{
if( $HTTP_GET_VARS['offset'] < 1 ) $HTTP_GET_VARS['offset'] = 0;
$sql = "SELECT p.*
FROM ". ALBUM_TABLE ." AS p
WHERE pic_approval = 1 AND pic_lock = 0 AND pic_cat_id <> 0
ORDER BY pic_time DESC
LIMIT " . $HTTP_GET_VARS['offset'] . ",1";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql);
}
$thispic = $db->sql_fetchrow($result);
$HTTP_GET_VARS['pic_id'] = $thispic['pic_id'];
}
#
#-----[ OPEN ]-------------------------------------------------------
#
album_thumbnail.php
#
#-----[ FIND ]----------------------------------------
#
//
// Get general album information
//
include($album_root_path . 'album_common.'.$phpEx);
#
#-----[ AFTER ADD ]----------------------------------------
#
//
// Latest pic mod by Nuffmon 13-12-2003
//
if( $HTTP_GET_VARS['pic_id'] == "latest" )
{
if( $HTTP_GET_VARS['offset'] < 1 ) $HTTP_GET_VARS['offset'] = 0;
$sql = "SELECT p.*
FROM ". ALBUM_TABLE ." AS p
WHERE pic_approval = 1 AND pic_lock = 0 AND pic_cat_id <> 0
ORDER BY pic_time DESC
LIMIT " . $HTTP_GET_VARS['offset'] . ",1";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql);
}
$thispic = $db->sql_fetchrow($result);
$HTTP_GET_VARS['pic_id'] = $thispic['pic_id'];
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
#
En voor het aanroepen van link en de thumbnail, op 'm'n html pagina, gebruik ik het volgende:
<a href="http://DOMAIN/phpBB2/album_pic.php?pic_ ... et=0"><img src="http://DOMAIN/phpBB2/album_thumbnail.ph ... set=0"></a>
Dit werkt perfect, maar heeft iemand een idee hoe ik dit kan aanpassen zodat ik ook de omschrijving, naam van de poster en de datum van de laatste foto kan tonen?
En eventueel een "alt" text?
Jeroen
Modje uitbreiden?
Forumregels
Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
