The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Ranking Table

5 posters

Go down

Solved Ranking Table

Post by SkyGuide July 16th 2015, 8:19 pm

I don't know if I'm allowed to post here for this kind of topic, but i would be most grateful if i can get some help on whether or not its even possible for a graphics designer to make a Ranking table for our forum? It would be most exciting to have yugioh duel challenges and to record points on a table for other members to see.


I really need help with this and i don't have any other place i could possibly request help from. Thank you!
SkyGuide
SkyGuide
Forumember

Male Posts : 269
Reputation : 3
Language : english

http://oldschoolsociety.forumotion.org/

Back to top Go down

Solved Re: Ranking Table

Post by SLGray July 16th 2015, 8:27 pm

Are you asking how to create a ranking table?


Ranking Table Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51463
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Ranking Table

Post by SkyGuide July 16th 2015, 11:38 pm

Yeah. I'm assuming it can be done with a graphics design, but i need to be sure if its actually possible first. Hers an example: http://www.duelacademy.net/h22-
SkyGuide
SkyGuide
Forumember

Male Posts : 269
Reputation : 3
Language : english

http://oldschoolsociety.forumotion.org/

Back to top Go down

Solved Re: Ranking Table

Post by Pizza Boi July 17th 2015, 6:02 am

Hi Very Happy

That table was coded by Amy Cool as well as LG Forum. From what I recall, that code can manually be edited by a staff moderator or it's taken from a certain topic.

You can, however do your own manual table by either using <div> or <table> tags. You can learn more about it in w3schools.com which I highly suggest you do.

Regards,
Pizza Boi
Pizza Boi
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

Back to top Go down

Solved Re: Ranking Table

Post by SkyGuide July 17th 2015, 12:15 pm

Thanks pizza boi. But what do you mean about <div> or <table> tags? Is that something i can do on my forum?
SkyGuide
SkyGuide
Forumember

Male Posts : 269
Reputation : 3
Language : english

http://oldschoolsociety.forumotion.org/

Back to top Go down

Solved Re: Ranking Table

Post by Pizza Boi July 17th 2015, 3:33 pm

Hi Very Happy

Something like this: http://redlustempire.forumtl.com/h5-market

That's what I did in my forum, I made it into a market Smile .

Regards,
Pizza Boi
Pizza Boi
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

Back to top Go down

Solved Re: Ranking Table

Post by SkyGuide July 17th 2015, 5:57 pm

Ah i see. Thanks budd. Much appreciated Smile
SkyGuide
SkyGuide
Forumember

Male Posts : 269
Reputation : 3
Language : english

http://oldschoolsociety.forumotion.org/

Back to top Go down

Solved Re: Ranking Table

Post by Ape July 17th 2015, 6:29 pm

is this now solved for you ?


Ranking Table Left1212Ranking Table Center11Ranking Table Right112
Ranking Table Ape_b110
Ranking Table Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19084
Reputation : 1988
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Ranking Table

Post by Pizza Boi July 17th 2015, 7:15 pm

Hi Very Happy

This actually makes me curious. This is the Javascript that I found:

Code:
"use strict";(function(o){var noES5=false;if(!Object.hasOwnProperty||!Object.propertyIsEnumerable||!Object.create||!Object.keys||!Object.freeze||!Array.prototype.forEach||!Array.prototype.sort){noES5=true}o.noES5=noES5}(window));function Map(o){var p;if(!(this instanceof Map)){return new Map(o)}for(p in o){if(o.hasOwnProperty(p)&&o.propertyIsEnumerable(p)&&!(p in this)){this[p]=o[p]}}return this}Map.prototype.map=function(s){return this[s]||this[s.toLowerCase()]||this[s.toUpperCase()]||null};var rankMap=Map({0:{rank:"Slifer Red",elo:500,rankID:0},1:{rank:"Ra Yellow",elo:750,rankID:1},2:{rank:"Obelisk Blue",elo:1000,rankID:2},3:{rank:"Society of Light",elo:1250,rankID:3},"slifer":{rank:"Slifer Red",elo:500,rankID:0},"ra":{rank:"Ra Yellow",elo:750,rankID:1},"obelisk":{rank:"Obelisk Blue",elo:1000,rankID:2},"sol":{rank:"Society of Light",elo:1250,rankID:3},"slifer red":{rank:"Slifer Red",elo:500,rankID:0},"ra yellow":{rank:"Ra Yellow",elo:750,rankID:1},"obelisk blue":{rank:"Obelisk Blue",elo:1000,rankID:2},"society of light":{rank:"Society of Light",elo:1250,rankID:3}}),dbTopic="/t41235-",entries={},matches=[],entry,iter,sortArray=[];function calculateNewElo(opts){if(!opts){console.log('Argument not specified for `calculateNewElo(opts)`');return}var previousWinnerElo=entries[opts.winner].elo,previousLoserElo=entries[opts.loser].elo,staticPointsGained=15,staticPointsLost=15,pointsGained,pointsLost,newWinnerElo,newLoserElo,rankDifference=entries[opts.winner].rankID-entries[opts.loser].rankID,winnerWLRatio=(entries[opts.winner].wins/(entries[opts.winner].wins+entries[opts.winner].losses))*100,loserWLRatio=(entries[opts.loser].wins/(entries[opts.loser].wins+entries[opts.loser].losses))*100,winnerWLString=winnerWLRatio.toFixed(1).replace(/\.0$/,'')+'%',loserWLString=loserWLRatio.toFixed(1).replace(/\.0$/,'')+'%',hardCapGainPercentage=60,hardCapLossPercentage=40;entries[opts.winner].winLossHistory.push({status:1,versus:opts.loser});entries[opts.loser].winLossHistory.push({status:0,versus:opts.winner});if(rankDifference>0){pointsGained=Math.floor(staticPointsGained/(rankDifference+(rankDifference*0.1)));pointsLost=(rankDifference>=2)?Math.floor(pointsGained/rankDifference):Math.ceil(pointsGained/2);entries[opts.winner].lowerPlayed++;entries[opts.winner].lowerWon++;entries[opts.loser].higherPlayed++;entries[opts.loser].higherLost++}else if(rankDifference<0){pointsGained=(rankDifference<=-2)?Math.round(staticPointsGained*Math.abs(rankDifference)):Math.round(staticPointsGained*1.5);pointsLost=pointsGained;entries[opts.winner].higherPlayed++;entries[opts.winner].higherWon++;entries[opts.loser].lowerPlayed++;entries[opts.loser].lowerLost++}else if(rankDifference===0){pointsGained=staticPointsGained;pointsLost=staticPointsLost;entries[opts.winner].equalPlayed++;entries[opts.winner].equalWon++;entries[opts.loser].equalPlayed++;entries[opts.loser].equalLost++}if(Math.round(winnerWLRatio)>hardCapGainPercentage){pointsGained=pointsGained+10}else if(Math.round(winnerWLRatio)<hardCapLossPercentage){pointsGained=pointsGained-10}else if(Math.round(winnerWLRatio)>=50){pointsGained=pointsGained+(Math.round(winnerWLRatio-50))}else if(Math.round(winnerWLRatio)<=50){pointsGained=pointsGained-(Math.round(50-winnerWLRatio))}pointsGained=(pointsGained<=0)?1:pointsGained;if(Math.round(loserWLRatio)>hardCapGainPercentage){pointsLost=pointsLost-10}else if(Math.round(loserWLRatio)<hardCapLossPercentage){pointsLost=pointsLost+10}else if(Math.round(loserWLRatio)>=50){pointsLost=pointsLost-(Math.round(loserWLRatio-50))}else if(Math.round(loserWLRatio)<=50){pointsLost=pointsLost+(Math.round(50-loserWLRatio))}newWinnerElo=previousWinnerElo+pointsGained;newLoserElo=previousLoserElo-pointsLost;entries[opts.winner].elo=newWinnerElo;entries[opts.winner].winratio=winnerWLString;entries[opts.loser].elo=newLoserElo;entries[opts.loser].winratio=loserWLString;entries[opts.winner].eloDifference=newWinnerElo-rankMap.map(entries[opts.winner].rank).elo;entries[opts.loser].eloDifference=newLoserElo-rankMap.map(entries[opts.loser].rank).elo}function createWinLossStreak(user){if(!user.winLossHistory||user.winLossHistory.length===0){return null}var index=0,arrayLength=user.winLossHistory.length,returnObject={wins:[],losses:[]},count=0,statusString,temp,previousTemp,samePlayed={};for(index,arrayLength;index<arrayLength;index++){temp=user.winLossHistory[index];previousTemp=user.winLossHistory[index-1];if(samePlayed[temp.versus]===undefined){samePlayed[temp.versus]=1}else{samePlayed[temp.versus]++}if(index===0){count=1;statusString=(temp.status===1)?"wins":"losses";continue}if(previousTemp&&(temp.status===previousTemp.status)){count++}else{returnObject[statusString].push(count);count=1;statusString=(temp.status===1)?"wins":"losses"}if(index===arrayLength-1){returnObject[statusString].push(count)}}if(!returnObject.wins.length){returnObject.wins=[0]}if(!returnObject.losses.length){returnObject.losses=[0]}user.samePlayed=samePlayed;user.highestWinStreak=Math.max.apply({},returnObject.wins);user.highestLossStreak=Math.max.apply({},returnObject.losses);return user}function makeTable(sourceArray){var returnHTML="";sourceArray.forEach(function(v,i){returnHTML=returnHTML+'<tr class="rankingTable rank_'+(i+1)+'"><td class="rankingTableUser">'+v.username+'</td><td class="rankingTableWins">'+v.wins+'</td><td class="rankingTableLosses">'+v.losses+'</td><td class="rankingTableElo">'+v.elo+'</td></tr>'});return returnHTML}function sortAfter(sourceArray,sortString,ascDesc){return sourceArray.sort(function(a,b){if(sortString==="username"){return(ascDesc?((b.username[0].toLowerCase()<a.username[0].toLowerCase()?1:-1)):((b.username[0].toLowerCase()<a.username[0].toLowerCase())?-1:1))}else{return(ascDesc?b[sortString]-a[sortString]:a[sortString]-b[sortString])}})}function adjustRank(user){var id=user.rankID;switch(id){case 0:{if(user.elo>rankMap.map(1).elo){id=1}break}case 1:{if(user.elo>rankMap.map(2).elo){id=2}if(user.elo<rankMap.map(0).elo){id=0}break}case 2:{if(user.elo>rankMap.map(3).elo){id=3}if(user.elo<rankMap.map(1).elo){id=1}break}case 3:{if(user.elo<rankMap.map(2).elo){id=2}break}default:{console.log("No user specified to update.");break}}user.rankID=id;return user}function createDataCopy(user){var userCopy=Object.create({}),userKeys=Object.keys(user);userKeys.forEach(function(v){Object.defineProperty(userCopy,v,{enumerable:true,writeable:true,configurable:true,value:user[v]})});userCopy.hasOwnProperty("lastDataCopies")&&delete userCopy.lastDataCopies;return userCopy}$(function(){if(window.noES5){$('#loading').html('<span class="fatal">We have detected a fatal error: your browser does not support EcmaScript 5 features. Download a new browser or update your current browser to view this page.</span>')}else{$.get(dbTopic,function(data,status,xhr){if(xhr.status!==200){console.log('Error "'+status+'"\nHTTP Request failed with Error Status of '+xhr.status+', please check your connection settings or connect your system administrator.')}data=$(data);entries=$.parseJSON($('#entryTable td',data).html().replace(/<br>/gi,''));matches=$.parseJSON($('#matchTable td',data).html().replace(/<br>/gi,'')).matches;for(entry in entries){if(entries.hasOwnProperty(entry)&&entries.propertyIsEnumerable(entry)){entries[entry].username=entry;entries[entry].rankID=rankMap.map(entries[entry].rank).rankID;entries[entry].elo=rankMap.map(entries[entry].rank).elo;entries[entry].wins=0;entries[entry].losses=0;entries[entry].gamesPlayed=0;entries[entry].higherPlayed=0;entries[entry].lowerPlayed=0;entries[entry].equalPlayed=0;entries[entry].higherWon=0;entries[entry].lowerWon=0;entries[entry].equalWon=0;entries[entry].higherLost=0;entries[entry].lowerLost=0;entries[entry].equalLost=0;entries[entry].eloDifference=0;entries[entry].highestWinStreak=0;entries[entry].highestLossStreak=0;entries[entry].winLossHistory=[];entries[entry].lastDataCopies=[]}}matches.forEach(function(v,i){if(!v.winner||!v.loser){console.log('Invalid entry; winner or loser not given.')}else if(!(v.winner in entries)){console.log('Invalid entry for match "'+v.winner+'" versus "'+v.loser+'"; winner not registered in database.')}else if(!(v.loser in entries)){console.log('Invalid entry for match "'+v.winner+'" versus "'+v.loser+'"; loser not registered in database.')}else{entries[v.winner].wins++;entries[v.loser].losses++;entries[v.winner].gamesPlayed++;entries[v.loser].gamesPlayed++;calculateNewElo({winner:v.winner,loser:v.loser,index:i});entries[v.winner].lastDataCopies.push(Object.freeze(createDataCopy(entries[v.winner])));entries[v.loser].lastDataCopies.push(Object.freeze(createDataCopy(entries[v.loser])));adjustRank(entries[v.winner]);adjustRank(entries[v.loser])}});for(iter in entries){if(entries.hasOwnProperty(iter)&&entries.propertyIsEnumerable(iter)){createWinLossStreak(entries[iter]);sortArray.push(entries[iter])}}$('#eloDisplay tbody').html(makeTable(sortAfter(sortArray,"eloDifference",true)));$('#loading').css('display','none');$('#tableHead').css('display','block')})}});

I know where to place it; however, I cannot entirely sort it out. I know it's a generator of some sort so hmm... I'll see what I can do, for now, I hope someone else helps.

@Ange Tuteur @Daemon @JScript . Please help us if possible, now I want this Hello !

Regards,
Pizza Boi
Pizza Boi
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

Back to top Go down

Solved Re: Ranking Table

Post by brandon_g July 17th 2015, 9:24 pm

SkyGuide wrote:Thanks pizza boi. But what do you mean about <div> or <table> tags? Is that something i can do on my forum?


Thats html, granted you have it enabled, you can use it on your forum yes. Very Happy
brandon_g
brandon_g
Manager
Manager

Male Posts : 10106
Reputation : 923
Language : English
Location : USA

https://www.broadcastingduo.com

Back to top Go down

Solved Re: Ranking Table

Post by SkyGuide July 18th 2015, 9:02 pm

This topic is solved. Thank guys Smile
SkyGuide
SkyGuide
Forumember

Male Posts : 269
Reputation : 3
Language : english

http://oldschoolsociety.forumotion.org/

Back to top Go down

Solved Re: Ranking Table

Post by SLGray July 19th 2015, 12:56 am

Topic solved and archived


Ranking Table Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51463
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum