Avatar

Installatie lukt niet? Plotseling een foutmelding. Of weet je niet hoe iets werkt. Problemen met phpBB2 kun je in dit archief opzoeken.
Forumregels

Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
phpBB2.0.x
Gesloten
verhoej
Berichten: 64
Lid geworden op: 26 mar 2004, 18:12

Avatar

Bericht door verhoej » 11 apr 2004, 09:12

Kunnen 2 personen gebruik maken van dezelfde avatar in de gallery, of wordt deze gelocked als iemand hem in gebruik heeft.

Gebruikersavatar
Luuk
Berichten: 7311
Lid geworden op: 22 okt 2003, 10:07
Locatie: Delft

Bericht door Luuk » 11 apr 2004, 09:17

Deze wordt niet gelockt, maar daar kun je wel voor zorgen met deze mod: http://www.phpbbhacks.com/viewhack.php?id=786
Afbeelding

jeroen84
Berichten: 95
Lid geworden op: 08 apr 2004, 14:34

Bericht door jeroen84 » 12 apr 2004, 11:39

Hallo, een vraagje, ik heb deze geprobeerd en volgens mij werkt hij niet.
De avatars die al in gebruik zijn, en dus gelocked moeten zijn, worden deze wel weergegeven in de gallery of wat???
Want anders snap ik het misschien niet.
Alvast bedankt,
Groetjes, Jeroen

Gebruikersavatar
Luuk
Berichten: 7311
Lid geworden op: 22 okt 2003, 10:07
Locatie: Delft

Bericht door Luuk » 12 apr 2004, 12:09

dat weet ik niet, ik denk van niet
Afbeelding

jeroen84
Berichten: 95
Lid geworden op: 08 apr 2004, 14:34

Bericht door jeroen84 » 13 apr 2004, 10:20

Nou heb ik deze mod geprobeerd, maar nog steeds worden ze niet gelocked, iedereen kan ze gewoon nog steeds gebruiken...

Script:
#################################################################
## Mod Title: Avatar gallery hack
## Mod Version: 1.0.0
## phpBB Version: 2.0.2
## Author: dzidzius - dzidzius@dione.ids.pl (you can find me also at forum http://www.ForumBest.150.pl, there send all questions)
## Description:
## Avatar from gallery after chosing it by user automatically disappear from gallery. Thanks
## to this hack two users cannot have the same avatar. If user resign from that avatar it will
## be shown again in gallery.
## Installation Level: easy
## Installation Time: 2
## Files To Edit:
##
## includes\usercp_avatar.php,
## Generator: phpBB2 phpBB MODCreator v 1.1
#################################################################
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
#################################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
#################################################################
## Author Note:
##
#################################################################
##
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
#
#-----[ OPEN ]------------------------------------------
#
# includes\usercp_avatar.php
#
#-----[ FIND ]------------------------------------------
#
# $dir = @opendir($board_config['avatar_gallery_path']);
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$my_counter = 0;
$my_checker = 0;
$sql = "SELECT user_avatar
FROM " . USERS_TABLE . "
WHERE user_avatar_type=3";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);
}

while( $row = $db->sql_fetchrow($result) )
{
$my_counter++;
$my_used_list[$my_counter] = $row['user_avatar'];
}

$db->sql_freeresult($result);
#
#-----[ FIND ]------------------------------------------
#
while( $sub_file = @readdir($sub_dir) )
{
if( preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $sub_file) )
{
$avatar_images[$file][$avatar_row_count][$avatar_col_count] = $file . '/' . $sub_file;
$avatar_name[$file][$avatar_row_count][$avatar_col_count] = ucfirst(str_replace("_", " ", preg_replace('/^(.*)\..*$/', '\1', $sub_file)));

$avatar_col_count++;
if( $avatar_col_count == 5 )
{
$avatar_row_count++;
$avatar_col_count = 0;
}
}
}


#
#-----[ REPLACE WITH ]------------------------------------------
#
while( $sub_file = @readdir($sub_dir) )
{
$my_checker = 0;
for ($i = 1; $i<= $my_counter; $i++ )
{
$my_temp = $file . '/' . $sub_file;
if ($my_temp == $my_used_list[$i]) $my_checker=1;
if ($my_checker==1) break;
}
if ($my_checker == 0)
{
if( preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $sub_file) )
{
$avatar_images[$file][$avatar_row_count][$avatar_col_count] = $file . '/' . $sub_file;
$avatar_name[$file][$avatar_row_count][$avatar_col_count] = ucfirst(str_replace("_", " ", preg_replace('/^(.*)\..*$/', '\1', $sub_file)));

$avatar_col_count++;
if( $avatar_col_count == 5 )
{
$avatar_row_count++;
$avatar_col_count = 0;
}
}
}
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Waarom werkt het script niet? Kan iemand me helpen aub?
Alvast bedankt,
Groetjes, Jeroen

Gesloten