function getHeaderPOIEntryDefinitions($zoomFaktor = 14)
{
    $dbTablePOI = new DbTable($_SESSION['config']->DBCONNECT, "gpsPositions", array("id", "timeonupdate", "longitude", "latitude", "altitiude", "accuracy", "user_id"), "", "", " IF( user_id = " . $_SESSION['config']->CURRENTUSER->USERID . " , 1, 0 ) ", "");
    $rowCount = $dbTablePOI->getRowCount();
    $ret = "    \r\n\t\t\tvar markers = [];\r\n\t\t\ticon =  null;\r\n\t\t\ttitle = \"\";\r\n\t\t\tposn = null;\r\n\t\t\t          \r\n\t\t\tallmarkers.length = 0;\r\n\r\n\t\t\tmgr = new GMarkerManager(map);\r\n\t   ";
    for ($i = 1; $i <= $rowCount && $rowCount > 0; $i++) {
        $poiRow = $dbTablePOI->getRow($i);
        // Ermittelter POI
        $userId = $poiRow->getNamedAttribute("user_id");
        $user = getUserFullnameById($poiRow->getNamedAttribute("user_id"));
        $lg = $poiRow->getNamedAttribute("latitude");
        $bg = $poiRow->getNamedAttribute("longitude");
        $ret .= "\r\n\t\t\t\tmarker" . $userId . " = null; \r\n                ";
        if ($bg != 0 && $lg != 0) {
            if ($userId != null && $userId == $_SESSION['config']->CURRENTUSER->USERID) {
                $ret .= "\r\n\t\t\t\t          icon = iconCurrent; \r\n\t\t\t\t\t\t  \r\n   \t\t\t\t\t      var myGeographicCoordinates = new GLatLng(" . $bg . ", " . $lg . ");\r\n\t\t       \t\t\t  map.setCenter(myGeographicCoordinates, " . $zoomFaktor . ");";
            } else {
                if ($userId != null && isUserOnFriendlist($userId)) {
                    $ret .= "\r\n\t\t\t\t          icon = icon" . $userId . "; ";
                } else {
                    $ret .= "\r\n\t\t\t\t          icon = blueIcon; ";
                }
            }
            $ret .= "\r\n\t\t\t\t          title = \"" . $user . "\" \r\n\t\t\t\t          posn = new GLatLng( " . $bg . ", " . $lg . " );\r\n\t\t\t\t          marker" . $userId . " = createMarker(posn,title,icon);\r\n                          \r\n                          var html" . $userId . " = \"" . getUserMarkerInfoSource($userId) . "\";  \r\n\t\t\t\t          \r\n                          \r\n                          \r\n           \t\t\t\t  GEvent.addDomListener(marker" . $userId . ", \"click\", function() {\r\n\t\t\t\t\t\t    // document.location.href = \"?showUser="******"\";\r\n                            marker" . $userId . ".openInfoWindowHtml(html" . $userId . ")\r\n\t\t\t\t\t\t  });\r\n\r\n\t\t\t\t          \r\n\t\t\t\t\t\t  markers.push(marker" . $userId . ");\r\n\t\t\t\t          allmarkers.push(marker" . $userId . ");\r\n\t\t\t";
        }
    }
    $ret .= "\t\r\n                mgr.addMarkers(markers, 10); \r\n            ";
    // ------------------------
    //     Statische POIs
    // ------------------------
    $ret .= "\r\n \t\t\t\t\r\n \t\t\t\tvar wkMarker = [];\r\n\t\t\t\tvar wkText = \"Wermelskirchen\";\r\n\t\t\t\t\r\n\t\t\t\tmarkerWk = createMarker(new GLatLng(51.15, 7.21667), wkText, iconWkWappen); \r\n\t\t\t\twkMarker.push(markerWk);\r\n\t\t\t\t\r\n \t\t\t\tmgr.addMarkers(wkMarker, 6);\r\n \t\t\t\tmgr.refresh();\r\n\t\t\t";
    return $ret;
}
Exemplo n.º 2
0
function checkAction($chkVal)
{
    $w = "chkVal='" . $chkVal . "'";
    if (isset($_SESSION['config']) && $_SESSION['config']->CURRENTUSER->USERID != null) {
        $w .= " and user_id=" . $_SESSION['config']->CURRENTUSER->USERID;
    }
    $dbTblTest = new DbTable($_SESSION['config']->DBCONNECT, "chkActions", array("*"), "", "", "id desc", $w);
    if ($dbTblTest->getRowCount() > 0) {
        $r = $dbTblTest->getRow(1);
        if ($r->getNamedAttribute("chkVal") == $chkVal) {
            return false;
        }
    }
    $r = $dbTblTest->createRow();
    $r->setNamedAttribute("user_id", $_SESSION['config']->CURRENTUSER->USERID);
    $r->setNamedAttribute("chkVal", $chkVal);
    $r->insertIntoDB();
    return true;
}
/**
 * Liefert die Anzahl der Unterthemen  des angegebenen Threads
 * 
 * @param $CurrentThreadtitle           Name des aktuellen Themas
 */
function getForumThreadCount($CurrentThreadtitle)
{
    $dbTable = new DbTable($_SESSION['config']->DBCONNECT, 'forum', array("title"), "Titel", "", "", "parent='" . $CurrentThreadtitle . "' ");
    return $dbTable->getRowCount();
}
Exemplo n.º 4
0
function addFriendRequest($userId, $friendId)
{
    $dbTblFriends = new DbTable($_SESSION['config']->DBCONNECT, "freundesliste", array("user_id", "friend_id", "accepted"), "", "accepted = 'N'", "", "user_id=" . $userId . " AND friend_id=" . $friendId);
    if ($dbTblFriends->getRowCount() > 0) {
        echo "Dieser Benutzer ist bereits in Ihrer Freundesliste, oder Sie haben bereits eine Anfrage gestellt.";
        return;
    }
    $dbRowNewFriend = $dbTblFriends->createRow();
    $dbRowNewFriend->setNamedAttribute("user_id", $userId);
    $dbRowNewFriend->setNamedAttribute("friend_id", $friendId);
    $dbRowNewFriend->setNamedAttribute("accepted", "N");
    $dbRowNewFriend->insertIntoDB();
    echo "Freundesanfrage gesendet";
}
Exemplo n.º 5
0
 function existsUsername($name)
 {
     $dbTblUser = new DbTable($this->DBCONNECT, "user", array("*"), "", "", "", "User = '******' ");
     return $dbTblUser->getRowCount() > 0;
 }
Exemplo n.º 6
0
 /**
  * Zeigt das gesamte DIV an
  */
 function show()
 {
     echo "<div ";
     if ($this->XPOS > 0 || $this->YPOS > 0) {
         $tmp = ":absolute; ";
         if ($this->YPOS > 0) {
             $tmp .= " top:" . $this->YPOS . "px; ";
         }
         if ($this->XPOS > 0) {
             $tmp .= " left:" . $this->XPOS . "px; ";
         }
         $this->setStyle("position", $tmp);
     }
     $this->getToolTipTag();
     $this->showStyles();
     echo " > ";
     if ($this->KOPFTEXT_NEED) {
         /*
          * Bei berechtigung, Kopftext bearbeiten.
          */
         if ($_SESSION['config']->CURRENTUSER->STATUS == "admin" || $_SESSION['config']->CURRENTUSER->STATUS == "user") {
             if (isset($_REQUEST['changeHeadInfo']) && strlen($_REQUEST['changeHeadInfo']) > 5) {
                 $ktRl = substr($_REQUEST['changeHeadInfo'], 5);
                 $dbtbl = new DbTable($_SESSION['config']->DBCONNECT, "kopftexte", array("text"), "", "", "", "runlink = '" . $ktRl . "' ");
                 if ($dbtbl->getRowCount() == 0) {
                     $dbtblInsert = new DbTable($_SESSION['config']->DBCONNECT, "kopftexte", array("runlink", "parent", "text"), "", "", "", "runlink = '" . $ktRl . "' ");
                     $dbtblInsert->insertRowByArray(array($ktRl, null, ""));
                     $dbtbl->refresh();
                 }
                 if (isset($_REQUEST['DbTableUpdate' . $dbtbl->TABLENAME]) && $_REQUEST['DbTableUpdate' . $dbtbl->TABLENAME] == "Speichern") {
                     $dbtbl->doUpdate();
                 }
                 $frm = $dbtbl->getUpdateAllMask();
                 $frm->add(new Hiddenfield("changeHeadInfo", $_REQUEST['changeHeadInfo']));
                 $frm->show();
             } else {
                 $sp = new Spacer(5);
                 $sp->show();
                 $txKtb = new Text("Kopftext bearbeiten<br>");
                 $txKtb->setFilter(false);
                 $lnk = new Link("?changeHeadInfo=Cnge-" . $_SESSION['runLink'], $txKtb);
                 $lnk->show();
             }
         }
         $tx = new Text(getKopfText());
         $tx->setFilter(false);
         $tx->show();
     }
     if ($this->getObjectCount() > 0) {
         foreach ($this->OBJECTS as $obj) {
             $obj->show();
         }
     }
     //--------------
     include $this->FILE;
     //--------------
     echo "</div>";
 }