ArcEmu: Php Script For Blizzard_feedbackui - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Php Script For Blizzard_feedbackui

#1 User is offline   salamanda 

  • Enthusiast
  • PipPipPip
  • Group: Members
  • Posts: 161
  • Joined: 10-July 08

Posted 28 April 2013 - 07:47 AM

Here is a PHP script I wrote in order to read and manage reports via the Blizzard_FeedbackUI addon:

index.php
<!DOCTYPE html>
<html><head><title>Bug Report Reader - Edge of Chaos</title><script language="JavaScript" type="text/javascript">
<!--
if (document.getElementById) {
document.writeln('<style type="text/css"><!--')
document.writeln('.texter {display:none} @media print {.texter {display:block;}}')
document.writeln('//--></style>') }

function openClose(theID) {
if (document.getElementById(theID).style.display == "block") { document.getElementById(theID).style.display = "none" }
else { document.getElementById(theID).style.display = "block" } }
// -->
</script></head><body>
<?php
$connection = mysql_connect("", "", "") or die("Connection to Database failed");
mysql_select_db("") or die ("Database selection failed");

$result = mysql_query("SELECT * FROM `playerbugreports` ORDER BY UID DESC");
$row = mysql_fetch_array($result);
$count = 0;
while ($row)
{
	$count = $count + 1;
	$show = false;
	$output = "";
	for ($i = 0; $i < 6; $i++)
	{
		if ($i == 0)
		{
			$date = date('m/d/Y', $row[2]);
			$output = $output . "<div onClick=\"openClose('a{$row[0]}')\" style=\"cursor:hand; cursor:pointer\">";
			$output = $output . "<u><b>Bug ID: {$row[$i]}</b></u> - <b>Account ID:</b> {$row[1]} - <b>Date:</b> {$date} - <u><font color=\"blue\">Open/Close</font></u></div>";
		}
		else if ($i == 1)
		{
			$output = $output . "<div id=\"a{$row[0]}\" class=\"texter\">";
			$output = $output . "<b>Account ID:</b> {$row[$i]}<br>";
		}
		else if ($i == 2)
		{
			$date = date('m/d/Y', $row[$i]);
			$output = $output . "<b>Date:</b> {$date}<br>";
		}
		else if ($i == 3)
		{
			if ($row[$i] == 1)
			{
				$output = $output . "<b>Suggestion:</b> True<br>";
			}
			else
			{
				$output = $output . "<b>Suggestion:</b> False<br>";
			}
		}
		else if ($i == 4)
		{
			$output = $output . "<a href=\"delete.php?id={$row[0]}\">Delete This Report</a><br>";
			$output = $output . "<b>Character Data:</b><br><pre>";
			// Parse XML
			$html= "<?xml version=\"1.0\"?><Config>{$row[$i]}</Config>";
			$html = str_replace("<", "<T", $html);
			$html = str_replace("<T?", "<?", $html);
			$html = str_replace("<T/", "</T", $html);
			$xml = simplexml_load_string($html);

			$output = $output . "Report Type:		{$xml->T26}<br>";
			$output = $output . "WoW Version:		{$xml->T1}<br>";
			$output = $output . "WoW Build:		{$xml->T2}<br>";
			$output = $output . "Realm Name:		{$xml->T4}<br>";
			$output = $output . "Locale:			{$xml->T5}<br>";
			$output = $output . "Character:		{$xml->T6}<br>";
			$output = $output . "Race:			{$xml->T8}<br>";
			$output = $output . "Level:			{$xml->T7}<br>";
			$output = $output . "Gender:			{$xml->T9}<br>";
			$output = $output . "Average Combat Time:	{$xml->T39}<br>";
			$output = $output . "NPC Name:		{$xml->T23}<br>";
			$output = $output . "Speed:		{$xml->T16}<br>";
			$output = $output . "Map:			{$xml->T11}<br>";
			$output = $output . "Location:		{$xml->T12}<br>";
			$output = $output . "Reported:		{$xml->T43}<br>";
			$output = $output . "AddOns:			{$xml->T19}<br>";
			$output = $output . "Survey Name:		{$xml->T27}<br>";
			$output = $output . "Survey ID:		{$xml->T28}<br>";
			$output = $output . "Survey Objective:		{$xml->T29}<br>";
			$output = $output . "Survey Type:		{$xml->T30}<br>";
			$output = $output . "Survey Obtained:	{$xml->T31}<br>";
			$output = $output . "Survey Submitted:	{$xml->T32}<br>";
			$in = $xml->T33;
			if ($in == 1)
			{
				$in = "Extremely Vague";
			}
			else if ($in == 2)
			{
				$in = "Somewhat Vague";
			}
			else if ($in == 3)
			{
				$in = "Fairly Clear";
			}
			else if ($in == 4)
			{
				$in = "Perfectly Clear";
			}
			$output = $output . "Clarity:		{$in}<br>";
			$in = $xml->T34;
			if ($in == 1)
			{
				$in = "Easy";
			}
			else if ($in == 2)
			{
				$in = "Manageable";
			}
			else if ($in == 3)
			{
				$in = "Challenging";
			}
			else if ($in == 4)
			{
				$in = "Hard";
			}
			$output = $output . "Difficulty:		{$in}<br>";
			$in = $xml->T35;
			if ($in == 1)
			{
				$in = "Awful";
			}
			else if ($in == 2)
			{
				$in = "Bad";
			}
			else if ($in == 3)
			{
				$in = "Good";
			}
			else if ($in == 4)
			{
				$in = "Awesome";
			}
			$output = $output . "Rewards:		{$in}<br>";
			$in = $xml->T36;
			if ($in == 1)
			{
				$in = "Not fun at all";
			}
			else if ($in == 2)
			{
				$in = "Not very fun";
			}
			else if ($in == 3)
			{
				$in = "Pretty fun";
			}
			else if ($in == 4)
			{
				$in = "A lot of fun";
			}
			$output = $output . "Fun:			{$in}<br>";
			$output = $output . "Who:		{$xml->T23}<br>";
			$output = $output . "Where:		{$xml->T24}<br>";
			$output = $output . "When:		{$xml->T25}<br>";
			$output = $output . "Type:		{$xml->T26}<br>";
			$output = $output . "Equipment:		{$xml->T22}<br>";
			$mess = $xml->T41;
			if (strlen($mess) != 0)
			{
				$show = true;
				$output = $output . "Message: {$mess}<br>";
			}

			$output = $output . "</pre>";
			//print_r($xml);

		}
		else if ($i == 5)
		{
			$output = $output . "<b>Computer:</b> <pre>{$row[$i]}<br></pre></div>";
		}
	}
	$output = $output . "<br>";
	if ($show)
	{
		echo $output;
	}
	$row = mysql_fetch_array($result);
}
echo "<br><br><b>There are {$count} reports open.</b><br><br>";

mysql_close($connection);
?>
</body></html>


delete.php
<!DOCTYPE html>
<html><head><title>Bug Report Deleter - Edge of Chaos</title>
<?php
$connection = mysql_connect("", "", "") or die("Connection to Database failed");
mysql_select_db("") or die ("Database selection failed");
$id = mysql_real_escape_string($_GET["id"]);
if ($id != NULL && $id != "")
{
	mysql_query("DELETE FROM `playerbugreports` WHERE `UID` = '{$id}'");
	echo "Deleted successfully. <a href=\"index.php\">Return.</a>";
}
mysql_close($connection);
?>
</body></html>


Screenshot:

Posted Image
0

#2 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 28 April 2013 - 10:15 PM

There's also a sample app for reading them in the repo:
https://github.com/a...ReportReaderApp
"The demand for free goods is infinite."
0

#3 User is offline   salamanda 

  • Enthusiast
  • PipPipPip
  • Group: Members
  • Posts: 161
  • Joined: 10-July 08

Posted 29 April 2013 - 03:50 AM

View Postdfighter, on 28 April 2013 - 10:15 PM, said:

There's also a sample app for reading them in the repo:
https://github.com/a...ReportReaderApp


... :blink:

Well that could have saved me a bit of time, I didn't see it before for some reason. Thanks.

edit:

Actually, my version has much more functionality. Supports more fields, converts index values into their string equivalent (some, not all), allows for deletion of reports, allows for you to view reports without needed to go back/forward between pages, etc. :P
0

#4 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 29 April 2013 - 07:39 AM

View Postsalamanda, on 29 April 2013 - 03:50 AM, said:

... :blink:

Well that could have saved me a bit of time, I didn't see it before for some reason. Thanks.

edit:

Actually, my version has much more functionality. Supports more fields, converts index values into their string equivalent (some, not all), allows for deletion of reports, allows for you to view reports without needed to go back/forward between pages, etc. :P

Yes, that's why it's called a *sample* app :D
"The demand for free goods is infinite."
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users