• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ Contributions (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Kick / Ban reasons

Post a bug fix, a new feature, a theme ...

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
6 posts • Page 1 of 1

Postby ljbuesch » Sat Jul 21, 2007 12:17 am

If you try to kick or ban a user and use more than one word in your reason, you only get the first word:
Code: Select all
/kick user You have been naughty

will result in
Code: Select all
user quit (kicked from chan by admin - reason: You

Here is a fix for beta-11

kick.php
Code: Select all
--- beta11    2007-02-15 08:13:34.000000000 -0800
+++ bugfix      2007-07-20 16:13:58.878619000 -0700
@@ -22,6 +22,14 @@
     $reason = isset($params[1]) ? $params[1] : '';
     if ($reason == '') $reason = _pfc("no reason");
 
+    if (count($params) > 2)
+    {
+        for ($x=2;$x<count($params);$x++)
+        {
+            $reason.=" ".$params[$x];
+        }
+    }
+

ban.php
Code: Select all
--- beta11     2007-03-07 11:14:11.000000000 -0800
+++ bugfix       2007-07-20 16:12:15.754543000 -0700
@@ -21,6 +21,15 @@
     $nick   = isset($params[0]) ? $params[0] : '';
     $reason = isset($params[1]) ? $params[1] : '';
     if ($reason == '') $reason = _pfc("no reason");
+
+    if (count($params) > 2)
+    {
+        for ($x=2;$x<count($params);$x++)
+        {
+            $reason.=" ".$params[$x];
+        }
+    }
+
ljbuesch
New member
 
Posts: 9
Joined: Thu Jul 05, 2007 7:09 pm
Top

Postby phpfreechat » Tue Jul 24, 2007 3:35 pm

This is not a bug, it's a feature, does this syntaxe work ?

/kick user "You have been naughty"
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby Tuxie » Tue Jul 24, 2007 7:23 pm

How is this not a bug? :P
Tuxie
New member
 
Posts: 5
Joined: Fri Jul 06, 2007 3:30 pm
Top

Postby ljbuesch » Thu Jul 26, 2007 10:43 pm

kerphi wrote:This is not a bug, it's a feature, does this syntaxe work ?

/kick user "You have been naughty"

This syntax worked, although I would still consider it a bug. As a user, I would expect it to work properly w/o having to use quotations around what I am saying. I can see why the implementation requires ""s, but I fail to see why it is considered a feature for these commands.

Thank you for your feedback though, it is much appreciated.
ljbuesch
New member
 
Posts: 9
Joined: Thu Jul 05, 2007 7:09 pm
Top

Postby phpfreechat » Fri Jul 27, 2007 8:31 am

ljbuesch you are right, your solution is more user friendly.
I commited your patch in 1057 revision.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby Agyuku » Wed Oct 03, 2007 9:06 am

mine looks like this:

$reason = isset($params[1]) ? $params[1] : '';
if(count($params) > 2) {
$reason = array_shift($params);
$reason = join(' ',$params);
}

works the same way :D
Agyuku
Member
 
Posts: 10
Joined: Thu Jun 28, 2007 7:37 am
Top


Post a reply
6 posts • Page 1 of 1

Return to Contributions (v1.x)

Who is online

Users browsing this forum: No registered users and 13 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub