Channellist

The UnrealIRCd team does not officially provide support for any services packages that you may be using or want to use. This forum is provided so the community can help each other with services issues.

Moderator: Supporters

Locked
sylvester_jr
Posts: 8
Joined: Mon Nov 21, 2011 5:27 pm
Location: Belgium
Contact:

Channellist

Post by sylvester_jr »

Hello,

I'm really bad in php so i have problems with my php channellist :?
I get a lots of errors and some times i see the rooms...
ERRORS:

Code: Select all

:irc.supportme.be NOTICE AUTH :*** Looking up your hostname...

Deprecated: Function ereg_replace() is deprecated in C:\xampp\htdocs\rooms.php on line 38

Deprecated: Function ereg_replace() is deprecated in C:\xampp\htdocs\rooms.php on line 39
:irc.supportme.be NOTICE AUTH :*** Found your hostname (cached)

Deprecated: Function ereg_replace() is deprecated in C:\xampp\htdocs\rooms.php on line 38

Deprecated: Function ereg_replace() is deprecated in C:\xampp\htdocs\rooms.php on line 39
ERROR :Closing Link: Chatterup29904[dD576D808.access.telenet.be] (Too many connections from your IP)

Deprecated: Function ereg_replace() is deprecated in C:\xampp\htdocs\rooms.php on line 38

Deprecated: Function ereg_replace() is deprecated in C:\xampp\htdocs\rooms.php on line 39
This is what I have:

Code: Select all

<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
    $botnick = "Chatterup";
    $server = "sylvester.no-ip.org";
    $port = "6667";
    $channel = "";
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Room List</title>
</head>
<body>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" id="AutoNumber1" style="border-collapse: collapse">
  <tr>
    <td width="8%" height="20" align="center" valign="middle" bgcolor="#FFFFCC" style="border-left:1px solid #333333;border-bottom:1px solid;border-top:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;">&nbsp;Users</td>
    <td width="15%" height="20" align="left" valign="middle" bgcolor="#FFFFCC" style="border-bottom:1px solid;border-top:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;">&nbsp;Roomname:</td>
    <td width="77%" height="20" align="left" valign="middle" bgcolor="#FFFFCC" style="border-right:1px solid #333333;border-top:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;">&nbsp;Topic:</td>
  </tr>
<?php
    $fp = fsockopen($server, $port, $errno, $errstr, 30);
    if (!$fp) {
        echo "$errstr ($errno)<br />\n";
    }
    else {
        fputs($fp,"USER $botnick $botnick supportme.be :php\n");
        $nick = $botnick . rand(10000,99999);
        fputs($fp,"NICK $nick\n");
        while (!feof($fp)) {
            usleep(50);
            $fget = @fgets($fp, 128);
            echo "$fget <br>\n";
            $match = explode(" ", $fget);
            $fget = ereg_replace ("\n", "", $fget);
            $fget = ereg_replace ("\r", "", $fget);
            if ($match[1] == "001") {
                fputs($fp,"LIST\n");
            }
          else if ($match[0] == "PING") {
                echo "PONG :" . $match[1];
                echo "\n";
                fputs($fp, "PONG :" . $match[1]);
            }
            else if ($match[1] == "433") {
                $nick = $botnick . rand(10000,99999);
                fputs($fp,"NICK $nick\n");
            }
            else if ($match[1] == "323") {
                fputs($fp, "QUIT :bye!\n");
                break;
            }
            else if ($match[1] == "322") {
                $match[3] = ereg_replace ("#", "", $match[3]);
                if (eregi ("$channel(.*)", $match[3], $chan)) {
                    $topic = explode(":", $fget);
                    unset($topic[0]);
                    unset($topic[1]);
                    $topic = implode(":", $topic);
                    if ($color == "FBFBF7") {
                        $color = "FFFFFF";
                    }
                    else {
                        $color = "FBFBF7";
                    }
                    ?>
  <tr>
    <td width="8%" align="center" valign="middle" bgcolor="#<?php echo $color; ?>" style="border-top:1px solid #333333;border-left:1px solid #333333;border-bottom:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;"><?php echo $match[4]; ?></td>
    <td width="15%" style="border-bottom:1px solid #333333;bordertop:1px solid #333333;border-top:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;" bgcolor="#<?php echo $color; ?>">&nbsp;<a href="./chat.php?action=Chat&rmname=[EN]<?php echo $chan[1]; ?>">
      <?php echo $chan[1]; ?>
      </a></td>
    <td width="77%" style="border-right:1px solid #333333;border-bottom:1px solid #333333;FONT-FAMILY:;border-top:1px solid #333333; verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;"bgcolor="#<?php echo $color; ?>">&nbsp;
      <?php echo $topic; ?></td>
  </tr>
                      <?php
                }
            }
        }
        fclose($fp);
    }
?>
</table>
</body>
</html>
Can some one make u good php script for me? I post the credits on my website if it is done ^^
If you can't explain it simply, you don't understand it well enough
-albert einstein
Jobe
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Re: Channellist

Post by Jobe »

As for the PHP errors you get, those are down to your choice of using ereg_replace() which as of PHP 5.3 is now deprecated and should NOT be used. Consider instead using preg_replace() if you REALLY need to use a regex, otherwise if you're using a simple find and replace string matching try str_replace() instead of wasting CPU cycles on regex matching when it isn't really needed.

As for the too many connections error, you'll need to set up an appropriate allow {} block to cover the IP the script connects FROM.

Also a better idea for including a channel list on your website would be to perhaps install and use Denora and use the MySQL database it saves data to to retrieve the channel list from MySQL instead.
Your IP: Image
Your Country: Image
sylvester_jr
Posts: 8
Joined: Mon Nov 21, 2011 5:27 pm
Location: Belgium
Contact:

Re: Channellist

Post by sylvester_jr »

and there is no easy way?
Denora is realy difficult :?
If you can't explain it simply, you don't understand it well enough
-albert einstein
Jobe
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Re: Channellist

Post by Jobe »

What's difficult about Denora for you?
Your IP: Image
Your Country: Image
sylvester_jr
Posts: 8
Joined: Mon Nov 21, 2011 5:27 pm
Location: Belgium
Contact:

Re: Channellist

Post by sylvester_jr »

I just cant start denora

Log file Denora:

Code: Select all

[Nov 23 13:36:44 2011] Loading IRCD Protocol Module: [unreal32]
[Nov 23 13:36:44 2011] IRCD Protocol Author: [Denora]
[Nov 23 13:36:44 2011] IRCD Protocol Version: [$Id: unreal32.c 405 2011-02-02 16:18:55Z jobe $]
[Nov 23 13:36:44 2011] Loading stats.db
[Nov 23 13:36:44 2011] Loading tld.db
[Nov 23 13:36:44 2011] Loading ChannelStats.db
[Nov 23 13:36:44 2011] Loading server.db
[Nov 23 13:36:44 2011] Loading ctcp.db
[Nov 23 13:36:44 2011] Loading chan.db
[Nov 23 13:36:44 2011] Loading exclude.db
[Nov 23 13:36:44 2011] Loading admin.db
[Nov 23 13:36:44 2011] Denora 1.4.5.411 (IRCd protocol: UnrealIRCd 3.2+) starting up (options: debug off)
[Nov 23 13:36:44 2011] Error: Disabling SQL due to errors with SQL
[Nov 23 13:36:44 2011]FATAL: Can't connect to server: Connection refused
But phpdenora say:

Code: Select all

ERROR: The database seems to be empty.
Please do the following checks:

    Ensure that your Denora server is setup correctly, connected to your irc network and running.
    Yes, you NEED a Denora server running on your irc network in order to use phpDenora.
    Get Denora from www.denorastats.org
    Check your Denora log file for any mysql-related errors.
    In the phpDenora configuration file you specified sylvester.no-ip.org as Denora server name.
    Please ensure that this is the EXACT same name you gave to your Denora server on your irc network.
Settings Mysql denora.conf

Code: Select all

sql {
    // required tokens
    type        mysql;
    host        127.0.0.1;
    user        root;
    passwd      P@ssw0rd;
    name        denora;

    // optional tokens
    #sock        /tmp/mysql.sock;
    port        3306;
    #retryonlost 0;
    #retries     6;
    #retrygap    10;
    #disableopt;
    #keepusers;
    #keepservers;
};
And i can login with the user name and password (phpmyadmin) :) http://www.supportme.be/temp/phpmyadmin.PNG
And add the DB of denora with phpmyadmin import.

Websever and mysql info:

Code: Select all

MySQL

    Server: Localhost via UNIX socket
    Server version: 5.1.41-3ubuntu12.10
    Protocol version: 10
    User: root@localhost
    MySQL charset: UTF-8 Unicode (utf8)

Web server

    Apache/2.2.14 (Ubuntu)
    MySQL client version: 5.1.41
    PHP extension: mysqli

phpMyAdmin

    Version information: 3.3.2deb1
So... Denora is realy defficult :lol:
Or can you give me a basic how to? ^^
If you can't explain it simply, you don't understand it well enough
-albert einstein
Jobe
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Re: Channellist

Post by Jobe »

If you have the time to drop by #denora on irc.denorastats.org im sure someone will be able to help you if im not around. (I find IRC is a quicker way to get support for matters like these due to instant responses)
Your IP: Image
Your Country: Image
sylvester_jr
Posts: 8
Joined: Mon Nov 21, 2011 5:27 pm
Location: Belgium
Contact:

Re: Channellist

Post by sylvester_jr »

But i need just a good manual or "how to" to link denora and unrealircd.
Im new with irc, so there is no simple php script? =S
If you can't explain it simply, you don't understand it well enough
-albert einstein
sylvester_jr
Posts: 8
Joined: Mon Nov 21, 2011 5:27 pm
Location: Belgium
Contact:

Re: Channellist

Post by sylvester_jr »

Eggdrop works but it only export the channel list to a html file... :(
If you can't explain it simply, you don't understand it well enough
-albert einstein
katsklaw
Posts: 1124
Joined: Sun Apr 18, 2004 5:06 pm
Contact:

Re: Channellist

Post by katsklaw »

Code: Select all

[Nov 23 13:36:44 2011] Error: Disabling SQL due to errors with SQL
[Nov 23 13:36:44 2011]FATAL: Can't connect to server: Connection refused
That usually means SQL isn't running or you are trying to connect to an IP/port SQL isn't listening to.

Mod Note: Moved to Services as this has nothing to do with Unreal3.2 support. -katsklaw
sylvester_jr
Posts: 8
Joined: Mon Nov 21, 2011 5:27 pm
Location: Belgium
Contact:

Re: Channellist

Post by sylvester_jr »

Starting Nmap 5.00 ( http://nmap.org ) at 2011-11-28 11:35 CET
Interesting ports on localhost (127.0.0.1):
Not shown: 992 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
139/tcp open netbios-ssn
443/tcp open https
445/tcp open microsoft-ds
3306/tcp open mysql
6667/tcp open irc
8002/tcp open teradataordbms

And i can login with phpymadmin... :P
If you can't explain it simply, you don't understand it well enough
-albert einstein
katsklaw
Posts: 1124
Joined: Sun Apr 18, 2004 5:06 pm
Contact:

Re: Channellist

Post by katsklaw »

sylvester_jr wrote: And i can login with phpymadmin... :P
That just means phpmyadmin is configured to connect correctly, that doesn't mean Denora is. I simply pointed out the error in your own log, it says Denora can't connect and gets a "connection refused" when it tries. As already stated, "connection refused" is caused by SQL not running OR you are connecting to an IP/port SQL isn't listening to.
Jobe
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Re: Channellist

Post by Jobe »

katsklaw wrote:
sylvester_jr wrote: And i can login with phpymadmin... :P
That just means phpmyadmin is configured to connect correctly, that doesn't mean Denora is. I simply pointed out the error in your own log, it says Denora can't connect and gets a "connection refused" when it tries. As already stated, "connection refused" is caused by SQL not running OR you are connecting to an IP/port SQL isn't listening to.
Note: the connection refused error noted in that log refers to Denora being unable to connect to UnrealIRCd.
Your IP: Image
Your Country: Image
sylvester_jr
Posts: 8
Joined: Mon Nov 21, 2011 5:27 pm
Location: Belgium
Contact:

Re: Channellist

Post by sylvester_jr »

And how can i connect Unrealircd with denora...
If you can't explain it simply, you don't understand it well enough
-albert einstein
katsklaw
Posts: 1124
Joined: Sun Apr 18, 2004 5:06 pm
Contact:

Re: Channellist

Post by katsklaw »

sylvester_jr wrote:And how can i connect Unrealircd with denora...
The exact same was as any other server.
Locked