60 ) { mysql_query( "INSERT INTO jpm_hirlevel_emailek SET email='" . urlencode( $_REQUEST[ "newsletter_email" ] ) . "', status=0, visible=1" ); updatesearchfield( 10, mysql_insert_id() ); $_SESSION[ "newsletter_lastemail" ] = time(); } if ( isset( $_REQUEST[ "unsubscribe" ] ) ) { if ( $_REQUEST[ "hash" ] != md5( $_REQUEST[ "unsubscribe" ] . "verysalty" ) ) die(); mysql_query( "UPDATE jpm_hirlevel_emailek SET status=1 WHERE email='" . urlencode( $_REQUEST[ "unsubscribe" ] ) . "'" ); } switch ( $m ) { case MAINMENU_HOME: // FOOLDAL // fejlec $content .= str_replace( "%CLASS%", "", gettemplate( "topheader" ) ); // fomenu $content .= mm( $m ); $content .= gettemplate( "separator" ); // almenu $content .= sm( ); $content .= gettemplate( "separator" ); // oriasbanner if ( !isset( $id ) && $s == 0 ) { $content .= banners( $m ); //$content .= gettemplate( "blank" ); $ilist = getlist( "jpm_icons", -1, -1, "", "lang={$_SESSION[ "langcode" ]}" ); for ( $i = 0; $i < count( $ilist ); $i++ ) { $replace = Array( "%LINK%" => $ilist[ $i ][ "link" ], "%IMGLINK%" => thumblink( $ilist[ $i ][ "image" ] ), "%LABEL%" => $ilist[ $i ][ "label" ] ); $items .= replacearr( $replace, gettemplate( "bigicon_item" ) ); } $content .= str_replace( "%ITEMS%", $items, gettemplate( "bigicon" ) ); $content .= gettemplate( "separator2" ); } // cikkek switch ( $s ) { case SUBMENU_GENERIC: // altalanos cikkek case SUBMENU_ARCHIVE: case SUBMENU_PRESSROOM: if ( isset( $id ) ) { $imgdb = "jpm_mainarticleimages"; $articlelist = getlist( "jpm_mainarticles", -1, -1, "", "id=$id AND status=1" ); $commentsallowed = $articlelist[ 0 ][ "comments" ]; } else { switch ( $s ) { case SUBMENU_GENERIC: $imgdb = "jpm_museumarticleimages"; $articlelist = getlist( "jpm_museumarticles", 15, 0, "ORDER BY publishdate DESC", "status=1 AND belongsto=0 AND lang={$_SESSION[ "langcode" ]}" ); break; case SUBMENU_ARCHIVE: $imgdb = "jpm_mainarticleimages"; $articlelist = getlist( "jpm_mainarticles", -1, -1, "ORDER BY publishdate DESC", "status=2 AND lang={$_SESSION[ "langcode" ]}" ); break; case SUBMENU_PRESSROOM: $imgdb = "jpm_mainarticleimages"; $articlelist = getlist( "jpm_mainarticles", -1, -1, "ORDER BY publishdate DESC", "status=1 AND lang={$_SESSION[ "langcode" ]} AND belongsto=5" ); break; } } $articletpl = gettemplate( "article_item" ); for ( $i = 0; $i < count( $articlelist ); $i++ ) { $maintitle = $lang[ "mainarticlecategs" ][ $articlelist[ $i ][ "belongsto" ] ]; if ( $s == SUBMENU_GENERIC ) $link = BASEURL . "index.php?m={$articlelist[ $i ][ "museumclass" ]}&s=" . belongsto2sub( $articlelist[ $i ][ "belongsto" ] ) . "&id={$articlelist[ $i ][ "id" ]}"; else $link = BASEURL . "index.php?id={$articlelist[ $i ][ "id" ]}"; if ( isset( $id ) ) $imagelist = getlist( $imgdb, -1, -1, "", "articleid={$articlelist[ $i ][ "id" ]}" ); else $imagelist = getlist( $imgdb, 1, 0, "", "articleid={$articlelist[ $i ][ "id" ]}" ); $images = ""; if ( count( $imagelist ) == 0 ) $articletpl = gettemplate( "article_item_noimg" ); //$images = ""; for ( $j = 0; $j < count( $imagelist ); $j++ ) { if ( isset( $id ) ) $images .= ""; else $images .= ""; } if ( isset( $id ) && $articlelist[ $i ][ "attachment" ] != "" ) $attachment = str_replace( "%FILES%", "{$articlelist[ $i ][ "attachment" ]}", gettemplate( "article_attachment" ) ); else $attachment = ""; $replace = Array( "%SUPTITLE%" => "$maintitle | " . $articlelist[ $i ][ "publishdate" ], "%TITLE%" => $articlelist[ $i ][ "title" ], "%CONTENT%" => ( isset( $id ) ? $articlelist[ $i ][ "content" ] : $articlelist[ $i ][ "contentshort" ] ), "%ATTACHMENT%" => $attachment, "%IMAGES%" => $images, "%LINK%" => $link, "%SCRIPT%" => ( isset( $id ) ? gettemplate( "article_item_initgallery" ) : "" ), "%ID%" => $articlelist[ $i ][ "id" ] ); $articleitems .= replacearr( $replace, $articletpl ); } break; case SUBMENU_EVENTS: // programok $maintitle = $lang[ "submenu" ][ "item2" ]; $link = BASEURL . "index.php?s=" . SUBMENU_EVENTS . "&id={$articlelist[ $i ][ "id" ]}"; // facebook-nak if ( isset( $id ) ) // konkret program { $articlelist = getlist( "jpm_events", -1, -1, "ORDER BY startdate DESC", "id=$id AND status=1" ); $commentsallowed = $articlelist[ 0 ][ "comments" ]; } else { if ( !isset( $ss ) ) // hamarosan { $maintitle = $lang[ "eventstitle" ][ "soon" ]; $articlelist = getlist( "jpm_events", 5, 0, "ORDER BY startdate DESC", "status=1 AND lang={$_SESSION[ "langcode" ]} AND TO_DAYS(startdate)>=TO_DAYS(NOW())" ); // esetleg: TO_DAYS(startdate)"; $dates = substr( $articlelist[ $i ][ "startdate" ], 0, 16 ); if ( !$articlelist[ $i ][ "enddatenotset" ] ) $dates .= " ... " . substr( $articlelist[ $i ][ "enddate" ], 0, 16 ); if ( isset( $id ) && $articlelist[ $i ][ "attachment" ] != "" ) $attachment = str_replace( "%FILES%", "{$articlelist[ $i ][ "attachment" ]}", gettemplate( "article_attachment" ) ); else $attachment = ""; $replace = Array( "%ID%" => $articlelist[ $i ][ "id" ], "%SUPTITLE%" => "{$lang[ "museumclasses" ][ $articlelist[ $i ][ "belongsto" ] ]}", "%TITLE%" => $articlelist[ $i ][ "title" ], "%DATES%" => "$dates | {$articlelist[ $i ][ "location" ]}", "%CONTENT%" => ( isset( $id ) ? $articlelist[ $i ][ "content" ] : $articlelist[ $i ][ "contentshort" ] ), "%ATTACHMENT%" => $attachment, "%IMAGES%" => $images, "%LINK%" => $link ); $articleitems .= replacearr( $replace, $articletpl ); } break; case SUBMENU_ACTIVITIES: // foglalkozasok $maintitle = $lang[ "submenu" ][ "item3" ]; $link = BASEURL . "index.php?s=" . SUBMENU_ACTIVITIES . "&id={$articlelist[ $i ][ "id" ]}"; // facebook-nak if ( isset( $id ) ) // konkret program { $articlelist = getlist( "jpm_activities", -1, -1, "", "id=$id AND status=1" ); $commentsallowed = $articlelist[ 0 ][ "comments" ]; } else { if ( !isset( $ss ) ) // hamarosan { $maintitle = $lang[ "activitiestitle" ][ "soon" ]; $articlelist = getlist( "jpm_activities", 5, 0, "ORDER BY startdate ASC", "status=1 AND lang={$_SESSION[ "langcode" ]} AND TO_DAYS(startdate)>=TO_DAYS(NOW())" ); } else // tipusra szures { $maintitle = $lang[ "activitiestitle" ][ $ss ]; $articlelist = getlist( "jpm_activities", -1, -1, "ORDER BY startdate ASC", "status=1 AND lang={$_SESSION[ "langcode" ]} AND categ=$ss" ); } } $articletpl = gettemplate( "article_activityitem" ); for ( $i = 0; $i < count( $articlelist ); $i++ ) { $imagelist = getlist( "jpm_activityimages", -1, -1, "", "articleid={$articlelist[ $i ][ "id" ]}" ); $images = ""; for ( $j = 0; $j < count( $imagelist ); $j++ ) $images .= ""; $dates = substr( $articlelist[ $i ][ "startdate" ], 0, 16 ); if ( !$articlelist[ $i ][ "enddatenotset" ] ) $dates .= " ... " . substr( $articlelist[ $i ][ "enddate" ], 0, 16 ); if ( isset( $id ) && $articlelist[ $i ][ "attachment" ] != "" ) $attachment = str_replace( "%FILES%", "{$articlelist[ $i ][ "attachment" ]}", gettemplate( "article_attachment" ) ); else $attachment = ""; $replace = Array( "%ID%" => $articlelist[ $i ][ "id" ], "%SUPTITLE%" => "{$lang[ "museumclasses" ][ $articlelist[ $i ][ "belongsto" ] ]}", "%TITLE%" => $articlelist[ $i ][ "title" ], "%DATES%" => "$dates | {$articlelist[ $i ][ "location" ]}", "%CONTENT%" => ( isset( $id ) ? $articlelist[ $i ][ "content" ] : $articlelist[ $i ][ "contentshort" ] ), "%ATTACHMENT%" => $attachment, "%IMAGES%" => $images, "%LINK%" => $link ); $articleitems .= replacearr( $replace, $articletpl ); } break; case SUBMENU_GIFTS: $maintitle = $lang[ "submenu" ][ "item4" ]; if ( isset( $id ) ) $articlelist = getlist( "jpm_gifts", -1, -1, "", "id=$id" ); else $articlelist = getlist( "jpm_gifts", -1, -1, "ORDER BY title ASC", "lang={$_SESSION[ "langcode" ]} AND categ=$ss" ); $articletpl = gettemplate( "article_giftitem" ); for ( $i = 0; $i < count( $articlelist ); $i++ ) { $images = ""; if ( isset( $_POST[ "giftid" ] ) ) { $contentadd = str_replace( "%ID%", $articlelist[ $i ][ "id" ], gettemplate( "article_giftitem_orderdone" ) ); $gitem = getitem( "jpm_gifts", "id", $_POST[ "giftid" ] ); $body = "Ajándék: {$gitem[ "title" ]}
Név: {$_POST[ "name" ]}
Szállítási cím: {$_POST[ "address" ]}
Telefonszám: {$_POST[ "phone" ]}
E-mail: {$_POST[ "email" ]}
Mennyiség: {$_POST[ "quantity" ]}
"; mail2( ROOT_MAIL, "ajándék megrendelés", $body ); } else if ( isset( $id ) ) $contentadd = str_replace( "%ID%", $articlelist[ $i ][ "id" ], gettemplate( "article_giftitem_orderform" ) ); else $contentadd = str_replace( "%ID%", $articlelist[ $i ][ "id" ], gettemplate( "article_giftitem_orderbutton" ) ); $replace = Array( "%ID%" => $articlelist[ $i ][ "id" ], "%SUPTITLE%" => $lang[ "submenu" ][ "item4" ] . " | " . $lang[ "giftcateg" ][ $articlelist[ $i ][ "categ" ] ], "%TITLE%" => $articlelist[ $i ][ "title" ], "%PRICE%" => $articlelist[ $i ][ "price" ], "%CONTENT%" => $articlelist[ $i ][ "description" ], "%CONTENTADD%" => $contentadd, "%IMAGES%" => $images ); $articleitems .= replacearr( $replace, $articletpl ); } break; } // mai programok $eventitems = eventstoday(); $replace = Array( "%MAINTITLE%" => $maintitle, "%EVENTITEMS%" => $eventitems, "%ARTICLEITEMS%" => $articleitems ); $content .= replacearr( $replace, gettemplate( "article" ) ); $content .= gettemplate( "separator2" ); // linkek $linksitemtpl = gettemplate( "links_item" ); $items2 = ""; $articlelist = getlist( "jpm_mainarticles", -1, -1, "ORDER BY orderby ASC", "belongsto=4 AND status=1 AND lang={$_SESSION[ "langcode" ]}" ); for ( $i = 0; $i < count( $articlelist ); $i++ ) { $replace = Array( "%LINK%" => "./index.php?id={$articlelist[ $i ][ "id" ]}", "%LABEL%" => $articlelist[ $i ][ "title" ] ); $items2 .= replacearr( $replace, $linksitemtpl ); } $items3 = ""; $articlelist = getlist( "jpm_mainarticles", -1, -1, "ORDER BY orderby ASC", "belongsto=3 AND status=1 AND lang={$_SESSION[ "langcode" ]}" ); for ( $i = 0; $i < count( $articlelist ); $i++ ) { $replace = Array( "%LINK%" => "./index.php?id={$articlelist[ $i ][ "id" ]}", "%LABEL%" => $articlelist[ $i ][ "title" ] ); $items3 .= replacearr( $replace, $linksitemtpl ); } $items4 = ""; for ( $i = 0; $i < count( $lang[ "giftcateg" ] ); $i++ ) { $replace = Array( "%LINK%" => "./index.php?s=" . SUBMENU_GIFTS . "&ss=$i", "%LABEL%" => $lang[ "giftcateg" ][ $i ] ); $items4 .= replacearr( $replace, $linksitemtpl ); } $replace = Array( "%ITEMS2%" => $items2, "%ITEMS3%" => $items3, "%ITEMS4%" => $items4 ); $content .= replacearr( $replace, gettemplate( "links" ) ); $content .= gettemplate( "separator" ); // videok $content .= gettemplate( "video" ); $content .= gettemplate( "separator" ); $content .= gettemplate( "misc" ); $content .= gettemplate( "footer" ); break; case MAINMENU_SEARCH: $content .= str_replace( "%CLASS%", "", gettemplate( "topheader" ) ); $content .= mm( $m ); $content .= gettemplate( "separator" ); $content .= sm( ); $content .= gettemplate( "separator" ); $maintitle = $lang[ "search" ][ "title" ]; $eventitems = eventstoday(); $resulttpl = gettemplate( "searchresult" ); $articleitems = ""; $results = getmultiresult( "SELECT * FROM jpm_mainarticles WHERE visible=1 AND status!=0 AND search LIKE '%" . urlencode( strtoupper2( $_REQUEST[ 'search' ] ) ) . "%' LIMIT 10" ); for ( $i = 0; $i < count( $results ); $i++ ) { $replace = Array( "%TITLE%" => $results[ $i ][ "title" ], "%CONTENT%" => shorten_string( strip_tags( $results[ $i ][ "contentshort" ] ), 20 ), "%LINK%" => "./index.php?id={$results[ $i ][ "id" ]}" ); $articleitems .= replacearr( $replace, $resulttpl ); } $results = getmultiresult( "SELECT * FROM jpm_museumarticles WHERE visible=1 AND status!=0 AND search LIKE '%" . urlencode( strtoupper2( $_REQUEST[ 'search' ] ) ) . "%' LIMIT 10" ); for ( $i = 0; $i < count( $results ); $i++ ) { $s = belongsto2sub( $results[ $i ][ "belongsto" ] ); $replace = Array( "%TITLE%" => $results[ $i ][ "title" ], "%CONTENT%" => shorten_string( strip_tags( $results[ $i ][ "contentshort" ] ), 20 ), "%LINK%" => "./index.php?m={$results[ $i ][ "museumclass" ]}&s=$s&id={$results[ $i ][ "id" ]}" ); $articleitems .= replacearr( $replace, $resulttpl ); } $results = getmultiresult( "SELECT * FROM jpm_events WHERE visible=1 AND status!=0 AND search LIKE '%" . urlencode( strtoupper2( $_REQUEST[ 'search' ] ) ) . "%' LIMIT 10" ); for ( $i = 0; $i < count( $results ); $i++ ) { $replace = Array( "%TITLE%" => $results[ $i ][ "title" ], "%CONTENT%" => shorten_string( strip_tags( $results[ $i ][ "contentshort" ] ), 20 ), "%LINK%" => "./index.php?s=1&id={$results[ $i ][ "id" ]}" ); $articleitems .= replacearr( $replace, $resulttpl ); } if ( $articleitems == "" ) $articleitems = "

{$lang[ "search" ][ "noresult" ]}

"; $replace = Array( "%MAINTITLE%" => $maintitle, "%EVENTITEMS%" => $eventitems, "%ARTICLEITEMS%" => $articleitems ); $content .= replacearr( $replace, gettemplate( "article" ) ); $content .= gettemplate( "separator2" ); $content .= gettemplate( "misc" ); $content .= gettemplate( "footer" ); break; default: // muzeumi menuk 1...6 $content .= str_replace( "%CLASS%", "ts_bg$m", gettemplate( "topheader" ) ); $content .= mm( $m ); $content .= gettemplate( "separator" ); $content .= sm( ); $content .= gettemplate( "separator" ); if ( !isset( $id ) && $s == 0 ) $content .= banners( $m ); if ( isset( $id ) ) { $aitem = getitem( "jpm_museumarticles", "id", $id ); if ( $aitem[ "banner" ] != "" ) $content .= str_replace( "%IMAGE%", "", gettemplate( "simplebanner" ) ); } //$content .= gettemplate( "blank" ); $content .= gettemplate( "separator2" ); $txt = $lang[ "homepage" ] . " > " . $lang[ "museumclasses2" ][ $m ]; $content .= str_replace( "%TXT%", $txt, gettemplate( "bigtitle" ) ); $content .= gettemplate( "separator2" ); $articleblocks = Array(); $articleblocktitles = Array(); $blockcount = 0; //if ( $s == MUSEUMMENU_SUMMARY ) //$submenu_items .= str_replace( Array( "%M%", "%LABEL%" ), Array( $m, $lang[ "museumarticlecategs" ][ "summary" ] ), gettemplate( "article2_submenu_curritem" ) ); //else $submenu_items .= str_replace( Array( "%M%", "%LINK%", "%LABEL%" ), Array( $m, "./index.php", $lang[ "museumarticlecategs" ][ "summary" ] ), gettemplate( "article2_submenu_item2" ) ); // hirek $articlelist = getlist( "jpm_museumarticles", -1, -1, "ORDER BY publishdate DESC", "museumclass=$m AND belongsto=0 AND status=1 AND lang={$_SESSION[ "langcode" ]}" ); if ( count( $articlelist ) != 0 ) { if ( $s == MUSEUMMENU_NEWS ) $submenu_items .= str_replace( Array( "%M%", "%S%", "%LABEL%" ), Array( $m, MUSEUMMENU_NEWS, $lang[ "museumarticlecategs" ][ 0 ] ), gettemplate( "article2_submenu_curritem" ) ); else $submenu_items .= str_replace( Array( "%M%", "%S%", "%LABEL%" ), Array( $m, MUSEUMMENU_NEWS, $lang[ "museumarticlecategs" ][ 0 ] ), gettemplate( "article2_submenu_item" ) ); $articleblocks[ MUSEUMMENU_NEWS ] = $articlelist; for ( $i = 0; $i < count( $articlelist ); $i++ ) $articleblocks[ MUSEUMMENU_NEWS ][ $i ][ "images" ] = getlist( "jpm_museumarticleimages", -1, -1, "", "articleid={$articlelist[ $i ][ "id" ]}" ); $articleblocktitles[ MUSEUMMENU_NEWS ] = $lang[ "museumarticlecategs" ][ 0 ]; $blockcount++; } // allando kiallitasok $articlelist = getlist( "jpm_museumarticles", -1, -1, "ORDER BY publishdate DESC", "museumclass=$m AND belongsto=1 AND status=1 AND lang={$_SESSION[ "langcode" ]}" ); if ( count( $articlelist ) != 0 ) { if ( $s == MUSEUMMENU_FIXEXHIBITIONS ) $submenu_items .= str_replace( Array( "%M%", "%LABEL%" ), Array( $m, $lang[ "museumarticlecategs" ][ 1 ] ), gettemplate( "article2_submenu_curritem" ) ); else $submenu_items .= str_replace( Array( "%M%", "%S%", "%LABEL%" ), Array( $m, MUSEUMMENU_FIXEXHIBITIONS, $lang[ "museumarticlecategs" ][ 1 ] ), gettemplate( "article2_submenu_item" ) ); $articleblocks[ MUSEUMMENU_FIXEXHIBITIONS ] = $articlelist; for ( $i = 0; $i < count( $articlelist ); $i++ ) $articleblocks[ MUSEUMMENU_FIXEXHIBITIONS ][ $i ][ "images" ] = getlist( "jpm_museumarticleimages", -1, -1, "", "articleid={$articlelist[ $i ][ "id" ]}" ); $articleblocktitles[ MUSEUMMENU_FIXEXHIBITIONS ] = $lang[ "museumarticlecategs" ][ 1 ]; $blockcount++; } // idoszaki kiallitasok $articlelist = getlist( "jpm_museumarticles", -1, -1, "ORDER BY publishdate DESC", "museumclass=$m AND belongsto=2 AND status=1 AND lang={$_SESSION[ "langcode" ]}" ); if ( count( $articlelist ) != 0 ) { if ( $s == MUSEUMMENU_CURREXHIBITIONS ) $submenu_items .= str_replace( Array( "%M%", "%LABEL%" ), Array( $m, $lang[ "museumarticlecategs" ][ 2 ] ), gettemplate( "article2_submenu_curritem" ) ); else $submenu_items .= str_replace( Array( "%M%", "%S%", "%LABEL%" ), Array( $m, MUSEUMMENU_CURREXHIBITIONS, $lang[ "museumarticlecategs" ][ 2 ] ), gettemplate( "article2_submenu_item" ) ); $articleblocks[ MUSEUMMENU_CURREXHIBITIONS ] = $articlelist; for ( $i = 0; $i < count( $articlelist ); $i++ ) $articleblocks[ MUSEUMMENU_CURREXHIBITIONS ][ $i ][ "images" ] = getlist( "jpm_museumarticleimages", -1, -1, "", "articleid={$articlelist[ $i ][ "id" ]}" ); $articleblocktitles[ MUSEUMMENU_CURREXHIBITIONS ] = $lang[ "museumarticlecategs" ][ 2 ]; $blockcount++; } // programok $articlelist = getlist( "jpm_events", -1, -1, "ORDER BY startdate DESC", "belongsto=$m AND status=1 AND lang={$_SESSION[ "langcode" ]}" ); if ( count( $articlelist ) != 0 ) { if ( $s == MUSEUMMENU_EVENTS ) $submenu_items .= str_replace( Array( "%M%", "%LABEL%" ), Array( $m, $lang[ "submenu" ][ "item2" ] ), gettemplate( "article2_submenu_curritem" ) ); else $submenu_items .= str_replace( Array( "%M%", "%S%", "%LABEL%" ), Array( $m, MUSEUMMENU_EVENTS, $lang[ "submenu" ][ "item2" ] ), gettemplate( "article2_submenu_item" ) ); $articleblocks[ MUSEUMMENU_EVENTS ] = $articlelist; for ( $i = 0; $i < count( $articlelist ); $i++ ) $articleblocks[ MUSEUMMENU_EVENTS ][ $i ][ "images" ] = getlist( "jpm_eventimages", -1, -1, "", "articleid={$articlelist[ $i ][ "id" ]}" ); $articleblocktitles[ MUSEUMMENU_EVENTS ] = $lang[ "submenu" ][ "item2" ]; $blockcount++; } // foglalkozasok $articlelist = getlist( "jpm_activities", -1, -1, "ORDER BY startdate DESC", "belongsto=$m AND status=1 AND lang={$_SESSION[ "langcode" ]}" ); if ( count( $articlelist ) != 0 ) { if ( $s == MUSEUMMENU_ACTIVITIES ) $submenu_items .= str_replace( Array( "%M%", "%LABEL%" ), Array( $m, $lang[ "submenu" ][ "item3" ] ), gettemplate( "article2_submenu_curritem" ) ); else $submenu_items .= str_replace( Array( "%M%", "%S%", "%LABEL%" ), Array( $m, MUSEUMMENU_ACTIVITIES, $lang[ "submenu" ][ "item3" ] ), gettemplate( "article2_submenu_item" ) ); $articleblocks[ MUSEUMMENU_ACTIVITIES ] = $articlelist; for ( $i = 0; $i < count( $articlelist ); $i++ ) $articleblocks[ MUSEUMMENU_ACTIVITIES ][ $i ][ "images" ] = getlist( "jpm_activityimages", -1, -1, "", "articleid={$articlelist[ $i ][ "id" ]}" ); $articleblocktitles[ MUSEUMMENU_ACTIVITIES ] = $lang[ "submenu" ][ "item3" ]; $blockcount++; } // szakmai oldalak $articlelist = getlist( "jpm_museumarticles", -1, -1, "ORDER BY publishdate DESC", "museumclass=$m AND belongsto=3 AND status=1 AND lang={$_SESSION[ "langcode" ]}" ); if ( count( $articlelist ) != 0 ) { if ( $s == MUSEUMMENU_PROFESSIONAL ) $submenu_items .= str_replace( Array( "%M%", "%LABEL%" ), Array( $m, $lang[ "museumarticlecategs" ][ 3 ] ), gettemplate( "article2_submenu_curritem" ) ); else $submenu_items .= str_replace( Array( "%M%", "%S%", "%LABEL%" ), Array( $m, MUSEUMMENU_PROFESSIONAL, $lang[ "museumarticlecategs" ][ 3 ] ), gettemplate( "article2_submenu_item" ) ); $articleblocks[ MUSEUMMENU_PROFESSIONAL ] = $articlelist; for ( $i = 0; $i < count( $articlelist ); $i++ ) $articleblocks[ MUSEUMMENU_PROFESSIONAL ][ $i ][ "images" ] = getlist( "jpm_museumarticleimages", -1, -1, "", "articleid={$articlelist[ $i ][ "id" ]}" ); $articleblocktitles[ MUSEUMMENU_PROFESSIONAL ] = $lang[ "museumarticlecategs" ][ 3 ]; $blockcount++; } // extra menupont $articlelist = getlist( "jpm_museumarticles", -1, -1, "ORDER BY publishdate DESC", "museumclass=$m AND belongsto=4 AND status=1 AND lang={$_SESSION[ "langcode" ]}" ); if ( count( $articlelist ) != 0 ) { if ( $s == MUSEUMMENU_EXTRA ) $submenu_items .= str_replace( Array( "%M%", "%LABEL%" ), Array( $m, $lang[ "museumarticlecategs" ][ 4 ][ $m ] ), gettemplate( "article2_submenu_curritem" ) ); else $submenu_items .= str_replace( Array( "%M%", "%S%", "%LABEL%" ), Array( $m, MUSEUMMENU_EXTRA, $lang[ "museumarticlecategs" ][ 4 ][ $m ] ), gettemplate( "article2_submenu_item" ) ); $articleblocks[ MUSEUMMENU_EXTRA ] = $articlelist; for ( $i = 0; $i < count( $articlelist ); $i++ ) $articleblocks[ MUSEUMMENU_EXTRA ][ $i ][ "images" ] = getlist( "jpm_museumarticleimages", -1, -1, "", "articleid={$articlelist[ $i ][ "id" ]}" ); $articleblocktitles[ MUSEUMMENU_EXTRA ] = $lang[ "museumarticlecategs" ][ 4 ][ $m ]; $blockcount++; } if ( isset( $id ) ) // egy konkret cikk { $articlelist = $articleblocks[ $s ]; for ( $i = 0; $i < count( $articlelist ); $i++ ) { if ( $articlelist[ $i ][ "id" ] == $id ) { $images = ""; for ( $j = 0; $j < count( $articlelist[ $i ][ "images" ] ); $j++ ) $images .= ""; $afiles = ""; for ( $j = 1; $j <= 5; $j++ ) if ( $articlelist[ $i ][ "attachment$j" ] != "" ) $afiles .= "{$articlelist[ $i ][ "attachment$j" ]}  "; if ( $afiles != "" ) $attachment = str_replace( "%FILES%", $afiles, gettemplate( "article_attachment" ) ); $replace = Array( "%IMAGES%" => $images, "%GALLERY%" => $images, "%TITLE%" => $articlelist[ $i ][ "title" ], "%CONTENT%" => $articlelist[ $i ][ "content" ], "%ATTACHMENT%" => $attachment, "%SCRIPT%" => gettemplate( "article_item_initgallery" ), "%ID%" => $articlelist[ $i ][ "id" ], "%LINK%" => "javascript:;" ); $articleitems .= replacearr( $replace, ( $images == "" || $articlelist[ $i ][ "gallerymode" ] ? gettemplate( "article2_col1_v1_noimg" ) : gettemplate( "article2_col1_v1" ) ) ); break; } } } else { switch( $s ) { case MUSEUMMENU_SUMMARY: // osszefoglalo switch ( $blockcount ) { case 0: case 1: case 2: case 3: default: $col = 1; foreach ( $articleblocks as $key => $value ) { //$link = "index.php?m=$m&s=$key&id={$articleblocks[ $key ][ 0 ][ "id" ]}"; $link = "index.php?m=$m&s=$key"; if ( !isset( $articleblocks[ $key ][ 0 ][ "images" ][ 0 ][ "image" ] ) ) $image = ""; else $image = ""; $replace = Array( "%COL%" => ( 1 + ( $col - 1 ) % 3 ), "%M%" => $m, "%MAINTITLE%" => $articleblocktitles[ $key ], "%IMAGE%" => $image, "%TITLE%" => "", //$articleblocks[ $key ][ 0 ][ "title" ], "%CONTENT%" => "", //$articleblocks[ $key ][ 0 ][ "contentshort" ], "%LINK%" => $link ); $articleitems .= replacearr( $replace, gettemplate( "article2_col1_v2" ) ); if ( $col % 3 == 0 ) $articleitems .= "
"; $col++; } break; } break; default: // minden mas almenu $articlelist = $articleblocks[ $s ]; for ( $i = 0; $i < count( $articlelist ); $i++ ) { $link = "./index.php?m=$m&s=$s&id={$articlelist[ $i ][ "id" ]}"; if ( !isset( $articlelist[ $i ][ "images" ][ 0 ][ "image" ] ) ) $images = ""; else $images = ""; $replace = Array( "%IMAGES%" => $images, "%TITLE%" => $articlelist[ $i ][ "title" ], "%CONTENT%" => $articlelist[ $i ][ "contentshort" ], "%ATTACHMENT%" => "", "%LINK%" => $link, "%SCRIPT%" => "" ); $articleitems .= replacearr( $replace, gettemplate( "article2_col1_v1" ) ); } break; } } $replace = Array( "%M%" => $m, "%ARTICLEITEMS%" => $articleitems, "%SUBMENU_ITEMS%" => $submenu_items ); $content .= replacearr( $replace, gettemplate( "article2" ) ); $content .= gettemplate( "separator" ); $content .= gettemplate( "misc" ); $content .= gettemplate( "footer" ); break; } $replace = Array( "%CONTENT%" => $content, "%FB_INIT%" => ( $commentsallowed ? gettemplate( "fb_init" ) : "" ) ); echo replacearr( $replace, $main ); ?>