Skip to content
View in the app

A better way to browse. Learn more.

MagicDuel Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Function: Mds_Player_Avatar

Featured Replies

[b]null[/b] mds_player_avatar(string $name, string $attributes);

Will echo the player's avatar image if the name is valid, otherwise it will give a no avatar message.

Player name is not case sensitive.
The image is echoed directly by the function with only a null value returned.

The function can be called a maximum of 5 times in the script.

Attributes are not required, but if used will be given directly to the image in html.

Example:

HTML
[code]
<script type="text/javascript">
function toggle(){
var img = document.getElementById("avatar");
img.style.display = img.style.display == "none" ? "inline" : "none";
}
</script>
<input type="button" value="Show/Hide" onclick="toggle()" />
<br />
[/code]

Script
[code]
echo @content[0];
mds_player_avatar('Rendril Revant', 'id="avatar"');
[/code]

Edited by Rendril

It's not case sensitive...
i get my avatar by entering '*burns*' xD

apart from that... i left out the id= part, and it still works :/

script:
[php]echo @content[0];
@vn=@input['name'];
mds_player_avatar(@vn); [/php]

html:
[html]<form method="post" action=""> Enter a Playername and see his/her Avatar!<br />
<input name="name" type="text" /><br /> <br />
<input name="submit" type="submit" value="Show me your looks!"/><br /> </form>[/html]

  • Author

Thanks for pointing out the change. When I tested it the function was case sensitive.

Attritbutes are not required, I added the id only because the particular example I used needed a reference.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Forum Statistics

  • Total Topics 17.5k
  • Total Posts 182.2k

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.