DemptD |
|
---|---|
There is a default noavatar image that comes when the user has no avatar.
Is it possible to get a "nophoto" image? |
TwistedGA |
|
---|---|
pieter |
|
---|---|
I guess he ment, how to change it in Cotoni that when a user don't upload a photo, a standard one will appear.
BTW: Nicely done. ... can we help you ...
|
DemptD |
|
---|---|
# pieter : I guess he ment, how to change it in Cotoni that when a user don't upload a photo, a standard one will appear. Yes, thats what i meant :) |
TwistedGA |
|
---|---|
Ahhh, my bad. I'll write ya some code for it later.
Open up your functions.php and search for:
elseif($type == 'photo')
{
if(!empty($image))
{
return '<img src="'.$image.'" alt="" class="photo" />';
}
}
Replace with:
elseif($type == 'photo')
{
if(empty($image))
{
$image = 'datas/defaultav/blank2.png';
}
return '<img src="'.$image.'" alt="" class="photo" />';
}
You need to have blank2.png in the same folder as the blank.png for this to work. [color=#CC0000]Lazymod[/color] [color=#000000]Studios[/color]
|
|
Отредактировано: TwistedGA (14.04.2009 04:15, 15 лет назад) |
DemptD |
|
---|---|
Thanks! Works perfectly :)
|
CorpQuid |
|
---|---|
Nice Job, works excellent!
Thank you |
simplex |
|
---|---|
Even better, how about the "No Avatar" image links to the users profile page.
So if a user sees their "No Avatar" image they can click on it and load one into their profile. |
Lissbol |
|
---|---|
you probably could fix it with sql instead of doing corehax
Run this with phpMyAdmin, tab "SQL" : Code: ALTER TABLE sed_users CHANGE user_avatar user_avatar varchar(255) collate utf8_unicode_ci NOT NULL default 'datas/avatars/default.gif'; ... And upload the default GIF : datas/avatars/default.gif Optionally, you can also set this default image for the already registered members with no avatar : Code: UPDATE sed_users SET user_avatar='datas/avatars/default.gif' WHERE user_avatar=''; did work on the Sed engine should work on Cotonti aswell LISSBOL Designs
|
Kingsley |
|
---|---|
# TwistedGA : Ahhh, my bad. I'll write ya some code for it later. Somehow this isn't working for me. It won't display the image at all.. only get a red cross.. |
CorpQuid |
|
---|---|
Did you upload the blank2 image from Twisted first post above?
http://www.cotonti.com/datas/users/blank2_252.png Download that image and put it in the datas/defaultav/ folder and you should be all set. You need to either rename the image to blank2.png or you need to modify the code twisted gave above to $image = 'datas/defaultav/blank2_252.png'; |
esclkm |
|
---|---|
I think that this is bad idea. We have logic in new version of Xtemplate by medar. And noimage we can realise with help of this Without any core hacks
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты |
Kingsley |
|
---|---|
@ CorpQuid
I tried it with the image provided by Twisted and with one I made myself. Everytime I get the red cross. even tried to do it with blank.png. Followed twisted post to the letter. @esclkm If you have a better way, please share it with us.. |
CorpQuid |
|
---|---|
esclkm,
I can not find the template that you mentioned "Xtemplate by medar" can you share the logic that you have so that we can implement this in our own templates? Or am I miss-understanding you? Lissbol, I noticed your suggestion is for the Avatar, would we just change the paths and such to reflect for the photo? The avatar currently works fine out of the box Cotonti install, it's the Photo thats not showing. Kingsley, The way they are suggesting I believe is much better so lets wait for them to reply, this way we do not have to core hack our installs. |
TwistedGA |
|
---|---|
I can't imagine why it's not working Kingsley.. Very odd..
Here is the SQL to run should you not want to core hack it in. Which by the way, are very uninvasive and easy to uninstall if you do it like you should and make backups, not hard. There is absolutely nothing wrong with corehacking. UPDATE sed_users SET user_photo='datas/defaultav/blank2.png' WHERE user_photo='';
ALTER TABLE sed_users CHANGE user_photo user_photo varchar(255) NOT NULL default 'datas/defaultav/blank2.png'; [color=#CC0000]Lazymod[/color] [color=#000000]Studios[/color]
|