Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Question about using MySQL  (Read 10701 times)

0 Members and 1 Guest are viewing this topic.

SpaceDoG

  • Anope User
  • Offline Offline
  • Posts: 183
    • http://www.hypermutt.net
Question about using MySQL
« on: May 25, 2006, 02:41:06 PM »

Is there any documentation out there about how Anope query's MySQL and then can pull the data and display more than 1 record at a time. I'm fluent with PHP and kinda familiar with the Anope module coding process. My goal is to write an addon to HelpServ that will allow people to submit help tickets and notify the specified users in a room that you set. The reason I want MySQL is so that users can check the status of their ticket(s) via the web. Any help would be greatly appriciated. Oh and I'll also need to determine inside the module wether or not Anope has been compiled with MySQL support.

-SpaceDoG
Logged

SpaceDoG

  • Anope User
  • Offline Offline
  • Posts: 183
    • http://www.hypermutt.net
(No subject)
« Reply #1 on: May 25, 2006, 10:40:38 PM »

Also if it would be better/easier to do this with the standard Anope DB that's fine. I just want to do it with web access as a courtesy for my users and to make things easier for my opers. Any guidance would be greatly appriciated.
Logged

Trystan Scott Lee

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 343
(No subject)
« Reply #2 on: May 26, 2006, 02:29:41 AM »

a module can do two way access to mysql..  probably need a callback and keep some sort of track of whether the ticket has notified the support channel yet.. all of this is doable, and for checking if compiled with mysql support in the init() check like so

#ifdef USE_MYSQL
 return MOD_CONT;
#else
 return MOD_STOP;
#endif
Logged
my God my tourniquet, return to me salvation

SpaceDoG

  • Anope User
  • Offline Offline
  • Posts: 183
    • http://www.hypermutt.net
(No subject)
« Reply #3 on: May 26, 2006, 03:15:46 AM »

Well I'm not exactly sure how to access mysql with Anope. That's part of the problem. As for the tickets I was thinking about setting up some sort of timer for HelpServ to message the oper room like every 30 mins with the # of tickets currently in queue and to also message whenever a new ticket is in queue... I'm not too familiar with C so I'm not real sure how to do it. I would do it with PHP but I have issues with getting my bot to connect and read sockets and stuff correctly.
Logged

Dave Robson

  • Team
  • *
  • Offline Offline
  • Posts: 357
(No subject)
« Reply #4 on: May 26, 2006, 07:32:49 AM »

Personally i would avoid the use of #ifdef USE_MYSQL  - while there are no plans to change it, eventaully i suspect it will go.

There is no reason for a module to require anope to be compiled with mysql support, strictly speaking, the module can check for the existance of the mysql dev libs (or any other libs a module may want) at compile time and link against them itsself should it find them.  This removes any reliance on how anope is setup, and how anope access's its own db files.
Logged

Trystan Scott Lee

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 343
(No subject)
« Reply #5 on: June 04, 2006, 02:17:19 AM »

wondering if this is still something you were looking to do SpaceDog? kinda sat down on Friday and now have a working demo of it, just needs a web interface
Logged
my God my tourniquet, return to me salvation

SpaceDoG

  • Anope User
  • Offline Offline
  • Posts: 183
    • http://www.hypermutt.net
(No subject)
« Reply #6 on: June 04, 2006, 04:06:32 AM »

Yes it's still something I'm looking to do. I actually have started on it but am doing it via PHP's PEAR Net_SmartIRC. Haven't really got too far on it and I would rather have it integrated with Anope.
Logged

Trystan Scott Lee

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 343
(No subject)
« Reply #7 on: June 04, 2006, 04:56:23 AM »

Well I have a working demo

1. User can submit a ticket via the web (could add a irc command)

2. New tickets are broadcasted on a timer to a given channel

[11:02] <HelpServ> New Support Issue [#1]
[11:02] <HelpServ> Reported By Trystan
[11:02] <HelpServ> Reported at 2006-06-03 00:00:00
[11:02] <HelpServ> Testing module

3. User can check the status via irc with a command

[11:24] -HelpServ- Report [#1] Status Open

4. Admin can view tickets by number via IRC

[11:17] -> *helpserv* issue 1
-
[11:17] -HelpServ- New Support Issue [#1]
[11:17] -HelpServ- Reported By Trystan
[11:17] -HelpServ- Reported at 2006-06-03 00:00:00
[11:17] -HelpServ- Testing new module

5. Admin can set the ticket as resolved via IRC or web

[11:32] -HelpServ- Bug report [#1] set to resolved

Only part that is really lacking is a nice interface for the web
Logged
my God my tourniquet, return to me salvation

SpaceDoG

  • Anope User
  • Offline Offline
  • Posts: 183
    • http://www.hypermutt.net
(No subject)
« Reply #8 on: June 04, 2006, 06:11:38 AM »

Well I can code the PHP portion but I suck at coming up with page designs. Also I'm hoping that when it broadcasts to the specified channel it doesn't list all the issues and that it just says something like "There are currently 3 open trouble tickets" or something along those lines. Something else to add is that when closing a ticket it should be required that you put a solution to the problem to basically make it like a kb and you can have users check the completed tickets to see if their problem has already been resolved. Oh yea the tickets should be editable by the creater/services admins so that if the user doesn't put a proper topic (IE they need help with registering and just say "I need help" we can reject it or change the topic subject to make the listing better).
Logged

SpaceDoG

  • Anope User
  • Offline Offline
  • Posts: 183
    • http://www.hypermutt.net
(No subject)
« Reply #9 on: June 04, 2006, 06:14:37 AM »

Oh yea 1 other feature would be to have it so that when users join the help channel they get a detailed message(s) from the bot stating what to do when seeking help and such so that common problems can be addressed before they ask an oper/member for help.
Logged

katsklaw

  • Guest
(No subject)
« Reply #10 on: June 04, 2006, 03:59:18 PM »

Quote
Originally posted by SpaceDoG
Oh yea 1 other feature would be to have it so that when users join the help channel they get a detailed message(s) from the bot stating what to do when seeking help and such so that common problems can be addressed before they ask an oper/member for help.


I think he_helpchanentry can help with that.
Logged

SpaceDoG

  • Anope User
  • Offline Offline
  • Posts: 183
    • http://www.hypermutt.net
(No subject)
« Reply #11 on: June 04, 2006, 05:20:23 PM »

Well I never got that module to work plus that requires another module to be installed. I would rather have this coded as part of this module.
Logged
Pages: [1]   Go Up