MyBB Community Forums

Full Version: XML Database League
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Download:

Mods site: http://community.mybb.com/mods.php?action=view&pid=549


XML Database League:
to install upload all the files of the New Version 1.1

Update Details:
  • Implement new code in XML
  • Add images folder
  • Add Code JavaScript
  • Add Template: Home » Template Sets » Global Templates » Add Template » xmleague_template
  • Video Tutorial: Add Template » xmleague_template
Code To Add Template in xmleague_template


<html>
<head>
<title>XML Database League</title>
{$headerinclude}

<script type="text/javascript">
            if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp = new XMLHttpRequest();
            }
            else {// code for IE6, IE5
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp.open("GET", "xmleague.xml", false);
            xmlhttp.send();
            xmlDoc = xmlhttp.responseXML;
            var x = xmlDoc.getElementsByTagName("Team");

            function displayXMLeague(i) {
                var leagueElement = x[i];
                Team_Name = (leagueElement.getElementsByTagName("Team_Name")[0].childNodes[0].nodeValue);
                description = (leagueElement.getElementsByTagName("description")[0].childNodes[0].nodeValue);
                City = (leagueElement.getElementsByTagName("City")[0].childNodes[0].nodeValue);
                Stadium = (leagueElement.getElementsByTagName("Stadium")[0].childNodes[0].nodeValue);

                var players = leagueElement.getElementsByTagName("first_name");
                var player;
                var playerString;
                for(var index = 0; index < players.length; index++)
                {
                    player = players[index];
                    if (index == 0)
                    {
                        playerString = player.childNodes[0].nodeValue;
                    }
                    else
                    {
                        playerString = (playerString + "<br />" + player.childNodes[0].nodeValue);
                    }

                }

                Players = playerString;
                image = (leagueElement.getElementsByTagName("image")[0].childNodes[1].childNodes[0].nodeValue);
                txt = "<b>Team_Name:</b> " + Team_Name + "<br><b>description:</b> " + description + "<br><b>City:</b> " + City + "<br><b>Stadium:</b> " + Stadium + "<br><b>Players:</b> " + Players + "<br><b>image:</b>" + image;
                document.getElementById("showXMLeague").innerHTML = txt;
            }

            displayXMLeague(0);
        </script>
	
</head>
<body>
{$header}

<h2>List of Premier League clubs </h2>
<p><small><i>Update with More <ins>Teams Clubs And Leagues</ins>... for the next version</i></small> </p>
	

<div id='showXMLeague'>Click on a Team Club to display information.</div><br>
<script>
document.write("<table border='2'>");
for (var i=0;i<x.length;i++)
  { 
  document.write("<tr onclick='displayXMLeague(" + i + ")'>");
  document.write("<td>");
  document.write(x[i].getElementsByTagName("Team_Name")[0].childNodes[0].nodeValue);
  document.write("</td><td>");
  document.write(x[i].getElementsByTagName("City")[0].childNodes[0].nodeValue);
  document.write("</td></tr>");
  }
document.write("</table>");
</script>
	
{$footer}
</body>
</html>
This seems to have been approved on the mods site. Added the link to the 1st post. Sorry for latency.
(2015-10-10, 06:38 PM)Destroy666 Wrote: [ -> ]This seems to have been approved on the mods site. Added the link to the 1st post. Sorry for latency.

Thanks, So Much for the Support Destroy666.
Update the Plugin with information and performance of Download and Support Links in MyBB

Version 1.2
  • Performance Download Page and update Support info plugin
  • Add Style font-family: Verdana
  • Fix Some Trasparent Logos teams in Files (.png) and Update in Folder images/xmleague
  • Add Code JavaScript
  • Update Template: Home » Template Sets » Global Templates » Add Template » xmleague_template
  • Video Tutorial: Add Template » xmleague_template

Collaborator and suggestions Are Welcome…
Would it be possible if members could customize this? I run an RP forum, and this would be usefull if not for the football specific factor. If there was a way you could tailor it to rp purposes, or if you would be willing to work with me to customize it for my forum, I think this would be a great plugin.
(2015-10-21, 07:48 PM)Bamk84 Wrote: [ -> ]Would it be possible if members could customize this? I run an RP forum, and this would be usefull if not for the football specific factor. If there was a way you could tailor it to rp purposes, or if you would be willing to work with me to customize it for my forum, I think this would be a great plugin.

Hi Bamk84.
Yes, its possible performance, the League Football its a base to learn implement  a XML Database with MyBB.
the Plugin Can Customize with different options like a Table Leader Members, or Links Table Sponsor.

I do not understand when you write to rp purposes, what its your forum?

You Are Welcome!