EndGame for DF

Addons for WoWRosterDF

EndGame for DF

Postby blueagewizard » Thu May 03, 2007 12:23 am

I tried to get EndGame to work for DF but can't get the "Zone" to work ... just takes me back to the index of my site.
any ideas?

EndGame

I know that this URL works

http://stlguild.com/index.php?name=WoWR ... C&zone=NAX

but to change:
http://stlguild.com/index.php?roster_ad ... C&zone=NAX

to

http://stlguild.com/index.php?name=WoWR ... C&zone=NAX

is what i've tried, but it failed
Last edited by blueagewizard on Thu May 03, 2007 12:31 am, edited 1 time in total.
blueagewizard
WR.net Apprentice
WR.net Apprentice
 
Posts: 8
Joined: Tue Jul 25, 2006 10:26 pm

EndGame for DF

Postby Razac » Fri May 04, 2007 2:35 am

can you post the code of the file /area you want it changed..

TY
Razac
WR.net Journeyman
WR.net Journeyman
 
Posts: 145
Joined: Thu Jul 27, 2006 6:00 pm

EndGame for DF

Postby robojerk » Fri May 04, 2007 4:00 am

Image
For the Horde!
Image
User avatar
robojerk
WR.net Master
WR.net Master
 
Posts: 484
Joined: Wed Jul 05, 2006 12:17 am
Location: -The OmniMatrix- Web 3.0

EndGame for DF

Postby robojerk » Fri May 04, 2007 2:27 pm

zxaltan now has a DragonflyCMS site, you could ask him if he is planning on porting the addon himself. It doesn't appear he has installed WoWRosterDF though. It might just be a test site.. /shrug It won't hurt to ask him though.
Image
For the Horde!
Image
User avatar
robojerk
WR.net Master
WR.net Master
 
Posts: 484
Joined: Wed Jul 05, 2006 12:17 am
Location: -The OmniMatrix- Web 3.0

EndGame for DF

Postby Razac » Fri May 04, 2007 8:49 pm

I had worked on this one before when I was running Nuke

will work on this for DF now
Razac
WR.net Journeyman
WR.net Journeyman
 
Posts: 145
Joined: Thu Jul 27, 2006 6:00 pm

Re: EndGame for DF

Postby zxaltan » Sat May 05, 2007 8:50 pm

I have WOWRoster DF installed the admin page does not work
i know it's do th this line but i dont know much about creating addon for DF

$selfurl = htmlentities($_SERVER['PHP_SELF'] . "?roster_addon_name=EndGame$authurl");
Last edited by zxaltan on Sat May 05, 2007 11:09 pm, edited 1 time in total.
User avatar
zxaltan
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 62
Joined: Mon Jul 10, 2006 1:09 am

EndGame for DF

Postby blueagewizard » Sun May 06, 2007 3:37 am

Sorry was out... here let me paste the code but yeah... just need a way to change where the URL goes to

so add "name=WoWRosterDF&file=addon&" into

http://stlguild.com/index.php?roster_ad ... C&zone=NAX

to get

http://stlguild.com/index.php?name=WoWR ... C&zone=NAX



Code: Select all
<?php
$versions['versionDate']['endgamelang'] = '$Date: 2007/04/25 $';
$versions['versionRev']['endgamelang'] = '$Revision: 2.0 $';
$versions['versionAuthor']['endgamelang'] = '$Author: Dave, Zxaltan $';

if ( !defined('ROSTER_INSTALLED') )
{
    exit('Detected invalid access to this file!');
}


require_once "config.php";
require_once "auth.php";
require_once "percentBar.php";

// Load Configuration
$table = addslashes($config['EndGame_table']);
$showzone = isset($config['showzone']) ? $config['showzone'] : true;
$showinstance = isset($config['showinstance']) ? $config['showinstance'] : true;
$showhealth = isset($config['showhealth']) ? $config['showhealth'] : true;
$showitem = isset($config['showitem']) ? $config['showitem'] : true;
$showfirstkill = isset($config['showfirstkill']) ? $config['showfirstkill'] : true;
$showlastkill = isset($config['showlastkill']) ? $config['showlastkill'] : true;
$shownumkills = isset($config['shownumkills']) ? $config['shownumkills'] : true;
// End Configuration


/****  CODE SECTION - NO DISPLAY YET  ****/

$js  = '<script language="JavaScript" type="text/javascript"><!-- //hide script from antique or braindead browsers'."\n";
$js .= "\tfunction setSort(field) {\n";
$js .= "\t\tif(document.zoneform.sort.value == field.toLowerCase()) {\n";
$js .= "\t\t\tdocument.zoneform.dir.value = document.zoneform.dir.value == 'ASC' ? 'DESC' : 'ASC';\n";
$js .= "\t\t} else {\n";
$js .= "\t\t\tdocument.zoneform.sort.value = field.toLowerCase();\n";
$js .= "\t\t}\n";
$js .= "\t\tdocument.zoneform.submit();\n";
$js .= "\t}\n";
$js .= "// end hiding script --></script>\n";


// Parse query string variables
$zone = '';
if (isset($_REQUEST["zone"])) $zone=$_REQUEST["zone"];
switch(strtolower($_REQUEST['sort'])) {
    case 'zone':
   $sort = 'zone';
   break;
    case 'instance':
           $sort = 'instance';
   break;
    case 'stat':
    case 'status':
       $sort = 'stat';
       break;
    case 'item':
    case 'itemtext':
    case 'itemurl':
       $sort = 'itemtext';
       break;
    case 'kill':
    case 'killdate':
       $sort = 'killdate';
       break;
    case 'last':
    case 'lastdate':
       $sort = 'lastdate';
       break;
    case 'numkills':
       $sort = 'numkills';
       break;
    case 'name':
    default:
   $sort = 'name';
}
switch(strtoupper($_REQUEST['dir'])) {
    case 'DESC':
   $sortdir = 'DESC';
   break;
    default:
   $sortdir = 'ASC';
}
switch(strtolower($_REQUEST['action'])) {
    case 'edit':
   $action = 'edit';
   break;
    case 'put':
   $action = 'put';
   break;
    case 'config':
   $action = 'config';
   break;
    case 'setconfig':
   $action = 'setconfig';
   break;
    case 'view':
    default:
   $action = 'view';
}

$selfurl = htmlentities($_SERVER['PHP_SELF'] . "?roster_addon_name=EndGame$authurl");
if ($zone != '') $selfurl .= "&zone=$zone";
if ($sort != 'name') $selfurl .= "&sort=$sort";
if ($sortdir == 'DESC') $selfurl .= "&dir=DESC";

$all_zones = array('AQ20','AQ40','BWL','MC','NAX','WBS','ZG','ONY','GL','ML','KRZ','EYE','SSC');
$form = '';
$form .= '<form action="'.$_SERVER['PHP_SELF'].'" method="GET" name="zoneform">';
$form .= '<input type="hidden" name="roster_addon_name" value="EndGame" />';
$form .= '<input type="hidden" name="sort" value="'.htmlentities($sort).'" />';
$form .= '<input type="hidden" name="dir" value="'.htmlentities($sortdir).'" />';
$form .= '<table class="membersRow1">';
$form .= '<tr><td class="membersRow1">';
$form .= '<select name="zone" size="1" onChange="document.zoneform.submit();">';
$form .= '<option value="">[All Zones]</option>';
foreach ($all_zones as $z) {
   if ($zone == $z) {
      $is_selected = ' selected';
   } else {
      $is_selected = '';
   }
   $form .= '<option value="'.$z.'"'.$is_selected.'>'.$wordings[$z].'</option>';
}

$form .= '</select></td>';
$form .= '</tr></table></form>';


// Make a table to hold the content
$content = '<table class="membersRow1">';



// Display the header
$content .= "<tr>";
$content .= "\t<td style=\"color: #CBA300\" class=\"membersRow1\"><a href=\"javascript:setSort('name')\">${wordings['Name']}</a></td>\n";
if($showinstance) $content .= "\t<td style=\"color: #CBA300\" class=\"membersRow1\"><a href=\"javascript:setSort('instance')\">${wordings['instance']}</a></td>\n";
if($showzone) $content .= "\t<td style=\"color: #CBA300\" class=\"membersRow1\"><a href=\"javascript:setSort('zone')\">${wordings['Zone']}</a></td>\n";
if($showhealth) $content .= "\t<td style=\"color: #CBA300\" class=\"membersRow1\"><a href=\"javascript:setSort('status')\">${wordings['Status']}</a></td>\n";
if($showitem) $content .= "\t<td style=\"color: #CBA300\" class=\"membersRow1\"><a href=\"javascript:setSort('item')\">${wordings['Item']}</a></td>\n";
if($showfirstkill) $content .= "\t<td style=\"color: #CBA300\" class=\"membersRow1\"><a href=\"javascript:setSort('kill')\">${wordings['Kill']}</a></td>\n";
if($showlastkill) $content .= "\t<td style=\"color: #CBA300\" class=\"membersRow1\"><a href=\"javascript:setSort('lastdate')\">${wordings['lastdate']}</a></td>\n";
if($shownumkills) $content .= "\t<td style=\"color: #CBA300\" class=\"membersRow1\"><a href=\"javascript:setSort('numkill')\">${wordings['numkill']}</a></td>\n";
if($adminMode) $content .= "\t<td style=\"color: #CBA300\" class=\"membersRow1\">Admin</td>\n";
$content .= "</tr>\n";

// Content varies depending on action requested
if ($action == 'put' && $adminMode) {
   //TODO: validate the input better, if invalid set action to 'edit' to drop through below
   $nm = addslashes($_REQUEST['row']);
   $st = 0 + $_REQUEST['edit_stat'];
   $iu = addslashes($_REQUEST['edit_itemurl']);
   $it = addslashes($_REQUEST['edit_itemtext']);
   $kd = strftime('%Y-%m-%d', strtotime(str_replace('-', '/', $_REQUEST['edit_killdate'])));
   $ld = strftime('%Y-%m-%d', strtotime(str_replace('-', '/', $_REQUEST['edit_lastdate'])));
   $nk = 0 + $_REQUEST['edit_numkills'];
   $query = "UPDATE `$table` SET stat=$st, itemurl='$iu', itemtext='$it', killdate='$kd', lastdate='$ld', numkills=$nk WHERE name='$nm';";
   $wowdb->query($query) or die($wowdb->error());
   switch(mysql_affected_rows()) {
   case 0:
   case -1:
      $message .= 'No records matched or database error. Edit aborted.';
      $action = 'edit';
      break;
   case 1:
      $message .= '1 row successfully modified.';
      $action = 'view';
      break;
   default:
      $message .= 'Collision detected, serious database corruption may have occurred. UPDATE affected '.mysql_affected_rows().' rows.';
      $action = 'edit';
   }
}
if($action == 'edit' && $adminMode) {
   $query = "SELECT name, instance, zone, stat, itemurl, itemtext, killdate, lastdate, numkills FROM `$table` WHERE name='".addslashes($_REQUEST['row'])."';";
   $result = $wowdb->query($query) or die($wowdb->error());
   if($wowdb->num_rows($result) < 1) {
      $message .= 'No records matched or database error. Edit aborted.';
      $action = 'view';
   } else {
      $row = $wowdb->fetch_array($result);
      $nm = empty($nm) ? $row['name'] : stripslashes($nm);
      $st = htmlentities(!isset($st) ? $row['stat'] : $st);
      $iu = htmlentities(empty($iu) ? $row['itemurl'] : stripslashes($iu));
      $it = htmlentities(empty($it) ? $row['itemtext'] : stripslashes($it));
      $kd = strftime('%m-%d-%Y', strtotime(empty($kd) ? $row['killdate'] : stripslashes($kd)));
      $ld = strftime('%m-%d-%Y', strtotime(empty($ld) ? $row['lastdate'] : stripslashes($ld)));
      $nk = htmlentities(!isset($nk) ? $row['numkills'] : $nk);
      $tmpe = $content; // Preserve existing output
      $content = ''; // New output will prepend to the existing output
      $content .= "<a href=\"$selfurl&action=config\">Customize View</a><br />\n";
      $content .= "<form action=\"${_SERVER['PHP_SELF']}\" method=\"GET\" name=\"editform\">\n";
      $content .= '<input type="hidden" name="roster_addon_name" value="EndGame" />';
      $content .= "\n<input type=\"hidden\" name=\"row\" value=\"$nm\" />\n";
      $content .= "<input type=\"hidden\" name=\"zone\" value=\"$zone\" />\n";
      $content .= "<input type=\"hidden\" name=\"instance\" value=\"$instance\" />\n";
      $content .= "<input type=\"hidden\" name=\"sort\" value=\"$sort\" />\n";
      $content .= "<input type=\"hidden\" name=\"sortdir\" value=\"$sortdir\" />\n";
      $content .= '<input type="hidden" name="action" value="put" />';
      $content .= "\n$tmpe<tr>\n"; // Restore the previously existing output here
      $content .= '<td class="membersRow1">'.htmlentities(isset($wordings[$nm]) ? $wordings[$nm] : $nm)."</td>\n";
      if($showzone) $content .= '<td class="membersRow1">'.htmlentities(isset($wordings[$row['zone']]) ? $wordings[$row['zone']] : $row['zone'])."</td>\n";
      if($showinstance) $content .= '<td class="membersRow1">'.htmlentities(isset($wordings[$row['instance']]) ? $wordings[$row['instance']] : $row['instance'])."</td>\n";
      if($showhealth) $content .= "<td class=\"membersRow1\"><input type=\"text\" name=\"edit_stat\" size=\"3\" value=\"$st\" />%</td>\n";
      if($showitem) $content .= "<td class=\"membersRow1\">URL: <input type=\"text\" name=\"edit_itemurl\" size=\"24\" value=\"$iu\" />";
      if($showitem) $content .= "Label: <input type=\"text\" name=\"edit_itemtext\" size=\"16\" value=\"$it\" /></td>\n";
      if($showfirstkill) $content .= "<td class=\"membersRow1\"><input type=\"text\" name=\"edit_killdate\" size=\"10\" value=\"$kd\" /></td>\n";
      if($showlastkill) $content .= "<td class=\"membersRow1\"><input type=\"text\" name=\"edit_lastdate\" size=\"10\" value=\"$ld\" /></td>\n";
      if($shownumkills) $content .= "<td class=\"membersRow1\"><input type=\"text\" name=\"edit_numkills\" size=\"3\" value=\"$nk\" /></td>\n";
      $content .= "<td class=\"membersRow1\"><input type=\"submit\" value=\"Submit\" /></td></tr>\n";
      $content .= "</table>\n</form>\n";
      $form = ''; // Don't show a zone selection box above an edit form
   }
}
if($action == 'setconfig' && $adminMode) {
   foreach (array("showzone", "showinstance", "showhealth", "showitem", "showfirstkill", "showlastkill", "shownumkills") as $var) {
      if(isset($_REQUEST[$var])) $$var = $_REQUEST[$var];
      if(isset($config[$var])) $query = "UPDATE `$conf_table` SET `value` = '".$$var."' WHERE `name` = '$var'";
      else $query = "INSERT INTO `$conf_table` (`name`, `value`) VALUES ('$var', '".$$var."')";
      $wowdb->query($query) or $message .= "<br />Failed to save configuration variable $var:".htmlentities($wowdb->error()).", query was ".htmlentities($query)."\n";
   }
   $action = 'config';
}
if($action == 'config' && $adminMode) {
   $content = ''; // Clear header and re-start output
   $content .= "<form action=\"${_SERVER['PHP_SELF']}\" method=\"GET\" name=\"configform\">\n";
   $content .= '<input type="hidden" name="roster_addon_name" value="EndGame" />';
   $content .= '<input type="hidden" name="action" value="setconfig" />';
   $content .= "<table class=\"membersList\" cellspacing=\"0\" cellpadding=\"0\">\n";
   foreach (array("zone", "instance","health", "item", "firstkill", "lastkill", "numkills") as $field) {
      $fieldvar = "show" . $field;
      $content .= "<tr><td class=\"membersRow1\">Show $field in output?</td>";
      $content .= "<td><input type=\"radio\" name=\"show$field\" value=\"1\" ";
      if($$fieldvar) $content .= "checked ";
      $content .= "/>Yes <input type=\"radio\" name=\"show$field\" value=\"0\" ";
      if(!$$fieldvar) $content .= "checked ";
      $content .= "/>No </td></tr>\n";
   }
   $content .= "<td colspan=\"2\" class=\"membersRow1\"><input type=\"submit\" value=\"Submit\" /></td></tr>\n";
   $content .= "</table>\n</form>\n";
   $form = ''; // Don't show a zone selection box above an edit form
}
if($action == 'view' || !$adminMode) {
   if($adminMode) {

      $tmpv = $content;
      $content = "<a href=\"$selfurl&action=config\">Customize View</a><br />\n";
      $content .= $tmpv;
   }
   // Fetch and display the content out of the database
   $query = "SELECT name, instance, zone, stat, itemurl, itemtext, killdate, lastdate, numkills FROM `$table`";
   if(!empty($zone)) $query .= " WHERE grp='".addslashes($zone)."'";
   if(!empty($sort)) $query .= " ORDER BY $sort $sortdir;";
   $result = $wowdb->query($query) or die($wowdb->error());
   if($wowdb->num_rows($result) < 1) {
      $content .= '<tr><td colspan="7" class="membersRow1">No records returned.</td></tr>'."\n";
   } else while ($row = $wowdb->fetch_array($result)) {
      $content .= "<tr>\n";
      $nm = htmlspecialchars(isset($wordings[$row['name']]) ? $wordings[$row['name']] : $row['name']);
      $content .= "\t<td class=\"membersRow1\">$nm</td>\n";
      $zn = htmlspecialchars(isset($wordings[$row['zone']]) ? $wordings[$row['zone']] : $row['zone']);
      $is = htmlspecialchars(isset($wordings[$row['instance']]) ? $wordings[$row['instance']] : $row['instance']);
      $content .= "\t<td class=\"membersRow1\">$is</td>\n";
      if($showzone) $content .= "\t<td class=\"membersRow1\">$zn</td>\n";
      if($showhealth) {
         $content .= "\t<td class=\"membersRow1\">".percentBar((int)($row['stat']),100)."</td>\n";
      }
      if($showitem) {
         $content .= "\t<td class=\"membersRow1\">";
         if($row['itemurl'] != "") $content .= "<a href=\"".$row['itemurl']."\" target=\"_blank\">";
         if($row['itemtext'] != "") $content .= htmlspecialchars(isset($wordings[$row['itemtext']]) ? $wordings[$row['itemtext']] : $row['itemtext']);
         if($row['itemurl'] != "") $content .= "</a>";
         $content .= "</td>\n";
      }
      if($showfirstkill) $content .= "\t<td class=\"membersRow1\">".(strtotime($row['killdate']) <= strtotime("1/1/1980") ? "" : strftime('%m-%d-%Y', strtotime($row['killdate'])))."&nbsp;</td>\n";
      if($showlastkill) $content .= "\t<td class=\"membersRow1\">".(strtotime($row['lastdate']) <= strtotime("1/1/1980") ? "" : strftime('%m-%d-%Y', strtotime($row['lastdate'])))."&nbsp;</td>\n";
      if($shownumkills) $content .= "\t<td class=\"membersRow1\">".htmlspecialchars($row['numkills'])." </td>\n";
      if($adminMode) $content .= "\t<td><a href=\"$selfurl&action=edit&row=${row['name']}\">[Edit]</a></td>\n";
      $content .= "</tr>\n";

   }
   $wowdb->free_result($result);
   // Close the table
   $content .= "</table>\n";
}


/****  DISPLAY SECTION  ****/


// Display the Tier select Form in a stylish border
echo $js;
if(!empty($form)) {
   echo border('syellow','start','  Zone');
   echo $form;
   echo border('syellow','end');
   echo "<br />";
}

// Show logout option
if($adminMode) {
   echo $authmessage.'<br />';
}

if(isset($message)) echo "<div style=\"font-weight: bold; font-size: 12pt\">$message</div>\n";

// Display the content in a Stylish Border
echo border('syellow', 'start', "$header");
echo $content;
echo border('syellow','end');
echo "<br />";

// Admin Login
if(!$adminMode) {
   echo $authmessage;
   echo $loginbox;
}
echo "<br />";

?>
Last edited by blueagewizard on Sun May 06, 2007 1:58 pm, edited 3 times in total.
blueagewizard
WR.net Apprentice
WR.net Apprentice
 
Posts: 8
Joined: Tue Jul 25, 2006 10:26 pm

Re: EndGame for DF

Postby Anaxent » Sun May 06, 2007 3:51 am

zxaltan wrote:I have WOWRoster DF installed the admin page does not work
i know it's do th this line but i dont know much about creating addon for DF

$selfurl = htmlentities($_SERVER['PHP_SELF'] . "?roster_addon_name=EndGame$authurl");


Try changing that to

Code: Select all

$selfurl 
getlink($module_name."&file=addon&roster_addon_name=".$_GET['roster_addon_name'].$authurl); 
Last edited by Anaxent on Sun May 06, 2007 3:53 am, edited 3 times in total.
User avatar
Anaxent
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 642
Joined: Tue Jul 04, 2006 6:27 am
Location: Phoenix, Az

Re: EndGame for DF

Postby blueagewizard » Sun May 06, 2007 5:01 am

Anaxent wrote:
zxaltan wrote:I have WOWRoster DF installed the admin page does not work
i know it's do th this line but i dont know much about creating addon for DF

$selfurl = htmlentities($_SERVER['PHP_SELF'] . "?roster_addon_name=EndGame$authurl");


Try changing that to

Code: Select all

$selfurl 
getlink($module_name."&file=addon&roster_addon_name=".$_GET['roster_addon_name'].$authurl); 



:( no that didn't work

still goes to the old url
blueagewizard
WR.net Apprentice
WR.net Apprentice
 
Posts: 8
Joined: Tue Jul 25, 2006 10:26 pm

EndGame for DF

Postby blueagewizard » Sun May 06, 2007 5:07 am

only time i got a reaction is when i change this portion of the code

$form .= '<input type="hidden" name="roster_addon_name" value="EndGame" />';

what i changed was

$form .= '<input type="hidden" name="name=WoWRosterDF&file=addon&roster_addon_name" value="EndGame" />';

but when i try a link it changes the "=" to %3D and the "&" to %26
blueagewizard
WR.net Apprentice
WR.net Apprentice
 
Posts: 8
Joined: Tue Jul 25, 2006 10:26 pm

EndGame for DF

Postby Anaxent » Sun May 06, 2007 5:18 am

What I have found with other addons that use forms is that all the get forms need to be converted to post then leo linking can be used to put the links together. Can you go ahead and post your version of this addon. Im noticing that it also does not have its own installer. and just now noticed that the $selfurl could still be used the way it is and then add the getlink() function to each href
like
Code: Select all

$content 
"<a href=\"$selfurl&action=config\">Customize View</a><br />\n";
 


Code: Select all

$content 
"<a href=\"".getlink($selfurl."&action=config").">Customize View</a><br />\n";
 
User avatar
Anaxent
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 642
Joined: Tue Jul 04, 2006 6:27 am
Location: Phoenix, Az

EndGame for DF

Postby blueagewizard » Sun May 06, 2007 5:52 am

I'm using the new one
V 2.0 EndGame
blueagewizard
WR.net Apprentice
WR.net Apprentice
 
Posts: 8
Joined: Tue Jul 25, 2006 10:26 pm

Re: EndGame for DF

Postby blueagewizard » Wed May 09, 2007 11:58 pm

Anyone else have suggestions?
blueagewizard
WR.net Apprentice
WR.net Apprentice
 
Posts: 8
Joined: Tue Jul 25, 2006 10:26 pm

Re: EndGame for DF

Postby IslandStyle » Mon May 14, 2007 7:57 pm

Has anyone gotten this to work yet under WoWRosterDF?
Image
Image
User avatar
IslandStyle
WR.net Apprentice
WR.net Apprentice
 
Posts: 41
Joined: Tue Jul 11, 2006 8:57 am

EndGame for DF

Postby zanix » Tue May 15, 2007 2:45 am

Moved
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Next

Return to WoWRosterDF Addons

Who is online

Users browsing this forum: No registered users and 1 guest

cron