db_qry("select * from t_data where kind=1 and parent_id=0 order by title"); $maincats = $db->get_assoc_data(); $perpage=15; $numpage=0; $maxpage=15; $id=""; $page=0; $state = "HOME"; $maincat=null; $subcat=null; $txt=null; $suchboxtitel=null; $doublead = 0; $stickys=array(); if (isset($_REQUEST['tag'])) { $state = "SEARCH"; $q = urldecode($_REQUEST['tag']); if (isUTF8($q)) $q = utf8_decode($q); } if (isset($_REQUEST['se'])) { $page = $_REQUEST['se']; } if (isset($_REQUEST['rrid'])) { $idents = explode("/", $_REQUEST['rrid']); if (sizeof($idents)==2 && $idents[0] == "tag") { $state = "SEARCH"; $q = urldecode($idents[1]); if (isUTF8($q)) $q = utf8_decode($q); } else { foreach ($idents as $i) { if ($state == "SEARCH") break; $db->db_qry("select * from t_data where ident='".$i."' limit 1"); $tmp = $db->get_data(); if (is_array($tmp)) { if ($tmp['kind'] == 0) { $state = "TEXT"; $txt = $tmp; } else { if ($tmp['parent_id'] != 0) { $state = "CAT"; $subcat = $tmp; } else { $state = "CAT"; $maincat = $tmp; } } } else { if ($i == "haftung") { $state = "HAFTUNG"; $meta_follow = "noindex,nofollow"; break; } else if ($i == "datensch") { $state = "DATENSCHUTZ"; $meta_follow = "noindex,nofollow"; break; } else if ($i == "imprint") { $state = "IMPRESSUM"; $meta_follow = "noindex,nofollow"; break; } else { exit("Diese Seite wurde nicht gefunden."); } } } } } if ($state == "SEARCH") { $txts=null; $tmp = strtolower($q); $target = "tag=".addslashes($tmp); $targetnopage = $target; //$searchurl = "?".$targetnopage; $searchurl = "tag/".addslashes($tmp); if ($page>0) $target .= "se=".$page; $keys = explode_and_trim(" ", text_to_keywords($q)); $qstr = ""; $ksim = array(); $qarr = array(); foreach($keys as $k) { if (strlen($k)>2) { $db->db_qry("select * from t_stopword where word='".addslashes($k)."' limit 1"); if ($db->row_count() == 0) { $db->db_qry("select * from t_tagtext where name='".addslashes($k)."' limit 1"); if ($db->row_count() > 0) { $tmp = $db->get_data(); $kwid = $tmp['id']; if (strlen($qstr) > 0) $qstr .= " or tagtext_id="; $qstr .= $kwid; } array_push($qarr, $k); } $db->db_qry("select * from t_tagtext where name like '".$k."%'"); $tmp = $db->get_assoc_data(); if (is_array($tmp)) { foreach ($tmp as $t) { if ($t['name'] != $k) { array_push($ksim, $t['name']); } } } } } /*if (strlen($qstr)>0) { $db->db_qry("select distinct t_data.* from t_data,t_tag where data_id=t_data.id and (tagtext_id=".$qstr.")"); $txts = $db->get_assoc_data(); }*/ if (strlen($qstr)>0) { $sql = "select distinct t_data.* from t_data,t_tag where data_id=t_data.id and (tagtext_id=".$qstr.") order by t_data.id desc limit "; $sql2 = "select count(distinct t_data.id) from t_data,t_tag where data_id=t_data.id and (tagtext_id=".$qstr.")"; $db->db_qry($sql2); $ccc = $db->get_data(); $ccc = $ccc[0]; $numpage = $ccc / $perpage; if ($page>0) { $sql .= $page*$perpage.","; } $sql .= $perpage; $db->db_qry($sql); $txts = $db->get_assoc_data(); } if (sizeof($txts) >= 6) $doublead = 1; $db->db_qry("select * from t_se_keyphrase where target='".$target."' order by lastdate desc limit 20"); $keyph = $db->get_assoc_data(); $db->db_qry("select * from t_se_keyword where target='".$target."' order by num desc limit 25"); $keywo = $db->get_assoc_data(); if (is_array($keywo)) { foreach ($keywo as $k) { $db->db_qry("select id from t_tagtext where status=1 and name='".$k['word']."' limit 1"); if ($db->row_count() > 0) { pushTops($k); } } } if (sizeof($tops)<30 && is_array($txts)) { $txt = $txts[0]; $db->db_qry("select t_tagtext.name word,t_tagtext.ident from t_tag,t_tagtext where data_id=".$txt['id']." and status=1 and tagtext_id=t_tagtext.id order by name limit 10"); $ks = $db->get_assoc_data(); if (is_array($ks)) { $cnt = sizeof($tops); foreach ($ks as $kkks) { pushTops($kkks); $cnt++; if ($cnt > 15) break; } } } $meta_title = ""; //$meta_title = "Ergebnis der Suche nach "; foreach ($qarr as $qq) $meta_title .= upperword($qq)." "; if (is_array($tops)) { $i = 0; while (strlen($meta_title)<60 && $idb_qry("select * from t_data where kind=0 and parent_id=".$subcat['id']." order by id limit 100"); $txts = $db->get_assoc_data(); $db->db_qry("select * from t_se_keyphrase where target='".$subcat['ident']."' order by lastdate desc limit 15"); $keyph = $db->get_assoc_data(); $db->db_qry("select * from t_se_keyword where target='".$subcat['ident']."' order by num desc limit 25"); $keywo = $db->get_assoc_data(); $db->db_qry("select * from t_data_sticky where fromurl='".$subcat['ident']."' order by to_data_id limit 20"); $stickys = $db->get_assoc_data(); $db->db_qry("select * from t_pic where fromurl='".$subcat['ident']."' limit 1"); $pic = $db->get_data(); $title .= " zu ".$subcat['title']; if ($maincat != null) { $maincats = array(); array_push($maincats,$maincat); } } else if ($maincat != null) { $db->db_qry("select * from t_data where kind=1 and parent_id=".$maincat['id']." order by title"); $subcats = $db->get_assoc_data(); if (is_array($subcats)) { $s = ""; $nn = 0; foreach ($subcats as $sc) { if ($nn > 0) $s .= ','; else $nn = 1; $s .= $sc['id']; } if (strlen($s)>0) $s .= ','; $s .= $maincat['id']; $db->db_qry("select * from t_data where kind=0 and parent_id in (".$s.") order by id limit ".$maxpage); $txts = $db->get_assoc_data(); } else { $db->db_qry("select * from t_data where kind=0 and parent_id=".$maincat['id']." order by id limit ".$maxpage); $txts = $db->get_assoc_data(); } $maincats = array(); array_push($maincats,$maincat); $db->db_qry("select * from t_se_keyphrase where target='".$maincat['ident']."' order by lastdate desc limit 15"); $keyph = $db->get_assoc_data(); $db->db_qry("select * from t_se_keyword where target='".$maincat['ident']."' order by num desc limit 25"); $keywo = $db->get_assoc_data(); $db->db_qry("select * from t_data_sticky where fromurl='".$maincat['ident']."' order by to_data_id limit 20"); $stickys = $db->get_assoc_data(); $db->db_qry("select * from t_pic where fromurl='".$maincat['ident']."' limit 1"); $pic = $db->get_data(); $title .= " zu ".$maincat['title']; $subcat = null; } if (sizeof($txts) >= 6) $doublead = 1; if (is_array($keywo)) { foreach ($keywo as $k) { $db->db_qry("select id from t_tagtext where status=1 and name='".$k['word']."' limit 1"); if ($db->row_count() > 0) { pushTops($k); } } } $id = 0; if ($subcat != null) $id = $subcat['id']; else $id = $maincat['id']; if (sizeof($tops)<15 && is_array($txts)) { $txt = $txts[0]; $db->db_qry("select t_tagtext.name word,t_tagtext.ident from t_tag,t_tagtext where data_id=".$txt['id']." and status=1 and tagtext_id=t_tagtext.id order by name limit 25"); $ks = $db->get_assoc_data(); if (is_array($ks)) { $cnt = sizeof($tops); foreach ($ks as $kkks) { pushTops($kkks); $cnt++; if ($cnt > 15) break; } } } if ( (!is_array($tops)) || (sizeof($tops)<2) ) { $db->db_qry("select name word,ident from t_tagtext where status=1 order by num desc limit 12"); $ks = $db->get_assoc_data(); foreach ($ks as $k) { pushTops($k); } } if ($txt['meta_title'] != null && strlen($txt['meta_title'])>0) { $meta_title = stripslashes($txt['meta_title']); } else { $meta_title = $title; /*$meta_title = stripslashes($txt['title']); if (is_array($tops)) { $i = 0; while (strlen($meta_title)<70 && $i0) { $meta_descr = stripslashes($txt['text_intro']); } else { $meta_descr = "Wissensgebiet ".stripslashes($txt['title']); /*if (is_array($tops)) { $i = 0; while (strlen($meta_descr)<200 && $idb_qry("select * from t_se_keyphrase where target='' order by lastdate desc limit 18"); $keyph = $db->get_assoc_data(); $db->db_qry("select * from t_se_keyword where target='' order by num desc limit 18"); $keywo = $db->get_assoc_data(); $db->db_qry("select distinct * from t_se_keyword order by num desc limit 50"); $ks = $db->get_assoc_data(); $cnt = 0; if (!is_array($ks)) { $db->db_qry("select name word,ident from t_tagtext order by id desc limit 30"); $ks = $db->get_assoc_data(); } else if (sizeof($ks) < 30) { $db->db_qry("select name word,ident from t_tagtext order by id desc limit 30"); $ks2 = $db->get_assoc_data(); foreach ($ks2 as $k) array_push($ks,$k); } foreach ($ks as $k) { $found = 0; foreach($tops as $tt) { if ($tt['word'] == $k['word']) { $found = 1; break; } } if ($found == 0) { array_push($tops, $k); $cnt++; } if ($cnt > 15) break; } $db->db_qry("select * from t_data where kind=0 order by id desc limit 12"); $txts = $db->get_assoc_data(); $db->db_qry("select * from t_data_sticky where fromurl='' order by to_data_id limit 20"); $stickys = $db->get_assoc_data(); $suchboxtitel = "Tipps schnell finden"; $doublead = 1; } if (is_own_referrer()) { if ($state == "SEARCH") { $ref = array(); $ref['Query'] = $q; } else $ref = false; } else { $ref = seReferer(false); } if (!($ref===false)) { $target = ""; if ($state == "TEXT") { $target = $txt['ident']; } else if ($state == "CAT") { if ($subcat != null) { $target = $subcat['ident']; } else { $target = $maincat['ident']; } } else if ($state == "SEARCH") { $target = "tag=".addslashes($q); if ($page>0) $target .= "se=".$page; } $ip = $_SERVER['REMOTE_ADDR']; $q = strtolower(trim($ref['Query'])); if (validQ($q)==1) { $db->db_qry("select * from t_se_keyphrase where phrase='".addslashes($q)."' and target='".$target."' limit 1"); $currdate = date("YmdHis"); if ($db->row_count() == 0) { $db->db_qry("insert into t_se_keyphrase(phrase,num,lastdate,target,lastip) values ('".addslashes($q)."',1,'".$currdate."','".$target."','".addslashes($ip)."')"); } else { $tmp = $db->get_data(); if (stripslashes($tmp['lastip']) != $ip) { $db->db_qry("update t_se_keyphrase set num=num+1,lastdate='".$currdate."',lastip='".addslashes($ip)."' where id=".$tmp['id']); } } $keys = explode_and_trim(" ", text_to_keywords(utf8_decode($q))); $kkk=""; foreach($keys as $k) { if (strlen($k)>2) { $kkk .= $k."--"; $db->db_qry("select * from t_stopword where word='".addslashes($k)."' limit 1"); if ($db->row_count() == 0) { $db->db_qry("select * from t_se_keyword where word='".addslashes($k)."' and target='".$target."' limit 1"); if ($db->row_count() == 0) { $db->db_qry("insert into t_se_keyword(word,target,num,lastdate,lastip) values ('".addslashes($k)."','".$target."',1,'".$currdate."','".addslashes($ip)."')"); //$db->db_qry("select last_insert_id() from t_se_keyword"); //$tmp = $db->get_data(); //$kwid = $tmp[0]; } else { $tmp = $db->get_data(); if (stripslashes($tmp['lastip']) != $ip) { $db->db_qry("update t_se_keyword set num=num+1,lastdate='".$currdate."',lastip='".addslashes($ip)."' where id=".$tmp['id']." limit 1"); } $kwid = $tmp['id']; } } } } } } if ($state == "TEXT") { $db->db_qry("select * from t_data where id=".$txt['parent_id']." limit 1"); $cat = $db->get_data(); if ($cat['parent_id']==0) { $maincat = $cat; } else { $subcat = $cat; $db->db_qry("select * from t_data where id=".$subcat['parent_id']." limit 1"); $maincat = $db->get_data(); } $maincats = array(); array_push($maincats,$maincat); $db->db_qry("select t_data.* from t_data_assoc,t_data where from_data_id=".$txt['id']." and to_data_id=t_data.id"); $assoc = $db->get_assoc_data(); $db->db_qry("select * from t_se_keyphrase where target='".$txt['ident']."' order by lastdate desc limit 18"); $keyph = $db->get_assoc_data(); $db->db_qry("select * from t_se_keyword where target='".$txt['ident']."' order by num desc limit 25"); $keywo = $db->get_assoc_data(); $db->db_qry("select * from t_pic where fromurl='".$txt['ident']."' limit 1"); $pic = $db->get_data(); $ip = $_SERVER['REMOTE_ADDR']; if (stripslashes($txt['lasthitip']) != $ip) { $db->db_qry("update t_data set hits=hits+1,lasthitip='".addslashes($ip)."' where id=".$txt['id']." limit 1"); } if (is_array($keywo)) { foreach ($keywo as $k) { $db->db_qry("select id from t_tagtext where status=1 and name='".$k['word']."' limit 1"); if ($db->row_count() > 0) { pushTops($k); } } } if (sizeof($tops)<40) { $db->db_qry("select t_tagtext.name word,t_tagtext.ident from t_tag,t_tagtext where data_id=".$txt['id']." and status=1 and tagtext_id=t_tagtext.id order by name limit 30"); $ks = $db->get_assoc_data(); if (is_array($ks)) { $cnt = sizeof($tops); foreach ($ks as $kkks) { pushTops($kkks); $cnt++; if ($cnt > 40) break; } } } if ($txt['meta_title'] != null && strlen($txt['meta_title'])>0) { $meta_title = stripslashes($txt['meta_title']); } else { $meta_title = stripslashes($txt['title']); if (is_array($tops)) { $i = 0; while (strlen($meta_title)<70 && $i0) { $meta_descr = stripslashes($txt['text_intro']); } else { $meta_descr = "Texte zum Wissensgebiet".stripslashes($txt['title'])." sowie "; if (is_array($tops)) { $i = 0; while (strlen($meta_descr)<200 && $i".$word."", $t); $t = str_replace($uword,"".$uword."", $t); } return $t; } function suchbox() { global $subcat,$maincat,$keyph,$keywo,$home,$tops,$suchboxtitel; if ($suchboxtitel != null) $s = "

".$suchboxtitel; else { $s = "

Suchen in "; if ($subcat!=null) $s .= stripslashes($subcat['title']); else $s .= stripslashes($maincat['title']); } $s .= '

'; $s .= '
'; if (is_array($tops)) { $s .= '
Häufige Suche: '; foreach ($tops as $t) { /*$s .=''.$t['word'].'   ';*/ $s .=''.$t['word'].'   '; } $s .= '
'; } if (is_array($keyph)) { $s .= ''; $s .= ''; $s .= ''; foreach ($keyph as $k) { $s .= ''; $s .= ''; } $s .= '
Letzte Suchenzuletzt
'.decodeUTF8($k['phrase']).''.fmtdatetime($k['lastdate']).'
'; } /*if (is_array($keywo)) { $s .= ''; $s .= ''; $s .= ''; foreach ($keywo as $k) { $s .= ''; $s .= ''; $s .= ''; } $s .= '
Beliebte Wörterzuletzt
'.decodeUTF8($k['word']).' ('.$k['num'].')'.fmtdatetime($k['lastdate']).'
'; }*/ $s .= '
'; return $s; } function is_own_referrer() { global $home; if (isset($_SERVER['HTTP_REFERER'])) { if (!(strpos($_SERVER['HTTP_REFERER'],$home)===false)) return true; } else return true; return false; } function seReferer($ref = false) { $SeReferer = (is_string($ref) ? $ref : $_SERVER['HTTP_REFERER']); if( //Check against Google, Yahoo, MSN, Ask and others preg_match( "/[&\?](q|p|w|searchfor|as_q|as_epq|s|query)=([^&]+)/i", $SeReferer,$pcs) ){ if(preg_match("/https?:\/\/([^\/]+)\//i",$SeReferer,$SeDomain)){ $SeDomain = trim(strtolower($SeDomain[1])); $SeQuery = $pcs[2]; if(preg_match("/[&\?](start|b|first|stq)=([0-9]*)/i",$SeReferer,$pcs)){ $SePos = (int)trim($pcs[2]); } } } if(!isset($SeQuery)){ if( //Check against DogPile preg_match( "/\/search\/web\/([^\/]+)\//i", $SeReferer,$pcs) ){ if(preg_match("/https?:\/\/([^\/]+)\//i",$SeReferer,$SeDomain)){ $SeDomain = trim(strtolower($SeDomain[1])); $SeQuery = $pcs[1]; } } } if(!isset($SeQuery)){ return false; } $OldQ=$SeQuery; $SeQuery=urldecode($SeQuery); // The Multiple URLDecode Trick to fix DogPile %XXXX Encodes while($SeQuery != $OldQ){ $OldQ=$SeQuery; $SeQuery=urldecode($SeQuery); } return array( "Se"=>$SeDomain, "Query"=>$SeQuery, "Pos"=>(int)$SePos, "Referer"=>$SeReferer ); } function validQ($q) { if (!(strpos($q,".de")===false)) return 0; if (!(strpos($q,"www")===false)) return 0; if (!(strpos($q,"porn")===false)) return 0; if (!(strpos($q,"http")===false)) return 0; if (!(strpos($q,"nackt")===false)) return 0; if (!(strpos($q,"sex")===false)) return 0; if (!(strpos($q,"schamlippe")===false)) return 0; if (!(strpos($q,"nackig")===false)) return 0; if (!(strpos($q,"cache")===false)) return 0; return 1; } function getText2($txt) { $tx = $txt['text_short']; if ($txt['text_long'] != null && strlen($txt['text_long'])>strlen($txt['text_short'])) $tx = $txt['text_long']; return $tx; } $datenschutz = $home."/datensch"; ?>

Werbung


Wissenswertes im Alltag

Tintenfass schnellfrage.de bemüht sich, interessante Fragen zu beantworten. Dabei werden alle Themen kurz und bündig erläutert, so dass keine langen Texte gelesen werden müssen. Zudem verfügt die Seite über eine Schnellsuche, mit der man die gewünschten Tipps schnell finden kann. Die kurzen Texte sind kategorisch sortiert. Nach einen Klick auf ein Wissensgebiet erscheinen Unterthemen, in denen man sortiert nach Datum blättern kann. Besondere Schwerpunkte weden auf die Wissensgebiete Reise, Basteln und Lebensmittel gelegt.

Kürzlich hinzugefügte Wissenstexte

db_qry("select * from t_data where id=".$tx['parent_id']); $subcat = $db->get_data(); if (is_array($subcat)) { if ($subcat['parent_id'] == null || $subcat['parent_id'] == 0) { $maincat = $subcat; $subcat = null; } else { $db->db_qry("select * from t_data where id=".$subcat['parent_id']); $maincat = $db->get_data(); } } else { $subcat = null; $maincat = array(); } $link = $home."/".$maincat['ident']; if ($subcat != null) $link .= "/".$subcat['ident']; ?>