yeni aldığım db nedeniyle tabloyu çevirmek çok zor olduğundan .0 kurmak ozrunda kaldım.. Ancak seo sorununu bi türlü çözemedim.. admin panelden seo on diyorum bu basit iş.. Ama htaccess veya functions da bi sorun var. htaccess böyle
RewriteEngine on
RewriteRule ^game/([0-9]+)/([_A-Za-z0-9-]+).html index.php?action=file&fileid=$1 [L]
RewriteRule ^category/([0-9]+)/([_A-Za-z0-9-]+)/?$ index.php?action=browse&cid=$1 [L]
RewriteRule ^category/([0-9]+)/([_A-Za-z0-9-]+)/([0-9]+).html index.php?action=browse&cid=$1&page=$3 [L]
RewriteRule ^profile/([0-9]+)/([_A-Za-z0-9-]+).html index.php?action=profile&uid=$1 [L]
RewriteRule ^([_A-Za-z0-9-]+).html index.php?action=$1 [L]
bu da functions.php
<?php
// Get user ip
function getip() {
if (getenv('HTTP_CLIENT_IP')) {
$ip = getenv('HTTP_CLIENT_IP');
}
elseif (getenv('HTTP_X_FORWARDED_FOR')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
}
elseif (getenv('HTTP_X_FORWARDED')) {
$ip = getenv('HTTP_X_FORWARDED');
}
elseif (getenv('HTTP_FORWARDED_FOR')) {
$ip = getenv('HTTP_FORWARDED_FOR');
}
elseif (getenv('HTTP_FORWARDED')) {
$ip = getenv('HTTP_FORWARDED');
}
else {
$ip = $_SERVER['REMOTE_ADDR'];
}
return $ip;
}
function fileurl($fileid,$filetitle) {
global $siteurl, $sefriendly;
if ($sefriendly == '1') {
$filetitle = str_replace(" ","-",$filetitle);
$filetitle = str_replace("'","_",$filetitle);
$filetitle = str_replace("ä","a",$filetitle);
$filetitle = str_replace("ö","o",$filetitle);
$filetitle = str_replace("ü","y",$filetitle);
$fileurl = $siteurl."/game/".$fileid."/".$filetitle.".html";
} else {
$fileurl = $siteurl."/index.php?action=file&fileid=".$fileid;
}
return $fileurl;
}
function categoryurl($categoryid,$categoryname) {
global $siteurl, $sefriendly;
if ($sefriendly == '1') {
$categoryname = str_replace(" ","-",$categoryname);
$categoryname = str_replace("'","_",$categoryname);
$categoryname = str_replace("ä","a",$categoryname);
$categoryname = str_replace("ö","o",$categoryname);
$categoryname = str_replace("ü","y",$categoryname);
$categoryurl = $siteurl."/category/".$categoryid."/".$categoryname;
} else {
$categoryurl = $siteurl."/index.php?action=browse&cid=".$categoryid;
}
return $categoryurl;
}
function profileurl($userid,$username) {
global $siteurl, $sefriendly;
if ($sefriendly == '1') {
$username = str_replace(" ","-",$username);
$username = str_replace("'","_",$username);
$username = str_replace("ä","a",$username);
$username = str_replace("ö","o",$username);
$username = str_replace("ü","y",$username);
$profileurl = $siteurl."/profile/".$userid."/".$username.".html";
} else {
$profileurl = $siteurl."/index.php?action=profile&uid=".$userid;
}
return $profileurl;
}
//Display categories
function displaycategories($userStatus) {
if ($userStatus == '1') {
$result = mysql_query("SELECT name, catid FROM categories WHERE status = '1' ORDER BY catorder, name");
} else {
$result = mysql_query("SELECT name, catid FROM categories WHERE status = '1' && permissions = '1' ORDER BY catorder, name");
}
if (mysql_num_rows($result)) {
while($row = mysql_fetch_array($result)) {
$categoryname = $row['name'];
$categoryid = $row['catid'];
?>
- <a href="<?php echo categoryurl($categoryid,$categoryname); ?>" target="_self"><?php echo $categoryname; ?></a><br />
<?php
}
}
}
// Display files and categories on index page
function displaygamesindex($userStatus) {
global $siteurl, $maxindexpage, $sefriendly;
$cell = "1";
// Get categories
if ($userStatus == '1') {
$result = mysql_query("SELECT * FROM categories WHERE status = '1' ORDER BY catorder, name");
} else {
$result = mysql_query("SELECT * FROM categories WHERE status = '1' && permissions = '1' ORDER BY catorder, name");
}
if (mysql_num_rows($result)) {
while($row = mysql_fetch_array($result)) {
$categoryname = $row['name'];
$categoryid = $row['catid'];
// Get files in this category
$result2 = mysql_query("SELECT title, icon, iconlocation, fileid, description, timesplayed FROM files WHERE category = '$categoryid' && status = '1' ORDER BY fileid DESC LIMIT $maxindexpage");
if ($cell == '1') {
?>
<tr>
<td width="50%" valign="top">
<div class="gamesbox">
<div class="gamesboxheader">
<?php echo $categoryname; ?>
</div>
<div class="boxestext">
<table class="boxestext" border="0" width="100%">
<?php
if (mysql_num_rows($result2)) {
while($file = mysql_fetch_array($result2)) {
$filetitle = $file['title'];
$fileicon = $file['icon'];
$iconlocation = $file['iconlocation'];
$fileid = $file['fileid'];
$timesplayed = number_format($file['timesplayed']);
if ($iconlocation == '1') {
$imageurl = $siteurl."/files/image/".$fileicon;
} else {
$imageurl = $fileicon;
}
$filedescription = $file['description'];
if (strlen($filedescription) > '80') {
$filedescription = substr("$filedescription",0,77)."...";
}
?>
<tr>
<td width="71" valign="top">
<a href="<?php echo fileurl($fileid,$filetitle); ?>" target="_self"><img src="<?php echo $imageurl; ?>" width="70" height="59" title="<?php echo $filetitle; ?>" alt="<?php echo $filetitle; ?>" border="0"></a>
</td>
<td valign="top">
<a href="<?php echo fileurl($fileid,$filetitle); ?>" target="_self" class="gamelink"><?php echo $filetitle; ?></a><br />
<?php echo $filedescription; ?><br />
<span class="played">(<?php echo $timesplayed; ?> defa oynandi)</span>
</td>
</tr>
<?php
}
}
?>
<tr>
<td colspan="2" align="right">
<a href="<?php echo categoryurl($categoryid,$categoryname); ?>" target="_self">Hepsi ></a>
</td>
</tr>
</table>
</div>
</div>
</td>
<?php
$cell = "2";
} elseif ($cell == '2') {
?>
<td width="50%" valign="top">
<div class="gamesbox2">
<div class="gamesboxheader">
<?php echo $categoryname; ?>
</div>
<div class="boxestext">
<table class="boxestext" border="0" width="100%">
<?php
if (mysql_num_rows($result2)) {
while($file = mysql_fetch_array($result2)) {
$filetitle = $file['title'];
$fileicon = $file['icon'];
$iconlocation = $file['iconlocation'];
$fileid = $file['fileid'];
$timesplayed = number_format($file['timesplayed']);
if ($iconlocation == '1') {
$imageurl = $siteurl."/files/image/".$fileicon;
} else {
$imageurl = $fileicon;
}
$filedescription = $file[description];
if (strlen($filedescription) > '80') {
$filedescription = substr("$filedescription",0,77)."...";
}
?>
<tr>
<td width="71" valign="top">
<a href="<?php echo fileurl($fileid,$filetitle); ?>" target="_self"><img src="<?php echo $imageurl; ?>" width="70" height="59" title="<?php echo $filetitle; ?>" alt="<?php echo $filetitle; ?>" border="0"></a>
</td>
<td valign="top">
<a href="<?php echo fileurl($fileid,$filetitle); ?>" target="_self" class="gamelink"><?php echo $filetitle; ?></a><br />
<?php echo $filedescription; ?><br />
<span class="played">(<?php echo $timesplayed; ?> defa oynandi)</span>
</td>
</tr>
<?php
}
}
?>
<tr>
<td colspan="2" align="right">
<a href="<?php echo categoryurl($categoryid,$categoryname); ?>" target="_self">Hepsi ></a>
</td>
</tr>
</table>
</div>
</div>
</td>
</tr>
<?php
$cell = "1";
}
}
if ($cell == '2') {
echo "<td></td></tr>";
}
}
}
//Display most popular files
function displaymostpopular() {
global $maxmostpopular;
$result = mysql_query("SELECT title, fileid, timesplayed FROM files WHERE status = '1' ORDER BY timesplayed DESC LIMIT $maxmostpopular");
if (mysql_num_rows($result)) {
while($row = mysql_fetch_array($result)) {
$mpfiletitle = $row['title'];
$mpfileid = $row['fileid'];
$mptimesplayed = number_format($row['timesplayed']);
?>
<a href = "<?php echo fileurl($mpfileid,$mpfiletitle); ?>" target="_self"><?php echo $mpfiletitle; ?></a> (<?php echo $mptimesplayed; ?> times)<br />
<?php
}
} else {
echo "Henüz Eklenmis Oyun Yok";
}
}
//Display newest files
function displaynewest() {
global $maxnewest;
$result = mysql_query("SELECT title, fileid, timesplayed FROM files WHERE status = '1' ORDER BY fileid DESC LIMIT $maxnewest");
if (mysql_num_rows($result)) {
while($row = mysql_fetch_array($result)) {
$nfiletitle = $row['title'];
$nfileid = $row['fileid'];
$ntimesplayed = number_format($row['timesplayed']);
?>
<a href = "<?php echo fileurl($nfileid,$nfiletitle); ?>"><?php echo $nfiletitle; ?></a> (<?php echo $ntimesplayed; ?> times)<br />
<?php
}
} else {
echo "Henüz Eklenmis Oyun Yok";
}
}
//Display top players
function displaytopplayers() {
global $maxtopplayers;
$top_result = mysql_query("SELECT * FROM users WHERE status = '1' ORDER BY played DESC LIMIT $maxtopplayers");
if (mysql_num_rows($top_result)) {
while($top_row = mysql_fetch_array($top_result)) {
$topuserName = $top_row['username'];
$topuserId = $top_row['userid'];
$topuserPlayed = number_format($top_row['played']);
?>
<a href = "<?php echo profileurl($topuserId,$topuserName); ?>" target="_self"><?php echo $topuserName; ?></a> (<?php echo $topuserPlayed; ?> defa)<br />
<?php
}
} else {
echo "Henüz Kayitli Üye Yok";
}
}
//Display top links
function displaytoplinks() {
global $maxlinks;
$result = mysql_query("SELECT * FROM links WHERE status = '1' ORDER BY hitsin DESC LIMIT $maxlinks");
if (mysql_num_rows($result)) {
while($row = mysql_fetch_array($result)) {
$linkName = htmlentities($row['name']);
$linkUrl = htmlentities($row['linkurl']);
?>
<a href = "<?php echo $linkUrl; ?>" target="_blank"><?php echo $linkName; ?></a><br />
<?php
}
} else {
echo "Henüz Eklenmis Link Yok";
}
}
// BB Code
function bbcode($text) {
global $siteurl;
$text = str_replace("[b]","<b>",$text);
$text = str_replace("[/b]","</b>",$text);
$text = str_replace("[u]","<u>",$text);
$text = str_replace("[/u]","</u>",$text);
$text = str_replace("[i]","<i>",$text);
$text = str_replace("[/i]","</i>",$text);
$text = str_replace("[s]","<s>",$text);
$text = str_replace("[/s]","</s>",$text);
$text = str_replace("[quote]","<div class=\"quote\">",$text);
$text = str_replace("[/quote]","</div>",$text);
$text = str_replace(":)","<img src=\"".$siteurl."/images/happy.gif\" title=\"Happy\">",$text);
$text = str_replace(":(","<img src=\"".$siteurl."/images/sad.gif\" title=\"Sad\">",$text);
$text = str_replace(";)","<img src=\"".$siteurl."/images/wink.gif\" title=\"Wink\">",$text);
$text = str_replace(":@:","<img src=\"".$siteurl."/images/@.gif\" title=\"@\">",$text);
$text = str_replace(":8","<img src=\"".$siteurl."/images/cool.gif\" title=\"Cool\">",$text);
$text = str_replace(":wave:","<img src=\"".$siteurl."/images/wave.gif\" title=\"Wave\">",$text);
$text = str_replace(":think:","<img src=\"".$siteurl."/images/think.gif\" title=\"Hmm...\">",$text);
$text = str_replace(":clap:","<img src=\"".$siteurl."/images/clap.gif\" title=\"Clap hands\">",$text);
return $text;
}
// Get the number of files in database
function totalfiles() {
$totalfiles_result = mysql_query("SELECT count(fileid) AS total_files FROM files WHERE status = '1'");
$gettotalfiles = mysql_fetch_array($totalfiles_result);
$totalfiles = $gettotalfiles['total_files'];
return number_format($totalfiles);
}
// Count total played
function totalplayed() {
$totalplayed_result = mysql_query("SELECT sum(timesplayed) AS total_played FROM files");
$gettotalplayed = mysql_fetch_array($totalplayed_result);
$totalplayed = $gettotalplayed['total_played'];
return number_format($totalplayed);
}
// Count # of members
function totalmembers() {
$totalmembers_result = mysql_query("SELECT count(userid) AS total_members FROM users WHERE status = '1'");
$gettotalmembers = mysql_fetch_array($totalmembers_result);
$totalmembers = $gettotalmembers['total_members'];
return number_format($totalmembers);
}
// Display news
function displaynews() {
global $maxnews;
$news_result = mysql_query("SELECT * FROM news ORDER BY newsid DESC LIMIT $maxnews");
$numbernews = mysql_num_rows($news_result);
if ($numbernews) {
$newsnumber = "1";
while($news_row = mysql_fetch_array($news_result)) {
$newsTitle = $news_row['title'];
$newsMessage = nl2br($news_row['message']);
$newsMessage = bbcode($newsMessage);
if ($numbernews > '1' && $newsnumber < $numbernews) {
echo "<div class=\"newsline\">";
} else {
echo "<div>";
}
echo "<b>".$newsTitle."</b><br />";
echo $newsMessage."<br />";
echo "</div>";
$newsnumber++;
}
} else {
echo "Henüz Haber Yok";
}
}
?>nerde hata var yardım ederseniz sevinirim