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_is_itc();

Featured Replies

Thank you Rendril!

array|boolean mds_is_itc(string $itc)

Returns false if invalid ITC is supplied,
otherwise it returns an array with item information.

["id"] - The ID of the item itself.
["uid"] - The ID of the owner!

["playername"] - The playername of the owner
["name"] - The name of the object (ie: "Silver Coin")
["creationdate"] - When it was created (as epoch seconds I think?)
["transferdate"] - last transfer date (also as epoch secondS?)
["tag"] - Tag ("tool", "Valuable", "enchanted, consumable", etc)


When inputting an item transfer code, never use the full string, it will be treated as invalid and return false.
I find it best to copy from the ITC to MDI of the code, that is all it needs to identify the creature.


if(isset(@input['submit']))//check that button was clicked
{
@vc= mds_is_itc(@input['ctc0']);
if (@vc) {
echo "<table border=1>";
echo "<tr><td>Item Name:</td><td>".@vc["name"]."</td></tr>";
echo "<tr><td>Item ID:</td><td>".@vc["id"]."</td></tr>";
echo "<tr><td>Owner ID:</td><td>".@vc["uid"]."</td></tr>";
echo "<tr><td>Owner Playername: </td><td>".@vc["playername"]."</td></tr>";
echo "<tr><td>Created:</td><td>".date("F j, Y, g:i a",@vc["creationdate"])."</td></tr>";
echo "<tr><td>Last Transfer:</td><td>".date("F j, Y, g:i a",@vc["transferdate"])."</td></tr>";
echo "<tr><td>Tags:</td><td>".@vc["tag"]."</td></tr>";
echo "</table>";
echo @content[0];
} else {
echo "Sorry, it appears that is not a va"."lid Item Transfer Code.<br>";
echo @content[0];
}

} else {
//echo the html, it is not shown by default
echo @content[0];
}
 
if(isset(@input['submit']))//check that button was clicked
{
@vc= mds_is_itc(@input['ctc0']);
if (@vc) {
echo "<table border=1>";
echo "<tr><td>Item Name:</td><td>".@vc["name"]."</td></tr>";
echo "<tr><td>Item ID:</td><td>".@vc["id"]."</td></tr>";
echo "<tr><td>Owner ID:</td><td>".@vc["uid"]."</td></tr>";

echo "<tr><td>Created:</td><td>".date("F j, Y, g:i a",@vc["creationdate"])."</td></tr>";
echo "<tr><td>Last Transfer:</td><td>".date("F j, Y, g:i a",@vc["transferdate"])."</td></tr>";
echo "<tr><td>Tags:</td><td>".@vc["tag"]."</td></tr>";
echo "</table>";
echo @content[0];
} else {
echo "Sorry, it appears that is not a va"."lid Item Transfer Code.<br>";
echo @content[0];
}

} else {
//echo the html, it is not shown by default
echo @content[0];
}

<form method="post" action="">
Enter an ITC to check<br />
<input name="ctc0" type="text" /><br />
<br />
<input name="submit" type="submit" value="Submit"/><br />
<br />
<font size="1px">*Copy from "ITC" to "MDI", not the entire code</font>
</form>

Edited by Chewett

  • 1 year later...

What's the significance behind this function and mds_is_ctc being designed to return the owner's UID but not their name? It's simple enough to manually find someone's name from their UID, so spoilers/secrets wouldn't seem to be an issue.

  • Root Admin

What's the significance behind this function and mds_is_ctc being designed to return the owner's UID but not their name? It's simple enough to manually find someone's name from their UID, so spoilers/secrets wouldn't seem to be an issue.

 

Probably because thats what information was available and therefore easy to access, i have added playername and updated the docs for both functions

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.