$v){ $tmp[] = array_search($v, $GLOBALS['titlesEnc']); } $id = implode(",", $tmp); } else { $id = 1; } } else { if (@ !$_GET['id'] || $_GET['id'] == ""){ $id = 1; } else {$id = $_GET['id']; } } $ids = explode(",", $id); $myId = end($ids); //404 if (@ $GLOBALS['status'][$myId] == 0){ $myId = 17;} //get template $q = "SELECT templates.placeholders, templates.filepath FROM sitemap, templates WHERE sitemap.pageid='$myId' AND sitemap.template=templates.id"; $r = runQuery($q, $db1); //print_r( $r ); $rr= mysql_fetch_array($r['r']); //echo '
';print_r( $rr ); echo '
'; $myTemplate = $rr['filepath']; $p = unserialize($rr['placeholders']); //get page info $q = "SELECT * FROM content WHERE id='$myId'"; $r = runQuery($q, $db1); $rr= mysql_fetch_array($r['r']); //print_r( $rr ); $pTitle =$rr['title']; $bTitle =$rr['btitle']; $pHead =$rr['pageTitle']; $mD =$rr['metaDesc']; $mW =$rr['metaWords']; if ($mD == ""){ $mD = META_DESC;} if ($mW == ""){ $mW = META_WORDS;} $browserTitle = stripslashes($bTitle); if (@ $bTitle == ""){ $browserTitle = stripslashes(SITE_NAME); //." - ".stripslashes($pTitle); } @ $pText= unserialize($rr['pText']); foreach($p as $k=>$v){ @ $pl[$k] = stripslashes(urldecode($pText[$k])); } //get promos $qp = "SELECT * FROM modules WHERE pageid LIKE '%<$myId>%' ORDER BY id ASC"; $rp = runQuery($qp, $db1); $pagePromos = array( "left"=>array(), "right"=>array(), "top"=>array(), "center"=>array(), "footer"=>array() ); if ($rp['nr'] > 0 ){ for ($x=0; $x<$rp['nr']; $x++){ $rrp = mysql_fetch_array($rp['r']); $promoText = unserialize($rrp['pText']); $pagePromos[$rrp['location']][] = stripslashes(urldecode($promoText['nugget1'])); } } //check promos and get default if necessary foreach($pagePromos as $k=>$v){ if (count($v) < 1){ $qd = "SELECT * FROM modules WHERE location='$k' AND locked='2' ORDER BY id ASC"; $rd = runQuery($qd, $db1); for ($x=0; $x<$rd['nr']; $x++){ $rrd = mysql_fetch_array($rd['r']); $promoText = unserialize($rrd['pText']); $pagePromos[$rrd['location']][] = stripslashes(urldecode($promoText['nugget1'])); //print("\n"); } } } include("./includes/runtime.menufunctions.php"); include("./templates/".$myTemplate); mysql_close($db1); ?>