$poiname 		= $_GET['poiname'];
    $description	= $_GET['description'];
    $longtext		= $_GET['longtext'];
    $lat 		    = $_GET['lat'];
    $lon            = $_GET['lon'];
    $georssurl		= $_GET['georssurl'];
    $poilist		= $_GET['poilist'];
    $groupid		= $_GET['groupid'];
    $poiid	 		= $_GET['poiid'];
    $tagname 		= $_GET['tagname'];
    $zoomlevel 		= $_GET['zoomlevel'];
    //$itemtype       = $_GET['itmetype'];
    */
}
if (application_userisvalid()) {
    $usr = application_getvaliduser();
    if ($usr != null) {
        $pof = new PoiFactory();
        $js2 = new Services_JSON();
        //msg_createpoi
        if ($action == msg_createpoi) {
            if (!$pof->poiExistsByPos($usr->getUid(), $lat, $lon)) {
                if ($pof->createPoi($usr->getUid(), $poiname, $description, $lat, $lon, $zoomlevel, $tagname, "Poi")) {
                    $poi = $pof->getPoiById($usr->getUid(), $pof->lastid);
                    if ($poi != null) {
                        if (isset($groupname)) {
                            //add created poi into a group
                            $gf = new GroupFactory();
                            $grp = $gf->getGroupByName($usr->getUid(), $groupname);
                            if ($grp != null) {
                                $gf->addGroupItem($grp->itemid, $usr->getUid(), $poi->itemid, $poi->itemtype);
function application_getuserdir()
{
    $usr1 = application_getvaliduser();
    if ($usr1) {
        return "trf_" . $usr1->itemid . "/";
    }
    return "";
}