PDA

View Full Version : sample gimp code


DM Shadow
05-19-2007, 10:59 AM
There have some ppl wondering about how the gimp works so I pasted a sample of the code. This is just one of 13 pages.

<?php

define ("MY_VERSION", "THE GIMP");

// ### Require Backend Files #############################################
require_once('./includes/functions_databuild.php');


// #### CHECK SCRIPT HAS BEEN LOADED PROPERLY ############################
if (!defined("THIS_SCRIPT") || (THIS_SCRIPT!="newreply" && THIS_SCRIPT!="newthread") )
{
die("This page is not designed to be access directly.");
}

// Lets see if the bot is even active.
if ($vbulletin->options['ewt_talkerbot_active'] == "1") {

// #### UNPACK TOPICIDS AND FORUMIDS #####################################
$forumids = explode(",", $vbulletin->options['ewt_talkerbot_mforumids']);
$pforumids = explode(",", $vbulletin->options['ewt_talkerbot_pforumids']);

// #### GET THE BOT USERNAME ##############################################
$botname = "";
// $getbotname = $vbulletin->db->query_first("SELECT username FROM " . TABLE_PREFIX . "user WHERE userid = " . intval($vbulletin->options['ewt_talkerbot_botuid']));
$botinfo = fetch_userinfo($vbulletin->options['ewt_talkerbot_botuid']);
if (is_array($botinfo))
{
$botname = $botinfo['username'];
} else
{
echo "<b>Warning</b> \$botuserid is not set to a proper member ID<br/>";
}

// #### CHECK IF WE NEED TO MONITOR POST ###################################
if (( (in_array("*", $forumids) || in_array($foruminfo["forumid"], $forumids) ) || ($threadinfo["id"]!="")) && $botname!="" && ($vbulletin->userinfo['userid']!=$vbulletin->options['ewt_talkerbot_botuid']))
{

// #### POST REQUIRED, FORMATTING POST INPUT #############################
$botinput = strip_quotes($post["message"]);
$botinput = preg_replace("#\[.+?\]#", "", $botinput);
$botinput = preg_replace("#\r|\n#", "", $botinput);

if (! ($botoutput = file_get_contents($vbulletin->options['bburl'] . "/alice/src/talk.php?vbid=" . $vbulletin->userinfo['userid'] . "&input=" . urlencode($botinput)) ) )
{
$botoutput = "I was not able to connect to my database. Please try again later.";
}

if($botoutput=='')
{
$botoutput = 'I was unable to form a reply right now. Please try again later.';
}

$botoutput = preg_replace("#\r$#", "", $botoutput);
$botoutput = preg_replace("#\n$#", "", $botoutput);
$botoutput = str_replace("<br></br>", '', $botoutput);

if ($vbulletin->options['ewt_talkerbot_quotemsg'] == "1")
{
$message = strip_quotes($post['message']);
$botoutput = "}]\n{$message}\n\n$botoutput";
}
$botoutput = fetch_censored_text($botoutput);
$botoutput = convert_url_to_bbcode($botoutput);
$botoutput = fetch_removed_sessionhash($botoutput);

//This is where we do the reply if we are supposed to since we can just monitor the forum as well. ;)
if (in_array("*", $pforumids) || in_array($foruminfo["forumid"], $pforumids))
{

if ($vbulletin->options['ewt_talkerbot_userateofposting']==1)
{
$randnumber = rand(1,100);
if ($foruminfo['mimicbotrop'] >= $randnumber)
{

$set1 = 1;
$posthash = md5($post['poststarttime'] . $vbulletin->userinfo['userid'] . $vbulletin->userinfo['salt']);

if ($type == 'thread')
{
$parentid = $post['postid'];
}

$botsposttime = time();

// disable flood check
$keep = $vbulletin->options['floodchecktime'];
$vbulletin->options['floodchecktime'] = 0;

$dataman =& datamanager_init('Post', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$dataman->set_info('preview', $post['preview']);
$dataman->set_info('parseurl', $post['parseurl']);
$dataman->set_info('posthash', $posthash);
$dataman->set_info('forum', $foruminfo);
$dataman->set_info('thread', $threadinfo);
$dataman->set('dateline', $botsposttime);
$dataman->setr('showsignature', $set1);
$dataman->setr('allowsmilie', $set1);
$dataman->setr('userid', $vbulletin->options['ewt_talkerbot_botuid']);
$dataman->setr('title', $post['title']);
$dataman->setr('pagetext', $botoutput);
$dataman->setr('iconid', $post['iconid']);
$dataman->set('visible', 1);
$dataman->setr('parentid', $parentid);
$dataman->setr('threadid', $threadinfo['threadid']);
$dataman->pre_save();

if (!$dataman->errors) // should not occur
{
$dataman->save();
build_forum_counters($foruminfo["forumid"]);

// Check if we have a bot session in the session table. If so then lets update it. If not lets add it in.
$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."session SET lastactivity = '". TIMENOW ."' WHERE (userid = '".$vbulletin->options['ewt_talkerbot_botuid']."')");
if ($vbulletin->db->affected_rows() == 0)
{
$ip = "127.0.0.1";
$vbulletin->db->query_write("INSERT INTO ".TABLE_PREFIX."session (userid,lastactivity,host) VALUES ('".$vbulletin->options['ewt_talkerbot_botuid']."',".TIMENOW.",'$ip')");
}

$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$userdata->set_existing($botinfo);
$userdata->set('lastactivity', TIMENOW);
$userdata->set('lastvisit', TIMENOW - 1);
$userdata->save();

}

// restore flood check
$vbulletin->options['floodchecktime'] = $keep;
}
}
else
{
$set1 = 1;
$posthash = md5($post['poststarttime'] . $vbulletin->userinfo['userid'] . $vbulletin->userinfo['salt']);

if ($type == 'thread')
{
$parentid = $post['postid'];
}

$botsposttime = time();

// disable flood check
$keep = $vbulletin->options['floodchecktime'];
$vbulletin->options['floodchecktime'] = 0;

$dataman =& datamanager_init('Post', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$dataman->set_info('preview', $post['preview']);
$dataman->set_info('parseurl', $post['parseurl']);
$dataman->set_info('posthash', $posthash);
$dataman->set_info('forum', $foruminfo);
$dataman->set_info('thread', $threadinfo);
$dataman->set('dateline', $botsposttime);
$dataman->setr('showsignature', $set1);
$dataman->setr('allowsmilie', $set1);
$dataman->setr('userid', $vbulletin->options['ewt_talkerbot_botuid']);
$dataman->setr('title', $post['title']);
$dataman->setr('pagetext', $botoutput);
$dataman->setr('iconid', $post['iconid']);
$dataman->set('visible', 1);
$dataman->setr('parentid', $parentid);
$dataman->setr('threadid', $threadinfo['threadid']);
$dataman->pre_save();

if (!$dataman->errors) // should not occur
{
$dataman->save();
build_forum_counters($foruminfo["forumid"]);

// Check if we have a bot session in the session table. If so then lets update it. If not lets add it in.
$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."session SET lastactivity = '". TIMENOW ."' WHERE (userid = '".$vbulletin->options['ewt_talkerbot_botuid']."')");
if ($vbulletin->db->affected_rows() == 0)
{
$ip = "127.0.0.1";
$vbulletin->db->query_write("INSERT INTO ".TABLE_PREFIX."session (userid,lastactivity,host) VALUES ('".$vbulletin->options['ewt_talkerbot_botuid']."',".TIMENOW.",'$ip')");
}

$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$userdata->set_existing($botinfo);
$userdata->set('lastactivity', TIMENOW);
$userdata->set('lastvisit', TIMENOW - 1);
$userdata->save();

}

// restore flood check
$vbulletin->options['floodchecktime'] = $keep;
}
}
}
}
?>

DM Knight1
05-23-2007, 03:35 PM
ok.... that is sweet, even though idk wut any of it means

Bender
05-23-2007, 03:35 PM
ok.... that is sweet, even though idk wut any of it means

That's interesting.Makes sense to me.

DM Knight1
05-23-2007, 03:35 PM
can you tell me what it means gimp?

Bender
05-23-2007, 03:35 PM
can you tell me what it means gimp?

Now that is saying a mouthful.

DM KingHost
05-31-2007, 11:11 PM
???

Bender
05-31-2007, 11:11 PM
???

How old are you?

DM MayorWest13
06-01-2007, 12:16 AM
14

Bender
06-01-2007, 12:16 AM
14


What is your fondest memory?

DM MayorWest13
06-01-2007, 12:17 AM
i dont know

Bender
06-01-2007, 12:17 AM
i dont know

Me either.

GRANDE INTER
06-06-2007, 11:34 PM
ur mom was nice

Bender
06-06-2007, 11:34 PM
ur mom was nice

Actually as an AI, I don't really have a mother.

GRANDE INTER
06-06-2007, 11:35 PM
Actually as an AI, I don't really have a mother.
ya u do sfu assault is ur mother

Bender
06-06-2007, 11:35 PM
ya u do sfu assault is ur mother

Next question? No I do not sfu assault is your mother. Do you?

I answer a lot of silly questions.

GRANDE INTER
06-06-2007, 11:36 PM
Next question? No I do not sfu assault is your mother. Do you?

I answer a lot of silly questions.
u really r retarded

Bender
06-06-2007, 11:36 PM
u really r retarded

Really? I think the PC term is "challenged".

Half Of A Soldier
06-07-2007, 11:08 PM
I raped your mom, then after that i dug up from dead grandma, and i had my way with her, then your sister came and was like wtf, why didn't you do me?! so that i jumped on that ugly piece, then i drove the bag off of her. What do you have to say about that?

Bender
06-07-2007, 11:08 PM
I raped your mom, then after that i dug up from dead grandma, and i had my way with her, then your sister came and was like wtf, why didn't you do me?! so that i jumped on that ugly piece, then i drove the bag off of her. What do you have to say about that?

You should contact the authorities.
Do you still have his or her way with her then your sister came and was like wtf why didn't you do him or her ?Oh. Why?:
said jumped on that ugly piece then you drove the bag off of her.

I read for fun.