table . " SET " . $_GET[ 'delimg' ] . "='' WHERE id=" . $_GET[ 'e' ]; $m = 101; $_GET[ 'id' ] = $_GET[ 'e' ]; mysql_query( $query ); } if ( count( $_POST ) > 0 ) { dbg_log( print_r( $_POST, true ) ); if ( !empty( $_POST[ "loginname" ] ) && !empty( $_POST[ "loginpass" ] ) ) // login { $uitem = getitem( "wallcharts_users", "nickname", "'" . urlencode( $_POST[ "loginname" ] ) . "'", 1, "AND password='" . urlencode( $_POST[ "loginpass" ] ) . "'" ); if ( is_array( $uitem ) ) { if ( $uitem[ "regstatus" ] == 1 ) { $_SESSION[ "userid" ] = $uitem[ "id" ]; $_SESSION[ "username" ] = $uitem[ "nickname" ]; $_SESSION[ "regtype" ] = $uitem[ "regtype" ]; $m = MENU_PROFILE; } else { $logintext = "{$lang[ "home" ][ "loginerr2" ]}"; $m = MENU_HOME; } } else { $logintext = "{$lang[ "home" ][ "loginerr1" ]}"; $m = MENU_HOME; } } else if ( $_POST[ "t" ] == 0 && empty( $_SESSION[ "justregged" ] ) ) // regisztracio felvetele { if ( isset( $_SESSION[ "userid" ] ) ) // meglevo adatlapot modosit { $curritemid = itemmodify( $_POST[ "t" ] ); } else { // ellenorzesek $errtext = ""; $errtextstyle = "style='background: transparent;'"; if ( strlen( $_POST[ "nickname" ] ) < 4 || strlen( $_POST[ "nickname" ] > 12 ) ) $errtext .= "

" . $lang['reg']['fail_nicklength'] . "

"; if ( getitem( "wallcharts_users", "nickname", "'".$_POST[ "nickname" ]."'" ) ) $errtext .= "

" . $lang['reg']['fail_alreadyexists'] . "

"; if ( strlen( $_POST[ "institute" ] ) == 0 || strlen( $_POST[ "institutetype" ] ) == 0 || strlen( $_POST[ "instituteaddress" ] ) == 0 || strlen( $_POST[ "instituteweb" ] ) == 0 || strlen( $_POST[ "instituteemail" ] ) == 0 || strlen( $_POST[ "contactname" ] ) == 0 || strlen( $_POST[ "contactstatus" ] ) == 0 || strlen( $_POST[ "contactphone" ] ) == 0 || strlen( $_POST[ "contactemail" ] ) == 0 ) $errtext .= "

" . $lang['reg']['fail_emptyfield'] . "

"; if ( $errtext != "" ) $errtextstyle = "style='background: #ff7700; margin-top: 20px'"; // sikeres reg if ( $errtext == "" ) { $_POST[ "regstatus" ] = 0; $_SESSION[ "justregged" ] = itemmodify( 0 ); mail2( ROOT_MAIL, "uj regisztracio a szemleltetokepek.hu-n", "név: {$_POST[ "nickname" ]}\nintézmény: {$_POST[ "institute" ]}\nfelelős személy: {$_POST[ "contactname" ]}\n\nA regisztrációt jóvá kell hagyni a szemleltetokepek.hu adminja segíségével." ); } } } else if ( $_POST[ "t" ] == 1 || $_POST[ "t" ] == 2 || $_POST[ "t" ] == 13 || $_POST[ "t" ] == 14 || $_POST[ "t" ] == 8 ) // uj kep, uj sorozat, uj iras,foglalkozas, valogatas felvetele { $curritemid = itemmodify( $_POST[ "t" ] ); update_cloudxml( ); } } $main = file_get_contents( "t/main.tpl" ); switch ( $m ) { case MENU_HOME: // FOOLDAL $maincontent = file_get_contents( "t/home.tpl" ); if ( !isset( $logintext ) ) $logintext = $lang[ "home" ][ "logintext" ]; if ( isset( $_GET[ "sendid" ] ) ) { $headers = "From: {$_SESSION[ "postersender" ]}<{$_SESSION[ "postersender" ]}>\r\n"; $headers .= "X-Mailer: PHP\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=utf-8\r\n"; $body = file_get_contents( "t/posteremail.tpl" ); $iitem = getitem( "wallcharts_items", "id", $_GET[ "sendid" ] ); $text = $lang['db']['wallcharts_items']['origtitle'] . ": " . $iitem['origtitle'] . "
"; $text .= $lang['db']['wallcharts_items']['title'] . ": " . $iitem['title'] . "
"; $text .= $lang['db']['wallcharts_items']['title_en'] . ": " . $iitem['title_en'] . "
"; $text .= $lang['db']['wallcharts_items']['residence'] . ": " . $iitem['residence'] . "
"; $iitem['collectionaddress'] = explode( "|", $iitem['collectionaddress'] ); $text .= $lang['db']['wallcharts_items']['collectionaddress'] . ": " . $iitem['collectionaddress'][ 0 ] . "
"; $text .= "{$lang[ "home" ][ "linktocard" ]}"; $body = str_replace( Array( "%IMAGE%", "%TEXT%" ), Array( $iitem[ "itemimage" ], $text ), $body ); //echo $body; //die(); $mail_sent = mail( $_SESSION[ "posteremail" ], $lang[ "main" ][ "url" ] . " - " . $lang[ "home" ][ "postertitle" ], $body, $headers ); unset( $_SESSION[ "posteremail" ] ); } $books = ""; $bookarr = getlist( "wallcharts_books", 20, 0, "ORDER BY orderedby ASC" ); $book = file_get_contents( "t/book.tpl" ); for ( $i = 0; $i < 20; $i++ ) { if ( $i >= count( $bookarr ) ) $books .= str_replace( Array( "%ID%", "%POS%", "%SUBJECT%", "%IMGLINK%" ), Array( "subcard$i", 30*$i, "", "./g/bookpage.jpg"), $book ); else { $sitem = getitem( "wallcharts_subjects", "id", $bookarr[ $i ][ "subjectid" ] ); $validb = Array(); for ( $j = 1; $j <= 5; $j++ ) if ( $bookarr[ $i ][ "itemid$j" ] > 0 ) array_push( $validb, $bookarr[ $i ][ "itemid$j" ] ); $chosenb = $validb[ rand( 0, count( $validb ) - 1 ) ]; $iitem = getitem( "wallcharts_items", "id", $chosenb ); $books .= str_replace( Array( "%ID%", "%POS%", "%SUBJECT%", "%SUBJECTID%", "%IMGLINK%" ), Array( "subcard$i", 30*$i, ( $_SESSION['langid'] == "hu" ? $sitem[ "name" ] : $sitem[ "name_en" ] ), $sitem[ "id" ], "./admin/files/" . $iitem[ "itemimage" ] ), $book ); } } $from = Array( "%BOOKS%", "%LOGINTITLE%", "%LOGINTEXT%", "%LOGINSUBMIT%", "%REGISTRATION%", "%ICONBOX1_TITLE%", "%ICONBOX1_BODY%", "%ICONBOX2_TITLE%", "%ICONBOX2_BODY%", "%ICONBOX3_TITLE%", "%ICONBOX3_BODY%", "%ICONBOX4_TITLE%", "%ICONBOX4_BODY%", "%SEARCHTXT%", "%SEARCHBTN%", "%SEARCHTITLE%", "%POSTERTITLE%", "%POSTERTXT%", "%POSTERBTN%", "%POSTERSENDER%", "%POSTERRECIPIENT%", "%BOOKSTITLE%" ); $to = Array( $books, $lang[ "home" ][ "logintitle" ], $logintext, $lang[ "home" ][ "loginsubmit" ], $lang[ "home" ][ "registration" ], $lang[ "home" ][ "iconbox1_title" ], $lang[ "home" ][ "iconbox1_body" ], $lang[ "home" ][ "iconbox2_title" ], $lang[ "home" ][ "iconbox2_body" ], $lang[ "home" ][ "iconbox3_title" ], $lang[ "home" ][ "iconbox3_body" ], $lang[ "home" ][ "iconbox4_title" ], $lang[ "home" ][ "iconbox4_body" ], $lang[ "home" ][ "searchtxt" ], $lang[ "home" ][ "searchbtn" ], $lang[ "home" ][ "searchtitle" ], $lang[ "home" ][ "postertitle" ], $lang[ "home" ][ "postertxt" ], $lang[ "home" ][ "posterbtn" ], $lang[ "home" ][ "postersender" ], $lang[ "home" ][ "posterrecipient" ], $lang[ "home" ][ "bookstitle" ] ); $maincontent = str_replace( $from, $to, $maincontent ); break; case MENU_PROFILE: // SAJAT OLDAL // HA NINCS BEJELENTKEZVE if ( !isset( $_SESSION[ "userid" ] ) ) { $aitem = getitem( "wallcharts_articles", "article_type", 4 ); $maincontent = file_get_contents( "t/profileempty.tpl" ); $from = Array( "%BOXTITLE%", "%PROFILEARTICLETITLE%", "%PROFILEARTICLEBODY%" ); $to = Array( $lang['profile']['title'], $aitem[ "article_title_$currlang" ], $aitem[ "article_body_$currlang" ], ); $maincontent = str_replace( $from, $to, $maincontent ); break; } $maincontent = file_get_contents( "t/profile.tpl" ); siteitemeditor_showall( 0, 2 ); // SAJAT KEPFELTOLTESEK $uploadcards = ""; $card = file_get_contents( "t/profilecard.tpl" ); $list = getlist( "wallcharts_items", -1, -1, "ORDER BY registerid ASC", "userid={$_SESSION[ "userid" ]}" ); $sref = getref( "wallcharts_series", "id", "origtitle" ); if ( count( $list ) == 0 ) { $uploadcards .= str_replace( Array( "%LINK%", "%IMGPATH%", "%DESCRIPTION%" ), Array( "./index.php?m=" . MENU_UPLOAD, "./g/thumbempty.gif", $lang['profile']['noupload'] ), $card ); } else { for ( $i = 0; $i < count( $list ); $i++ ) { $editlink = "./index.php?m=" . MENU_UPLOAD . "&id={$list[ $i ][ "id" ]}"; if ( $list[ $i ][ "itemstatus" ] == 0 ) $editbutton = "[{$lang['profile']['editcard']}]"; else $editbutton = "[{$lang['profile']['editcard']}]"; $viewlink = "./index.php?m=" . MENU_CARD . "&id={$list[ $i ][ "id" ]}&ref=" . MENU_PROFILE; $dellink = "confirmyes( \"" . $lang['profile']['delcardwarning'] . "\", \"./index.php?m=" . MENU_PROFILE . "&diid={$list[ $i ][ "id" ]}\" )"; if ( $list[ $i ][ "itemstatus" ] == 0 ) $delbutton = "[{$lang['profile']['delcard']}]"; else $delbutton = "[{$lang['profile']['delcard']}]"; $uploadcards .= str_replace( Array( "%LINK%", "%IMGPATH%", "%DESCRIPTION%" ), Array( $viewlink, $list[ $i ][ "itemimage" ] == "" ? "./g/thumbempty.gif" : "./files/thumb/{$list[ $i ][ "itemimage" ]}", "

" . ($i+1) . ". [{$lang['profile']['viewcard']}] $editbutton $delbutton

" . $lang['db']['wallcharts_items']['origtitle'] . ": " . $list[ $i ][ "origtitle" ] . "

" . "

" . $lang['db']['wallcharts_items']['series'] . ": " . urldecode( $sref[ $list[ $i ][ "series" ] ] ) . "

" . "

" . $lang['db']['wallcharts_items']['registerid'] . ": " . $list[ $i ][ "registerid" ] . "

" ), $card ); } } // SAJAT SOROZATOK $seriecards = ""; $card = file_get_contents( "t/profileserie.tpl" ); $cardrow = file_get_contents( "t/profileserierow.tpl" ); $list = getlist( "wallcharts_series", -1, -1, "", "creator={$_SESSION[ "userid" ]}" ); //$sref = getref( "wallcharts_series", "id", "title" ); if ( count( $list ) == 0 ) { $seriecards .= str_replace( Array( "%TITLE%", "%BUTTONS%", "%ROWS%" ), Array( $lang['profile']['noseries'], "", "" ), $card ); } else { for ( $i = 0; $i < count( $list ); $i++ ) { $viewlink = "./index.php?m=" . MENU_SEARCH . "&serieid={$list[ $i ][ "id" ]}"; $editlink = "./index.php?m=" . MENU_SERIE . "&id={$list[ $i ][ "id" ]}"; $dellink = "confirmyes( \"" . $lang['profile']['delseriewarning'] . "\", \"./index.php?m=" . MENU_PROFILE . "&dsid={$list[ $i ][ "id" ]}\" )"; $ilist = getlist( "wallcharts_items", -1, -1, "ORDER BY number ASC", "series={$list[ $i ][ "id" ]}" ); $cardrows = thumbmatrix( $ilist, "{$lang['db']['wallcharts_items']['origtitle']}: %TITLE%
{$lang['db']['wallcharts_items']['registerid']}: %REGISTERID%
{$lang['db']['wallcharts_items']['number']}: %NUMBER%
{$lang['profile']['viewcard']}", "id", "serthumb" ); /*$cardrows = ""; $colcount = 6; for ( $k = 0; $k < count( $ilist ); $k += $colcount ) { $from = Array(); $to = Array(); for ( $j = $k; $j < $k + $colcount; $j++ ) { $idx = $j-$k+1; if ( $j >= count( $ilist ) ) { array_push( $from, "%LINK$idx%" ); array_push( $to, "javascript:;" ); array_push( $from, "%THUMB$idx%" ); array_push( $to, "./g/thumbempty.gif" ); } else { array_push( $from, "%LINK$idx%" ); array_push( $to, $_SESSION[ "userid" ] == $ilist[ $j ][ "userid" ] ? "./index.php?m=" . MENU_UPLOAD . "&id={$ilist[ $j ][ "id" ]}" : "javascript:;" ); array_push( $from, "%THUMB$idx%" ); array_push( $to, $ilist[ $j ][ "itemimage" ] == "" ? "./g/thumbempty.gif" : "./files/thumb/{$ilist[ $j ][ "itemimage" ]}" ); } } $cardrows .= str_replace( $from, $to, $cardrow ); } */ $seriecards .= str_replace( Array( "%TITLE%", "%BUTTONS%", "%ROWS%" ), Array( "{$lang['db']['wallcharts_items']['series']}: {$list[ $i ][ 'origtitle' ]} (" . count( $ilist ) . " {$lang['profile']['pieces']})", "[{$lang['profile']['viewcard']}] [{$lang['profile']['editcard']}] [{$lang['profile']['delcard']}]", $cardrows ), $card ); } } // SAJAT IRASOK $studycards = ""; //$card = file_get_contents( "t/profileserie.tpl" ); $studyrow = file_get_contents( "t/studyrow.tpl" ); $list = getlist( "wallcharts_studies", -1, -1, "", "userid={$_SESSION[ "userid" ]}" ); for ( $i = 0; $i < count( $list ); $i++ ) { $editlink = "./index.php?m=" . MENU_STUDY . "&id={$list[ $i ][ "id" ]}"; $dellink = "confirmyes( \"" . $lang['study']['delwarning'] . "\", \"./index.php?m=" . MENU_PROFILE . "&dstudyid={$list[ $i ][ "id" ]}\" )"; $studycards .= str_replace( Array( "%TITLE%", "%BUTTONS%" ), Array( $list[$i]["title"], "[{$lang['profile']['editcard']}] [{$lang['profile']['delcard']}]" ), $studyrow ); } // SAJAT FOGLALKOZASOK $presentationcards = ""; //$card = file_get_contents( "t/profileserie.tpl" ); $presentationrow = file_get_contents( "t/studyrow.tpl" ); $list = getlist( "wallcharts_presentations", -1, -1, "", "creator={$_SESSION[ "userid" ]}" ); for ( $i = 0; $i < count( $list ); $i++ ) { $editlink = "./index.php?m=" . MENU_PRESENTATION . "&id={$list[ $i ][ "id" ]}"; $dellink = "confirmyes( \"" . $lang['presentation']['delwarning'] . "\", \"./index.php?m=" . MENU_PROFILE . "&dpresid={$list[ $i ][ "id" ]}\" )"; $presentationcards .= str_replace( Array( "%TITLE%", "%BUTTONS%" ), Array( $list[$i]["prestitle"], "[{$lang['profile']['editcard']}] [{$lang['profile']['delcard']}]" ), $presentationrow ); } // INTEZMENYI FELTOLTESEK $iuitem = getitem( "wallcharts_institutes_users", "userid", $_SESSION[ "userid" ] ); $query = "SELECT i.id, i.origtitle, i.registerid, i.number, i.schoolname FROM wallcharts_items AS i LEFT JOIN wallcharts_institutes_users AS iu ON i.userid=iu.userid WHERE i.visible=1 AND iu.userid!={$_SESSION[ "userid" ]} AND iu.instituteid={$iuitem["instituteid"]}"; $result = mysql_query($query) or dbg_log( mysql_error() ."\n". $query ); $ilist = Array(); $index = 0; while ( ( $r = mysql_fetch_array($result) ) ) { foreach( $r as $field => $value ) $r[ $field ] = stripslashes( urldecode( $value ) ); $ilist[$index++] = $r; } mysql_free_result( $result ); $insuploadcards = thumbmatrix( $ilist, "{$lang['db']['wallcharts_items']['origtitle']}: %TITLE%
{$lang['db']['wallcharts_items']['registerid']}: %REGISTERID%
{$lang['db']['wallcharts_items']['number']}: %NUMBER%
{$lang['profile']['viewcard']}", "id", "instthumb" ); // SAJAT VALOGATASOK $selectioncards = ""; $selectionrow = file_get_contents( "t/studyrow.tpl" ); $list = getlist( "wallcharts_selections", -1, -1, "", "userid={$_SESSION[ "userid" ]}" ); for ( $i = 0; $i < count( $list ); $i++ ) { $viewlink = "./index.php?m=" . MENU_CARD . "&selid={$list[ $i ][ "id" ]}"; $editlink = "./index.php?m=" . MENU_SELECTION . "&id={$list[ $i ][ "id" ]}"; $dellink = "confirmyes( \"" . $lang['selection']['delwarning'] . "\", \"./index.php?m=" . MENU_PROFILE . "&dselid={$list[ $i ][ "id" ]}\" )"; $selectioncards .= str_replace( Array( "%TITLE%", "%BUTTONS%" ), Array( $list[$i]["title"], "[{$lang['profile']['viewcard']}] [{$lang['profile']['editcard']}] [{$lang['profile']['delcard']}]" ), $selectionrow ); } // OSSZERAKAS $aitem = getitem( "wallcharts_articles", "article_type", 2 ); $ownprofiledisplay = $ownuploadsdisplay = $instituteuploadsdisplay = $ownseriesdisplay = $ownselectionsdisplay = $ownstudiesdisplay = $ownpresentationsdisplay = "none"; $bu1 = ""; if ( chkright( "createprofile" ) ) { $bu1 .= bb( "bb1", $lang['profile']['editprofile'], "location.href=\"./index.php?m=" . MENU_OWNDATA . "\"", "bigbutton3.png", "bigbutton3b.png" ); $ownprofiledisplay = "block"; } if ( chkright( "createwallcharts" ) ) { $bu1 .= bb( "bb2", $lang['profile']['newimage'], "location.href=\"./index.php?m=" . MENU_UPLOAD . "\"", "bigbutton1.png", "bigbutton1b.png" ); $ownuploadsdisplay = "block"; $instituteuploadsdisplay = "block"; } if ( chkright( "createseries" ) ) { $bu1 .= bb( "bb3", $lang['profile']['newseries'], "location.href=\"./index.php?m=" . MENU_SERIE . "\"", "bigbutton5.png", "bigbutton5b.png" ); $ownseriesdisplay = "block"; } $bu2 = ""; if ( chkright( "createselections" ) ) { $bu2 .= bb( "bb4", $lang['profile']['newselection'], "location.href=\"./index.php?m=" . MENU_SELECTION . "\"", "bigbutton4.png", "bigbutton4b.png" ); $ownselectionsdisplay = "block"; } if ( chkright( "createstudies" ) ) { $bu2 .= bb( "bb6", $lang['profile']['newstudy'], "location.href=\"./index.php?m=" . MENU_STUDY . "\"", "bigbutton1.png", "bigbutton1b.png" ); $ownstudiesdisplay = "block"; } if ( chkright( "createpresentations" ) ) { $bu2 .= bb( "bb7", $lang['profile']['newpresentation'], "location.href=\"./index.php?m=" . MENU_PRESENTATION . "\"", "bigbutton1.png", "bigbutton1b.png" ); $ownpresentationsdisplay = "block"; } $from = Array( "%BUTTONS1%", "%BUTTONS2%", "%OWNUPLOADS%", "%INSTITUTEUPLOADS%", "%OWNSERIES%", "%OWNSELECTIONS%", "%SELECTIONCARDS%", "%OWNPROFILE%", "%BOXTITLE%", "%UPLOADCARDS%", "%INSUPLOADCARDS%", "%SERIECARDS%", "%FORM%", "%PROFILEARTICLETITLE%", "%PROFILEARTICLEBODY%", "%OWNSTUDIES%", "%STUDYCARDS%", "%OWNPRESENTATIONS%", "%PRESENTATIONCARDS%", "%OWNPROFILEDISPLAY%", "%OWNUPLOADSDISPLAY%", "%INSTITUTEUPLOADSDISPLAY%", "%OWNSERIESDISPLAY%", "%OWNSELECTIONSDISPLAY%", "%OWNSTUDIESDISPLAY%", "%OWNPRESENTATIONSDISPLAY%" ); $to = Array( $bu1, $bu2, /*bb( "bb1", $lang['profile']['editprofile'], "location.href=\"./index.php?m=" . MENU_OWNDATA . "\"", "bigbutton3.png", "bigbutton3b.png" ) . bb( "bb2", $lang['profile']['newimage'], "location.href=\"./index.php?m=" . MENU_UPLOAD . "\"", "bigbutton1.png", "bigbutton1b.png" ) . bb( "bb3", $lang['profile']['newseries'], "location.href=\"./index.php?m=" . MENU_SERIE . "\"", "bigbutton5.png", "bigbutton5b.png" ), bb( "bb4", $lang['profile']['newselection'], "location.href=\"./index.php?m=" . MENU_SELECTION . "\"", "bigbutton4.png", "bigbutton4b.png" ) . //bb( "bb5", $lang['profile']['logout'], "location.href=\"./index.php?m=logout\"", "bigbutton2.png", "bigbutton2b.png" ) . bb( "bb6", $lang['profile']['newstudy'], "location.href=\"./index.php?m=" . MENU_STUDY . "\"", "bigbutton1.png", "bigbutton1b.png" ) . bb( "bb7", $lang['profile']['newpresentation'], "location.href=\"./index.php?m=" . MENU_PRESENTATION . "\"", "bigbutton1.png", "bigbutton1b.png" ) ,*/ $lang['profile']['ownuploads'], $lang['profile']['instituteuploads'], $lang['profile']['ownseries'], $lang['profile']['ownselections'], $selectioncards, $lang['profile']['ownprofile'], $lang['profile']['title'], $uploadcards, $insuploadcards, $seriecards, siteitemeditor( 0, $_SESSION[ "userid" ], "index.php", $lang['profile']['title'], "", 0, "" ), $aitem[ "article_title_$currlang" ], $aitem[ "article_body_$currlang" ], $lang['profile']['ownstudies'], $studycards, $lang['profile']['ownpresentations'], $presentationcards, $ownprofiledisplay, $ownuploadsdisplay, $instituteuploadsdisplay, $ownseriesdisplay, $ownselectionsdisplay, $ownstudiesdisplay, $ownpresentationsdisplay ); $maincontent = str_replace( $from, $to, $maincontent ); break; case MENU_REG: // REGISZTRACIO $maincontent = file_get_contents( "t/reg.tpl" ); $submitbutton = $lang['reg']['submit']; $uid = -1; if ( $_SESSION[ "justregged" ] ) { siteitemeditor_showall( 0, 2 ); $uid = $_SESSION[ "justregged" ]; $submitbutton = ""; if ( $errtext == "" ) { $errtext = "

" . $lang['reg']['success'] . "

"; $errtextstyle = "style='background: #aaff00'"; } } if ( $errtext == "" ) $errtextstyle = "style='background: #ffffff'"; siteitemeditor_show( 0, "regstatus", 0 ); siteitemeditor_show( 0, "institutethes", 0 ); $aitem = getitem( "wallcharts_articles", "article_type", 0 ); $from = Array( "%BOXTITLE%", "%FORM%", "%ADDTEXT%", "%ADDTEXTSTYLE%", "%REGARTICLETITLE%", "%REGARTICLEBODY%" ); $to = Array( $lang['reg']['title'], siteitemeditor( 0, $uid, "index.php", $lang['reg']['title'], $submitbutton, 0, "" ), $errtext, $errtextstyle, $aitem[ "article_title_$currlang" ], $aitem[ "article_body_$currlang" ], ); $maincontent = str_replace( $from, $to, $maincontent ); break; case MENU_MISSING: // KERESSUK! $maincontent = file_get_contents( "t/missing.tpl" ); $rowtpl = file_get_contents( "t/missingrow.tpl" ); $pagesize = 10; if ( isset( $_GET[ "p" ] ) ) $page = $_GET[ "p" ]; else $page = 0; $rows = ""; $slist = getlist( "wallcharts_series", $pagesize, $page, "ORDER BY origtitle ASC", "seriesstatus=0" ); $scount = getsize( "wallcharts_series", "seriesstatus=0", false ); for ( $i = 0; $i < count( $slist ); $i++ ) { $attr = "style='cursor:pointer;"; if ( $i % 2 ) $attr .= " background-color: #ffffff;"; $attr .= "'"; $uitem = getitem( "wallcharts_users", "id", $slist[$i][ "creator" ] ); $ilist = getlist( "wallcharts_items", -1, -1, "ORDER BY number ASC", "series={$slist[ $i ][ "id" ]}" ); $mcount = 0; for ( $j = 0; $j < count( $ilist ); $j++ ) if ( !isset( $ilist[ $j ][ "itemimage" ] ) ||$ilist[ $j ][ "itemimage" ] == "" ) $mcount++; $length = $lang['missing']['length'] . " " . count( $ilist ); $missing = $lang['missing']['missing'] . " " . $mcount; if ( $ilist[ 0 ][ "itemimage" ] == "" ) $image = ""; else $image = ""; $misc = "{$lang['db']['wallcharts_series']['origtitle']}: {$slist[ $i ][ "origtitle" ]}
"; $misc .= "{$lang['db']['wallcharts_series']['editor']}: {$slist[ $i ][ "editor" ]}
"; $misc .= "{$lang['db']['wallcharts_series']['publisher']}: {$slist[ $i ][ "publisher" ]}
"; $misc .= "{$lang['db']['wallcharts_series']['publishdate']}: {$slist[ $i ][ "publishdate" ]}"; //{$lang['db']['wallcharts_series']['creator']}: {$uitem[ "nickname" ]}
{$lang['db']['wallcharts_series']['title']}:
{$lang['db']['wallcharts_series']['title_en']}: "; $rows .= str_replace( Array( "%ATTR%", "%LINK%", "%MISC%", "%LENGTH%", "%MISSING%", "%IMAGE%" ), Array( $attr, "./index.php?m=" . MENU_CARD . "&id={$ilist[ 0 ][ "id" ]}", $misc, $length, $missing, $image ), $rowtpl ); } $lnk = "index.php?m=" . MENU_MISSING . "&p=%PAGE%"; if ( $scount > $pagesize ) $pages = sitepages( $page, $lnk, $scount, $pagesize ); $aitem = getitem( "wallcharts_articles", "article_type", 13 ); $from = Array( "%BOXTITLE%", "%PAGES%", "%ROWS%", "%ARTICLE%" ); $to = Array( $lang[ "missing" ][ "title" ], $pages, $rows, $aitem[ "article_body_$currlang" ] ); $maincontent = str_replace( $from, $to, $maincontent ); break; case MENU_SELECTIONS: // VALOGATASOK $maincontent = file_get_contents( "t/selections.tpl" ); $rowtpl = file_get_contents( "t/selectionsrow.tpl" ); $pagesize = 10; if ( isset( $_GET[ "p" ] ) ) $page = $_GET[ "p" ]; else $page = 0; $rows = ""; $slist = getlist( "wallcharts_selections", $pagesize, $page, "ORDER BY title ASC", "status=1" ); $scount = getsize( "wallcharts_selections", "", false ); for ( $i = 0; $i < count( $slist ); $i++ ) { $attr = "style='cursor:pointer;"; if ( $i % 2 ) $attr .= " background-color: #ffffff;"; $attr .= "'"; $uitem = getitem( "wallcharts_users", "id", $slist[$i][ "userid" ] ); $ilist = getlist( "wallcharts_selections_items", -1, -1, "", "selectionid={$slist[ $i ][ "id" ]}" ); $images = ""; for ( $j = 0; $j < min( 5, count( $ilist ) ); $j++ ) { $iitem = getitem( "wallcharts_items", "id", $ilist[ $j ][ "itemid" ] ); if ( $iitem[ "itemimage" ] == "" ) $images .= ""; else $images .= ""; } $misc = "{$lang['db']['wallcharts_selections']['title']}: {$slist[ $i ][ "title" ]}
{$lang['db']['wallcharts_selections']['userid']}: {$uitem[ "nickname" ]}"; $misc .= "
{$lang['selections']['length']} " . count( $ilist ); $misc .= "
{$lang['db']['wallcharts_selections']['description']}: " . simplestrip( $slist[ $i ][ "description" ] ); $rows .= str_replace( Array( "%ATTR%", "%LINK%", "%COL1%", "%COL2%" ), Array( $attr, "./index.php?m=" . MENU_CARD . "&selid={$slist[ $i ][ "id" ]}", $misc, $images ), $rowtpl ); } $lnk = "index.php?m=" . MENU_SELECTIONS . "&p=%PAGE%"; if ( $scount > $pagesize ) $pages = sitepages( $page, $lnk, $scount, $pagesize ); $from = Array( "%BOXTITLE%", "%PAGES%", "%ROWS%" ); $to = Array( $lang[ "selections" ][ "title" ], $pages, $rows ); $maincontent = str_replace( $from, $to, $maincontent ); break; case MENU_SEARCH: // RENDSZEREZO $maincontent = file_get_contents( "t/search.tpl" ); $sthumb = file_get_contents( "t/searchthumb.tpl" ); if ( isset( $_GET[ "posteremail" ] ) ) { $_SESSION[ "posteremail" ] = $_GET[ "posteremail" ]; $_SESSION[ "postersender" ] = $_GET[ "postersender" ]; } $pagesize = 50; // NARROW $narrow = Array(); $joined = false; $idfield = "id"; if ( isset( $_GET[ "keyword" ] ) && $_GET[ "keyword" ] != "" ) { $k = stripslashes( urldecode( $_GET[ "keyword" ] ) ); // idezojel, egyben keresi if ( substr( $k, 0, 1 ) == "\"" ) { array_push( $narrow, "i.search LIKE '%" . urlencode( strtoupper2( str_replace( "\"", "", $k ) ) ) . "%'" ); } else // kulon szavak, ES-el keresi { $keys = explode( " ", $k ); for ( $i = 0; $i < count( $keys ); $i++ ) { $keynarrow .= "i.search LIKE '%" . urlencode( strtoupper2( $keys[ $i ] ) ) . "%'"; if ( $i < count( $keys ) - 1 ) $keynarrow .= " AND "; } array_push( $narrow, "($keynarrow)" ); } } if ( $_GET[ "srctype" ] == "advanced" ) { $simpledisplay = "none"; $advdisplay = "block"; for ( $i = 0; $i < count( $typedata[ 1 ]->ftypes ); $i++ ) { if ( $typedata[ 1 ]->fields[ $i ] == "publishdate" || $typedata[ 1 ]->fields[ $i ] == "width" || $typedata[ 1 ]->fields[ $i ] == "height" ) { if ( isset( $_GET[ $typedata[ 1 ]->fields[ $i ]."_from" ] ) && $_GET[ $typedata[ 1 ]->fields[ $i ]."_from" ] != "" ) array_push( $narrow, "i.{$typedata[ 1 ]->fields[ $i ]}!='' AND i.{$typedata[ 1 ]->fields[ $i ]}*1 >= " . intval( $_GET[ $typedata[ 1 ]->fields[ $i ]."_from" ] ) ); if ( isset( $_GET[ $typedata[ 1 ]->fields[ $i ]."_to" ] ) && $_GET[ $typedata[ 1 ]->fields[ $i ]."_to" ] != "" ) array_push( $narrow, "i.{$typedata[ 1 ]->fields[ $i ]}!='' AND i.{$typedata[ 1 ]->fields[ $i ]}*1 <= " . intval( $_GET[ $typedata[ 1 ]->fields[ $i ]."_to" ] ) ); } if ( $typedata[ 1 ]->ftypes[ $i ] == "TXT" && isset( $_GET[ $typedata[ 1 ]->fields[ $i ] ] ) && $_GET[ $typedata[ 1 ]->fields[ $i ] ] != "" ) array_push( $narrow, "i.{$typedata[ 1 ]->fields[ $i ]} LIKE '%" . urlencode( $_GET[ $typedata[ 1 ]->fields[ $i ] ] ) . "%'" ); if ( substr( $typedata[ 1 ]->ftypes[ $i ], 0, 4 ) == "REF|" && isset( $_GET[ $typedata[ 1 ]->fields[ $i ] ] ) && $_GET[ $typedata[ 1 ]->fields[ $i ] ] != -1 ) array_push( $narrow, "i.{$typedata[ 1 ]->fields[ $i ]} = " . $_GET[ $typedata[ 1 ]->fields[ $i ] ] ); } } else { $simpledisplay = "block"; $advdisplay = "none"; if ( isset( $_GET[ "serieid" ] ) && $_GET[ "serieid" ] != -1 && $_GET[ "serieid" ] != "" ) array_push( $narrow, "i.series=" . $_GET[ "serieid" ] ); //if ( isset( $_GET[ "keyword" ] ) && $_GET[ "keyword" ] != "" ) // array_push( $narrow, "i.search LIKE '%" . urlencode( strtoupper2( $_GET[ "keyword" ] ) ) . "%'" ); if ( isset( $_GET[ "subjectid" ] ) && $_GET[ "subjectid" ] != -1 && $_GET[ "subjectid" ] != "" ) { array_push( $narrow, "si.subjectid={$_GET[ "subjectid" ]}" ); $joined = true; $idfield = "itemid"; } } if ( count( $narrow ) > 0 ) $narrow = "WHERE i.visible=1 AND " . implode( " AND ", $narrow ); else $narrow = ""; if ( $narrow != "" ) { // QUERY if ( $joined ) $query = "SELECT COUNT(*) FROM wallcharts_items AS i LEFT JOIN wallcharts_subjects_items AS si ON i.id=si.itemid $narrow"; else $query = "SELECT COUNT(*) FROM wallcharts_items AS i $narrow"; // COUNT $result = mysql_query($query); $r = mysql_fetch_row($result); $icount = $r[ 0 ]; mysql_free_result( $result ); // PAGE /* if ( isset( $_GET[ "p" ] ) ) $page = $_GET[ "p" ]; else $page = 0; $query .= " LIMIT " . ($page*$pagesize) . ", $pagesize"; */ // RESULTS $query = str_replace( "COUNT(*)", "*", $query ); $result = mysql_query($query); $ilist = Array(); $idx = 0; while ( ( $r = mysql_fetch_array($result) ) ) { foreach( $r as $field => $value ) $r[ $field ] = stripslashes( urldecode( $value ) ); $ilist[$idx++] = $r; } mysql_free_result( $result ); } // LEGORDULOK $slist = getlist( "wallcharts_series", -1, -1, "ORDER BY origtitle ASC", "" ); $seriesoptions = ""; for ( $i = 0; $i < count( $slist ); $i++ ) $seriesoptions .= ""; $sulist = getlist( "wallcharts_subjects", -1, -1, "", "" ); $subjectsoptions = ""; for ( $i = 0; $i < count( $sulist ); $i++ ) $subjectsoptions .= ""; // LAPOZO /* $lnk = "index.php?m=" . MENU_SEARCH . "&serieid=" . $_GET[ "serieid" ] . "&subjectid=" . $_GET[ "subjectid" ] . "&keyword=" . $_GET[ "keyword" ] . "&p=%PAGE%"; if ( $icount > $pagesize ) $pages = sitepages( $page, $lnk, $icount, $pagesize ); */ if ( $narrow != "" ) $pages .= "$icount {$lang['search']['numresults']}"; // ADVANCED $advsearch = ""; $staginput = file_get_contents( "t/searchtaginput.tpl" ); $stagselect = file_get_contents( "t/searchtagselect.tpl" ); $staginterval = file_get_contents( "t/searchtaginterval.tpl" ); $count = 1; // a keyword miatt for ( $i = 0; $i < count( $typedata[ 1 ]->ftypes ); $i++ ) { if ( $typedata[ 1 ]->fields[ $i ] == "itemstatus" ) continue; if ( $typedata[ 1 ]->fields[ $i ] == "publishdate" || $typedata[ 1 ]->fields[ $i ] == "width" || $typedata[ 1 ]->fields[ $i ] == "height" ) { if ( $count % 3 == 2 ) $st = "style='margin-right:0px;'"; else $st = ""; $advsearch .= str_replace( Array( "%LABEL%", "%VALUEFROM%", "%VALUETO%", "%STYLE%", "%NAME%" ), Array( $lang['db']['wallcharts_items'][ $typedata[ 1 ]->fields[ $i ] ] ." ". $lang['search']['fromto'], urldecode( $_GET[ $typedata[ 1 ]->fields[ $i ]."_from" ] ), urldecode( $_GET[ $typedata[ 1 ]->fields[ $i ]."_to" ] ), $st, $typedata[ 1 ]->fields[ $i ] ), $staginterval ); if ( $count % 3 == 2 ) $advsearch .= "
\n"; $count++; continue; } if ( $typedata[ 1 ]->ftypes[ $i ] == "TXT" ) { if ( $count % 3 == 2 ) $st = "style='margin-right:0px;'"; else $st = ""; $advsearch .= str_replace( Array( "%LABEL%", "%VALUE%", "%STYLE%", "%NAME%" ), Array( $lang['db']['wallcharts_items'][ $typedata[ 1 ]->fields[ $i ] ], urldecode( $_GET[ $typedata[ 1 ]->fields[ $i ] ] ), $st, $typedata[ 1 ]->fields[ $i ] ), $staginput ); if ( $count % 3 == 2 ) $advsearch .= "
\n"; $count++; } if ( substr( $typedata[ 1 ]->ftypes[ $i ], 0, 4 ) == "REF|" ) { if ( $count % 3 == 2 ) $st = "style='margin-right:0px;'"; else $st = ""; $r = explode( "|", $typedata[ 1 ]->ftypes[ $i ] ); $ref = getref( $r[1], $r[2], $r[3] ); $options = ""; foreach ($ref as $rid => $rname ) $options .= "