Verify user photos

Neue Projekte und Anfragen, Teamarbeiten und Alpha/Beta Scripte jeder Art.
KEINE Supportanfragen zu bestehenden MODs!
Antworten
mayona
Beiträge: 19
Registriert: Sa 18.Dez, 2004 00:33

Beitrag von mayona »

I have profilephoto_mod installed... and instead of verifying the user... I wanna use it to verify someone else's photo....

I only wanna show the link "verify photo" (all it's function) if there's a photo. I know it has to be change something in the profilephoto_mod.php file.

I copied whatever on the usercp_viewprofile.php and here's a part of my profilephoto_mod code to view the photo with your mod :):

Code: Alles auswählen

	function perform_viewprofile()
	{
		global $HTTP_GET_VARS, $lang, $board_config, $phpbb_root_path, $phpEx, $template, $profiledata;
		
		if ( !file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_profilephoto.'.$phpEx) )
		{
			include($phpbb_root_path . 'language/lang_english/lang_profilephoto.'.$phpEx);
		}
		else
		{
			include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_profilephoto.' . $phpEx);
		}

		if ( empty($HTTP_GET_VARS[POST_USERS_URL]) || $HTTP_GET_VARS[POST_USERS_URL] == ANONYMOUS )
		{
			message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
		}
		
		$profiledata = get_userdata(intval($HTTP_GET_VARS[POST_USERS_URL]));
		// Verify User Start
if ( $userdata['session_logged_in'] )
{
	include_once($phpbb_root_path . 'includes/functions_verify_user.'.$phpEx);

	// Get verify mode
	$verify = ( isset($HTTP_GET_VARS['verify']) ) ? $HTTP_GET_VARS['verify'] : $HTTP_POST_VARS['verify'];

	// Check if user is banned
	$verify_ban = get_verify_ban_status($userdata['user_id']);

	// Check verify status and user ban
	if ( ( $verify == 'verify' || $verify == 'pending' ) && $verify_ban == FALSE )
	{
		// Get verify status for current user
		$verify_userstatus = get_verify_user($userdata['user_id']);

		// Set verify status for profileuser
		$verify_status = ( ($verify == 'pending' && $verify_config['allow_suggest'] == 1) || ( $verify_userstatus[$userdata['user_id']]['id'] == 2 && $verify_config['allow_verify_suggest'] == 1)) ? 1 : ( ( $userdata['user_level'] == ADMIN || ( $verify_userstatus[$userdata['user_id']]['id'] == 2 && $verify_config['allow_verify'] == 1 ) ) ? 2 : 0 );

		// Save status and notify profileuser if needed
		if ( $verify_status != 0 )
		{
			// Set status check for undo verifing by admin
			$save_status_check = TRUE;

			$verify_time_now = time();

			switch ($userdata['user_level'])
			{
				case ADMIN:
					$save_status_check = FALSE;
					break;
				case MOD:
					if ( $verify_config['verify_mod_allow'] == 1 )
					{
						$save_status_check = FALSE;
					}
					else
					{
						$save_status_check = TRUE;
					}
					break;
			}
			// Save status check if needed
			if ( $save_status_check == TRUE )
			{
				$sql = "INSERT INTO " . VERIFY_USER_TABLE . " (verified_by, user_id)
					VALUES (" . $userdata['user_id'] . ", " . $profiledata['user_id'] . ")";
				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Could not save verifing check', '', __LINE__, __FILE__, $sql);
				}
			}
			
			// Update verify status for user
			$sql = "UPDATE " . USERS_TABLE . " SET 
				verify_status = $verify_status, 
				verified_suggest = ".$userdata['user_id'].", 
				verified_suggest_name = '".$userdata['username']."', 
				verified_suggest_time = $verify_time_now, ";

			switch ($verify)
			{
				case 'pending':
					$sql .= "verified_by = '', 
						 verified_by_name = '', 
						 verified_time = 0";
					break;
				case 'verify':
					$sql .= "verified_by = ".$userdata['user_id'].", 
						 verified_by_name = '".$userdata['username']."', 
						 verified_time = $verify_time_now";
					break;
				default:
					break;
			}

					
		}
	}
}
// Verify User END





if ( $board_config['cell_allow_display_celleds'] && $profiledata['user_cell_celleds'] ) 
{
	$template->assign_block_vars('celleds', array());
}

		$photo_img = '';
		if ( $profiledata['user_photo_type'] )
		{
		
		// Verify User START
$vy = get_verify_user($profiledata['user_id']);
$verify = $vy[$profiledata['user_id']]['id'];

$dateformat = ( $userdata['user_dateformat'] == '' ) ? $board_config['default_dateformat'] : $userdata['user_dateformat'];
$timezone = ( $userdata['user_timezone'] == '' ) ? $board_config['board_timezone'] : $userdata['user_timezone'];

$verify_status = $verify;
$verify_user_name = $vy[$profiledata['user_id']]['by_name'];
$verify_user_time = create_date($dateformat, $vy[$profiledata['user_id']]['time'], $timezone);
$verify_suggest_name = $vy[$profiledata['user_id']]['suggest_name'];
$verify_suggest_time = create_date($dateformat, $vy[$profiledata['user_id']]['suggest_time'], $timezone);

$alt_title_by = ': '.$verify_user_name.' ('.$verify_user_time.') ';
$alt_title_suggest = ': '.' ('.$verify_suggest_time.') - ';

if ( $verify_status == 1 )
{
	$verify_user = '<img src="images/haken_gelb.gif" border="0" alt="'.$lang['Suggest_by'].$alt_title_suggest.$lang['User_verify_pending'].'" title="'.$lang['Suggest_by'].$alt_title_suggest.$lang['User_verify_pending'].'" />';
}
else if ( $verify_status == 2 )
{
	$verify_user = '<img src="images/icon_verified.gif" border="0" alt="'.$lang['Suggest_by'].$alt_title_suggest.$lang['User_was_verified'].$alt_title_by.'" title="'.$lang['Suggest_by'].$alt_title_suggest.$lang['User_was_verified'].$alt_title_by.'" />';
}
else if ( $userdata['user_id'] != $profiledata['user_id'] && $userdata['session_logged_in'] )
{
	$verify_ban = get_verify_ban_status($userdata['user_id']);
	
	if ( $verify_ban == FALSE )
	{
		$verify_userstatus = get_verify_user($userdata['user_id']);
		$verify_userstatus[$userdata['user_id']]['id'] = ( $verify_userstatus[$userdata['user_id']]['id'] == '' ) ? 0 : $verify_userstatus[$userdata['user_id']]['id'];

		if ( $userdata['user_level'] == ADMIN || ( $verify_userstatus[$userdata['user_id']]['id'] == 2 && $verify_config['allow_verify'] == 1 ) )
		{
			$verify_mode = 'verify';
		}
		else if ( ($verify_config['allow_suggest'] == 1 || ($verify_userstatus[$userdata['user_id']]['id'] == 2 && $verify_config['allow_verify_suggest'] == 1)) && $userdata['user_level'] != ADMIN )
		{
			$verify_mode = 'pending';
		}
		else
		{
			$verify_mode = '';
		}

		if ( $verify_mode != '')
		{
			$sql = "SELECT * FROM " . VERIFY_USER_TABLE . "
				WHERE verified_by = " . $userdata['user_id'] . "
				AND user_id = " . $profiledata['user_id'];
			if ( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not check old verifing', '', __LINE__, __FILE__, $sql);
			}

			$check_old_verify = $db->sql_numrows($result);
			$db->sql_freeresult($result);

			if ( $check_old_verify == 0 )
			{
				$verify_user = '<a href="'.append_sid("profile.$phpEx?mode=viewprofile&verify=$verify_mode&".POST_USERS_URL."=".$profiledata['user_id']).'" class=mainmenu" alt="'.$verify_config['verify_explain'].'" title="'.$verify_config['verify_explain'].'">'.$lang['Verify_user'].'</a>';
			}
			else
			{
				$verify_user = '';
			}
		}
		else
		{
			$verify_user = '';
		}
	}
	else
	{
		$verify_user = '';
	}
}
// Verify User END
			switch( $profiledata['user_photo_type'] )
			{
				case USER_AVATAR_UPLOAD:
					$photo_img = ( $board_config['allow_photo_upload'] ) ? '<b><i><span class="genmed">'. GetUsersAttitude($profiledata['user_attitude_mod'], $profiledata['user_id']).'</span></i></b><br><br>' .'<img src="' . $board_config['photo_path'] . '/' . $profiledata['user_photo'] . '" alt="" border="0" />'.'<br><br>' . $verify_user: '';
					$photo_img = ( ($profiledata['user_cell_time'] > 0) && $board_config['cell_allow_display_bars']) ? '<div style="position:absolute;padding:0px;width:'.$board_config['photo_max__width'].'px;height:'.$board_config['photo_max__height'].'px;z-index:1;"><IMG src="' . $board_config['photo_path'] . '/' . $profiledata['user_photo'] . '" border=0 width="'.$board_config['photo_max_width'].'" height="'.$board_config['photo_max_height'].'"></div><div style="position:relative;padding:0px;width:'.$board_config['photo_max_width'].'px;height:'.$board_config['photo_max_height'].'px;z-index:2;"><IMG src="images/cell.gif" border=0 STYLE="filter:alpha(opacity=65)" width="'.$board_config['photo_max_width'].'" height="'.$board_config['photo_max_height'].'"></div>' : $photo_img ;
					break;
				case USER_AVATAR_REMOTE:
					$photo_img = ( $board_config['allow_photo_remote'] ) ? '<img src="' . $profiledata['user_photo'] . '" alt="" border="0" />' : '';
					$photo_img = ( ($profiledata['user_cell_time'] > 0) && $board_config['cell_allow_display_bars'] ) ? '<div style="position:absolute;padding:0px;width:'.$board_config['photo_max_width'].'px;height:'.$board_config['photo_max_height'].'px;z-index:1;"><IMG src="' . $profiledata['user_photo'] . '" border=0 width="'.$board_config['avatar_max_width'].'" height="'.$board_config['photo_max_height'].'"></div><div style="position:relative;padding:0px;width:'.$board_config['photo_max_width'].'px;height:'.$board_config['photo_max_height'].'px;z-index:2;"><IMG src="images/cell.gif" border=0 STYLE="filter:alpha(opacity=65)" width="'.$board_config['photo_max_width'].'" height="'.$board_config['photo_max_height'].'"></div>' : $photo_img ;
					break;
			}
		}

		$template->assign_vars(array(
			'L_PHOTO' => $lang['Profile_photo'],
			'PHOTO_IMG' => $photo_img)
		);
	
	}
	


	


Thanks
Zuletzt geändert von mayona am Fr 01.Apr, 2005 22:46, insgesamt 2-mal geändert.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

I must think about this, but at the moment I must end creating a new page.
Sorry for the moment...
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
mayona
Beiträge: 19
Registriert: Sa 18.Dez, 2004 00:33

Beitrag von mayona »

Sorry i didn't c the split... thanks for answering :)
Antworten