فرق نمی کنن
راستی نفهمیدم که چرا کدم به کار نمیاد
فقط برای mybb می خوای؟
Printable View
فرق نمی کنن
راستی نفهمیدم که چرا کدم به کار نمیاد
فقط برای mybb می خوای؟
از dogtag هم تشكر مي كنم بابت كد. خيلي ممنون
كد شما رو تو يه صفحه خالي پيست كردم كار كرد ولي تو صفحه من كار نمي كنه يعني اصلا نمي ذاره يه كد هم خارج بشه. نمي دونم بايد يه نگاهي بكنم شايد اشكال از صفحه من باشه ، حتما تداخلي داره!
نتونستم بفهمم مشكل از كجاست:
كد من
[PHP]
<?php
function imeiPageOptimizer($page)
{
$time=microtime();
$before=strlen($page);
$ret=$page;
//############STRIP COMMENTS############
$ptrn=array(
'#<!--(.*?)-->#ms'
,'#(<(script|style)[^>]*>)(.*?)(</\\2>)#sei'
,'#<imei>.*?</imei>#s'
);
$rep=array(
'<imei>\\1</imei>'
,"unadd('$1').preg_replace('#<imei>(.*?)</imei>#s','<!--\\\\1-->',unadd('$3')).unadd('$4')"
,""
);
$ret=preg_replace($ptrn,$rep,$ret);
//############STRIP SPACES###########
$ptrn=array(
'#(\n\r|\r\n|\n|\r)#'
,'#(<(pre|textarea|script)[^>]*>)(.*?)(</\\2>)#sie'
,'#<imei>#'
);
$rep=array(
'<imei>'
,"unadd('$1').preg_replace('#<imei>#','\n',unadd(' $3')).unadd('$4')"
,""
);
$ret=preg_replace($ptrn,$rep,$ret);
//############STRIP NEW LINES###########
//############STRIP SPACES###########
$ptrn=array(
'#(\e| |\t){2,}#ms'
,'#(<(pre|code|script)[^>]*>)(.*?)(</\\2>)#isme'
,'#<imei>.*?</imei>#ms'
);
$rep=array(
'<imei>\\0</imei>'
,"unadd('$1').preg_replace('#<imei>(.*?)</imei>#','\\\\1',unadd('$3')).unadd('$4')"
,' '
);
$ret=preg_replace($ptrn,$rep,$ret);
$time= microtime()-$time ;
$after=strlen($ret);
$report="<!-- optimization: ".round(100- $after*100/$before,2)."% by imeiPageOptimize in $time Seconds -->";
return $ret.$report;
}
ob_start("imeiPageOptimizer");
?>
<?
//site name:
$site = "2";
// include configuration and language slection for all farabit.com pages
include("config.inc.php");
// meta tags & costantine links for all pages
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1. Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<meta name='Keywords' content='".$mkeyword."' />
<meta name='Description' content='".$mDescription."' />
<meta name='Author' content='".$mAuthor."' />
<meta name='Subject' content='".$msubject."' />
<meta name='Copyright' content='".$mcopyright."' />
<meta name='GOOGLEBOT' content='INDEX,FOLLOW' />
<meta name='Rating' content='general' />
<meta name='Classification' content='".$mClassification."' />
<meta http-equiv='Content-Type' content='text/html; ".$charset."' />
<link rel=\"shortcut icon\" type=\"image/ico\" href=\"images/icon.ico\" />
<link rel=\"alternate\" type=\"application/rss+xml\" href=\"sitemap.xml\" />";
// check if the config.inc.php file is writeable
if ($warning_system == 'true') {
if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/config.inc.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/config.inc.php')) ) {
echo "<div id='top_warning'><span><img src='images/padlock-open.gif'/><b> ".$warning.": </b></span>".$config_writable_warning."</div>";
}
}
//banners
include ROOT."inc/banners.php";
//set header urls
if ($language == "" and $page == "" and $theme == "" and $subid == "" and $ajax == "" and $website == "")
{
header ("location: ?lng=fa&pid=main&ajax=false");
}
if ($language != "" and $page == "" and $ajax == "")
{
header ("location: ?lng=$language&pid=main&ajax=false");
}
if ($language == "" and $page != "" and $subid != "" and $ajax != "" and $website != "")
{
header ("location: ?lng=fa&pid=$page&sid=$subid&ajax=$ajax&site=$webs ite");
}
if ($page != "" and $language == "")
{
header ("location: ?lng=fa&pid=$page&ajax=$ajax&site=$website&speriod =$statperiod");
}
if ($ajax == "" and $language != "" and $page != "")
{
header ("location: ?lng=$language&pid=$page&sid=$subid&ajax=false&sit e=$website&speriod=$statperiod");
}
if ($page == "main")
{
include ROOT."main.php";
}
if ($page == "acc")
{
include ROOT."accessory.php";
}
if ($page == "info")
{
include ROOT."accessory.php";
}
if ($page == "conews")
{
include ROOT."accessory.php";
}
// if dont javascript support
include ROOT."inc/noScript.php";
?>
<!-- xxxxxx . uncompressed/chunked - <?php echo "date: ".$miladi." time: ".$time;?>-->
<?php ob_end_flush();
?>
[/PHP]
به نظر که هیچ مشکلی نمیاد
تست خواهم کرد
گفتيد تست مي كنم ؟!
اين كد تو يه جاهايي مشكل داره!
مي توني با يك صفحه پر از html و جاوااسكريپت و استايل تست كني. من كه تست كردم تو خروجي نمي ذاري حتي يه كد هم بيرون بياد.
باور کن وقت ندارم
شرمنده
ولی جداً مشکلی نیست