File Not Found
Guest
- Author
- File Not Found
- Contributors
- N/A
- Quickbar Entry
-
javascript:
table_depth = 3;
name_var = "Name";
show_points = true;
show_villages = true;
show_ODA = true;
show_ODD = true;
dimensions =[180, 96]; /* Change nothing below here */
plus_one = 1;
type = "player";
if (typeof (main) != 'undefined')
{$ = main.$;
game_data = main.game_data;
}
if(game_data.market != "en")
{twstats = "http://"+game_data.market+".twstats.com/";
}
else
{twstats = "http://twstats.com/";
}
if (document.getElementById("ally_content") != null)
{table = document.getElementById("ally_content").getElementsByTagName("table")[0];
plus_one = 0;
}
else if (document.getElementById("player_ranking_table"))
{table = document.getElementById("player_ranking_table");
}
else if (document.getElementById("ally_ranking_table"))
{table = document.getElementById("ally_ranking_table");
type = "tribe";
}
else if (document.getElementById("con_ally_ranking_table"))
{table = document.getElementById("con_ally_ranking_table");
type = "tribe";
}
else if (document.getElementById("con_player_ranking_table"))
{table = document.getElementById("con_player_ranking_table");
}
else if (document.getElementById("kill_player_ranking_table"))
{table = document.getElementById("kill_player_ranking_table").parentNode.getElementsByTagName("table")[1];
}
else if (document.getElementById("kill_ally_ranking_table"))
{table = document.getElementById("kill_ally_ranking_table").parentNode.getElementsByTagName("table")[1];
type="tribe";
}
else
{table = $("table:contains('"+name_var+"')")[table_depth];
plus_one = 1;
}
rows = table.getElementsByTagName("tr");
if (show_points == true)
{ rows[0].innerHTML += "<th><center><b><u>Points</u></b></center></th>";
}
if (show_villages == true)
{ rows[0].innerHTML += "</b></center></th><th><center><b><u>Villages</u></b></center></th>";
}
if (show_ODA == true)
{rows[0].innerHTML += "<th><center><b><u>ODA</u></b></center></th>";
}
if (show_ODD == true)
{rows[0].innerHTML += "<th><center><b><u>ODD</u></b></center></th>";
}
for (i = 1;i < rows.length - 1 + plus_one;i++)
{pid = rows[i].getElementsByTagName("a")[0].toString().match(/id=\d+/).toString().split( "=")[1];
if (show_points == true)
{rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type +
"graph&graph=points&id=" + pid + "' style='width:" + dimensions[0] + "px; height:" + dimensions[1] + "px'></img></td>";
}
if (show_villages == true)
{rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type + "graph&graph=villages&id=" +
pid + "' style='width:" + dimensions[0] + "px; height:" + dimensions[1] + "px'></img></td>";
}
if (show_ODA == true)
{rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type + "graph&graph=oda&id=" + pid + "' style='width:" + dimensions[0] +
"px; height:" + dimensions[1] + "px'></img></td>";
}
if (show_ODD == true)
{rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type +
"graph&graph=odd&id=" + pid + "' style='width:" + dimensions[0] + "px; height:" + dimensions[1] +
"px'></img></td>";
}
}
void (0);
- Public?
- Public
The below will from any tribe member list, including your own, add the four main stat graphs for each user, to your the end of the players row on the list.
Alter these variables (at the start of the script) for the following effect.
table_depth = 3 - adjust this if the script is giving problems, and tell me whether it fixes the issue. *** Use second version, it will work without this ***
name_var = 'Name' - If you play on a non English server, this needs to be the word used for the header of the Name column on the other tribe member list.
show_points = true / false - Enables/Disables the Points Graph
show_villages = true / false - Enables/Disables the Villages Graph
show_ODA = true / false - Enables/Disables the ODA Graph
show_ODD = true / false - Enables/Disables the ODD Graph
dimensions = [180, 96] - Adjusts the size of the displayed graphs.
[spoil]
[/spoil]
This should get around the table depth issue. As usual, let me know.
[spoil]
[/spoil]
12:37:44 27/12/2010 - Update: Should now work from all "Rankings" pages.
13:33:33 27/12/2010 - Update: Reintroduced internationalization patch
13:33:33 27/12/2010 - Update: Added code to enable script for non premium accounts.
16:00:19 27/12/2010 - Update: Added variable for table depth as a debugging option.
0:02:22 28/12/2010 - Update: Added name_var variable, to enable international users to have the script work on other tribe member lists.
Alter these variables (at the start of the script) for the following effect.
table_depth = 3 - adjust this if the script is giving problems, and tell me whether it fixes the issue. *** Use second version, it will work without this ***
name_var = 'Name' - If you play on a non English server, this needs to be the word used for the header of the Name column on the other tribe member list.
show_points = true / false - Enables/Disables the Points Graph
show_villages = true / false - Enables/Disables the Villages Graph
show_ODA = true / false - Enables/Disables the ODA Graph
show_ODD = true / false - Enables/Disables the ODD Graph
dimensions = [180, 96] - Adjusts the size of the displayed graphs.
[spoil]
Code:
javascript:
table_depth = 3;
name_var = "Name";
show_points = true;
show_villages = true;
show_ODA = true;
show_ODD = true;
dimensions =[180, 96]; /* Change nothing below here */
plus_one = 1;
type = "player";
if (typeof (main) != 'undefined')
{$ = main.$;
game_data = main.game_data;
}
if(game_data.market != "en")
{twstats = "http://"+game_data.market+".twstats.com/";
}
else
{twstats = "http://twstats.com/";
}
if (document.getElementById("ally_content") != null)
{table = document.getElementById("ally_content").getElementsByTagName("table")[0];
plus_one = 0;
}
else if (document.getElementById("player_ranking_table"))
{table = document.getElementById("player_ranking_table");
}
else if (document.getElementById("ally_ranking_table"))
{table = document.getElementById("ally_ranking_table");
type = "tribe";
}
else if (document.getElementById("con_ally_ranking_table"))
{table = document.getElementById("con_ally_ranking_table");
type = "tribe";
}
else if (document.getElementById("con_player_ranking_table"))
{table = document.getElementById("con_player_ranking_table");
}
else if (document.getElementById("kill_player_ranking_table"))
{table = document.getElementById("kill_player_ranking_table").parentNode.getElementsByTagName("table")[1];
}
else if (document.getElementById("kill_ally_ranking_table"))
{table = document.getElementById("kill_ally_ranking_table").parentNode.getElementsByTagName("table")[1];
type="tribe";
}
else
{table = $("table:contains('"+name_var+"')")[table_depth];
plus_one = 1;
}
rows = table.getElementsByTagName("tr");
if (show_points == true)
{ rows[0].innerHTML += "<th><center><b><u>Points</u></b></center></th>";
}
if (show_villages == true)
{ rows[0].innerHTML += "</b></center></th><th><center><b><u>Villages</u></b></center></th>";
}
if (show_ODA == true)
{rows[0].innerHTML += "<th><center><b><u>ODA</u></b></center></th>";
}
if (show_ODD == true)
{rows[0].innerHTML += "<th><center><b><u>ODD</u></b></center></th>";
}
for (i = 1;i < rows.length - 1 + plus_one;i++)
{pid = rows[i].getElementsByTagName("a")[0].toString().match(/id=\d+/).toString().split( "=")[1];
if (show_points == true)
{rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type +
"graph&graph=points&id=" + pid + "' style='width:" + dimensions[0] + "px; height:" + dimensions[1] + "px'></img></td>";
}
if (show_villages == true)
{rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type + "graph&graph=villages&id=" +
pid + "' style='width:" + dimensions[0] + "px; height:" + dimensions[1] + "px'></img></td>";
}
if (show_ODA == true)
{rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type + "graph&graph=oda&id=" + pid + "' style='width:" + dimensions[0] +
"px; height:" + dimensions[1] + "px'></img></td>";
}
if (show_ODD == true)
{rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type +
"graph&graph=odd&id=" + pid + "' style='width:" + dimensions[0] + "px; height:" + dimensions[1] +
"px'></img></td>";
}
}
void (0);
This should get around the table depth issue. As usual, let me know.
[spoil]
Code:
javascript:
name_var = 'Name';
show_points = true;
show_villages = true;
show_ODA = true;
show_ODD = true;
dimensions =[180, 96]; /* Change nothing below here */
plus_one = 1;
type = "player";
if (typeof (main) != 'undefined')
{$ = main.$;
game_data = main.game_data;
}
if(game_data.market != "en")
{twstats = "http://"+game_data.market+".twstats.com/";
}
else
{twstats = "http://twstats.com/";
}
if (document.getElementById("ally_content") != null)
{table = document.getElementById("ally_content").getElementsByTagName("table")[0];
plus_one = 0;
}
else if (document.getElementById("player_ranking_table"))
{table = document.getElementById("player_ranking_table");
}
else if (document.getElementById("ally_ranking_table"))
{table = document.getElementById("ally_ranking_table");
type = "tribe";
}
else if (document.getElementById("con_ally_ranking_table"))
{table = document.getElementById("con_ally_ranking_table");
type = "tribe";
}
else if (document.getElementById("con_player_ranking_table"))
{table = document.getElementById("con_player_ranking_table");
}
else if (document.getElementById("kill_player_ranking_table"))
{table = document.getElementById("kill_player_ranking_table").parentNode.getElementsByTagName("table")[1];
}
else if (document.getElementById("kill_ally_ranking_table"))
{table = document.getElementById("kill_ally_ranking_table").parentNode.getElementsByTagName("table")[1];
type="tribe";
}
else
{table = $("table:contains('"+name_var+"')")[$("table:contains('"+name_var+"')").length - 1];
plus_one = 1;
}
rows = table.getElementsByTagName("tr");
if (show_points == true)
{ rows[0].innerHTML += "<th><center><b><u>Points</u></b></center></th>";
}
if (show_villages == true)
{ rows[0].innerHTML += "</b></center></th><th><center><b><u>Villages</u></b></center></th>";
}
if (show_ODA == true)
{rows[0].innerHTML += "<th><center><b><u>ODA</u></b></center></th>";
}
if (show_ODD == true)
{rows[0].innerHTML += "<th><center><b><u>ODD</u></b></center></th>";
}
for (i = 1;i < rows.length - 1 + plus_one;i++)
{pid = rows[i].getElementsByTagName("a")[0].toString().match(/id=\d+/).toString().split( "=")[1];
if (show_points == true)
{rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type +
"graph&graph=points&id=" + pid + "' style='width:" + dimensions[0] + "px; height:" + dimensions[1] + "px'></img></td>";
}
if (show_villages == true)
{rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type + "graph&graph=villages&id=" +
pid + "' style='width:" + dimensions[0] + "px; height:" + dimensions[1] + "px'></img></td>";
}
if (show_ODA == true)
{rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type + "graph&graph=oda&id=" + pid + "' style='width:" + dimensions[0] +
"px; height:" + dimensions[1] + "px'></img></td>";
}
if (show_ODD == true)
{rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type +
"graph&graph=odd&id=" + pid + "' style='width:" + dimensions[0] + "px; height:" + dimensions[1] +
"px'></img></td>";
}
}
void (0);
12:37:44 27/12/2010 - Update: Should now work from all "Rankings" pages.
13:33:33 27/12/2010 - Update: Reintroduced internationalization patch
13:33:33 27/12/2010 - Update: Added code to enable script for non premium accounts.
16:00:19 27/12/2010 - Update: Added variable for table depth as a debugging option.
0:02:22 28/12/2010 - Update: Added name_var variable, to enable international users to have the script work on other tribe member lists.
Last edited:
Upvote
0