Jump to content

Function: mds_is_itc();


Maebius

Recommended Posts

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
Link to comment
Share on other sites

  • 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.

Link to comment
Share on other sites

  • 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

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Forum Statistics

    17.5k
    Total Topics
    182k
    Total Posts
  • Recently Browsing

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
  • Recent Event Reviews

×
×
  • Create New...