egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help needed

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
KillerBoy
Voice


Joined: 02 Apr 2006
Posts: 2

PostPosted: Sun Apr 02, 2006 7:59 am    Post subject: Help needed Reply with quote

ok guys iam trying to make my script done but it wont give the way i wanted
i wanted a search system which will find the users starting ore where the name is in
like !user test
and the php file is ok and give me the result what i need when i vissit it true my inetx
like
testing test
it give me more then 1 result now i wanted to put the result true my eggdrop into my irc channel but i wont work
it only gives me 1 username but there are 3 users who got test in there name
those are the scripts but not working ok
Code:
<?php
error_reporting(7);

define ('LF', "\n");
// DEFINE YOUR MYSQL INFORMATION HERE!
$server="localhost";
$dbuser="user";
$dbpass="pass";
$db="database";

mysql_pconnect($server,$dbuser,$dbpass);
mysql_select_db($db);

$username=$_GET["username"];
$usernfo=mysql_query("SELECT * FROM users WHERE UPPER(nickname) LIKE UPPER('%$username%') ");

 while($user=mysql_fetch_array($usernfo)) {
  echo
  LF, $user[nickname],
  LF, $user[joindate],
  LF, $user[posts];
  }     
?>


And the tcl
Code:

set url "http://localhost/ircscripts/user.php"
set agent "Mozilla"
package require http
bind pub "-|-" !user getstatus

proc getstatus { nick host handle channel text } {
        global chan url agent
   putlog "$text"
   if {$text != ""} {
                          set query "$url?username=$text"
                set page [http::config -useragent $agent]
                          set data [http::geturl $query]
                          set data2 [http::data $data]
                          set lines [split [::http::data $data] \n]
                          set ok [lindex $lines 1]
           set date [lindex $lines 2]
                          set nickname [lindex $lines 1]
           set posts [lindex $lines 3]
                          upvar #0 $page state
                          set max 0
                          http::cleanup $data
                          foreach line [split $data2 \n] {
                          if {$ok != ""} {
                                putquick "PRIVMSG $channel :\00307,01 \002\[User\] \00307,01 \002$nickname : \00314,01Status \00307,01$posts JOINED AT $date"                     
                         } else {
                                putquick "PRIVMSG $channel :\00307,01 \002\[User\] \00307,01 \002$text not found"
                         }
                         }
                 }
}


please let me finnish thanxs alot
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber