BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.5.x Custom/Unofficial Modules => Topic started by: Temar on January 20, 2008, 07:07:00 am

Title: Forum
Post by: Temar on January 20, 2008, 07:07:00 am
This module is Still under Construction, this is more of an Early Release

At the Coment this Module REQUIRES SMF
i will be making it so it isnt required but that isnt done yet
this Module will be Based on the Tables and and how SMF works
meaning its great to use with a SMF forum

at the moment you can Read and Reply but not Post New Topics

Current Commands

The Default Prefix is smf_ if your forum has diferent prefix or isnt on same database, change in !set forum
To use a dif Database its like DB.smf_

Altho this system hasnt been done yet u can lock boards to stop viewing
there is a setting also under !set forum
the doesnt Allow access to those Ranks it Simply Locks to all
Title: Re: Forum
Post by: Temar on January 20, 2008, 07:18:06 am
Also some Users may not want to Use !forum reg as the bot Logs stuff
i made a page on my forum useing Tinyportal's articles
Code: [Select]
?>
<br>Character Registration
<br>to use ingame Forum
<br>
<br><b>
<?php
$prefix 
"smf_";
$altprefix "";

function select ($sql$result_form=MYSQL_NUM)//MYSQL_ASSOC = field names
{
$data "";
$result mysql_query($sql);

if (!$result)
{
// echo $sql;
echo mysql_error();
return false;
}

if (empty($result))
{
return false;
}

$count 0;

while ($row mysql_fetch_array($result$result_form))
{
$data[] = $row;
}

mysql_free_result($result);
return $data;
}

function query ($sql)
{
$return mysql_query($sql);

if (!$return)
{
echo mysql_error();
return false;
}
else
{
return true;
}
}
function mainchar($name$prefix)
{
$main select("SELECT main FROM ".$prefix."alts WHERE alt = '".$name."'");
if(!empty($name))
$main $main[0][0];
else
$main ucfirst(strtolower($name));
Return $main;
}

$user select("SELECT AOchar FROM ".$prefix."members WHERE ID_MEMBER = ".$context['user']['id']);

$char $_POST['char'];
if(!empty($char))
{

$main mainchar($char$altprefix);
$check select("SELECT AOchar FROM ".$prefix."members WHERE AOchar = '".$main."'");

if($user[0][0] != "NONE")
{
echo "You are Currently Attached to ".$user[0][0]." and alts, Code to Remove hasnt been done yet :p";
}
elseif(!empty($check))
echo "Error: That Character is Already Attached to a Forum Account.";
else
{
// create new account
query("UPDATE ".$prefix."members SET AOchar = '".$main."' WHERE ID_MEMBER = ".$context['user']['id']);
echo "Main Character ".$main." and alts has been registered to this Account.";
}
}
else
{
if($user[0][0] != "NONE")
{
echo "You are Currently Attached to ".$user[0][0]." and alts, Code to Remove hasnt been done yet :p";
}
else
{
echo '<form action="" method="post">';
echo '<input type="text" name="char" size="20" value="">';
echo '<input type="submit" name="submit" value="Register">';
echo '</form>';
}
}

echo 
"</b>";

Change
$prefix to your Forum prefix you will already be on your forum database
$altprefix to you alts table prefix default there is no prefix, if different database "DB." the . is seperator db.table
Title: Re: Forum
Post by: Monery on June 16, 2008, 08:20:10 am
Temar, I can't wait to figure out to install SMF so I can use it on my bot. Unless your planning a simple ready to go module in the next month or so, I will just keep en eye out here waiting for your next release
Title: Re: Forum
Post by: clashbot on June 29, 2008, 09:57:29 pm
temar, I am using SMF with TP, but is being hosted on a remote server, and bebot is, of corse, local(following the advice of everyone here) could you give a little bit better pointers on how to set up this module?
Title: Re: Forum
Post by: Temar on June 29, 2008, 11:35:33 pm
this module currently useing direct reading of the tables
Title: Re: Forum
Post by: clashbot on June 29, 2008, 11:37:10 pm
ok, so I would have to host the smf/tp on the same machine as the bot...that was what I was afraid of.
SimplePortal 2.3.7 © 2008-2024, SimplePortal