====== "geturl" for Prims ====== Please begin this tutorialand create the scripts:\\ [[:howtos:How do you use the command "geturl"]] ==== Create a table for the prims ==== This is a example how the table can looks like: 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 ""; echo ""; echo ""; echo ""; echo ""; for ($a=0; $a"; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
LastSeenPrim-TextPrim-SimPrim-Vector
$row[pikkubot_prims_datum]$row[pikkubot_prims_name]"; echo "
secondlife://".toSLURL($row[pikkubot_prims_sim], $row[pikkubot_prims_position])."
$row[pikkubot_prims_sim]$row[pikkubot_prims_position]
"; } 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~~ ----