Hoşgeldin Misafir

[MOD] Flash Avatar Mod / Flash Kullanılabilir Avatar

MiRaT

13 Kas 2017
2,077 Mesaj

Aktiflik

Seviye

Deneyim

TIM / GÖREV:
-Açıklama : Bu modla beraber kullanıcılar avatarlarında flash dosyalar kullanabileceklerdir.. 

Kullanılabilir Uzantılar : 'application/x-shockwave-flash , swf , jpeg , pjpeg , jpg --



Kod:
################################################################# 
## Mod Title: Flash Avatar 
## Mod Version: 1.3 
## Author: Hawaiian Dude < [email protected] > Steve 
## Description: 
## With this Mod a user can select a flash file for his/her avatar. 
## 
## 
## 
## Installation Level: easy 
## Installation Time: 2-5 Minutes 
## Files To Edit: viewtopic.php, 
## usercp_viewprofile.php, 
## usercp_avatar.php, 
## usercp_register.php 
## Included Files: N/A 
################################################################# 
## 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/ 
############################################################## 
## Authors Notes: 
## 
## Now updated for phpBB 2.0.3 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
################################################################# 

# 
#-----[ OPEN ]--------------------------------------------- 
# 
viewtopic.php 

# 
#-----[ FIND ]--------------------------------------------- 
# 
if ( $postrow[$i]['user_avatar_type'] && $poster_id != ANONYMOUS && $postrow[$i]['user_allowavatar'] ) 
{ 
switch( $postrow[$i]['user_avatar_type'] ) 
{ 
case USER_AVATAR_UPLOAD: 
$poster_avatar = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $postrow[$i]['user_avatar'] . '" alt="" border="0" />' : ''; 
break; 
case USER_AVATAR_REMOTE: 
$poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $postrow[$i]['user_avatar'] . '" alt="" border="0" />' : ''; 
break; 
case USER_AVATAR_GALLERY: 
$poster_avatar = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $postrow[$i]['user_avatar'] . '" alt="" border="0" />' : ''; 
break; 
} 
} 

# 
#-----[ REPLACE WITH ]-------------------------------------- 
# 
if ( $postrow[$i]['user_avatar_type'] && $poster_id != ANONYMOUS && $postrow[$i]['user_allowavatar'] ) 
{ 
if ( strpos ( $postrow[$i]['user_avatar'], ".swf" ) != 0 ) { 
$first_part = '<embed src="'; 
$second_part = '" quality="high" width=60 height=60 type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" />'; 
} else { 
$first_part = '<img src="'; 
$second_part = '" alt="" border="0" />'; 
} 
switch( $postrow[$i]['user_avatar_type'] ) 
{ 
case USER_AVATAR_UPLOAD: 
$poster_avatar = ( $board_config['allow_avatar_upload'] ) ? $first_part . $board_config['avatar_path'] . '/' . $postrow[$i]['user_avatar'] . $second_part : ''; 
break; 
case USER_AVATAR_REMOTE: 
$poster_avatar = ( $board_config['allow_avatar_remote'] ) ? $first_part . $postrow[$i]['user_avatar'] . $second_part : ''; 
break; 
case USER_AVATAR_GALLERY: 
$poster_avatar = ( $board_config['allow_avatar_local'] ) ? $first_part . $board_config['avatar_gallery_path'] . '/' . $postrow[$i]['user_avatar'] . $second_part : ''; 
break; 
} 
} 

# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/usercp_viewprofile.php 

# 
#-----[ FIND ]--------------------------------------------- 
# 
if ( $profiledata['user_avatar_type'] && $profiledata['user_allowavatar'] ) 
{ 
switch( $profiledata['user_avatar_type'] ) 
{ 
case USER_AVATAR_UPLOAD: 
$avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $profiledata['user_avatar'] . '" alt="" border="0" />' : ''; 
break; 
case USER_AVATAR_REMOTE: 
$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $profiledata['user_avatar'] . '" alt="" border="0" />' : ''; 
break; 
case USER_AVATAR_GALLERY: 
$avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $profiledata['user_avatar'] . '" alt="" border="0" />' : ''; 
break; 
} 
} 

# 
#-----[ REPLACE WITH ]-------------------------------------- 
# 
if ( $profiledata['user_avatar_type'] && $profiledata['user_allowavatar'] ) 
{ 
if ( strpos ( $profiledata['user_avatar'], ".swf" ) != 0 ) { 
$first_part = '<embed src="'; 
$second_part = '" quality="high" width=60 height=60 type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" />'; 
} else { 
$first_part = '<img src="'; 
$second_part = '" alt="" border="0" />'; 
} 
switch( $profiledata['user_avatar_type'] ) 
{ 
case USER_AVATAR_UPLOAD: 
$avatar_img = ( $board_config['allow_avatar_upload'] ) ? $first_part . $board_config['avatar_path'] . '/' . $profiledata['user_avatar'] . $second_part : ''; 
break; 
case USER_AVATAR_REMOTE: 
$avatar_img = ( $board_config['allow_avatar_remote'] ) ? $first_part . $profiledata['user_avatar'] . $second_part : ''; 
break; 
case USER_AVATAR_GALLERY: 
$avatar_img = ( $board_config['allow_avatar_local'] ) ? $first_part . $board_config['avatar_gallery_path'] . '/' . $profiledata['user_avatar'] . $second_part : ''; 
break; 
} 
} 

# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/usercp_avatar.php 

# 
#-----[ FIND ]--------------------------------------------- 
# 
function check_image_type(&$type, &$error, &$error_msg) 
{ 
global $lang; 

switch( $type ) 
{ 
case 'jpeg': 
case 'pjpeg': 
case 'jpg': 
return '.jpg'; 
break; 

# 
#-----[ REPLACE WITH ]-------------------------------------- 
# 
function check_image_type(&$type, &$error, &$error_msg) 
{ 
global $lang; 

switch( $type ) 
{ 
case 'application/x-shockwave-flash': 
return '.swf'; 
break; 
case 'jpeg': 
case 'pjpeg': 
case 'jpg': 
return '.jpg'; 
break; 

# 
#-----[ FIND ]--------------------------------------------- 
# 
function user_avatar_url($mode, &$error, &$error_msg, $avatar_filename) 
{ 
if ( !preg_match('#^(http)|(ftp):\/\/#i', $avatar_filename) ) 
{ 
$avatar_filename = 'http://' . $avatar_filename; 
} 

if ( !preg_match('#^((http)|(ftp):\/\/[a-z0-9\-]+?\.([a-z0-9\-]+\.)+[a-z]+(:[0-9]+)*\/.*?\.(gif|jpg|jpeg|png)$)#is', $avatar_filename) ) 
{ 

# 
#-----[ REPLACE WITH ]-------------------------------------- 
# 
function user_avatar_url($mode, &$error, &$error_msg, $avatar_filename) 
{ 
if ( !preg_match('#^(http)|(ftp):\/\/#i', $avatar_filename) ) 
{ 
$avatar_filename = 'http://' . $avatar_filename; 
} 

if ( !preg_match('#^((http)|(ftp):\/\/[a-z0-9\-]+?\.([a-z0-9\-]+\.)+[a-z]+(:[0-9]+)*\/.*?\.(gif|jpg|jpeg|png|swf)$)#is', $avatar_filename) ) 
{ 

# 
#-----[ FIND ]--------------------------------------------- 
# 
else if ( $avatar_mode == 'local' && file_exists($avatar_filename) && preg_match('/\.(jpg|jpeg|gif|png)$/i', $avatar_realname) ) 
{ 

# 
#-----[ REPLACE WITH ]-------------------------------------- 
# 
else if ( $avatar_mode == 'local' && file_exists($avatar_filename) && preg_match('/\.(jpg|jpeg|gif|png|swf)$/i', $avatar_realname) ) 
{ 

# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/usercp_register.php 

# 
#-----[ FIND ]--------------------------------------------- 
# 
if ( $user_avatar_type ) 
{ 
switch( $user_avatar_type ) 
{ 
case USER_AVATAR_UPLOAD: 
$avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $user_avatar . '" alt="" />' : ''; 
break; 
case USER_AVATAR_REMOTE: 
$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $user_avatar . '" alt="" />' : ''; 
break; 
case USER_AVATAR_GALLERY: 
$avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $user_avatar . '" alt="" />' : ''; 
break; 
} 
} 

# 
#-----[ REPLACE WITH ]-------------------------------------- 
# 
if ( $user_avatar_type ) 
{ 
if ( strpos ( $user_avatar, ".swf" ) != 0 ) { 
$first_part = '<embed src="'; 
$second_part = '" quality="high" width=60 height=60 type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" />'; 
} else { 
$first_part = '<img src="'; 
$second_part = '" alt="" border="0" />'; 
} 
switch( $user_avatar_type ) 
{ 
case USER_AVATAR_UPLOAD: 
$avatar_img = ( $board_config['allow_avatar_upload'] ) ? $first_part . $board_config['avatar_path'] . '/' . $user_avatar . $second_part : ''; 
break; 
case USER_AVATAR_REMOTE: 
$avatar_img = ( $board_config['allow_avatar_remote'] ) ? $first_part . $user_avatar . $second_part : ''; 
break; 
case USER_AVATAR_GALLERY: 
$avatar_img = ( $board_config['allow_avatar_local'] ) ? $first_part . $board_config['avatar_gallery_path'] . '/' . $user_avatar . $second_part : ''; 
break; 
} 
} 

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM