public function getSongs($status) { if ($status == 'all') { $songs = AGDO::getInstance()->GetAll("SELECT * FROM SVsongs LEFT OUTER JOIN sv_song_genres ON g_id = website ORDER BY title"); } elseif ($status == 'repertoire') { $songs = AGDO::getInstance()->GetAll("SELECT * FROM SVsongs LEFT OUTER JOIN sv_song_genres ON g_id = website WHERE probe != 1 AND probe != 5 ORDER BY title"); } elseif ($status == 'uebrige') { $songs = AGDO::getInstance()->GetAll("SELECT * FROM SVsongs LEFT OUTER JOIN sv_song_genres ON g_id = website WHERE probe != 1 AND probe != 5 ORDER BY g_id, title"); } elseif ($status == 'erschienen') { $songs = AGDO::getInstance()->GetAll("SELECT * FROM SVsongs LEFT OUTER JOIN sv_song_genres ON g_id = website ORDER BY erschienen DESC"); } elseif ($status == 2) { $dringend = AGDO::getInstance()->GetAll("SELECT * FROM SVsongs LEFT OUTER JOIN sv_song_genres ON g_id = website WHERE probe = 3 ORDER BY title"); $proben = AGDO::getInstance()->GetAll("SELECT * FROM SVsongs LEFT OUTER JOIN sv_song_genres ON g_id = website WHERE probe = 2 ORDER BY title"); $sonstige = AGDO::getInstance()->GetAll("SELECT * FROM SVsongs LEFT OUTER JOIN sv_song_genres ON g_id = website WHERE probe = 4 ORDER BY letzteProbe"); $songs = array_merge($dringend, $proben, $sonstige); } elseif ($status == 5) { $songs = AGDO::getInstance()->GetAll("SELECT * FROM SVsongs LEFT OUTER JOIN sv_song_genres ON g_id = website WHERE\n angefangen > '" . date("Y-m-d", time() - 3600 * 24 * 21) . "' OR probe = '5' ORDER BY angefangen DESC"); } else { $songs = AGDO::getInstance()->GetAll("SELECT * FROM SVsongs LEFT OUTER JOIN sv_song_genres ON g_id = website WHERE probe = '" . $status . "' ORDER BY title"); } foreach ($songs as $song) { $song['b'] = $song['c']; $song['arr_b'] = $song['arr_c']; $song['arr_t'] = ''; $song['arr_p'] = ''; $S = new Song(); $S->setSong($song); $this->songs[$song['id']] = $S; } return $this->songs; }
private function getBlocke($pl_id) { $bloecke = AGDO::getInstance()->GetAll("SELECT * FROM playlist_bloecke WHERE pl_id = " . $pl_id . " ORDER BY pb_sort_order"); $countbloecke = count($bloecke); $newPosition = $this->g['nr'] + $this->g['change']; if ($newPosition < 1) { $newPosition = 1; } if ($newPosition > $countbloecke) { $newPosition = $countbloecke; } $x = 1; foreach ($bloecke as $block) { $b = new playlist_bloecke(); $b->setBlock($block); if ($b->pb_id == $this->g['pb_id']) { $b->pb_sort_order = $newPosition; $b->saveBlock(); } else { $this->bloecke[$x++] = $b; } } for ($sortorder = 1; $sortorder < $countbloecke; $sortorder++) { if ($sortorder == $newPosition) { } elseif ($sortorder > $newPosition) { $block = $this->bloecke[$sortorder - 1]; $block->pb_sort_order = $sortorder; $block->saveBlock(); } else { $block = $this->bloecke[$sortorder]; $block->pb_sort_order = $sortorder; $block->saveBlock(); } } }
function get_last_entry($ip) { $prefix = AGDO::getInstance()->getDBConnector()->getPrefix(); $table = $this->check_table; $query = "SELECT * FROM ".$prefix.$table." WHERE `ip` = '".$ip."' ORDER BY `time` DESC"; $returnvalue = AGDO::getInstance()->GetAll($query); if (!empty($returnvalue)) return $returnvalue[0]; else return false; }
public function __construct($id) { $article = AGDO::getInstance()->GetAll("SELECT * FROM ".AGDO::getInstance()->getDBConnector()->getParentIDTable()." WHERE article_id = ".$id); $permissions = AGDO::getInstance()->GetAll("SELECT * FROM ".AGDO::getInstance()->getDBConnector()->getPrefix()."permission WHERE article_id = ".$article[0]['parent_id']); //AGDO::get foreach ($permissions as $permission) { $insertArray=array(); $insertArray['role_id']=$permission['role_id']; $insertArray['article_id']=$id; $insertArray['permission']=$permission['permission']; AGDO::getInstance()->AutoExecute(AGDO::getInstance()->getDBConnector()->getPrefix()."permission", $insertArray, 'INSERT'); } }
public function generateScript($article_url, $language, $article_id) { $article = AGDO::getInstance()->GetAll("SELECT * FROM ".AGDO::getInstance()->getDBConnector()->getDescriptionTable()." WHERE article_id = ".$article_id); $text=""; if (!empty($article[0]['twitter_text'])) { $text = 'data-text="'.$article[0]['twitter_text'].'"'; } if ($article[0]['article_url']=="/") $article_url=""; else $article_url =$article[0]['article_url'].".html"; $url = $_SERVER['HTTP_HOST']."/".$article_url; return '<a href="http://twitter.com/share" class="twitter-share-button" data-lang="'.$language.'" data-url="http://'.$url.'" '.$text.' data-count="'.$this->dataArray[0]['twitter_ausrichtung'] .'">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>'; }
public function generateMetaData($article_id) { $article= AGDO::getInstance()->GetAll("SELECT * FROM ".AGDO::getInstance()->getDBConnector()->getDescriptionTable()." WHERE article_id = ".$article_id); $suchmuster="/\< *[img][^\>]*[src] *= *[\"\']{0,1}([^\"\'\ >]*)/i"; //print_r() //preg_match_all($pattern, $subject, $matchesarray) if (empty($article[0]['facebook_title'])) $article[0]['facebook_title']=$article[0]['article_title']; $returnvalue='<meta property="og:title" content="'.$article[0]['facebook_title'].'" />'."\r\n"; $returnvalue.='<meta property="og:type" content="'.$article[0]['facebook_type'].'" />'."\r\n"; if ($article[0]['article_url']=='/') $returnvalue.='<meta property="og:url" content="http://'.$_SERVER['HTTP_HOST'].'" />'."\r\n"; else $returnvalue.='<meta property="og:url" content="http://'.$_SERVER['HTTP_HOST']."/".$article[0]['article_url'].'.html" />'."\r\n"; preg_match($suchmuster, $article[0]['article_content'], $treffer); //print_r($treffer); $image = ""; if (!empty($article[0]['facebook_image'])) { $image=$article[0]['facebook_image']; } else { if (!empty($treffer)) { $image = str_replace('"', '', $treffer[1]); } else { $image = $this->getdefaultImage(); } } $returnvalue.='<meta property="og:image" content="http://'.$_SERVER['HTTP_HOST'].$image.'" />'."\r\n"; $returnvalue.='<meta property="og:site_name" content="'.$this->dataArray[0]['facebook_site_name'].'" />'."\r\n"; $returnvalue.='<meta property="fb:admins" content="'.$this->dataArray[0]['facebook_admin_code'].'" />'."\r\n"; if (!empty($article[0]['facebook_description'])) $returnvalue.='<meta property="og:description" content="'.$article[0]['facebook_description'].'" />'."\r\n"; return $returnvalue; }
public function check($URL, $ID, $langID) // added sanitize check JA 23.01.2009 { $URL = $this->sanitzeURL($URL); $SQLQuery = "SELECT * FROM `".AGDO::getInstance()->getDBConnector()->getDescriptionTable()."` WHERE article_url = '".$URL."' and language_id = ".$langID; $result= AGDO::getInstance()->GetAll($SQLQuery); $count = count($result); //echo $count; //print_r($result); if ($count==0 ) // Neuer Eintrag return $URL; else { if ($count==1 && $result[0]['article_id']==$ID) { return $URL; } $SQLQuery = "SELECT COUNT(*) as count FROM `".AGDO::getInstance()->getDBConnector()->getDescriptionTable()."` WHERE article_url LIKE '".$URL."%' and language_id = ".$langID; $result=AGDO::getInstance()->GetAll($SQLQuery); return $URL.(($result[0]['count'])+1); } }
private function activateUser() { $sql = "SELECT * FROM user WHERE hash = '".Request::getInstance()->getGetRequests('registrieren')."' "; $user = AGDO::getInstance()->getAll($sql); $sql = "UPDATE ".$this->userTable." SET userActive = 1 WHERE hash = '".Request::getInstance()->getGetRequests('registrieren')."' "; AGDO::getInstance()->Execute($sql); }
public function getCompleteTreeFromDatabase($id,$ebene) { $aktDate=date("Y")."-".date("n")."-".date("j"); $SQLQuery="Select ".$this->articleTable.".article_id, ".$this->articleTable.".published, ".$this->articleTable.".viewable, ".$this->descriptionTable.".article_linktext, ".$this->articleTable.".article_type, ".$this->descriptionTable.".article_url, ".$this->parentIDTable.".parent_id , ".$this->descriptionTable.".farbe ". "FROM ".$this->articleTable." join ".$this->descriptionTable." ON ".$this->articleTable.".article_id = ".$this->descriptionTable.".article_id " . "join ".$this->parentIDTable." ON ".$this->descriptionTable.".article_id = ".$this->parentIDTable.".article_id " . "where ".$this->parentIDTable.".parent_id='".$id."' " . "and language_id='".$this->lang."' ". "ORDER by sort_order"; $result = AGDO::getInstance()->GetAll($SQLQuery); if(!empty($result)) { for ($zaehler=0; $zaehler< count($result);$zaehler++ ) { if ($result[$zaehler]['article_id']=="4") $this->home=$result[$zaehler]; if ($ebene==2) { $this->setFlavour($result[$zaehler]['article_id']); } if ($ebene==4) { $this->setSecondFlavour($result[$zaehler]['parent_id']); } $result[$zaehler]['mark']=false; $result[$zaehler]['Child']=$this->getCompleteTreeFromDatabase($result[$zaehler]['article_id'],($ebene+1)); if ($ebene>2) { $this->flavourArray[$result[$zaehler]['article_id']]=$this->getFlavour(); $result[$zaehler]['flavour']=$this->getFlavour(); } if ($ebene>3) { $this->flavourArray2[$result[$zaehler]['article_id']]=$result[$zaehler]['parent_id']; $result[$zaehler]['flavour2']=$result[$zaehler]['parent_id']; $this->setSecondFlavour($result[$zaehler]['parent_id']); $result[$zaehler]['self']=$result[$zaehler]['article_id']; } } } return $result; }
private function organizePost($command) { if ($command) { $p = Request::getInstance()->getPostRequests(); switch ($command) { case 'insertSong': $lastEntry = AGDO::getInstance()->GetFirst("SELECT * FROM playlists WHERE pl_number = " . $p['pl_id'] . " AND block_number = " . $p['block_number'] . " ORDER BY sort_order DESC"); if (isset($lastEntry['sort_order'])) { $sort_order = $lastEntry['sort_order'] + 10; } else { $sort_order = 10; } AGDO::getInstance()->Execute("INSERT INTO playlists SET pl_number = " . $p['pl_id'] . ", id = " . $p['id'] . ", block_number = " . $p['block_number'] . ", sort_order = " . $sort_order . " "); break; default: z($p); } } }
public function savePlaylist() { AGDO::getInstance()->Execute("UPDATE playlists SET pl_name = '" . $this->pl_name . "',\n pl_datum = '" . $this->pl_datum . "',\n pl_start = '" . $this->pl_start . "'\n WHERE pl_id = '" . $this->pl_id . "'"); }
public function delete() { $mp3 = PATH . 'files/' . $this->mp3; if (file_exists($mp3)) { unlink($mp3); } $txt = PATH . 'files/' . $this->txt; if (file_exists($txt)) { unlink($txt); } AGDO::getInstance()->Execute("DELETE FROM SVsongs WHERE id = " . $this->id); header("location:index.php?idt=Liste&status=1"); }
public function generate($array, $langshort, $langID, $mode) { //print_r($array); //echo $langID; Logger::getInstance()->Log($_POST, LOG_ABLAUF); //$array['article_url_de'] = iconv('ISO-8859-1',"UTF-8",$array['article_url_de']); Logger::getInstance()->Log($array, LOG_ABLAUF); $arrayKeys = array_keys($array); $returnArray=array(); if (ModuleManager::getInstance()->getModuleByName('Rechteverwaltung')) { $rechteverwaltung = ModuleManager::getInstance()->getModuleByName('Rechteverwaltung'); $rechteverwaltung->setConnection(AGDO::getInstance()); $rechteverwaltung->setLanguage(1); $rechteverwaltung->calculate(); $permissions = array(); foreach ($arrayKeys as $keys) { if (!(strpos($keys,'role_')===false)) { //echo strpos($keys,'e_'); $roleID = substr($keys,5); //echo $roleID; $permission = $array['GroupSelect_'.$roleID]; $permissions[]=array('permission'=>$permission,'role_id'=>$roleID); // } } if (isset( $array['ID'])) $rechteverwaltung->setPermissions($permissions, $array['ID']); if (isset($array['rolerekursiv'])) { $this->updateRecPermission($rechteverwaltung, $permissions, $array['ID']); } } if (isset($array['tag_new'])) $returnArray['tags']=$array['tag_new']; else { if (isset($array['tags'])) $returnArray['tags']=$array['tags']; else $returnArray['tags']=""; } if (isset($array['kopfbild_de'])) $returnArray['kopfbild']=$array['kopfbild_de']; if(empty($array['kopfbildgalerie_on_de'])) $returnArray['kopfbildgalerie_on'] = 'no'; if (isset($array['kopfbild_slideshow'])) $returnArray['kopfbild_slideshow']=$array['kopfbild_slideshow']; else $returnArray['kopfbild_slideshow']=''; if (isset($array['facebook'])) $returnArray['facebook']=1; else $returnArray['facebook']=0; if (isset($array['twitter'])) $returnArray['twitter']=1; else $returnArray['twitter']=0; if (empty($array['twitter_text'])) $returnArray['twitter_text']=""; if (empty($array['facebook_title'])) $returnArray['facebook_title']=""; if (empty($array['facebook_description'])) $returnArray['facebook_description']=""; if (empty($array['facebook_image'])) $returnArray['facebook_image']=""; if (isset($array['tags']) && $array['tags']=='Keine') $returnArray['tags']=NULL; // JA 09.03.2010 Rating $returnArray['rating_enabled'] = !empty($array['rating_enabled']) + ''; $returnArray['show_rating'] = !empty($array['show_rating']) + ''; if(isset($array['avg_rating'])) $returnArray['avg_rating'] = $array['avg_rating']; if(!empty($array['reset_rating'])){ // reset data $returnArray['avg_rating'] = $returnArray['rating_count'] = 0; // delete rating info $settings = unserialize(SETTINGS); $table = $this->dbconnector->getPrefix() . $settings['rating']['table']; $query = "DELETE FROM $table WHERE article_id = ".$array['article_id']; $result = $this->dbverbindung->Execute($query); } foreach ($arrayKeys as $keys) { // JA 23.06.2009: that method is unsafe and kills description. /* if (strpos($keys,"_".$langshort)>0) { $newkey=substr($keys,0,strpos($keys,"_".$langshort)); $returnArray[$newkey]=$array[$keys]; } */ $parts = explode('_',$keys); if( count($parts) > 1 and end($parts) === $langshort) { array_pop($parts); $returnArray[join($parts,'_')]=$array[$keys]; } } if (isset($returnArray['Modul'])) //05.07.2007 $returnArray['Module']=$returnArray['Modul']; else //10.10.2007 $returnArray['Module']=""; //10.10.2007 if (isset($returnArray['Modul_parameter'])) //05.07.2007 $returnArray['module_parameter']=$returnArray['Modul_parameter']; else //10.10.2007 $returnArray['module_parameter']=""; if (isset($returnArray['Modul_parameter_2'])) //05.07.2007 $returnArray['module_parameter_2']=$returnArray['Modul_parameter_2']; else //10.10.2007 $returnArray['module_parameter_2']=""; $bereinigterArtikelName=""; if (!isset($returnArray['article_as_link'])) $returnArray['article_as_link']='0'; if (isset($returnArray['article_name'])) { //echo "update"; /** No automated change of page title and menu title. JA 30.01.2009 if ($mode=='UPDATE') { $isChangedArticleName= $this->checkArticleName(mb_convert_encoding($returnArray['article_name'],"HTML-ENTITIES","auto"),$array['article_id'],$langID); if ($isChangedArticleName) { unset($returnArray['article_linktext']); unset($returnArray['article_title']); //unset($myArray['article_url_'.$this->languageID[$counter]['short']]); } } **/ $bereinigterArtikelName = str_replace("\'","",$returnArray['article_name']); $bereinigterArtikelName = str_replace("\\\"","",$bereinigterArtikelName); if (!isset($returnArray['article_linktext'])) { $returnArray['article_linktext']=$bereinigterArtikelName; } if (!isset($returnArray['article_title'])) { $returnArray['article_title']=$bereinigterArtikelName; } if (!isset($returnArray['article_url'])) { $returnArray['article_url']=$this->convertArticleNameToArticleUrl($returnArray['article_name']); $returnArray['article_url']=$this->urlchecker->check($returnArray['article_url'], $array['article_id'],$langID); } else { $returnArray['article_url']=$this->urlchecker->check($returnArray['article_url'], $array['article_id'],$langID); } } else { $returnArray['article_name']=""; if (!isset($returnArray['article_linktext'])) $returnArray['article_linktext']=""; } if (!isset($returnArray['Additional_Content'])) //MG 10.10.2007 $returnArray['Additional_Content']=0; if (!isset($returnArray['article_teaser_link_1'])) //MG 02.10.2007 $returnArray['article_teaser_link_1']=0; if (!isset($returnArray['article_teaser_link_2'])) $returnArray['article_teaser_link_2']=0; if (!isset($returnArray['article_teaser_link_3'])) $returnArray['article_teaser_link_3']=0; if (!isset($returnArray['article_teaser_link_4'])) $returnArray['article_teaser_link_4']=0; if ($array['article_id']==4 && $langID==1) $returnArray['article_url']="/"; //$returnArray['article_url']=$array['article_url_de']; if (isset($array['jslib']) && $array['jslib']!='keine') $returnArray['jslib']=$array['jslib']; else $returnArray['jslib']=NULL; $returnArray['article_name']=$this->checkString($returnArray['article_name']); //$returnArray['article_name']=str_replace("\'","'",$returnArray['article_name']); $returnArray['article_id']=$array['article_id']; if (!isset($array['show_navi'])) $returnArray['show_navi']=0; else $returnArray['show_navi']=1; if (!isset($array['template'])) $returnArray['template']='MainTemplate.htm'; else $returnArray['template']=$array['template']; $returnArray['language_id']=$langID; if (isset($returnArray['ta']) && $returnArray['ta']!="") //MG 04.10.2007 $returnArray['article_content']=$this->checkString(mb_convert_encoding($returnArray['ta'],"HTML-ENTITIES","auto")); else $returnArray['article_content']=""; if (isset($returnArray['article_description']) && $returnArray['article_description']!="") //MG 04.10.2007 $returnArray['article_description']=$this->checkString(mb_convert_encoding($returnArray['article_description'],"HTML-ENTITIES","auto")); else $returnArray['article_description']=""; if (isset($array['article_type'])) $returnArray['article_type']=$array['article_type']; else $returnArray['article_type']=1; $returnArray['article_name']=mb_convert_encoding($returnArray['article_name'],"HTML-ENTITIES","auto"); if (isset($array['GroupID'])) $returnArray['GroupID']=$array['GroupID']; else $returnArray['GroupID']=0; if (isset($array['UserID'])) $returnArray['UserID']=$array['UserID']; else $returnArray['UserID']=0; if (isset($returnArray['article_linktext'])) $returnArray['article_linktext']=mb_convert_encoding($returnArray['article_linktext'],"HTML-ENTITIES","auto"); if (isset($returnArray['article_title'])) $returnArray['article_title']=mb_convert_encoding($returnArray['article_title'],"HTML-ENTITIES","auto"); if (!isset($returnArray['article_teaserhead'])) $returnArray['article_teaserhead'] = $this->getTeaderHeadFromArticleName($returnArray['article_name']); else $returnArray['article_teaserhead']=$this->checkString($returnArray['article_teaserhead']); if (!isset($returnArray['article_teaser_content'])) $returnArray['article_teaser_content']= $this->checkString($this->getTeaserContentFromArticleContent($returnArray['article_content'])); $returnArray['article_teaser_content']= $this->checkString($returnArray['article_teaser_content']); //MG 26.09.2007 if (isset($returnArray['picture_name'])) { $returnArray['picture_name']= mb_convert_encoding($returnArray['picture_name'],"HTML-ENTITIES","auto"); $returnArray['picture_name']=$this->checkString($returnArray['picture_name']); } else $returnArray['picture_name']=""; $returnArray['newsdate']= empty($array['newsdate']) ? '0000-00-00' : $array['newsdate']; // 03.09.2008 JA Logger::getInstance()->Log("returnArray", LOG_ABLAUF); Logger::getInstance()->Log($returnArray, LOG_ABLAUF); //echo "langshort".$langshort; //echo "<!--\n".print_r($returnArray,true)."-->"; return $returnArray; }
public function deleteBlock($pb_id) { $this->getBlockByID($pb_id); $this->getSongs(); if (count($this->songs) == 0) { AGDO::getInstance()->Execute("DELETE FROM playlist_bloecke WHERE pb_id=" . $this->pb_id); } }
public function updateRecursive($parentID, $updateField, $updateValue, $languageID) { $query = "SELECT ".$this->DBConnector->getDescriptionTable().".article_id " . "FROM ".$this->DBConnector->getDescriptionTable()." JOIN ".$this->DBConnector->getParentIDTable()." " . "ON ".$this->DBConnector->getDescriptionTable().".article_id = ".$this->DBConnector->getParentIDTable().".article_id " . "WHERE parent_id='".$parentID."' AND language_id='".$languageID."'"; $returnvalue=AGDO::getInstance()->GetAll($query); if (empty($returnvalue)) { return ""; } else { foreach ($returnvalue as $line) { $query="UPDATE ".$this->DBConnector->getDescriptionTable()." SET `".$updateField."`='".$updateValue."' WHERE article_id='".$line['article_id']."' AND language_id='".$languageID."'"; $returnvalue=AGDO::getInstance()->Execute($query); //echo $query."<br>"; $this->updateRecursive($line['article_id'],$updateField, $updateValue, $languageID ); } } }
private function activateNewPasswort($newPasswortMD5, $user_id) { $sql = "UPDATE user SET passwort = '".$newPasswortMD5."', newPassword = '', hash = '', userActive = 1 WHERE user_id = '".$user_id."'"; AGDO::getInstance()->Execute($sql); }
public function getUser() { $user = AGDO::getInstance()->GetAll("SELECT * FROM ".$this->userTable." WHERE betreuer_id = ".$this->getUserID()); return $user[0]; }
private function getSingleDatum($table, $field, $id, $id_name) { $res = AGDO::getInstance()->GetFirst("SELECT " . $id_name . ", " . $field . " FROM " . $table . " WHERE " . $id_name . " = '" . $id . "'"); $data['table'] = $table; $data['field'] = $field; $data['id'] = $id; $data['id_name'] = $id_name; $data['value'] = $res[$field]; return TemplateParser::getInstance()->parseTemplate($data, 'ajax/ajaxSingleForm.html', PATH); }