Jump to content

Swords

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Swords's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Make a .htaccess file in the directory you want it to affect and put this line in it: [code]DirectoryIndex index.html index.php[/code] This will have it direct to index.html first, and index.php if index.html isn't found. Note that it will affect all subdirectories of the directory you place it in.
  2. I know I'm a noob at php, but I know what all the functions do and I understand how this function works, but I can't figure out the cause of this error message I'm getting. Running this in the console, I get PHP Notice: undefined offset on lines 215, 250, 251, and 252. [code]<?php function parse_buffer() { /* :username!~identd@hostname JOIN :#php :username!~identd@hostname PRIVMSG #PHP :action text :username!~identd@hostname command channel :text */ global $con, $CONFIG; $buffer = $con['buffer']['all']; $buffer = explode(" ", $buffer, 4);   $buffer['all'] = $con['buffer']['all']; //fix undefined key error /* Get username */ $buffer['username'] = substr($buffer[0], 1, strpos($buffer['0'], "!")-1); /* Get identd */ $posExcl = strpos($buffer[0], "!"); $posAt = strpos($buffer[0], "@"); $buffer['identd'] = substr($buffer[0], $posExcl+1, $posAt-$posExcl-1); $buffer['hostname'] = substr($buffer[0], strpos($buffer[0], "@")+1); /* The user and the host, the whole shabang */ $buffer['user_host'] = substr($buffer[0],1); /* Isolate the command the user is sending from the "general" text that is sent to the channel This is  privmsg to the channel we are talking about. We also format $buffer['text'] so that it can be logged nicely. */ switch (strtoupper($buffer[1])) //line 215 { case "JOIN":   $buffer['text'] = "*JOINS: ". $buffer['username']." ( ".$buffer['user_host']." )"; $buffer['command'] = "JOIN"; $buffer['channel'] = $CONFIG['channel'];   break; case "QUIT":   $buffer['text'] = "*QUITS: ". $buffer['username']." ( ".$buffer['user_host']." )"; $buffer['command'] = "QUIT"; $buffer['channel'] = $CONFIG['channel'];   break; case "NOTICE":   $buffer['text'] = "*NOTICE: ". $buffer['username']; $buffer['command'] = "NOTICE"; $buffer['channel'] = substr($buffer[2], 1);   break; case "PART":   $buffer['text'] = "*PARTS: ". $buffer['username']." ( ".$buffer['user_host']." )"; $buffer['command'] = "PART"; $buffer['channel'] = $CONFIG['channel'];   break; case "MODE":   $buffer['text'] = $buffer['username']." sets mode: ".$buffer[3]; $buffer['command'] = "MODE"; $buffer['channel'] = $buffer[2]; break; case "NICK": $buffer['text'] = "*NICK: ".$buffer['username']." => ".substr($buffer[2], 1)." ( ".$buffer['user_host']." )"; $buffer['command'] = "NICK"; $buffer['channel'] = $CONFIG['channel']; break; default: // it is probably a PRIVMSG $buffer['command'] = $buffer[1]; //line 250 $buffer['channel'] = $buffer[2]; //line 251 $buffer['text'] = substr($buffer[3], 1); //line 252 break; } $con['buffer'] = $buffer; } ?>[/code] I assume it means that it can't find $buffer[1] $buffer[2] and $buffer[3], but my (limited) understanding tells me that they should be left over from the explode(" ", $buffer, 4) at the beginning of the function.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.