prepare ( "select description from tbl_categories where id = ?" ); $stmt->bind_param ( "i", $id ); $stmt->execute(); $stmt->bind_result ( $description); $stmt->fetch(); $stmt->close(); return $description; } $tokens = explode('/', $_SERVER['REQUEST_URI']); if ( ( count ( $tokens ) >= 3 ) && ( $tokens[2] !== '' ) ) { $path_parts = pathinfo( $tokens[2]); $pos = strrpos($path_parts['filename'], '-'); if ( $pos === false ) { header('HTTP/1.0 404 Not Found'); echo "

404 Not Found

"; echo "The page that you have requested could not be found."; exit; } } $mysqli = new mysqli ( 'localhost', 'cns', 'pc2000', 'cns' ); header('Content-Type: text/html; charset=UTF-8'); echo ""; echo ""; echo ''; $path_parts = pathinfo( $tokens[2]); $pos = strrpos($path_parts['filename'], '-'); if ( $pos !== false ) { $description = substr($path_parts['filename'], 0, $pos ); } else { $description = $path_parts['filename']; } $stmt = $mysqli->prepare ( "select id, description, keywords from tbl_catalogs where description = ?" ); $stmt->bind_param ( "s", $description ); $stmt->execute(); $stmt->bind_result ( $id, $description, $keywords ); $stmt->fetch(); $stmt->close(); echo ''; echo ''; echo ''; echo ""; if ( ( count ( $tokens ) === 3 ) && ( $tokens[2] === '' ) ) { $pos = strrpos($tokens[count ( $tokens )-1], '-'); if ( $pos !== false ) { $description = substr($tokens[count ( $tokens )-1], 0, $pos ); } echo "Collect And Swap : Sammeln und Tauschen : $tokens[2] " . $description . ""; echo ""; if ( $stmt = $mysqli->prepare ( "select id, description from tbl_catalogs where active = 1 and delete_date is null order by description " ) ) { $stmt->execute(); $stmt->store_result(); $stmt->bind_result ( $id, $description ); while ($stmt->fetch()) { $url = $description . "-" . $id . ".html"; echo '' . $description . ''; echo "
"; } $stmt->close(); } } else if ( ( count ( $tokens ) >= 3 ) && ( $tokens[2] !== '' ) ) { $path_parts = pathinfo( $tokens[2]); $pos = strrpos($path_parts['filename'], '-'); if ( $pos !== false ) { $id = substr($path_parts['filename'], $pos + 1 ); $description = substr($path_parts['filename'], 0, $pos ); } else { $stmt = $mysqli->prepare ( "select id, description from tbl_catalogs where description = ?" ); $stmt->bind_param ( "s", $path_parts['filename'] ); $stmt->execute(); $stmt->bind_result ( $id, $description ); $stmt->fetch(); $stmt->close(); } $title1 = urldecode ( substr($tokens[2], 0, $pos ) ); $pos = strrpos($tokens[count ( $tokens )-1], '-'); $title2 = urldecode ( substr($tokens[count ( $tokens )-1], 0, $pos ) ); echo "Collect And Swap : Sammeln und Tauschen : " . $title1 . " " . $title2 . ""; echo ""; if ( ! is_numeric ( $id ) || ( $id === 0 ) ) { echo "ID not numeric"; exit; } echo "

Sie moechten " . $description . " kaufen, verkaufen oder einfach tauschen ? You want to buy, sell or just swap " . $description . " ?

"; ?> prepare ( "select id, description from tbl_catalogs where id = ?" ); $stmt->bind_param ( "i", $id ); $stmt->execute(); $stmt->bind_result ( $refcatalog, $description ); $stmt->fetch(); $stmt->close(); echo "

" . $description . "

"; $id = -1; $caturl = "http://www.collect-and-swap.com/info/" . $description . $id; if ( count ( $tokens ) >= 4 ) { $path_parts = pathinfo( $tokens[3]); $pos = strrpos($path_parts['filename'], '-'); $id = substr($path_parts['filename'], $pos + 1 ); $caturl = $caturl . "/" . urldecode ( substr($path_parts['filename'], 0, $pos ) ) . "-" . $id; echo '

' . urldecode ( GetCategoryDescriptionFromId ( $mysqli, $id ) ) . '

'; } if ( count ( $tokens ) >= 5 ) { $path_parts = pathinfo( $tokens[4]); $pos = strrpos($path_parts['filename'], '-'); $id = substr($path_parts['filename'], $pos + 1 ); $caturl = $caturl . "/" . urldecode ( substr($path_parts['filename'], 0, $pos ) ) . "-" . $id; echo '

' . urldecode ( GetCategoryDescriptionFromId ( $mysqli, $id ) ) . '

'; } if ( count ( $tokens ) >= 6 ) { $path_parts = pathinfo( $tokens[5]); $pos = strrpos($path_parts['filename'], '-'); $id = substr($path_parts['filename'], $pos + 1 ); $caturl = $caturl . "/" . urldecode ( substr($path_parts['filename'], 0, $pos ) ) . "-" . $id; echo '

' . urldecode ( GetCategoryDescriptionFromId ( $mysqli, $id ) ) . '

'; } if ( count ( $tokens ) >= 7 ) { $path_parts = pathinfo( $tokens[6]); $pos = strrpos($path_parts['filename'], '-'); $id = substr($path_parts['filename'], $pos + 1 ); $caturl = $caturl . "/" . urldecode ( substr($path_parts['filename'], 0, $pos ) ) . "-" . $id; echo '

' . urldecode ( GetCategoryDescriptionFromId ( $mysqli, $id ) ) . '

'; } if ( count ( $tokens ) >= 8 ) { $path_parts = pathinfo( $tokens[7]); $pos = strrpos($path_parts['filename'], '-'); $id = substr($path_parts['filename'], $pos + 1 ); $caturl = $caturl . "/" . urldecode ( substr($path_parts['filename'], 0, $pos ) ) . "-" . $id; echo '

' . urldecode ( GetCategoryDescriptionFromId ( $mysqli, $id ) ) . '

'; } if ( count ( $tokens ) >= 9 ) { $path_parts = pathinfo( $tokens[8]); $pos = strrpos($path_parts['filename'], '-'); $id = substr($path_parts['filename'], $pos + 1 ); $caturl = $caturl . "/" . urldecode ( substr($path_parts['filename'], 0, $pos ) ) . "-" . $id; echo '

' . urldecode ( GetCategoryDescriptionFromId ( $mysqli, $id ) ) . '

'; } if ( count ( $tokens ) >= 10 ) { $path_parts = pathinfo( $tokens[9]); $pos = strrpos($path_parts['filename'], '-'); $id = substr($path_parts['filename'], $pos + 1 ); $caturl = $caturl . "/" . urldecode ( substr($path_parts['filename'], 0, $pos ) ) . "-" . $id; echo '

' . urldecode ( GetCategoryDescriptionFromId ( $mysqli, $id ) ) . '

'; } if ( count ( $tokens ) >= 11 ) { $path_parts = pathinfo( $tokens[10]); $pos = strrpos($path_parts['filename'], '-'); $id = substr($path_parts['filename'], $pos + 1 ); $caturl = $caturl . "/" . urldecode ( substr($path_parts['filename'], 0, $pos ) ) . "-" . $id; echo '

' . urldecode ( GetCategoryDescriptionFromId ( $mysqli, $id ) ) . '

'; } if ( count ( $tokens ) >= 12 ) { $path_parts = pathinfo( $tokens[11]); $pos = strrpos($path_parts['filename'], '-'); $id = substr($path_parts['filename'], $pos + 1 ); $caturl = $caturl . "/" . urldecode ( substr($path_parts['filename'], 0, $pos ) ) . "-" . $id; echo '

' . urldecode ( GetCategoryDescriptionFromId ( $mysqli, $id ) ) . '

'; } if ( count ( $tokens ) >= 13 ) { $path_parts = pathinfo( $tokens[12]); $pos = strrpos($path_parts['filename'], '-'); $id = substr($path_parts['filename'], $pos + 1 ); $caturl = $caturl . "/" . urldecode ( substr($path_parts['filename'], 0, $pos ) ) . "-" . $id; echo '

' . urldecode ( GetCategoryDescriptionFromId ( $mysqli, $id ) ) . '

'; } if ( ! is_numeric ( $id ) ) { exit; } if ( $id ) { $stmt = $mysqli->prepare ( "select id, description, url from tbl_categories where refcatalog = ? and refparent = ? and del_date is null order by description" ); $stmt->bind_param ( "ii", $refcatalog, $id ); $stmt->execute(); $stmt->store_result(); $stmt->bind_result ( $id, $description, $url ); if ( $stmt->num_rows > 0 ) { while ($stmt->fetch()) { $path_parts = pathinfo( $_SERVER['REQUEST_URI'] ); $description = str_replace("/", "-", $description); if ( $url == "" ) { echo '' . $description . ''; } else { echo '' . $description . ''; } echo "
"; } $stmt->close(); } else { $stmt->close(); $stmt = $mysqli->prepare ( "select o.id, c.description, o.extid from tbl_objects o inner join tbl_categories c on c.id = o.refcategory where o.refcategory = ? and o.del_date is null" ); $stmt->bind_param ( "i", $id ); $stmt->execute (); $stmt->store_result(); $stmt->bind_result ( $id,$categorytext, $extid); echo ""; echo ""; echo "
"; while ( $stmt->fetch() ) { echo '' . $categorytext . '; } echo "
"; echo ""; echo ""; } } echo "

"; echo ""; } echo ""; echo ""; ?>