Search

bbPress Showcase » Plugins by Others

Avatar Upload (0.8.3) - Delete Avatar BUG.

RSS
  1. Perry
    User has not uploaded an avatar

    new member
    Joined: Feb '09
    Posts: 4

    offline

    Hello _ck_

    You posted an extention to the Avatar Upload (0.8.3) plugin to allow users to delete their avatars. However, the code you posted does not set the avatar to the default when deleted. I tested your avatar system on this bbpress and it does, please can you provide me with the code that will do this.

    Link to your post: http://bbpress.org/plugins/topic/avatar-upload/page/5/#post-1093

    Regards,

    Perry

    Posted 3 years ago #
  2. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 884

    offline

    I suspect the code to display the default when nothing else is saved/specified is probably in the display portion of the code.

    make sure your 'use_default' is set to 1 near the top
    and then compare yours to this:

    // Display the avatar image
    function avatarupload_display($id, $force_db=0, $class='avatar')
    {
    	if ($a = avatarupload_get_avatar($id,1,$force_db))
    	{	if ($a[1] && $a[2]) {$dimensions="width='$a[1]' height='$a[2]'";}
    		echo &quot;<img src='$a[0]' $dimensions alt='$a[4]' class='$class' />&quot;;
    	} else {
    		$config = new avatarupload_config();
    
    		if ($config->default_avatar['use_default'] == 1)
    		{
    			// Use a &quot;genric&quot; default avatar
    			echo '<img src=&quot;'.$config->default_avatar['uri'].'&quot; width=&quot;'.$config->default_avatar['width']
    			.'&quot; height=&quot;'.$config->default_avatar['height'].'&quot; alt=&quot;'.$config->default_avatar['alt'].'&quot; class=&quot;'.$class.'&quot; />';
    		} else {
    			// Or use Identicons instead.  New users will have an identicon automatically
    			// created when they join, but this is for existing users with no avatar.
    
    			felapplyidenticon($id); // create identicon
    
    			// now fetch it from the database
    			if ($a = avatarupload_get_avatar($id,1,$force_db))
    			{	if ($a[1] &amp;&amp; $a[2]) {$dimensions=&quot;width='$a[1]' height='$a[2]'&quot;;}
    				echo &quot;<img src='$a[0]' $dimensions alt='$a[4]' class='$class' />&quot;;
    			}
    		}
    	}
    }
    Posted 3 years ago #
  3. Perry
    User has not uploaded an avatar

    new member
    Joined: Feb '09
    Posts: 4

    offline

    My "use_default" is set to 1 near the top and when I try your code I get PHP error Parse error: syntax error, unexpected ';' in /home/runece00/public_html/forums/bb-plugins/avatar/bb-avatar-upload.php on line 84

    Posted 3 years ago #
  4. Perry
    User has not uploaded an avatar

    new member
    Joined: Feb '09
    Posts: 4

    offline

    Perry - 4 minutes ago  » 
    My "use_default" is set to 1 near the top and when I try your code I get PHP error Parse error: syntax error, unexpected ';' in /home/runece00/public_html/forums/bb-plugins/avatar/bb-avatar-upload.php on line 84

    Ok, Ignore that I wasn't looking at the code - Let me try again.

    Posted 3 years ago #
  5. Perry
    User has not uploaded an avatar

    new member
    Joined: Feb '09
    Posts: 4

    offline

    Okay now I get Fatal error: Call to undefined function avatarupload_display() in /home/runece00/public_html/forums/bb-templates/kakumei/profile.php on line 7 When I try to view the profile page...

    Posted 3 years ago #
  6. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 884

    offline

    I just gave you the very function it says is missing.
    Did you replace the function in your plugin copy?

    Posted 3 years ago #

RSS feed for this topic

Post a reply to “Avatar Upload (0.8.3) - Delete Avatar BUG.”

You must log in to post.

keep _ck_ coding >> donate $5 <<     Theme Switcher:
31 users online from in the past 30 minutes. 15 bots 15 guests 1 members: mccawphoto
7,543 views today 8,665 yesterday 14,010 peak. Most at once 63 today 48 yesterday 131 peak. Visited today: Dickinsonjohn9, shairah27, xiaotian, _ck_, engin1984, Augustine01, MichaelGomez, mccawphoto, KitchenDip
2,240 posts in 380 topics over 63 months by 425 of 1,992 members. Latest: shairah27, Augustine01, MichaelGomez