cotonti.com : Avatar In Header https://www.cotonti.com Laatste forum onderwerpen Cotonti en Mon, 29 Dec 2025 23:17:29 -0000 SunChase

The code that calls for the avatar:
$sql = sed_sql_query("SELECT user_avatar FROM $db_users WHERE user_id ='".$usr['id']."'");

The code that makes a picture from it:
$idu="<img src=https://www.cotonti.com/\"".$row['user_avatar']."\">";

and than just insert the %idu where you want to put the avatar.]]>
Ma, 29 Jun 2009 19:37:57 -0000
tensh
The logic blocks are from the updated and enhanced Xtemplate class:
http://www.cotonti.com/forums.php?m=posts&q=2305]]>
Ma, 29 Jun 2009 14:08:28 -0000
Kingsley
Got some more info about those 'logic blocks'?]]>
Ma, 29 Jun 2009 07:04:14 -0000
esclkm and tag {PHP.row.user_avatar}

Core hack is very bad idea]]>
Ma, 29 Jun 2009 06:31:08 -0000
medj
I have added the following to common.php in case anyone is wondering in the block where all the other $usr array variables are defined:

$usr['avatar'] = $row['user_avatar'];


I am just wondering, would it not be worth it to add these 2 lines of code (1 to header.php and 1 to common.php) to the default cotonti?]]>
Ma, 29 Jun 2009 06:21:57 -0000
Kilandor Ma, 29 Jun 2009 05:17:01 -0000 Lombi
The code has to be in the same file, just search for the variable troughout the file and you'll find it.]]>
Ma, 29 Jun 2009 04:52:55 -0000
medj I tried that too noticing that the variable $usr was being used throughout header.php.

Can you tell me where I would find the code that defines "$usr['name']"?
I figure there is an SQL statement there that is getting the name of the user logged in, and all I have to do is add "avatar."]]>
Ma, 29 Jun 2009 04:47:31 -0000
Lombi Ma, 29 Jun 2009 04:37:53 -0000 medj I tried adding the following line in system/header.php

"HEADER_USER_AVATAR" => sed_build_userimage($urr['user_avatar'], 'avatar'),

so that it looks like:
	$t->assign(array (
		"HEADER_USER_NAME" => $usr['name'],
		"HEADER_USER_ADMINPANEL" => $out['adminpanel'],
		"HEADER_USER_AVATAR" => sed_build_userimage($urr['user_avatar'], 'avatar'),
		"HEADER_USER_LOGINOUT" => $out['loginout'],
		"HEADER_USER_PROFILE" => $out['profile'],
		"HEADER_USER_PMS" => $out['pms'],
		"HEADER_USER_PFS" => $out['pfs'],
		"HEADER_USER_PMREMINDER" => $out['pmreminder'],
		"HEADER_USER_MESSAGES" => $usr['messages']
	));

Anyone have any ideas? As of right now, it doesn't work properly.]]>
Ma, 29 Jun 2009 04:32:11 -0000