Skip to content

Commit

Permalink
whatever i changed
Browse files Browse the repository at this point in the history
  • Loading branch information
crutchy committed Oct 31, 2015
1 parent 0438d38 commit 0fc6fd9
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 13 deletions.
27 changes: 20 additions & 7 deletions scripts/wiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/*
exec:~wiki|40|0|0|0|*||||php scripts/wiki.php %%trailing%% %%dest%% %%nick%% %%alias%%
exec:~wiki-privmsg|40|0|0|0|crutchy,mrcoolbp||||php scripts/wiki.php %%trailing%% %%dest%% %%nick%% %%alias%%
exec:~wiki-privmsg|40|0|0|0|||||php scripts/wiki.php %%trailing%% %%dest%% %%nick%% %%alias%%
init:~wiki register-events
*/

Expand Down Expand Up @@ -36,14 +36,27 @@

if ($alias=="~wiki-privmsg")
{
$spamctl=".spamctl";
if (strtolower(substr($trailing,0,strlen($spamctl)))==$spamctl)
{
wiki_spamctl($nick,$trailing);
return;
}
if ($dest=="#wiki")
{
$cmd=".spamctl";
if (strtolower(substr($trailing,0,strlen($cmd)))==$cmd)
{
wiki_spamctl($nick,$trailing);
return;
}
$cmd=".spamuser";
if (strtolower(substr($trailing,0,strlen($cmd)))==$cmd)
{
wiki_spamuser($nick,$trailing);
return;
}
if ($nick=="WikiRC")
{
if (users_get_account($nick)=="WikiRC")
{
wiki_autospamctl($trailing);
}
}
return;
}
$delim1="[[";
Expand Down
43 changes: 37 additions & 6 deletions scripts/wiki_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,17 @@ function wiki_privmsg($return,$msg)

#####################################################################################################

function wiki_spamctl($nick,$trailing)
function wiki_spamctl($nick,$trailing,$bypass_auth=False)
{
$account=users_get_account($nick);
$allowed=array("crutchy","chromas","mrcoolbp");
if (in_array($account,$allowed)==False)
if ($bypass_auth==False)
{
privmsg(" error: not authorized");
return;
$account=users_get_account($nick);
$allowed=array("crutchy","chromas","mrcoolbp");
if (in_array($account,$allowed)==False)
{
privmsg(" error: not authorized");
return;
}
}
$title=trim(substr($trailing,strlen(".spamctl")));
if ($title=="last")
Expand Down Expand Up @@ -377,4 +380,32 @@ function wiki_spamctl($nick,$trailing)

#####################################################################################################

# 14[[07The Meaning Of Chopsticks In Chinese Food Culture14]]4 !N10 02http://wiki.soylentnews.org/w/index.php?oldid=9223&rcid=13180 5* 03Trey18553770 5* (+3741) 10Created page with "<br><br>I remember that, after i was little, there were lots of riddles for children. My grandma used to ask me time to time considered one of them in particular: 'There are t..."

function wiki_autospamctl($trailing)
{
$spam_user_list=explode(PHP_EOL,file_get_contents(DATA_PATH."wiki_spam_users"));
delete_empty_elements($list,True);
$test_title=trim(extract_text_nofalse($trailing,"14[[07","14]]"));
$test_nick=trim(extract_text_nofalse($trailing," 5* 03"," 5*"));
if (($test_title=="") or ($test_nick==""))
{
return;
}
if (in_array($test_nick,$spam_user_list)==False)
{
return;
}
wiki_spamctl("",".spamctl ",True);
}

#####################################################################################################

function wiki_spamuser($nick,$trailing)
{
#privmsg($trailing);
}

#####################################################################################################

?>

0 comments on commit 0fc6fd9

Please sign in to comment.