Hello,
I am using cabal website from this link: http://forum.ragezone.com/f459/storm...ite-v1-761472/
Is it possible to hide the GMs from the rankings and the "Who is Online" pages ?
I don't want players to see when GMs are online.
Hello,
I am using cabal website from this link: http://forum.ragezone.com/f459/storm...ite-v1-761472/
Is it possible to hide the GMs from the rankings and the "Who is Online" pages ?
I don't want players to see when GMs are online.
Last edited by privlolek; 18-08-11 at 01:21 PM.
Ofcourse you can. Just edit the query that lists the who is online to exclude those who have nation 3.
Last edited by privlolek; 18-08-11 at 10:41 PM.
you could do something like:
SELECT * FROM table WHERE nation blablaba AND WHERE NATION NOT LIKE ('%3%')
This would remove gms from rank.
Find this line in the rankings.php file:
change it to:Code:$r=mssql_query('select top 20 * from '.DB_GAM.'.dbo.cabal_character_table WHERE Playtime > 0 order by exp desc, reputation desc, playtime desc, alz desc');
Code:$r=mssql_query('select top 20 * from '.DB_GAM.'.dbo.cabal_character_table WHERE Playtime > 0 AND Nation != 3 order by exp desc, reputation desc, playtime desc, alz desc');
It worked ! However, it only makes GMs disappear from Top 20 in Rankings and the Who is Online page.
I was trying to make it work in the Combo Rankings and Dungeon Runs rankings, but it gave me errors...
Here's the code from Combo rankings:
Dungeon Single:Code:$r=mssql_query('select top 10 * from '.DB_GAM.' .dbo.cabal_record_combo order by cntcombo desc');
Group:Code:$r=mssql_query('select top 10 * from '.DB_GAM.'.dbo.cabal_event_singledg where dungeounName="'.$name.'" order by passtime desc');
Do you know where to put it there to make it work ?Code:$r=mssql_query('select top 10 * from '.DB_GAM.'.dbo.cabal_event_partydg where dungeounName="'.$name.'" order by passtime desc');
I tried something like this:
But it gave me an error..Code:$r=mssql_query('select top 10 * from '.DB_GAM.'.dbo.cabal_event_partydg where dungeounName="'.$name.'" WHERE Nation != 3 order by passtime desc');
Those tables don't store nation informations, so in order to make that work you need to retrieve the nation columns from the cabal_character_table, possible using JOINs. Try to figure it out yourself first.
Unfortunately I didn't understand anything from the site you gave me :(
Maybe there's an easier way to do that or you could explain me exactly what to do ?
As I said I completely don't know PHP what makes me a noob in such things... Most of the things I do alone, I only ask for help when I don't know something and it isn't described anywhere.
This isn't about PHP, it's T-SQL.
JOIN creates a relation between data in different tables, that way you can query information that isn't in the table you're querying in the first place.
Let me show you an example:
Spoiler:
Ok....thanks for explaining a bit :P
Now I have question.. you showed me example as a query in management studio. Now I am confused... I can't put it in the rankings.php, right ? Only run it as a query in MySQL ?
If so, I should join the dbo.cabal_record_combo and dbo.cabal_character_table tables or which ?
MSSQL. Huge difference there.
Replace the query within the brackets, like this:
PHP Code:$r=mssql_query('-- Just replace this part, oh and remove the double minus');
I'm writing that one last query for you and hope you'll experience an "Aha!"-moment:
It could possible mess up the table layout of the website, if it does so, PM me an URL to your website.PHP Code:$r=mssql_query(SELECT TOP 10 cumbo.* FROM gamedb.dbo.cabal_record_combo cumbo JOIN gamedb.dbo.cabal_character_table chars ON (chars.CharacterIdx = cumbo.charIdx ) WHERE chars.Nation != 3 ORDER BY cntcombo desc)
Aaand now, back to the more important aspects of life
Spoiler:
Last edited by Alphakilo23; 19-08-11 at 11:23 PM.