Author Topic: Uban PHP Viewer  (Read 33248 times)

0 Members and 1 Guest are viewing this topic.

Offline Lt.Smith

  • Newbie
  • *
  • Posts: 32
  • Karma: 4
Re: Uban PHP Viewer
« Reply #15 on: June 02, 2008, 09:00:04 AM »
Good job, saves me writing my own :)

Offline AviZ

  • Newbie
  • *
  • Posts: 32
  • Karma: 0
Re: Uban PHP Viewer
« Reply #16 on: June 02, 2008, 11:11:52 AM »
what i would like to see is people help to make this a better thing, rather than just taking, editing it to their liking and thats it.

There must be some telented people out there that deals with php, afterall "Two Heads Are Better Than One"

Offline Lt.Smith

  • Newbie
  • *
  • Posts: 32
  • Karma: 4
Re: Uban PHP Viewer
« Reply #17 on: June 04, 2008, 08:00:43 AM »
Hey I'm fine with posting my code. It's not going to be much but I have no problem with sharing it :)

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Uban PHP Viewer
« Reply #18 on: June 04, 2008, 08:38:32 AM »
Experiencing God's grace one day at a time.

Offline Lt.Smith

  • Newbie
  • *
  • Posts: 32
  • Karma: 4
Re: Uban PHP Viewer
« Reply #19 on: June 05, 2008, 08:11:26 AM »
Oooh that looks interesting! My coding skills aren't that well-tuned yet though, so I'm having a hard time figuring out how I'm supposed to use it, but hey, I have time.

Update: Needs configuring in the webserver... I doubt I'll be able to do that with my cheap-as- package, but I suppose it doesn't hurt to ask. I know PHP though, so I'll be focusing my efforts on that. Perhaps if my brain grows I'll try later, haha ;D
« Last Edit: June 05, 2008, 08:19:07 AM by Lt.Smith »

Offline spbogie

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: 41
Re: Uban PHP Viewer
« Reply #20 on: June 05, 2008, 12:01:42 PM »
There's also the Google Web Toolkit. Cross compiles from Java, lets you use debuggers and everything else. I plan to try it myself when I get some time.
I have not failed. I've just found 10,000 ways that won't work. - Thomas A. Edison
I reject your reality and substitute my own. - Adam Savage

Offline Lt.Smith

  • Newbie
  • *
  • Posts: 32
  • Karma: 4
Re: Uban PHP Viewer
« Reply #21 on: June 05, 2008, 02:24:45 PM »
Heh, I ended up starting from scratch and writing my own page anyway.

You can take this and use it, modify it, whatever. Just remember to be nice and keep my name in the bottom or commented out in the page's source or something if you really find it ugly. Do whatever.

The coding is pretty sloppy, especially the pagination part, but I was too lazy to check where I'd mixed up ' and " quotes. I pulled the pagination part from a deceased script elsewhere, so it's a bit of a mess. If you want to cut down on the amount of queries you're executing, the thing you can remove is the permaban counter, it'll come out with no trouble at all. I tried to comment what I was doing as much as possible, so it shouldn't be too hard to follow.

The attached file is .txt by the way - just rename it to .php, fill in your database info and you're ready to roll! :)

Check out what she looks like here!




Offline Tophat Man

  • Newbie
  • *
  • Posts: 17
  • Karma: 2
Re: Uban PHP Viewer
« Reply #22 on: June 06, 2008, 04:22:04 PM »
We did the exact same thing about a month ago and it looks exactly the same as ours but ours showed more information on the ban when you clicked on the persons name. www.gman4president.com exept all the bans got erased in the re-install so it doesn't show up. Just ask mrpresident.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Uban PHP Viewer
« Reply #23 on: June 06, 2008, 07:29:33 PM »
Na, we dont have the list anymore because I unistalled UBan. Our SQL host was being retarded and the game was locking up everytime it tried to connect.

Offline Lt.Smith

  • Newbie
  • *
  • Posts: 32
  • Karma: 4
Re: Uban PHP Viewer
« Reply #24 on: June 07, 2008, 03:03:34 AM »
Quote
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'zakap_tophatman'@'69.89.31.223' (using password: YES) in /home/theslick/public_html/MrPresident/bans.php on line 95
Unable to select database.
::)

Well, there's only so many ways you can format a ban list. My database is in the USA, but the gameserver is in London, so yes, the game freezes for a bit when you run a query. My solution was to write to the db every 7 minutes instead of every minute. It means bans are lost if the server crashes within 1-7 minutes of banning someone, but if people got banned the server shouldn't be crashing anyway. It hides the latency issue pretty well.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Uban PHP Viewer
« Reply #25 on: June 07, 2008, 05:10:53 AM »
Is there not a way to make the gm_sql library run threaded? That is
Fake code-
Stored banlist -
Connect to SQL database
write stored banlist
<gmod, other lua scripts keep running here, not waiting on above lines>
<close connection>
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Uban PHP Viewer
« Reply #26 on: June 07, 2008, 10:03:26 AM »
Is there not a way to make the gm_sql library run threaded? That is
Fake code-
Stored banlist -
Connect to SQL database
write stored banlist
<gmod, other lua scripts keep running here, not waiting on above lines>
<close connection>

gm_sql runs asynchronously ("threaded") all the time.
Experiencing God's grace one day at a time.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Uban PHP Viewer
« Reply #27 on: June 07, 2008, 11:46:37 AM »
I wish that were true Meg. With gm_sql whenever it attempts to make a connection, if it can not, the whole game server stops responding and everyone on it times out for about 10-15 seconds. then everything resumes. Of course, this only happens when it CANT connect.


OH WAIT.. I wonder.. Now that I think about it, It didn't lag when I was playing a listen server doing some tests.. I would just get the errors, but no lag. (threaded?) Maybe my dedicated server doesn't allow threaded processes since we are sharing a box with other clients? Is this possibly the case?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Uban PHP Viewer
« Reply #28 on: June 07, 2008, 02:59:56 PM »
doesn't allow threaded processes since we are sharing a box with other clients? Is this possibly the case?

Uh, won't say no, but, 99% doubtful.
I didn't mean threaded as in multi-core type threading anyway.
Just meant as in programming 'fork' where each process takes turns (as equally as possible).
Sounds like ded server gm_sql or lua calls to it aren't sharing as nice as they should.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline spbogie

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: 41
Re: Uban PHP Viewer
« Reply #29 on: June 08, 2008, 10:19:08 AM »
The calls to the gm_mysql module are all blocking because they all return a value depending on the result of the connection, however, they should all gracefully timeout after a short period of time if they can't connect.
I have not failed. I've just found 10,000 ways that won't work. - Thomas A. Edison
I reject your reality and substitute my own. - Adam Savage