View Full Version : Login Panel; Default Avatar Mod?
LLeBRing
10-10-2006, 03:12 PM
We are running SD 2.3.5 w/IPB 2.1.x integration and have implemented a mod to make a default avatar for users who have yet to create or upload their own. It works very well and we are extremely pleased with it, however we are trying to get the login panel to do the same thing.
The code we used for IPB went something like this...
if($member['avatar']=='') {
$member['avatar']="<img src=\"style_images/<#IMG_DIR#>/noavatar.gif\" width=\"64\" height=\"64\">";}
Code wise, what would need to be done to the loginpanel plugin to have it display a default avatar for all users who do not currently have one? Thanks in advance guys for any help rendered.
LLeBRing
10-11-2006, 02:20 AM
nm, I did a simple 'else' and solved it, works like a champ.
Can someone clarify how to do this using phpBB2 and Subdreamer ? I would love to have a default Avatar.
Thanks
Cj
SSSlippy
11-20-2006, 01:06 PM
Can someone clarify how to do this using phpBB2 and Subdreamer ? I would love to have a default Avatar.
Thanks
Cj
You would have to look for a mod on the phpbb forums for the default avatar. The code here would just make it display in subdreamer login panel.
Pixelrage
11-20-2006, 02:47 PM
I'd love to have this for vB.
robert_p_skold
11-20-2006, 03:14 PM
This should help you. Open up the loginpanel.php
Look for this.
if(isset($avatar))
{
echo '<tr>
<td><br />' . $avatar . '</td>
</tr>';
}
and replace it with this
if(isset($avatar))
{
echo '<tr>
<td><br />' . $avatar . '</td>
</tr>';
}
else
{
echo '<tr>
<td><br />
<img src="http://www.somepic.com/somepic.jpg">
</td>
</tr>';
}
Yeah, you'll have to change the url to some default avatar
SSSlippy
11-20-2006, 06:47 PM
I'd love to have this for vB.
Visit vbulletin.org
Pixelrage
11-20-2006, 07:07 PM
and do what?
Hey,
Thanks for the info. I have used a Phpbb2 Hack to enable a default Avatar and I finally got it working but I can't get Subdreamer to recognise that the user is using the default avatar ? nothing shows up for anyone using the default Avatar?.......... Anyone got any idea how to get it to show up in the Subdreamer Login panel ?
I've attached the code hack I used to get the default avatar in phpbb2
SSSlippy
11-20-2006, 09:01 PM
Refer to this post above
http://www.subdreamer.org/forum/showpost.php?p=10181&postcount=6
Refer to this post above
http://www.subdreamer.org/forum/showpost.php?p=10181&postcount=6
I have tried that ! Didn't work.
robert_p_skold
11-20-2006, 09:51 PM
What's wrong? Did you get an error? It's real simple code. I must admit I didn't try it but seems pretty standard.:(
if(isset($avatar))
{
echo '<tr>
<td><br />' . $avatar . '</td>
</tr>';
}
elseif(strlen($avatar<=0))
{
echo '<tr>
<td><br />
<img src="http://www.somepic.com/somepic.jpg">
</td>
</tr>';
}
try that....
It never done anything. No errors or anything. I changed the link in the code to my link where the image was but it never effected it at all !?
robert_p_skold
11-21-2006, 07:00 AM
try this.
http://www.subdreamer.org/forum/showpost.php?p=10198&postcount=12
Thanks Robert but I still can't get it to work. Can you have a look at my login_panel php and let me know if you have any suggestions. I have been using a modified version of the code by jennec and im using Subdreamer 2.4
Thanks for any help.
CJ
robert_p_skold
11-21-2006, 09:08 PM
Throw this in there and see.
about line 51 , you should be familiar with it all by now.:D
if(isset($avatar))
{
echo '<tr align="Center" valign="Center">
<td align="Center" valign="Center"><div align="center" valign="Center"></div></td>';
}
else $avatar='<img src="http://www.somepic.com/somepic.jpg">';
echo '<tr align="Center" valign="Center">
<td align="Center" valign="Center"><div align="center" valign="Center">' . $avatar . '</div></td>
<td width="10%"></td>
<td align="center"><div align="center">'.iif(isset($cppath), $myaccount, '').'<br /><br/><a href="' . RewriteLink('index.php?categoryid=' . $categoryid . '&logout=1') . '"><img src="http://www.clublandedinburgh.com/subdreamer/plugins/p10_mi_loginpanel/icons/logout.jpg"/><br/>' . $language['logout'] . '</a></div></td>
</tr>';
Seems we had real different versions.:rolleyes:
Still doesn't work. There are no errors or anything but the avatar is still not showing up. Instead of using a link to an avatar image file in the code like you have given me, is it possible for subdreamer to pull the default avatar from phpbb2 ? I added code in phpbb2 to have a default avatar and that all seems to work perfectly for posting in the forum but it doesn't show up in the login panel in subdreamer ?
Thanks for all your help, I wouldn't ask but Im totally clueless when it comes to coding myself. Im fine with edinting code but not codeing from scratch!
CJ
robert_p_skold
11-22-2006, 06:27 AM
I tried both of my suggestions just now. They both worked.
I tried both of my suggestions just now. They both worked.
Could it be that the default avatar code in phpbb2 is conflicting with your default avatar code in the login panel as I can't get it to work.
If you have a few spare minutes would you be able to add the code to the attached loginpanel.php file for me as I have tried numerous times with no effect.
Thanks again, I will soon leave you alone! LOL :lol: :D
robert_p_skold
11-22-2006, 01:13 PM
Paste that on line 56 of your file.
if(!isset($avatar))
$avatar='<img scr="this.jpg>';
It definately isn't working. I have attached an exact copy of my loginpanel code with your code added on line 56 for you to have a look at.
It's really frustrating but I much appreciated all the help you are giving me !
Cj
robert_p_skold
11-22-2006, 05:21 PM
Swap 56-57
if(!$avatar)
$avatar='<img scr="http://www.clublandedinburgh.com/subdreamer/images/default.jpg>';
Now we are getting some where! Im getting the image marker showing up but not my actual image but the image link is perfect in the code ? I triple checked it but it still doesn't appear ! I've even tried changin the folder of my default avatar image but It still doesn't show up.
The login panel now realises that there should be an image there but it can't show it?
Pixelrage
11-28-2006, 01:59 PM
This thread has gotten a little confusing :( has there been any real progress on this? I'm using vbulletin but have not tried to do this mod yet, until someone posts about their success with it.
Pixelrage
11-30-2006, 01:49 PM
For vBulletin users, I found this thread as SSSlippy suggested:
http://www.vbulletin.org/forum/showthread.php?t=97347&highlight=default+avatar
However, I read this comment & reply in the feedback:
Very odd that the default avatar will not show up in the memberlist, but it does show up for me when I view a users profile that doesn't have an avatar set. It also shows up in the postbit for any users that don't have an avatar set.
It isn't a big deal. It probably would be if it was the other way around. http://www.vbulletin.org/forum/images/newsm/happy.gif
My board is running 3.6.2
Actually this mod is designed to work in posts & profiles only so I don't think it's been designed to work in memberlist too.
Does anyone know if it will show up in the SD login panel plugin?
robert_p_skold
11-30-2006, 04:18 PM
Swap 56-57
if(!$avatar)
$avatar='<img scr="http://www.clublandedinburgh.com/subdreamer/images/default.jpg>';
should read
if(!$avatar)
$avatar='<img src="http://www.clublandedinburgh.com/subdreamer/images/default.jpg>';[/quote]
Some one really should have caught that. It only works for the admin panel.
I did sort of thread jack this but I was just trying to help...
@ABC can you remove the other posts and make them their own post or something. This threads a mess.
Tobias
12-03-2006, 06:46 AM
Robert,
your "should read" code was still missing the closing double-quote, here is a more generic version:
if(!$avatar)
$avatar='<img src="'.$sdurl.'images/default.jpg">';
Obviously this requires - if not already present - the $sdurl being put in the "global" list at the top of the function where it is used.
:)
robert_p_skold
12-03-2006, 08:31 AM
I figured it was simple enough to fix. This thread had tried my patiance. I was trying to stay away. It was such a simple matter....:rolleyes:
Great Work People!
thanks. It's finally Working. Thanks for all the effort you lot put into this for us.
crusnik
05-11-2008, 11:28 AM
Is this possible for comments as well? I think I would have to edit the functions.php but I haven't been able to tweak it yet.
thomas
05-11-2008, 11:32 AM
yes there is already a function to show avatars in comments, please upgrade to the latest version of sd
crusnik
05-11-2008, 03:13 PM
I meant default avatar, sorry
thomas
05-11-2008, 11:12 PM
Well this mod is quite old, and would not necessary work with the latest version of subdreamer. apologies.
crusnik
05-11-2008, 11:40 PM
is there a current mod for a default avatar in the comment section?
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.