wantzel.pl.patch 1.22 KB
Newer Older
Mindiell's avatar
Mindiell committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
205a206,229
>     if ($s =~ /^\!quote/)
>     {
>         if (my($quote, $auteur, $url, $source)=($s =~ /^\!quote\s+"(.+)"\s+(.+)\s+(https?\:\/\/[\S]+)\s+(.+)/))
>         {
>             #$conn->privmsg($channel, "quote: $quote");
>             #$conn->privmsg($channel, "auteur: $auteur");
>             #$conn->privmsg($channel, "url: $url");
>             #$conn->privmsg($channel, "source: $source");
>             my $sql='INSERT INTO Quote
>                 (User_Quote, Quote_Quote, Auteur_Quote, URL_Quote, Source_Quote, Date_Quote, Note_Quote)
>             VALUES
>                 (         ?,           ?,            ?,         ?,            ?,      NOW(),          ?)';
>             my $dbh = DBI->connect($dsn, $db_user_name, $db_password);
>             my $sth = $dbh->prepare($sql);
>             die "Fatal: cannot RECONNECT !\n" unless
>                 ($sth->execute($who, $quote, $auteur, $url, $source,1));
>             $sth->finish();
>             $conn->privmsg($channel, "C'est dans la boite !");
>         }
>         else
>         {
>             $conn->privmsg($channel, "Pour ajoutter une citation tapez : !quote \"la citation\" l'auteur http://url la source");
>         }
>     } # a-t-on "!quote" dans le message