Forums / Cotonti / Core Labs / User Avatar in User Menu

a litle core hack

scriptor
#1 2010-02-11 02:37
To Display the User Avatar in the User menu you must only change the header.php in the core folder.
Find:
$t->assign(array (
			"HEADER_USER_NAME" => $usr['name'],
			"HEADER_USER_ADMINPANEL" => $out['adminpanel'],
			"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']
		));

And Change it with:
$sql = sed_sql_query("SELECT * from sed_users WHERE user_id='".$usr['id']."' LIMIT 1");
		$row = sed_sql_fetcharray($sql);
		
		$t->assign(array (
			"HEADER_USER_NAME" => $usr['name'],
			"HEADER_USER_ADMINPANEL" => $out['adminpanel'],
			"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'],
			"HEADER_USER_AVATAR" => $row['user_avatar']
		));

Then You can use {HEADER_USER_AVATAR} in your header.tpl :)
[url=http://www.freak-forum.de]Freak-Forum.de[/url] - The Freakstyle Community<br />
[url=http://www.adelmann-solutions.com]adelmann-solutions, webdesign Freiburg[/url]
3axap
#2 2010-02-11 03:03
Tnx...but how make this whithout core hack?
Kort
#3 2010-02-11 03:10
No need for a hack:
<!-- IF {PHP.usr.profile.user_avatar} -->
	<img src="{PHP.usr.profile.user_avatar}" alt="{PHP.L.Avatar}" />
<!-- ELSE -->
	<img src="datas/defaultav/blank.png" alt="{PHP.L.Avatar}" />
<!-- ENDIF -->
SED.by - создание сайтов, разработка плагинов и тем для Котонти

Dit bericht is bewerkt door Kort (2010-02-11 04:17, 14 jaren ago)
scriptor
#4 2010-02-11 03:32
ah cool thats simpler and update ressistance :) Merci
[url=http://www.freak-forum.de]Freak-Forum.de[/url] - The Freakstyle Community<br />
[url=http://www.adelmann-solutions.com]adelmann-solutions, webdesign Freiburg[/url]
pieter
#5 2010-02-11 04:13
Xtemplate is very powerfull.

Only question is. Where can we find all the tags like {PHP.usr.profile.user_avatar}?
Is there a complete list?
... can we help you ...
Kort
#6 2010-02-11 04:19
Just find the variable you need in the module it belongs to :) Listing all of them is one hell of a job!
SED.by - создание сайтов, разработка плагинов и тем для Котонти
marksjoni
#7 2015-02-21 06:12

Only question is. Where can we find all the tags like {PHP.usr.profile.user_avatar}?
ghfhgj ghjk

asad
pieter
#8 2015-02-21 12:18

Here you can see how you can find them.

http://www.cotonti.com/docs/ext/themes/cotemplate_debug_mode

 

... can we help you ...