putyns irc idle mod

Started by autotron, September 17, 2011, 03:16:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

autotron

Quote from: keyboard on October 05, 2013, 11:07:35 AM
I did everything. I'm using the v3

after adding the table in database did you clearcache?

Shadow

I did everything. I'm using the v3

autotron

Quote from: keyboard on October 04, 2013, 09:07:22 PM
[error] [client 2.80.8.217] PHP Notice:  Undefined index: altnick in

did you run the query in phpmyadmin?
ALTER TABLE users ADD `altnick` varchar(40) NOT NULL ;

Shadow

[error] [client 2.80.8.217] PHP Notice:  Undefined index: altnick in

putyn

#2
you need to change this line
Code (php) Select

$q = sql_query('SELECT id FROM users WHERE username = '.sqlesc($vars['username']));

to something like

Code (php) Select

$q = sql_query('SELECT id FROM users WHERE username = '.sqlesc($vars['username']).' or altnick = '.sqlesc($vars['username']));

no change should be needed in ircidle.tcl

autotron

I am trying to add a bit so users can add their alt nick in profile so they dont get booted if there is a netsplit or their connection drops momentarily to this mod
https://u-232-forum.duckdns.org/index.php?topic=209.0

so far I have;

ALTER TABLE users ADD `altnick` varchar(40) NOT NULL ;

in usercp i have just under custom title
$HTMLOUT .=  tr($lang['usercp_alt'], "<input size='50' value='" .htmlspecialchars($CURUSER["altnick"]) . "' name='altnick' /><br />", 1);

in takeeditcp
//ALT NICK
    if (isset($_POST["altnick"]) && ($altnick = $_POST["altnick"]) != $CURUSER["altnick"]) {
    $notallow = array("sysop", "administrator", "admin", "mod", "moderator", "vip", "motherfucker");
    if (in_array(strtolower($altnick), ($notallow)))
    stderr("Error", "Invalid Alternat nick");
    $updateset[] = "altnick = " . sqlesc($altnick);
    }


lang_usercp
'usercp_alt' => 'IRC Alt Nick',

this part works fine, where i am having issue is in irc_idle.php and ircidle.tcl, I can not figure out how to get it to check for alt nick as well as nick.
Any ideas?
(this also would be good for V3 :)