İyinet'e Hoşgeldiniz!

Türkiye'nin En Eski Webmaster Forum'una Hemen Kayıt Olun!

Kayıt Ol!

Aardvark Toplist Için Ekstra Dil Seçimi

ZApToR

0
İyinet Üyesi
Katılım
8 Mayıs 2005
Mesajlar
84
Reaction score
0
Arkadaşlar Aardvark toplist için ana sayfaya dil seçim bölümü entegre etmeyi düşünüyorum.Biraz daha açıklamak gerekirse, sitenin herhangi bir bölümüne ziyaretçilerin mevcut dillerden(İngilizce,Almanca..vs) herhangi birini seçebileceği bir bölüm oluşturmak için gerekli olan modül veya kod elinde olan arkadaşlar varsa paylaşırsanız sevinirim.

Selametle;
 

PHPtoplist

0
İyinet Üyesi
Katılım
12 Ocak 2005
Mesajlar
41
Reaction score
0
Konum
Ankara
Aslında, madem üyeler türkçe açıklama girecek, dil ingilizce olarak seçilse ingiliz ne anlar türkçe siteden diye düşünmekle birlikte

aardvark 5.1.2 sürümü için (son sürümü diye indirdim, daha yeni sürümü var mı bilmiyorum) index.php ve sources/misc/skin.php dosyalarında yapılacak değişiklikleri aşağıya ekliyorum:

index.php
PHP:
<?php
//===========================================================================\\
// Aardvark Topsites PHP 5                                                   \\
// Copyright (c) 2003-2006 Jeremy Scheff.  All rights reserved.              \\
//---------------------------------------------------------------------------\\
// http://www.aardvarktopsitesphp.com/                http://www.avatic.com/ \\
//---------------------------------------------------------------------------\\
// This program is free software; you can redistribute it and/or modify it   \\
// under the terms of the GNU General Public License as published by the     \\
// Free Software Foundation; either version 2 of the License, or (at your    \\
// option) any later version.                                                \\
//                                                                           \\
// This program is distributed in the hope that it will be useful, but       \\
// WITHOUT ANY WARRANTY; without even the implied warranty of                \\
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General \\
// Public License for more details.                                          \\
//===========================================================================\\

// Help prevent register_globals injection
define('ATSPHP', 1);
$CONF = array();
$FORM = array();
$TMPL = array();

// Change the path to your full path if necessary
$CONF['path'] = '.';
$TMPL['version'] = '5.1.2';
// Set to 1 to display SQL queries and GET/POST/COOKIE data
$CONF['debug'] = 0;

// Require some classes and start the timer
require_once("{$CONF['path']}/sources/misc/classes.php");
$TIMER = new timer;

// Connect to the database
// Set the last argument of $DB->connect to 1 to enable debug mode
require_once("{$CONF['path']}/settings_sql.php");
require_once("{$CONF['path']}/sources/sql/{$CONF['sql']}.php");
$DB = new sql;
$DB->connect($CONF['sql_host'], $CONF['sql_username'], $CONF['sql_password'], $CONF['sql_database'], $CONF['debug']);

// Settings
$settings = $DB->fetch("SELECT * FROM {$CONF['sql_prefix']}_settings", __FILE__, __LINE__);
$CONF = array_merge($CONF, $settings);

$ad_breaks = explode(',', $CONF['ad_breaks']);
$CONF['ad_breaks'] = array();
foreach ($ad_breaks as $key => $value) {
  $CONF['ad_breaks'][$value] = $value;
}

$result = $DB->query("SELECT category, skin FROM {$CONF['sql_prefix']}_categories ORDER BY category", __FILE__, __LINE__);
while (list($category, $skin) = $DB->fetch_array($result)) {
  $CONF['categories'][$category] = $skin;
}

$CONF['skins_path'] = "{$CONF['path']}/skins";
$CONF['skins_url'] = "{$CONF['list_url']}/skins";
$TMPL['skins_url'] = $CONF['skins_url'];
$TMPL['list_name'] = $CONF['list_name'];
$TMPL['list_url'] = $CONF['list_url'];

// Combine the GET and POST input
$FORM = array_merge($_GET, $_POST);


////////////////////////////////////////////////////////
///ARAYA GİRECEĞİMİZ KODLAR BAŞLIYOOR
////////////////////////////////////////////////////////

///languages klasorundeki dillerden birkaçı
$diller=array('turkish','english','french','german','russian');
$girilendil=$FORM['dilsec'];

if($girilendil){
	if(in_array($girilendil,$diller))
	{		
	setcookie('lngc',$girilendil,(time()+7*24*60*60));
	$lngc=$girilendil;	
	}
////Geçerli olmayan bir dil seçilmişse birşey yapma
}
else{
////Girilen dil yok cookie tanımlımı	
	$lngc=$HTTP_COOKIE_VARS['lngc'];
}

//cookie tanımlı veya girilmiş
if($lngc!=''){$dildosyasi=$lngc;}
//ne cookie ne de girilmiş
//browser Türkçe kabul ediyorsa türkçe olsun...
elseif(eregi('TR',$HTTP_ACCEPT_LANGUAGE)){$dildosyasi='turkish';}
else{
 ///browserin kabul ettiği diller arasında aradigimiz dil yok
 ///dil dosyamiz script kurulurken tanımlanan dil olsun
 $dildosyasi=$CONF['default_language'];
 }
// The language file
require_once("{$CONF['path']}/languages/{$dildosyasi}.php");


////Dil Seçimini için navigasyon
$nav='';
foreach ($diller as $dil){
	if($dildosyasi!=$dil){$nav.='<a href="index.php?dilsec='.$dil.'">'.ucwords($dil).'</a> | ';}
}
$nav=substr($nav,0,-3);
$CONF[nav]='<br>Dil Seç: '.$nav;
////////////////////////////////////////////////////////
///ARAYA GİRECEĞİMİZ KODLAR BİTİYOOR
////////////////////////////////////////////////////////

// Determine the category and skin
if (isset($FORM['cat']) && isset($CONF['categories'][$FORM['cat']])) {
  $TMPL['skin_name'] = $CONF['categories'][$FORM['cat']];
}
else {
  $TMPL['skin_name'] = $CONF['default_skin'];
}
if (!is_dir("{$CONF['path']}/skins/{$TMPL['skin_name']}/") || !$TMPL['skin_name']) {
  $TMPL['skin_name'] = $CONF['default_skin'];
}
if (!is_dir("{$CONF['path']}/skins/{$CONF['default_skin']}/")) {
  $TMPL['skin_name'] = 'fusion';
}
require_once("{$CONF['path']}/sources/misc/skin.php");

// Is it a new day/week/month?
list($last_new_day, $last_new_week, $last_new_month) = $DB->fetch("SELECT last_new_day, last_new_week, last_new_month FROM {$CONF['sql_prefix']}_etc", __FILE__, __LINE__);
$time = time() + (3600*$CONF['time_offset']);
$current_day = date('d', $time);
$current_week = date('W', $time);
$current_month = date('m', $time);
if ($last_new_day != $current_day) {
  require_once("{$CONF['path']}/sources/misc/new_day.php");
  new_day($current_day);
}
if ($last_new_week != $current_week) {
  require_once("{$CONF['path']}/sources/misc/new_day.php");
  new_week($current_week);
}
if ($last_new_month != $current_month) {
  require_once("{$CONF['path']}/sources/misc/new_day.php");
  new_month($current_month);
}

// Adjust the output text based on days, weeks, or months
if ($CONF['ranking_period'] == 'weekly') {
  $LNG['g_this_period'] = $LNG['g_this_week'];
  $LNG['g_last_period'] = $LNG['g_last_week'];
}
elseif ($CONF['ranking_period'] == 'monthly') {
  $LNG['g_this_period'] = $LNG['g_this_month'];
  $LNG['g_last_period'] = $LNG['g_last_month'];
}
else {
  $LNG['g_this_period'] = $LNG['g_today'];
  $LNG['g_last_period'] = $LNG['g_yesterday'];
}

// Check if installer is there
if (file_exists("{$CONF['path']}/install/")) {
  $TMPL['header'] = $LNG['g_error'];
  $base = new base;
  $base->error($LNG['g_delete_install']);
}

// Check for hits in
require_once("{$CONF['path']}/sources/in.php");
$in = new in;

// Array containing the valid .php files from the sources directory
$action = array(
            'admin' => 1,
            'in' => 1,
            'join' => 1,
            'lost_pw' => 1,
            'out' => 1,
            'page' => 1,
            'rankings' => 1,
            'rate' => 1,
            'search' => 1,
            'stats' => 1,
            'user_cp' => 1
          );

// Require the appripriate file
if (isset($FORM['a']) && isset($action[$FORM['a']])) {
  $page_name = $FORM['a'];
}
else {
  $page_name = 'rankings';
}

require_once("{$CONF['path']}/sources/{$page_name}.php");
$page = new $page_name;

// Display the page
$skin = new main_skin('wrapper');
echo $skin->make();

$DB->close();

// Print out debugging info, if necessary
if ($CONF['debug']) {
  echo '<div style="clear: both;">';
  foreach ($DB->queries as $value) {
    echo "<hr /><pre>{$value}</pre>";
  }
  echo '<hr /><pre>';
  print_r($_REQUEST);
  echo '</pre>';
  echo '</div>';
}
?>


skin.php
(sadece sonlardaki copyright yazılarının sonuna $CONF[nav] ekledim, tüm dosyayı buraya yazmaya gerek yok)
PHP:
    // If you want to remove these links, you can; however, I would appreciate
    // it if you left them there.
    $TMPL['powered_by'] .= '<br /><a href="http://www.avatic.com/">Avatic</a>  | <a href="http://www.itopsites.com/" title="Get a free hosted topsites list">iTopsites</a>  | <a href="http://www.pollverize.com/" title="Get a free remotely hosted poll">Pollverize</a> | <a href="http://www.consolidatestudentloansnow.org/" title="Consolidate student loans now">Student Loan Consolidation</a>'.$CONF[nav];
 

PHPtoplist

0
İyinet Üyesi
Katılım
12 Ocak 2005
Mesajlar
41
Reaction score
0
Konum
Ankara
4.2.1 i de ekleyelim bari

aardvark 4.2.1 için...

index.php
PHP:
<?php
//=================================================================\\
// Aardvark Topsites PHP 4.2.2                                     \\
//-----------------------------------------------------------------\\
// Copyright 2003-2005 Jeremy Scheff - http://www.aardvarkind.com/ \\
//-----------------------------------------------------------------\\
// This program is free software; you can redistribute it and/or   \\
// modify it under the terms of the GNU General Public License     \\
// as published by the Free Software Foundation; either version 2  \\
// of the License, or (at your option) any later version.          \\
//                                                                 \\
// This program is distributed in the hope that it will be useful, \\
// but WITHOUT ANY WARRANTY; without even the implied warranty of  \\
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   \\
// GNU General Public License for more details.                    \\
//=================================================================\\

error_reporting(E_ERROR | E_WARNING | E_PARSE);
set_magic_quotes_runtime(0);

// Start the timer
$starttime = microtime();
$starttime = explode(' ', $starttime);
$starttime = $starttime[1] + $starttime[0];

// Settings
require_once 'config.php';
require_once $CONFIG['path'].'/config_skins.php';
$queries = array();
$TMPL['queries'] = 0;
$DEBUG = 0; // Set to 1 and all the SQL queries will be shown at the bottom

// Is install.php still there?
if (file_exists($CONFIG['path'].'/install.php')) { echo "Delete install.php"; exit; }

// Require functions and process GET and POST input
require_once $CONFIG['path'].'/sources/functions.php';
$FORM = parse_form();


////////////////////////////////////////////////////////
///ARAYA GİRECEĞİMİZ KODLAR BAŞLIYOOR
////////////////////////////////////////////////////////

///languages klasorundeki dillerden birkaçı
$diller=array('turkish','english','french','german','russian');
$girilendil=$FORM['dilsec'];

if($girilendil){
	if(in_array($girilendil,$diller))
	{		
	setcookie('lngc',$girilendil,(time()+7*24*60*60));
	$lngc=$girilendil;	
	}
////Geçerli olmayan bir dil seçilmişse birşey yapma
}
else{
////Girilen dil yok cookie tanımlımı	
	$lngc=$HTTP_COOKIE_VARS['lngc'];
}

//cookie tanımlı veya girilmiş
if($lngc!=''){$dildosyasi=$lngc;}
//ne cookie ne de girilmiş
//browser Türkçe kabul ediyorsa türkçe olsun...
elseif(eregi('TR',$HTTP_ACCEPT_LANGUAGE)){$dildosyasi='turkish';}
else{
 ///browserin kabul ettiği diller arasında aradigimiz dil yok
 ///dil dosyamiz script kurulurken tanımlanan dil olsun
 $dildosyasi=$CONFIG['default_language'];
 }
// The language file
require_once($CONFIG['path'].'/languages/'.$dildosyasi.'.php');


////Dil Seçimini için navigasyon
$nav='';
foreach ($diller as $dil){
	if($dildosyasi!=$dil){$nav.='<a href="index.php?dilsec='.$dil.'">'.ucwords($dil).'</a> | ';}
}
$nav=substr($nav,0,-3);
$CONFIG['nav']='<br>Dil Seç: '.$nav;
////////////////////////////////////////////////////////
///ARAYA GİRECEĞİMİZ KODLAR BİTİYOOR
////////////////////////////////////////////////////////

// The language file
//require_once $CONFIG['path'].'/languages/'.$CONFIG['deflanguage'].'.php';

// Skin stuff
if ($FORM['skin_name']) { $TMPL['skin_name'] = $FORM['skin_name']; }
else { $TMPL['skin_name'] = isset($CONFIG['skin'][$FORM['cat']]) ? $CONFIG['skin'][$FORM['cat']] : $CONFIG['default_skin']; }
if (!is_dir($CONFIG['path'].'/skins/'.$TMPL['skin_name'])) { $TMPL['skin_name'] = $CONFIG['default_skin']; }
require_once $CONFIG['path'] . '/sources/template.php';

// Connect to the database
require_once $CONFIG['path'].'/sources/drivers/'.$CONFIG['sql'].'.php';
$db = new SQL;
$db->Connect($CONFIG['sql_host'], $CONFIG['sql_user'], $CONFIG['sql_pass'], $CONFIG['sql_database']);

// Get the number of members and the last reset
$result = $db->Execute("SELECT last_newday, num_members FROM ".$CONFIG['sql_prefix']."_etc");
list($last_newday, $TMPL['nummem']) = $db->FetchArray($result);

// Is it a new day/week/month?
$time = time();
if ($CONFIG['daymonth'] == 1) { $current_day = date("m", time() + (3600 * $CONFIG['timeoffset'])); }
elseif ($CONFIG['daymonth'] == 2) { $current_day = date("W", time() + (3600 * $CONFIG['timeoffset'])); }
else { $current_day = date("d", time() + (3600 * $CONFIG['timeoffset'])); }
if ($last_newday != $current_day) {
    require_once $CONFIG['path'].'/sources/new_day.php';
}
if ($CONFIG['daymonth'] == 1) {
  $LNG['g_today'] = $LNG['g_thismonth'];
  $LNG['g_yesterday'] = $LNG['g_lastmonth'];
  $LNG['g_2days'] = $LNG['g_2months'];
  $LNG['g_3days'] = $LNG['g_3months'];
}
elseif ($CONFIG['daymonth'] == 2) {
  $LNG['g_today'] = $LNG['g_thisweek'];
  $LNG['g_yesterday'] = $LNG['g_lastweek'];
  $LNG['g_2days'] = $LNG['g_2weeks'];
  $LNG['g_3days'] = $LNG['g_3weeks'];
}

// gzip
if ($CONFIG['gzip']) { ob_start("ob_gzhandler"); }

// Options of what to do
$action = array(
            'display' => 1,
            'edit' => 1,
            'email' => 1,
            'graph' => 1,
            'join' => 1,
            'lostcode' => 1,
            'lostpw' => 1,
            'rate' => 1,
            'search' => 1,
            'stats' => 1
          );

// Require the appropriate script
if (!isset($action[$FORM['a']])) { $FORM['a'] = 'display'; }
require_once $CONFIG['path'].'/sources/'.$FORM['a'].'.php';

build_skin_stuff();

$db->Close;

// Print the content
echo do_template("wrapper");

if ($DEBUG) {
  echo "<div style=\"margin: 2px;\">\n";
  foreach ($queries as $value) {
    echo "<hr />$value\n";
  }
  echo "</div>";
}
?>


template.php dosyasının sonlarında $CONFIG[nav] ekledim o kadar:
PHP:
  // Please do not remove the link to http://www.aardvarkind.com/.
  // This is a free script, all I ask for is a link back.
  // If you need to remove the link, see my website for details.
  $TMPL['poweredby'] = $LNG['main_powered']." <a href=\"http://www.aardvarkind.com/\">Aardvark Topsites PHP</a> ".$TMPL['version'];
  $TMPL['poweredby'] .= "<br /><a href=\"http://www.itopsites.com/\">iTopsites.com - Get a Free Hosted Topsites List</a>".$CONFIG['nav'];

  // Stop the timer
 

Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.

Backlink ve Tanıtım Yazısı için iletişime geçmek için Skype Adresimiz: .cid.1580508955483fe5

Üst