Ulysses

Ulysses Stuff => Releases => Ulysses Release Archives => Topic started by: Ninjadude101 on May 30, 2008, 04:45:51 PM

Title: Uban PHP Viewer
Post by: Ninjadude101 on May 30, 2008, 04:45:51 PM
Hey, i personally had a hard time finding a web-based ban-list to work with the Uban mod, and when i finally found one, it was VERY basic. i mean theres was no graphics and it was just text. sorry but the people who use my site want a bit of a better thing to look at.
Long story short, i've customized the code and it looks much nicer now, and im releasing it to you guys :D

No i won't tell you how to install it its really simple. I will tell you however that you need to edit the top of index.php to relate to your database settings.

If you'd like a demo go take a look at ours: http://www.aouv.co.uk/serverbans/

Feel free to modify it but please do not remove the link at the bottom.

---------- Update already available----------

I'll call this V1.2.
It now displays the time the user was banned.
Title: Re: Uban PHP Viewer
Post by: Megiddo on May 30, 2008, 05:18:03 PM
Nice job!
Title: Re: Uban PHP Viewer
Post by: jay209015 on May 30, 2008, 05:34:01 PM
Very nice. :D
Title: Re: Uban PHP Viewer
Post by: Ninjadude101 on May 30, 2008, 05:45:45 PM
Yay, I did something helpful ^^
Title: Re: Uban PHP Viewer
Post by: Sc00by22 on May 31, 2008, 03:14:07 AM
That's very good, I can use Uban but my server company don't allow outbound mysql connections
Title: Re: Uban PHP Viewer
Post by: Ninjadude101 on May 31, 2008, 04:39:16 AM
That's very good, I can use Uban but my server company don't allow outbound mysql connections

Owned. I have some spare databases on my hosting.. I could let you use one for some spare change..

EDIT: Oh wait do you mean your gmod server host don't allow that?

Cybernetic-servers! http://billing.cybernetic-servers.co.uk/whmcs/aff.php?aff=009

Please use that link cause its a referral link yay - mind you it kind of depends where you are. This one is in UK, but my friends from all over the world seem to have decent pings (below 50 mainly)
Title: Re: Uban PHP Viewer
Post by: Ninjadude101 on May 31, 2008, 08:08:48 PM
I've made some updates to my demo page (Not actually a demo its my real page) Basically it now shows only active bans and you can click a hyperlink to see all bans.
Will be releasing this shortly.
Title: Re: Uban PHP Viewer
Post by: Megiddo on May 31, 2008, 08:10:00 PM
Good work! Are you going to have it make pages for when you have 100+ bans?
Title: Re: Uban PHP Viewer
Post by: AviZ on May 31, 2008, 08:37:06 PM
why not have it all on the one page and do pageation of about 12 items per page?

also have a diffrence for the ban times. e,g 1 day ban

anyway heres my pages http://bans.impulsegaming.org
Title: Re: Uban PHP Viewer
Post by: Megiddo on May 31, 2008, 08:43:04 PM
Very nice AviZ.
Title: Re: Uban PHP Viewer
Post by: Ninjadude101 on June 01, 2008, 04:52:26 AM
also have a diffrence for the ban times. e,g 1 day ban
How do you mean?

I had a look at your page, and im fairly new to MySQL and PHP scripting, So would you be able to help me with pagination? I've found a few places on the interwebs with condes to use but i can't make head or tail from them. Also they are from back in 2003

I have future plans to build a search box to search steamids only. (as Uban doesn't pick up all characters. Like my old clantag was picked up as weird combinations of letters.)
And i also plan to have an identical page for server admins to be able to unban them, however this page would obviously have to be passworded.
Title: Re: Uban PHP Viewer
Post by: AviZ on June 01, 2008, 02:35:11 PM
im new to it too, however google is a wonderful tool :)

http://impulsegaming.org/serverbans <---- Pageation
Title: Re: Uban PHP Viewer
Post by: Ninjadude101 on June 01, 2008, 02:44:01 PM
I like what you have done with that. Could you send me the source code? (Obviously removing your database details)
Title: Re: Uban PHP Viewer
Post by: AviZ on June 01, 2008, 02:58:13 PM
yep ok

Heres the pageation fix.

Title: Re: Uban PHP Viewer
Post by: Ninjadude101 on June 01, 2008, 03:24:56 PM
Thanks, Applying my current bugfixes and updates to it. Should be another version soon :D
Title: Re: Uban PHP Viewer
Post by: Lt.Smith on June 02, 2008, 09:00:04 AM
Good job, saves me writing my own :)
Title: Re: Uban PHP Viewer
Post by: AviZ 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"
Title: Re: Uban PHP Viewer
Post by: Lt.Smith 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 :)
Title: Re: Uban PHP Viewer
Post by: Megiddo on June 04, 2008, 08:38:32 AM
http://www.zkoss.org/
Useful++
Title: Re: Uban PHP Viewer
Post by: Lt.Smith 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
Title: Re: Uban PHP Viewer
Post by: spbogie on June 05, 2008, 12:01:42 PM
There's also the Google Web Toolkit (http://code.google.com/webtoolkit/). Cross compiles from Java, lets you use debuggers and everything else. I plan to try it myself when I get some time.
Title: Re: Uban PHP Viewer
Post by: Lt.Smith 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! (http://www.gmodsauce.com/index.php?option=com_wrapper&view=wrapper&Itemid=3)



Title: Re: Uban PHP Viewer
Post by: Tophat Man 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.
Title: Re: Uban PHP Viewer
Post by: MrPresident 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.
Title: Re: Uban PHP Viewer
Post by: Lt.Smith 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.
Title: Re: Uban PHP Viewer
Post by: JamminR 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>
Title: Re: Uban PHP Viewer
Post by: Megiddo 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.
Title: Re: Uban PHP Viewer
Post by: MrPresident 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?
Title: Re: Uban PHP Viewer
Post by: JamminR 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.
Title: Re: Uban PHP Viewer
Post by: spbogie 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.
Title: Re: Uban PHP Viewer
Post by: Megiddo on June 08, 2008, 10:25:27 AM
Hmm, figured it was threaded because it says so on the release thread. :P
Title: Re: Uban PHP Viewer
Post by: spbogie on June 08, 2008, 02:19:33 PM
Ah, I get it now. If you call it with a noblock flag, then it spawns a thread and returns a refrence which you can use to check later to see if it completed and extract the information from it. It is still blocking by default though.
Title: Re: Uban PHP Viewer
Post by: Lt.Smith on June 09, 2008, 01:05:02 PM
Ah, I get it now. If you call it with a noblock flag, then it spawns a thread and returns a refrence which you can use to check later to see if it completed and extract the information from it. It is still blocking by default though.

See, that just goes above my head somewhat, not sure how to do it. What I noticed when I used SQL for server logs, is it froze the entire game for as long as it took to establish a connection and execute the query. A combination of cheap hosting services and data having to go across the Atlantic led to an unplayable game, but 200ms of lag every 5-7 minutes goes unnoticed.

If you guys have info on how to use the gm_mysql module without it blocking, I'm all ears. For logs I wouldn't care about what the query (always an INSERT, obviously) returned anyway, except maybe to notify the server admin when a query failed.
Title: Re: Uban PHP Viewer
Post by: spbogie on June 10, 2008, 07:33:05 PM
See, that just goes above my head somewhat

Haha, don't worry about it. We tend to loose a lot of people when we go back and forth like that (Jam can attest to that one).

Basically, what it means is that the way UBan is written right now all calls to the database will block until they can return a result. Changing it over to use asynchronux (non-blocking) calls would require a bit of a re-think, but nothing overly complex.
Title: Re: Uban PHP Viewer
Post by: JamminR on June 10, 2008, 08:42:22 PM
Remember the guy in the movie "Office Space".. the one who's job is to talk to the engineers for the customer, that later gets fired because the Bob's think he's useless.
I'm pretty much that guy (but, fortunately, no one on this team is Bob-like)
I'm fortunate enough to be able to code a bit too. :D

:P

[EDIT] - By the way, we've derailed much of NinjaDude's release.
Anyone else care to find a good split point to DevCorner?
Title: Re: Uban PHP Viewer
Post by: Megiddo on June 11, 2008, 01:48:05 AM
Sure, make mine banana.
Title: Re: Uban PHP Viewer
Post by: Ninjadude101 on August 06, 2008, 07:21:56 PM
I'm going to be working on a much nicer version if anyone is interested. If not i shan't bother releasing it :P
Title: Re: Uban PHP Viewer
Post by: JamminR on August 06, 2008, 09:07:53 PM
Though us ded server/php users are a small niche, I'm sure we're all interested.
Title: Re: Uban PHP Viewer
Post by: jamescorbett on August 09, 2008, 07:15:02 AM
Simple but effective.
Title: Re: Uban PHP Viewer
Post by: Ninjadude101 on August 10, 2008, 04:54:47 AM
Actually saying that I'm not sure i will release the updated version as i have seen with big communites are using my script as a base to their viewer but had removed the link to my page, which was requested to be left in. In fact most of the places ive been looking through seem to have removed it, this angers me somewhat.

Anyway I'm still unsure, as I'd like to help the community but I would like to be able to have my link left on it as it helps me to generate more site members in return for my script. Oh well, I'm sure I'll still probably release it.
Title: Re: Uban PHP Viewer
Post by: Megiddo on August 10, 2008, 06:56:24 AM
Welcome to the sad, cruel world of open source development. :P
Title: Re: Uban PHP Viewer
Post by: thelord on August 11, 2008, 04:49:15 AM
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! (http://www.gmodsauce.com/index.php?option=com_wrapper&view=wrapper&Itemid=3)





With my keen eye I fixed up your sexy script.

Here's the line that saves all the problems:
Code: [Select]
echo '<a href="?page=' . $i . '">' . $i . '</a> '; // echo a link to the page
Title: Re: Uban PHP Viewer
Post by: Killers2 on August 19, 2008, 09:15:36 PM
Cool script I use this. I removed the thing at the bottom but only because it ruined the feel to the viewer and looked out of place to me.   :(
Title: Re: Uban PHP Viewer
Post by: JamminR on August 20, 2008, 03:37:02 PM
Cool script I use this. I removed the thing at the bottom but only because it ruined the feel to the viewer and looked out of place to me.   :(
Then by all means, if you haven't already, find another way to show credit publicly. :)
A small text link somewhere can go a long way.
Title: Re: Uban PHP Viewer
Post by: Ninjadude101 on January 20, 2009, 06:50:55 PM
I know it's been a long time for posting in this thread, but it seems stupid to make a new thread.
Was speaking with Meg earlier today in my server (testing stuff) and I mentioned that i am re-building my clans website, totally re-writing a new ban-page and layout, so when we are done and moved over to the new system, i will release our old files.

To see the current look of the page: http://www.aouv.co.uk/serverbans

I know, having no pagination is kinda sucky, but it has search which makes up for it.
If i feel good i might put pagination in it just for you guys, would be an excuse to actually teach myself how to do that.

Please keep in mind i started making this page around a year ago (ish) some code may be from other sources, but the most part is my own bits. Also try to remember that this was initially made just for us, so we didn't make it super-easy to configure and it isn't made with the guy setting it up in mind. That said, there is a file for storing the database config variables in there, which obviously is the most of the configuration. If you want to change anything like images or layout, you're on your own.

Thanks
Title: Re: Uban PHP Viewer
Post by: Pizzaboy on January 27, 2009, 12:07:09 PM
Hi, im new on php and mysql so:

so how i install this on my website?
Title: Re: Uban PHP Viewer
Post by: deadeye536 on February 08, 2009, 06:54:13 PM
Hi, im new on php and mysql so:

so how i install this on my website?


Just edit the index.php file in any text editor filling the variables with the proper information, upload to any directory on a webserver, and it should work, make sure to keep the image relevant path though.

Also, NinjaDude101, I have learned a bit of PHP and CSS myself and during my free time, I'll be more than happy to help you out with the code.
Title: Re: Uban PHP Viewer
Post by: Dv2236 on February 10, 2009, 08:46:00 PM
as some of you can tell i lost my website so thats why my avatar ant working.

but i just had to give this a try for the of it, right now its just default
gmod.mygamingvoid.com
Title: Re: Uban PHP Viewer
Post by: Nuclear_Ice on April 02, 2009, 06:47:29 PM
Hey I appreciate you doing this and I would love to get this working!


Where is says IP I don't know what to put there?


The IP of what?


I've never seen IP, only name user pass etc...
Title: Re: Uban PHP Viewer
Post by: JamminR on April 02, 2009, 09:47:38 PM
Ice, you'd put the same IP that UBan uses for your MySQL server
This requires UBan, which requires MySQL database
Title: Re: Uban PHP Viewer
Post by: Nuclear_Ice on April 03, 2009, 01:40:20 PM
Ice, you'd put the same IP that UBan uses for your MySQL server
This requires UBan, which requires MySQL database

Thanks,
 I forgot to update this :P

I removed IP and added some custom php stuff so it makes a better connection and it now works. :P
Title: ulx php viewer
Post by: dpoolas on May 08, 2010, 11:50:10 PM
How would i go about modifying the uban php viewer to make it so it shows bans that are not from the addons uban and just normal bans from base ulx
Title: Re: Uban PHP Viewer
Post by: dpoolas on August 20, 2010, 03:16:56 PM
Another quick question. how would i make it instead of time left it would show their bantime
Title: Re: Uban PHP Viewer
Post by: JamminR on August 20, 2010, 03:30:52 PM
Both are questions that would require serious modification to the original codebase, and take more time than most of us hobbyists currently have motivation or time to do.
They are both valid and possible, just a major rewrite requirement for little end satisfaction.