Home Manuals Branches UNIX manpages Contact '; } elseif ( $_GET['item'] == 'cmd_branches' ) { $pageheader=' Home Manual Branches UNIX manpages Contact '; } elseif ( ( isset($_GET['item']) ) || ( isset($_GET['catid']) ) ) { $pageheader=' Home Manual Branches UNIX manpages Contact '; } else { $pageheader=' Home Manual Branches UNIX manpages Contact '; } //print $tablename_params; // get params for ad, content, lofasz $qry = "SELECT * FROM $tablename_params"; $qrh = mysqli_query( $dbh, $qry ); while ($qres = mysqli_fetch_assoc($qrh)) { $param[$qres['param']] = $qres['value']; } $qrh = mysqli_query ( $dbh, "SELECT * FROM $tablename_cat" ); while ( $qres = mysqli_fetch_assoc($qrh) ) { $catid = $qres['id']; $catname = $qres['catname']; $altcatname = $qres['altcatname']; //$catlink .= "\n"; $catlink .= "\n"; } if ( isset($_GET['catid']) ) #{{{ { if ( !isset($_GET['char']) ) { $char = 'A'; } else { $char = $_GET['char']; } if ( !isset($_GET['charpg']) ) { $charpg = 0; } else { $charpg = $_GET['charpg']; } $catid = mysqli_real_escape_string($dbh, $_GET['catid']); $qres = mysqli_fetch_assoc( mysqli_query ( $dbh, "SELECT id,catname,altcatname FROM $tablename_cat WHERE altcatname='$catid'" ) ); $altcatname = $qres['altcatname']; $catname = $qres['catname']; $catid = $qres['id']; $qry = "SELECT count(*) FROM $tablename WHERE cat='$catid'"; $qres = mysqli_fetch_assoc( mysqli_query( $dbh, $qry )); $cat_itemcount = $qres['count(*)']; $content .= "|text_category| $catname
|text_itemcount| $cat_itemcount
"; $catpage = $_GET['catpage']; if ( $charpg == 0 ) { $itembegin = 1; } else { $itembegin = $itemperpage * $charpg; } $qry = "SELECT count(*) FROM $tablename WHERE cat='$catid' AND name LIKE '$char%'"; $qres = mysqli_fetch_assoc( mysqli_query( $dbh, $qry )); $char_itemcount = $qres['count(*)']; if ( $char_itemcount == 1 ) { $qry = "SELECT * FROM $tablename WHERE cat='$catid' AND name LIKE '$char%'"; } else { $qry = "SELECT * FROM $tablename WHERE cat='$catid' AND name LIKE '$char%' LIMIT $itembegin, $itemperpage"; } $qrh = mysqli_query( $dbh, $qry ); if ( $char_itemcount == 0 ) { $content .= "|text_itemnotavail|"; } else { $content .= ""; } if ( $itemperpage < $char_itemcount ) { for ( $i=0; $i < $char_itemcount / $itemperpage; $i++ ) { //$link_charpage .= "$i\n"; $link_charpage .= "$i\n"; } $link_charpage = "

$link_charpage

"; } $link_chars = "
"; for ($i = a; $i<=z; $i++) { //$link_chars .= "".strtoupper($i)." \n"; $link_chars .= "".strtoupper($i)." \n"; if ( $i == 'z' ) { break; } } //$link_chars .= "0 \n"; $link_chars .= "0 \n"; $link_chars .= "
"; $content = $param['notstoredhere']."\n

".$link_chars."

\n

".$content."\n".$link_charpage."

\n"; } #}}} elseif ( isset($_GET['item']) ) #{{{ { if ( $_GET['item'] == 'cmd_contact' ) { $content = '

Contact

If you have any questions or comments, contact me at wigyori at uid0.hu

Distribution branches

If you have any questions or comments, contact me at wigyori at uid0.hu

'; $qres = mysqli_fetch_assoc( mysqli_query ( $dbh, $qry ) ); $itemname = $qres['name']; $desturl = $qres['url']; $catid = $qres['cat']; if ( $sitetype == 'remotelink' ) { $content = $param['notstoredhere']."
\n".$param['clickhere']."$itemname"; } elseif ( $sitetype == 'localdata' ) { //$qry = "SELECT cat,name FROM $tablename WHERE id='".$_GET['itemid']."'"; //print $qry; //$qres = mysql_fetch_assoc( mysql_query( $qry, $dbh ) ); $cat = $qres['cat']; $name = $qres['name']; $filename = $docroot.'/includes/data/'.$sitedir.'/'.$qres['cat'].'/'.$qres['name'].'.inc'; $fh = fopen( $filename, 'r' ); { $content = $param['notstoredhere']."\n

".fread($fh, filesize($filename))."

"; } fclose($fh); } } } #}}} elseif ( isset ($_POST['search']) ) #{{{ { $search = mysqli_real_escape_string($dbh, $_POST['search']); $qrh = mysqli_query ( $dbh, "SELECT id,name,cat FROM $tablename WHERE name LIKE '%$search%'" ); $qrescount = mysqli_num_rows($qrh); if ( $qrescount == 0 ) { $content .= "|text_itemnotavail|"; } else { $content .= 'Search results:

"; } $content = $param['notstoredhere']."\n

".$content."

\n"; } #}}} else { $content = '|text_bullshit|'; //print 'bullshit'; } // generate partnersites content if ( $lang == 'hu' ) { $partnersites .= '

Partneroldalak:

'; } if ( $lang == 'en' ) { $partnersites .= '

Partner sites:

'; } for ($i=0; $i".$othersites[$i]['sitename']."
\n"; } } for ($i=0; $i".$othersites[$i]['sitename']."
\n"; } } //print $catlink; $template = str_replace('|catlink|', $catlink, $template); $template = str_replace('|content|', $content, $template); $template = str_replace('|sitename|', $sitename, $template); $template = str_replace('|catheader|', $param['catheader'], $template); $template = str_replace('|leftdiv1header|', $param['leftdiv1header'], $template); $template = str_replace('|leftdiv1content|', $param['leftdiv1content'], $template); $template = str_replace('|ad120600|', $param['ad120600'], $template); $template = str_replace('|ad46860|', $param['ad46860'], $template); //$template = str_replace('|partnersites|', $partnersites, $template); $template = str_replace('|partnersites|', '', $template); $template = str_replace('|headerblock|', $param['headerblock'], $template); $template = str_replace('|text_category|', $param['text_category'], $template); $template = str_replace('|text_itemcount|', $param['text_itemcount'], $template); $template = str_replace('|text_itemnotavail|', $param['text_itemnotavail'], $template); $template = str_replace('|text_bullshit|', $param['text_bullshit'], $template); $template = str_replace('|sitekeywords|', $param['sitekeywords'], $template); $template = str_replace('|sitedescription|', $param['sitedescription'], $template); $template = str_replace('|cmdname|', $name, $template); $template = str_replace('|searchheader|', $param['searchheader'], $template); $template = str_replace('|searchblock|', $param['searchblock'], $template); $template = str_replace('|pageheader|', $pageheader, $template); print $template; //print "$catlink
$leftdiv
$content
$charlinkline"; mysql_close($dbh); ?>