• 27-05-2010, 17:45:21
    #1
    arkadaşlar yardımcı olurmusunuz burada hangi kodla oynarsak yeni eklediğim oyunlar son sayfa yerine ana sayfada görünür amacım yeni oyun eklediğimde 5.sayfaya değilde 1.sayfaya eklensin yani 1,2,3,4,5 yerine 5,4,3,2,1 olarak dizemek anlatabildimmi bilmiyorum site bu www.bebekizoyunlari.com

    PHP Kodu:
    /** 
     * am_listnewgames 
     * 
     * Return the newest games in either line break (flat) or in an unordered list (list) 
     * @param string $format accepted values are 'list' or 'flat', default is flat. 
     * @param string $number The number of games to return.  If not specified defaults to 10.  
     * @param string $cat The category you'd like the top games from (optional)  
     * @return unknown 
     */ 
        function am_listnewgames($format = NULL, $number = NULL, $cat=NULL, $echo=true) { 
            global $SEOFriendlyURLs; 
            global $db; 
            $icounter = 0; 
            if ($format == 'flat' || $format == NULL) { 
                $start = NULL; 
                $final = '<p />'; 
            } elseif($format == 'list') { 
                $start = '<li>'; 
                $final = '</li>'; 
                $output .= '<ul>'; 
            } 
            $rplce = array("!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "~", "`", "=", "+", "\\", "'", "\"", "|", ":", ";", "?", ".", ",", "/", "[", "{", "]", "}");         
            if ($number == NULL || !is_numeric($number)){$number=10;} 
            if ($cat==NULL) { 
                $sql = "SELECT `primkey`, `gamename`, `totalplays` FROM `AMCMS_games` ORDER BY `primkey` DESC LIMIT 0, $number;"; 
            } else { 
                $sql = "SELECT `primkey`, `gamename`, `totalplays` FROM `AMCMS_games` WHERE `category`='$cat' ORDER BY `primkey` DESC LIMIT 0, $number;";         
            } 
            $res = am_queries($db, $sql); 
            while($icounter < $number) { 
                if ($SEOFriendlyURLs == '1') { // -- If SEO Friendly titles & GamePages are on in Quick mode use this: 
                    $newpageurl = str_replace(" ", "-", strip_tags(trim(str_replace($rplce, "", $res[$icounter][1]))))  ; 
                    $output .= $start.'<a href="'.$res[$icounter][0].'-'.$newpageurl.'.html">'.$res[$icounter][1].'</a>'.$final;                     
                } else { // --- If GamePages are on, SEO titles are off, in Quick mode, use this: 
                    $output .= $start.'<a href="flash-arcade-game.php?gameid='.$res[$icounter][0].'&gamename='.$res[$icounter][1].'" title="' . $res[$icounter][1] . '">'.$res[$icounter][1].'</a>'.$final;     
                } 
                ++$icounter; 
            } 
            if($format == 'list') { 
                $output .= '</ul>'; 
            } 
            if ($echo==true) {echo $output;} 
            return $output; 
        }
    bu gamefunctions.php dosyasının bir kısmı yeni konularla alakalı olduğunu düşündüm sadece bu kısmını koydum ayrıca birde block.php var konuların yerleşimi ile ilgili heralde oda burda ;

    <?PHP
    /**
     * /includes/block.php
     * 
     * This is the central file that spits out the games.  It's an old file from the Arcadem 1.x branch that has only had minor feature upgrades.  Unfortunately, there are many issues with this file, including hard coded HTML tags which need to be removed.  In all likely hood, this file will be completely replaced in Arcadem 3.0.
     * @package /includes/block.php
     * @author Agares Media <sales@agaresmedia.com>
     * @copyright Copyright (c) 2007, Agares Media.  All rights reserved.
     * @todo ARCADEM 3.0 This file will be completely rewritten from scratch to remove DIVs, and other hard coded HTML.
     */
     require_once('./register_globals.php');
    $cat = am_injection($_GET['cat']);  // Pull the prodid from the last page.
    
    if ($cat== NULL && file_exists('.'.$themepath.'home.php')) { // This is new in Arcadem Pro 2.5.  If using a compatible 2.5 theme, if there is a file called home.php in the theme's directory, it will be the home page.
    	include('.'.$themepath.'home.php');
    	$loadedhome = true;
    } else { // This code only executes if not on home.php :
    
    // how many rows to show per page
    $rowsPerPage = $config_gamesPerPage;
    $numrows = am_numgssgames($db, $cat, NULL);
    $wnum = 0;
    
    // by default we show first page
    $blockpage = 1;
    
    // if $_GET['page'] defined, use it as page number
    if(isset($_GET['blockpage'])) {$blockpage = am_injection($_GET['blockpage']);}
    $offset = ($blockpage -1) * $rowsPerPage;
    
    
    if ($blockpage == NULL) {$blockpage = 1;}
    	$firstgame = ($blockpage * $config_gamesPerPage) - $config_gamesPerPage;
    	$lastgame = ($blockpage * $config_gamesPerPage);
    	$numgames = $lastgame - $firstgame;
    	if ($numrows != NULL) {
    		$res = am_getgssgames($db, $firstgame, $lastgame, $cat);
    	}
    
    
    $maxPage = ceil($numrows/$rowsPerPage);
    $self = $_SERVER['PHP_SELF'];	
    	
    // ------------------------------------
    // BEGIN THE TABLE CREATION PROCESS	
    echo '<div class="block">';
    $icounter = 0;
    
    	$rplce = array("!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "~", "`", "=", "+", "\\", "'", "\"", "|", ":", ";", "?", ".", ",", "/", "[", "{", "]", "}");
    
    if ($config_GamesQuickDetailed == 'Quick') {$detaildisp = 'tip';} else {$detaildisp = 'detail';}
    	
    while($icounter < $numgames) {
    	if ($res[$icounter][0] != NULL) {
    		$wwidth = $res[$icounter][4];
    		$wheight = ($res[$icounter][5]+25);
    		if ($wwidth < 26) {$wwidth = 640;}
    		if ($wheight < 26) {$wheight = 480;}
    			echo '
    			<div id="t'.$icounter.'" class="'.$detaildisp.'">
    			<img src="./arcade/img/' . $res[$icounter][13] . '" alt=" "> <br />
    			<b>Oyun adı:</b> '.$res[$icounter][1].'<br />
    			<div style="z-index:99;"><b>Açıklama: </b>'.$res[$icounter][2].' </div><br />
    			<b>Kategori:</b> '.$res[$icounter][7].' <br />
    			<b>Bu oyun kaç defa oynanmış:</b> '.$res[$icounter][8].' <br /><p />
    			</div>';
    		
    
    		if ($config_GamesQuickDetailed == 'Quick') {
    			if ($config_useGamePages == '0') { // -- If GamePages & SEO Friendly URLs are off in Quick mode, use this:
    				echo '<div id="blockdiv"><img src=".'.$themepath.'images/spacer01.gif" class="spacer" onmouseout="popUp(event,\'t'.$icounter.'\')" onmouseover="popUp(event,\'t'.$icounter.'\')"  onclick="return false"><h4>' . substr($res[$icounter][1], 0, 14) . '</h4><br /><a href=".'.$themepath.'playgame.php?getgame='.$res[$icounter][0].'&keepThis=true&TB_iframe=true&height=' . $wheight . '&width=' . $wwidth . '" title="' . $res[$icounter][1] . '" class="thickbox"><img src=".'.$themepath.'images/playnow.jpg"></a><br /><img src="./arcade/img/' . $res[$icounter][13] . '" onmouseout="popUp(event,\'t'.$icounter.'\')" onmouseover="popUp(event,\'t'.$icounter.'\')"  onclick="return false"><br /></div>';		
    			} else {
    				if ($SEOFriendlyURLs == '1') { // -- If SEO Friendly titles & GamePages are on in Quick mode use this:
    					$newpageurl = str_replace(" ", "-", strip_tags(trim(str_replace($rplce, "", $res[$icounter][1]))))  ;
    					echo '<div id="blockdiv"><img src=".'.$themepath.'images/spacer01.gif" class="spacer" onmouseout="popUp(event,\'t'.$icounter.'\')" onmouseover="popUp(event,\'t'.$icounter.'\')"  onclick="return false"><h4>' . substr($res[$icounter][1], 0, 14) . '</h4><br /><a href="'.$res[$icounter][0].'-'.$newpageurl.'.html" title="' . $res[$icounter][1] . '"><img src=".'.$themepath.'images/playnow.jpg"></a><br /><img src="./arcade/img/' . $res[$icounter][6] . '.png" onmouseout="popUp(event,\'t'.$icounter.'\')" onmouseover="popUp(event,\'t'.$icounter.'\')"  onclick="return false"><br /></div>';		
    				} else { // --- If GamePages are on, SEO titles are off, in Quick mode, use this:
    					echo '<div id="blockdiv"><img src=".'.$themepath.'images/spacer01.gif" class="spacer" onmouseout="popUp(event,\'t'.$icounter.'\')" onmouseover="popUp(event,\'t'.$icounter.'\')"  onclick="return false"><h4>' . substr($res[$icounter][1], 0, 14) . '</h4><br /><a href="flash-arcade-game.php?gameid='.$res[$icounter][0].'&gamename='.$res[$icounter][1].'" title="' . $res[$icounter][1] . '"><img src=".'.$themepath.'images/playnow.jpg"></a><br /><img src="./arcade/img/' . $res[$icounter][13] . '" onmouseout="popUp(event,\'t'.$icounter.'\')" onmouseover="popUp(event,\'t'.$icounter.'\')"  onclick="return false"><br /></div>';		
    				}
    			}
    		} else {
    			if ($config_useGamePages == '0') { // -- If GamePages & SEO Friendly URLs are off in Detailed mode, use this:
    					echo '<div class="playnow"><a href=".'.$themepath.'playgame.php?getgame='.$res[$icounter][0].'&keepThis=true&TB_iframe=true&height=' . $wheight . '&width=' . $wwidth . '" title="' . $res[$icounter][1] . '" class="thickbox"><img src=".'.$themepath.'images/playnow.gif" alt="playnow"></a></div>';
    			} else {
    				if ($SEOFriendlyURLs == '1') { // -- If SEO Friendly titles & GamePages are on in Detailed mode use this:
    					$newpageurl = str_replace(" ", "-", strip_tags(trim(str_replace($rplce, "", $res[$icounter][1]))))  ;
    					echo '<div class="playnow"><a href="'.$res[$icounter][0].'-'.$newpageurl.'.html" title="' . $res[$icounter][1] . '"><img src=".'.$themepath.'images/playnow.gif" alt="playnow"></a></div>';
    				} else { // --- If GamePages are on, SEO titles are off, in Detailed mode, use this:
    					echo '<div class="playnow"><a href="flash-arcade-game.php?gameid='.$res[$icounter][0].'&gamename='.$res[$icounter][1].'" title="' . $res[$icounter][1] . '"><img src=".'.$themepath.'images/playnow.gif" alt="playnow"></a></div>';
    				}
    			}	
    		}
    		
    		
    	}
    		$icounter++;
    	}
    echo '</div>';
    
    // --------------------------------------
    // Page navigation
    echo '<div class="bottomnav">';
    if ($blockpage > 1) {
    	$page  = $blockpage - 1;
    	$prev  = " <a href=\"$self?blockpage=$page&cat=$cat\"><</a> ";
    	$first = " <a href=\"$self?blockpage=1&cat=$cat\">«</a> ";
    } else {
    	$prev  = '&nbsp;'; // we're on page one, don't print previous link
    	$first = '&nbsp;'; // nor the first page link
    }
    
    if ($blockpage < $maxPage) {
    	$page = $blockpage + 1;
    	$next = " <a href=\"$self?blockpage=$page&cat=$cat\">></a> ";
    	$last = " <a href=\"$self?blockpage=$maxPage&cat=$cat\">»</a> ";
    } else {
    	$next = '&nbsp;'; // we're on the last page, don't print next link
    	$last = '&nbsp;'; // nor the last page link
    }
    
    // print the navigation link
    echo $first . $prev . " Şuanda $blockpage. sayfadasın, Toplam $maxPage sayfa var. (Yeni Oyunlar Son Sayfada) " . $next . $last ;
    
    $tempmax = $maxPage + 1;
    echo '<form name="sect" action="index.php" method="get">';
    echo '<select name="blockpage" onChange="window.location=document.sect.blockpage.options[document.sect.blockpage.selectedIndex].value">';
    	for ($counter=1; $counter<$tempmax; $counter++) {
    		if ($blockpage != $counter) {
    			echo '<option value="./index.php?blockpage='.$counter.'&cat='.$cat.'">'.$counter.'</option>';
    		} else {
    			echo '<option value="./index.php?blockpage='.$counter.'&cat='.$cat.'" selected>'.$counter.'</option>';
    		}
    	}
    echo '</select><input type="hidden" value="'.$cat.'" /></form>';
    echo '</div></div>';
    }
    ?>
    
    <center>
    <script type="text/javascript"><!--
    google_ad_client = "pub-4242876161481475";
    /* 468x60, oluşturulma 21.05.2010 */
    google_ad_slot = "4353186335";
    google_ad_width = 468;
    google_ad_height = 60;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    </center>
  • 28-05-2010, 09:12:31
    #2
    bi fikri olan yokmu?
  • 28-05-2010, 11:37:07
    #3
    DESC yazan yere ASC yaz oyle dene birde
  • 28-05-2010, 12:00:45
    #4
    erdemmin adlı üyeden alıntı: mesajı görüntüle
    DESC yazan yere ASC yaz oyle dene birde
    kardeş dediğin şekilde yapınca sağ menüde yeni oyunlar var ordaki oyunlar değişti ilk ekledim oyun ilk sıraya geldi /1-begendigini-giydir.html
  • 28-05-2010, 12:04:29
    #5
    DESC yazıncada en sonu gelmesi lazım o zaman
  • 28-05-2010, 12:06:21
    #6
    erdemmin adlı üyeden alıntı: mesajı görüntüle
    DESC yazıncada en sonu gelmesi lazım o zaman
    orjinalde desc yazıyo o şekilde sağ menüdeki yeni oyunlar istediğim gibi geliyor ama ana sayfada değişiklik yok yani ana sayffayı nası doldurduysam öyle kaldı
  • 28-05-2010, 12:09:53
    #7
    hocama anasayfanın kodunu koy bakayım
  • 28-05-2010, 12:13:06
    #8
    /index.php

    <?PHP
    //* Agares Media CMS- Version 3.0 *//
    //* Copyright 2007 � Agares Media.  All rights reserved. *//
    //* Use of this software is governed by the terms of our license *//
    error_reporting(0); 
    $benchmark_start = microtime();
    
    if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
    	ob_start("ob_gzhandler"); // Compress the HTML
    	header("Content-Encoding: gzip");
    }
    require_once("./includes/corefunctions.php"); // Load the AMCMS3 functions
    require_once("./includes/db.php"); // Get the database configuration settings & connect to DB.
    require_once('./includes/Smarty/libs/Smarty.class.php'); $smartyDeclared = true; // 2.709 adds support for the Smarty templating system
    require_once("./includes/config.php"); // Load the admin's preferences
    require_once('./language/'.$script_language.'/index.php');
    require_once("./includes/gamefunctions.php"); // Load the AMCMS3 game functions
    am_session(); // Start the session if nothing else has
    require_once("./includes/loginsubmit.php"); // Load login submission
    
    if (isset($_POST['gname']) || isset($_REQUEST['id']) || $_GET['autocom'] || $_POST['autocom'] || $_GET['do'] || $_POST['thescore'] || $_POST['gscore'] || $_GET['scoreVar'] || isset($_POST['sessdo'])) {
    	require_once('./includes/submitscore.php'); // Handles the submission of high scores.
    }
    
    if ($promptToRegister ==true) {
    	$headload = '
    	<script type="text/javascript">
    		jQuery(function(){
    			setTimeout(function(){ 
    				tb_show(\'Register\', \'./highscoreregister.php?height=450&width=425&keepThis=true&TB_iframe=true\', null);
    			}, 250);
    		});
    	</script>
    	
    	';
    }
    if ($_GET['loadpage']=='./includes/profile.php' && $_GET['challenge']=='true') {
    	$authorkey = am_injection($_GET['userkey']);
    	$headload = '
    	<script type="text/javascript">
    		jQuery(function(){
    			setTimeout(function(){ 
    				tb_show(\'Challenge\', \'./challenge.php?height=480&width=425&userkey='.$authorkey.'&keepThis=true&TB_iframe=true\', null);
    			}, 250);
    		});
    	</script>
    	';
    }
    
    $rotationcode = '		<script type="text/javascript" src="./includes/jquery/core.js"></script>
    
    		<script type="text/javascript" src="./includes/jquery/selector.js"></script>
    		<script type="text/javascript" src="./includes/jquery/event.js"></script>
    		<script type="text/javascript" src="./includes/jquery/ajax.js"></script>
    
    		<script type="text/javascript" src="./includes/jquery/fx.js"></script>
    		<script type="text/javascript" src="./includes/i/iutil.js"></script>
    		<script type="text/javascript" src="./includes/i/idrag.js"></script>
    
    		<script type="text/javascript" src="./includes/i/accordion.js"></script>
    	
    		<script type="text/javascript" src="./includes/i/carousel.js"></script>';
    
    
    $reg_pass = am_getuserpass();
    
    if ($themedir=='/theme/Smarty/') {
    	$smarty->assign('headload',$headload); // Assign to smarty
    	$smarty->assign('rotationcode',$rotationcode); // Assign to smarty
    
    	if($_GET['cat']!=NULL) {
    		require_once('./logic/gamecategory.php'); // Execute the business logic for the game categories
    		$smarty->display('gamecategory.tpl'); // Display the template for gamecategory.php
    		exit;
    	} elseif($_GET['loadpage']!=NULL) {
    		require_once('./logic/loadpage.php'); 
    		exit;
    	} elseif($_GET['article']!=NULL) {
    		require_once('./logic/article.php'); // Execute the business logic for displaying articles
    		$smarty->display('article.tpl'); // Display the template for articles.php		
    	} else {
    		$smarty->display('index.tpl'); // Display the template for index.php
    		exit;
    	}
    } else {
    	include_once(".".$themepath."top.php"); // Loads the topmost information (do not confuse this with the header)
    	include_once(".".$themepath."header.php"); // Loads the header and menu
    	require_once("./includes/cache_top.php"); // Load the page cache code
    	include_once(".".$themepath."sidebar.php"); // Loads the sidebar
    	include_once(".".$themepath."frontpage_right.php"); // Loads the right content
    	am_depthstats(); // Calls DepthStats code.
    	include_once(".".$themepath."footer.php"); // Loads the footer (there is no bottom.php, this is the last file)
    	require_once("./includes/cache_bottom.php"); // Load the page cache code
    }
    	
    $benchmark_end = microtime();
    $benchmark = $benchmark_end - $benchmark_start;
    print("<!-- Script Execution Time: " . $benchmark . "-->\n");
    if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
    	echo '<!-- gzip successful -->';
    	ob_end_flush(); // Output the uncompressed HTML
    } else {
    	echo '<!-- '.$HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'].' -->';
    }
    mysql_close($db);
    ?>
  • 28-05-2010, 12:17:11
    #9
    bunda sql ile ilgili bir işlem yokki orta sayfa hangisi siteyi acınca index 'in ortasında acılan sayfa hangisi onun phpsini gonderebilirmisin ?