CREATE TABLE `pikkubot_prims` (
`pikkubot_prims_id` int(11) NOT NULL auto_increment,
`pikkubot_prims_datum` datetime NOT NULL default '0000-00-00 00:00:00',
`pikkubot_prims_name` text NOT NULL,
`pikkubot_prims_sim` text NOT NULL,
`pikkubot_prims_position` text NOT NULL,
PRIMARY KEY (`pikkubot_prims_id`),
KEY `pikkubot_prims_datum` (`pikkubot_prims_datum`)
) ENGINE=MyISAM;
==== Enhance the log.php for prims ====
Now we enlarge the log.php with some lines:
if ($_GET[prim_name]!="") {
$insert=mysql_query("
INSERT INTO pikkubot_prims
(pikkubot_prims_datum, pikkubot_prims_name, pikkubot_prims_sim, pikkubot_prims_position)
VALUES
('".date("Y-m-d H:i:s")."', '$_GET[prim_name]', '$_GET[prim_sim]', '$_GET[prim_position]')
");
}
==== A PHP-script for logging in the database ====
A simple script to show the logged Prims, we call the file **prims.php**:
";
$select=mysql_query("
select * FROM pikkubot_prims
ORDER BY pikkubot_prims_datum DESC
LIMIT 0,500
");
if (mysql_num_rows($select)>0 ) {
echo "Last 500 Prims with text regarding the topic \"camping\" :
";
echo "";
echo "";
echo "LastSeen ";
echo "Prim-Text ";
echo "Prim-Sim ";
echo "Prim-Vector ";
echo " ";
for ($a=0; $a";
echo "$row[pikkubot_prims_datum] ";
echo "$row[pikkubot_prims_name]";
echo "
secondlife://".toSLURL($row[pikkubot_prims_sim], $row[pikkubot_prims_position])." ";
echo "$row[pikkubot_prims_sim] ";
echo "$row[pikkubot_prims_position] ";
echo "";
}
echo "
";
}
else
{
echo "... Sorry, no Prims seen yet ...
";
}
function toSLURL($sim, $loc) {
// <0.112076, 1.827652, -1.322716>
$loc=str_replace(">","",$loc);
$loc=str_replace("<","",$loc);
$loc_exp=explode(",", $loc);
$sim_exp=explode(" (", $sim);
return $sim_exp[0]."/".round(trim($loc_exp[0]))."/".round(trim($loc_exp[1]))."/".round(trim($loc_exp[2]));
}
?>
==== Configuration in Pikku ====
For the end just, use the command "huntwords" to say, witch words should be logged when they are foundl:\\
//"[[:english:documentation:all_commands_premium#huntwords_text_text|huntwords]] camp,pay,earn"//\\
\\
Finished!\\
\\
~~UP~~
----