[آموزش] تبدیل قالب 8.3 به 8.2

سئوالات متداول نسخه 8.2
نمایه کاربر
Ehsan_Pc
کاربر خیلی فعال
پست: 2052
تاریخ عضویت: یک‌شنبه ۲۸ شهریور ۱۳۸۹, ۱۲:۰۰ ق.ظ
تشکر کرده: 1 دفعه
تشکر شده: 818 دفعه
تماس:

[آموزش] تبدیل قالب 8.3 به 8.2

پست توسط Ehsan_Pc »

سلام خدمت دوستان عزیز
طی درخواست های دوستان آموزشی رو برای تبدیل قالب 8.3 به 8.2 نوشتم که دوستان میتونن بر اساس همین آموزش قالب های 8.3 رو به 8.2 تبدیل کنن

خب برای شروع اول فانکشن های دید که اضافه شده به 8.3 باید از theme.php حذف بشه

کدهای زیر رو از قالب حذف کنید


کد: انتخاب همه


function themeindex2($aid, $informant, $datetime, $title, $counter, $topic, $hometext, $notes, $topicname, $topicimage, $topictext, $comments, $score, $ratings, $sid, $productLink, $itempost, $itemcd, $itemprice)
{
	global $ShowTopic,$tipath,$RateUnitWidth;
	$ThemeSel = get_theme();
	theme_lang();
	if(file_exists("themes/$ThemeSel/images/topics/$topicimage")){
		$t_image = "themes/$ThemeSel/images/topics/$topicimage";
	}else{
		$t_image = "$tipath$topicimage";
	}
	if($score != 0){
		$rated = round($score / $ratings);
	}else{
		$rated = 0;
	}
	if($comments==0){
		$comments = ""._NOCOMMENTS."";
	}else{
		$comments = "$comments "._COMMENTS."";
	}
	if($ShowTopic == 1){
		$content = "<img align=\"right\" src=\"$t_image\"/>".$hometext."";
	}else{
		$content = "".$hometext."";
	}
	
?>
<div class="OpenHeadRight"></div>
<div class="OpenHeadLeft"></div>
<div class="OpenHeadMain"></div>
<div class="OpenBorderRight">
  <div class="OpenBorderLeft">
    <div class="OpenContent">
	 <?=$title?>
	 <table background="files/Products/<?=$sid?>.jpg" border="0" style="padding-bottom: 5px; background-position: center top;" align="center" width="100%">
	   <tr>
		<td height="200" valign="bottom" align="center"><div style="background-color: #cccccc;opacity:0.8;filter:alpha(opacity=80); color: #000000;">
		    <?=_NUMBER?>
		    :
		    <?=$itemcd ?>
		    <br>
		    <?=_PRICE?>
		    :
		    <?=$itemprice ?>
		  </div></td>
	   </tr>
	 </table>
	 <div align="center"><a href="<?=$itempost?>"><img src="themes/<?=$ThemeSel?>/images/buy.png" width="70" height="24" border="0"></a>&nbsp;&nbsp;<a href="<?=$productLink?>"><img src="themes/<?=$ThemeSel?>/images/more.png" width="70" height="24" border="0"></a><a href="<?=good_link($sid);?>"><img src="themes/<?=$ThemeSel?>/images/cart.png" width="150" height="38" border="0"></a></div>
    </div>
  </div>
</div>
<div class="OpenFootRight"></div>
<div class="OpenFootLeft"></div>
<div class="OpenFootMain"></div>
<?php
}


function themeindex3($title, $counter, $score, $ratings,$sid,$newsLink,$itempost,$itemcd,$itemprice)
{
	global $ShowTopic,$tipath,$RateUnitWidth,$cookie;
	$ThemeSel = get_theme();
	theme_lang();
	if($score != 0)
	{
		$rated = round($score / $ratings);
	}else
	{
		$rated = 0;
	}
?>
<div class="OpenHeadRight"></div>
<div class="OpenHeadLeft"></div>
<div class="OpenHeadMain"></div>
<div class="OpenBorderRight">
  <div class="OpenBorderLeft">
    <div class="OpenContent">
	 <table background="files/Products/<?=$sid?>.jpg" border="0" style="padding-bottom: 5px; background-position: center top;" align="center" width="100%">
	   <tr>
		<td height="200" valign="bottom" align="center"><div style="background-color: #cccccc;opacity:0.8;filter:alpha(opacity=80); color: #000000;">
		    <?=_NUMBER?>
		    :
		    <?=$itemcd ?>
		    <br>
		    <?=_PRICE?>
		    :
		    <?=$itemprice ?>
		  </div></td>
	   </tr>
	 </table>
	 <div align="center"><a href="<?=$itempost?>"><img src="themes/<?=$ThemeSel?>/images/buy.png" width="75" height="24" border="0"></a>&nbsp;&nbsp;<a href="<?=$newsLink?>"><img src="themes/<?=$ThemeSel?>/images/more.png" width="75" height="24" border="0"></a><br/>
	   <a href="<?=good_link($sid);?>"><img src="themes/<?=$ThemeSel?>/images/cart.png" width="150" height="38" border="0"></a></div>
	 <div class="Clear"></div>
	 <div style="float:right;margin-right:10px">
	   <?=rating_load2($sid)?>
	 </div>
	 <div style="float:right;margin-right:10px">
	   <?=_VISIT?>
	   :
	   <?=$counter?>
	   <?=_TIMES?>
	 </div>
	 <div class="Clear"></div>
    </div>
  </div>
</div>
<div class="OpenFootRight"></div>
<div class="OpenFootLeft"></div>
<div class="OpenFootMain"></div>
<?php
}




کد: انتخاب همه



function themeproduct($aid, $informant, $datetime, $title, $bodytext, $hometext, $topic, $topicname, $topicimage, $topictext, $printpage,$itempost,$itemcd,$itemprice,$sidd, $notes){
	global $admin, $sid, $tipath;
	$ThemeSel = get_theme();
	theme_lang();
	if(file_exists("themes/$ThemeSel/images/topics/$topicimage")){
	$t_image = "themes/$ThemeSel/images/topics/$topicimage";
	}else{
	$t_image = "$tipath$topicimage";
	}
	$posted = ""._POSTEDON." $datetime "._BY." "; 
	$posted .= get_author($aid);
	$posted .= "&nbsp;&nbsp;<a href=\"$printpage\" target=\"_blank\"><img border=\"0\" src=\"images/print.gif\" width=\"16\" height=\"16\" alt=\""._PRINT."\"></a>";
	$notes = str_replace(" ","_",$notes);
	$notes = explode(":",$notes);
	foreach($notes as $tag){
		$tags .= "<i><a href=\"modules.php?name=Products&file=tags&tags=$tag\">".str_replace("_"," ",$tag)."</a></i> ";
	}
?>
<div class="News">
  <div class="NewsTitle">
    <div class="NewsRating">
	 <?=rating_load($sid)?>
    </div>
    <div>
	 <h2 class="NewsTitleText"><a href="<?=newslink($sid);?>" rel="bookmark" title="<?=$title?>">
	   <?=$title?>
	   </a></h2>
    </div>
  </div>
  <div class="NewsBody">
    <div class="NewsBodyText">
	 <div align="center"><img src="files/Products/<?=$sidd ?>.jpg" border="0" onLoad="SMR_resize(this);"></div>
	 <br>
	 <?=$hometext?>
	 <br />
	 <br />
	 <?=$bodytext?>
	 <br />
	 <br />
	 <?=$tags?>
	 <br>
	 <br>
	 <span dir="rtl">
	 <p dir="rtl" align="center"><font color="#000000" face="tahoma" size="2"><img src="themes/<?=$ThemeSel?>/images/cd.gif" alt="" vspace="1" width="16" height="16"><font size="3"><sup>
	   <?=_NUMBER?>
	   :
	   <?=$itemcd ?>
	   <font size="2"></font></sup></font><br>
	   <img src="themes/<?=$ThemeSel?>/images/money.gif" alt="" vspace="1" width="16" height="16"><font size="4"><sup><sub>
	   <?=_PRICE?>
	   :
	   <?=$itemprice ?>
	   </sub></sup></font><br>
	   <a href="<?=$itempost ?>"><font size="3"><sup><img src="themes/<?=$ThemeSel?>/images/buy.png" border="0"></sup></font></a><br>
	   <a href="modules.php?name=cart&op=addgood&gdn=<?=$sidd?>"><font size="3"><sup><img src="themes/<?=$ThemeSel?>/images/cart2.png" border="0"></sup></font></a></font></p>
	 </span></div>
  </div>
  <div class="NewsFoot">
    <div class="NewsFootText">
	 <?=$posted?>
    </div>
  </div>
</div>
<br />
<?php
}


function contentindex($pid, $myauthor, $mytitle, $mysubtitle, $mypage_header2, $date, $mycounter)
{
	$ThemeSel = get_theme();
	theme_lang();
?>
<div class="OpenHeadRight"></div>
<div class="OpenHeadLeft"></div>
<div class="OpenHeadMain"></div>
<div class="OpenBorderRight">
  <div class="OpenBorderLeft">
    <div class="OpenContent"><a href="modules.php?name=Content&file=content&pid=<?=$pid?>"><b>
	 <?=$mytitle?>
	 </b></a>
	 <p><b>
	   <?=$mysubtitle?>
	   </b></p>
	 <p>
	   <?=$mypage_header2?>
	 </p>
	 <div class="Rank">
	   <?=rating_load3($pid)?>
	 </div>
	 <div class="Date"><? echo""._PUBLISHEDON.": ".nuketimes($date)." ($mycounter "._READS.")"; ?></div>
	 <div class="Date"><? echo""._AUTHOR.""; ?>:
	   <?=$myauthor?>
	 </div>
	 <a class="MoreNews" href="modules.php?name=Content&file=content&pid=<?=$pid?>" rel="bookmark" title="<?=$title?>">
	 <?=_MORE?>
	 </a>
	 <div class="Clear"></div>
    </div>
  </div>
</div>
<div class="OpenFootRight"></div>
<div class="OpenFootLeft"></div>
<div class="OpenFootMain"></div>
<?php
}


function contentfull($pid, $myauthor, $mytitle, $mysubtitle, $mypage_header2, $pageof, $contentpages, $mysignature, $date, $mypage_footer, $mycounter, $report, $total_rows, $entries_per_page, $current_page, $link_to)
{
	global $align;
	$ThemeSel = get_theme();
	theme_lang();
	$mysignature = str_replace(" ","_",$mysignature);
	$mysignature = explode(":", $mysignature);
	foreach($mysignature as $tag){	 
		$mysignature1 .= "<i><a href=\"modules.php?name=Content&file=tags&op=tags&tag=$tag\">".str_replace("_"," ",$tag)."</a></i>";
	}

?>
<div class="News">
  <div class="NewsTitle">
    <div class="NewsRating">
	 <?=rating_load3($pid)?>
    </div>
    <div>
	 <h2 class="NewsTitleText"><a href="<?=$newsLink?>" rel="bookmark" title="<?=$mytitle?>">
	   <?=$mytitle?>
	   </a></h2>
    </div>
  </div>
  <div class="NewsBody">
    <div class="NewsBodyText">
	 <p><b>
	   <?=$mysubtitle?>
	   </b></p>
	 <br />
	 <p>
	   <?=$mypage_header2?>
	 </p>
	 <br />
	 <p>
	   <?=$contentpages?>
	 </p>
	 <br />
	 <p>
	   <?=$mypage_footer?>
	 </p>
	 <p align="center">
	 <div id="pagination" class="pagination">
	   <?php clean_pagination($total_rows, $entries_per_page, $current_page, $link_to);?>
	 </div>
	 </p>
	 <p align="<?=$align?>">
	   <?=$mysignature1?>
	 </p>
    </div>
  </div>
  <div class="NewsFoot">
    <div class="NewsFootText">
	 <div class="Aid"><? echo""._PUBLISHEDON.": ".nuketimes($date).""; ?></div>
	 <div class="Aid">
	   <?=_AUTHOR?>
	   :
	   <?=$myauthor?>
	 </div>
	 <div class="Aid">
	   <?=$report?>
	 </div>
	 <div class="Aid"><? echo"($mycounter "._READS.")";?></div>
    </div>
  </div>
</div>
<br />
<?php
}

function comments_show($tid, $deact, $fileds, $score, $c_name, $datetime, $journal, $u_website, $u_ip, $karma, $avaimage, $comment, $pagevar, $pagefiled, $parent, $admin_delete_op, $admin_edit_op, $comcode, $parentid, $classstyle, $classtyp, $subcomrow, $Req_URI){
	global $align, $userinfo, $admin, $user, $anonpost, $admin_file;
	$ThemeSel = get_theme();
	theme_lang();
	echo "
	<style>
		.comment_class1 {border:1px solid #CCCCCC;background-color:#C6DEFF;margin:5px 2px 0 2px;}
		.comment_class2 {border:1px solid #CCCCCC;background-color:#CFECEC;margin:5px 2px 0 2px;}
	</style>
	<a name=\"$tid\"></a>
	<table width=\"99%\" border=\"0\" class=\"$classstyle\">
		<tr>
			<td width=\"100%\">
				$deact
				$fileds";
				echo"<br>"._ON." $datetime";
				if ($c_name != "Anonymous") {
					$r_uid = intval($userinfo['user_id']);
					echo ""._BY." <br>(<a href=\"modules.php?name=Your_Account&op=userinfo&username=$c_name\">"._USERINFO." $c_name</a> ";
					echo "| <a href=\"Forum/ucp.php?i=pm&mode=compose&u=$r_uid\">"._SENDAMSG."</a>";
					echo "$journal) ";
				}
				echo "<a href=\"$u_website\" target=\"_blank\">$u_website</a> <b>("._IP_ADDRESS." : $u_ip)</b> $karma";
				echo"
			</td>
		</tr>
		<tr>
			<td>
				<table border='0' width='100%'>
					<tr>
						<td dir='$align' width='80' height='80'><img width='80' height='80' src = '$avaimage' border = '0'></td>
						<td dir='$align'>$comment</td>
					</tr>";
					if($subcomrow > 0){
					echo"
					<tr>
						<td colspan=\"2\"><b>"._REPLYS."</b><br /><br />";
						display_comments($tid, $classtyp);
						echo"</td>
					</tr>";
					}
				echo"</table>";
				if ($anonpost==1 OR is_admin($admin) OR is_user($user)) {
					echo "
						<script>
							function replay_to(tid){
								document.getElementById(\"replayto\").innerHTML=\"<td><b>"._REPLY."</b></td><td><input type='text' value='"._REPLY." "._TO." \"+tid+\"' disabled /><input type='hidden' name='replay' value='\"+tid+\"'></td>\";		
							}
						</script>
						<a href=\"$Req_URI#commenteditor\"><span onclick=\"replay_to('$tid');\" style=\"cursor:pointer;\">"._REPLY."</span></a>";
				}
				if(is_admin($admin)) {
					echo " | <a href=\"".$admin_file.".php?op=".$admin_delete_op."&tid=$tid&".$pagefiled."=".$pagevar."&ok=1\" onclick=\"return confirm('"._SURETODELCOMMENTS."')\">"._DELETE."</a> | <a href=\"".$admin_file.".php?op=".$admin_edit_op."&tid=$tid\">"._EDIT."</a><br><br>";
				} elseif ($anonpost != 0 OR is_admin($admin) OR is_user($user)) {
					echo " ]<br><br>";
				}
			echo"
			</td>
		</tr>
	</table>";
}

بعد از حذف این فانکنشن ها




بعدش این کد رو


کد: انتخاب همه

function OpenTable()
{
	$ThemeSel = get_theme();
	theme_lang();
	?>
<div class="OpenHeadRight"></div>
<div class="OpenHeadLeft"></div>
<div class="OpenHeadMain"></div>
<div class="OpenBorderRight">
  <div class="OpenBorderLeft">
    <div class="OpenContent">
	 <?php
}

function CloseTable()
{
	$ThemeSel = get_theme();
	theme_lang();
?>
    </div>
  </div>
</div>
<div class="OpenFootRight"></div>
<div class="OpenFootLeft"></div>
<div class="OpenFootMain"></div>
<?php
}

function OpenTable2()
{
	$ThemeSel = get_theme();
	theme_lang();
		?>
<div class="OpenHeadRight"></div>
<div class="OpenHeadLeft"></div>
<div class="OpenHeadMain"></div>
<div class="OpenBorderRight">
  <div class="OpenBorderLeft">
    <div class="OpenContent">
	 <?php
}

function CloseTable2()
{
	$ThemeSel = get_theme();
	theme_lang();
	?>
    </div>
  </div>
</div>
<div class="OpenFootRight"></div>
<div class="OpenFootLeft"></div>
<div class="OpenFootMain"></div>
<?php
}



رو این قسمت هاش رو حذف میکنید


کد: انتخاب همه


	$ThemeSel = get_theme();
	theme_lang();



بعدش این قمست رو


کد: انتخاب همه

function head(){
		global $slogan, $name, $sitename, $banners, $nukeurl, $Version_Num, $ab_config, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle, $pagetags, $align, $anonymous , $preloader;
		$ThemeSel = get_theme();
		echo $adminpage;
		theme_lang();
		echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
		echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
		echo "<head>\n";
		echo"<title>$sitename $pagetitle</title>\n";
		@include("includes/meta.php");
		if (file_exists("themes/$ThemeSel/images/favicon.ico")) {
			echo "<link rel=\"shortcut icon\" href=\"themes/$ThemeSel/images/favicon.ico\" type=\"image/x-icon\" />\n";
		}
		@include("includes/javascript.php");



تبدیل میکنید به

کد: انتخاب همه


function head(){
		global $slogan,$name, $sitename, $banners, $nukeurl, $Version_Num, $ab_config, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle, $pagetags;
		$ThemeSel = get_theme();
		@include_once("themes/$ThemeSel/theme.php");
		echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
		echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
		echo "<head>\n";
		if($name != "Forums")
		{
			echo "<title>$sitename $pagetitle</title>\n";
		}
		if($pagetags !="")
		{
			echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset="._CHARSET."\" />\n";
			echo "<meta http-equiv=\"EXPIRES\" content=\"0\" />\n";
			echo "<meta name=\"RESOURCE-TYPE\" content=\"DOCUMENT\" />\n";
			echo "<meta name=\"DISTRIBUTION\" content=\"GLOBAL\" />\n";
			echo "<meta name=\"AUTHOR\" content=\"".addslashes($sitename)."\" />\n";
			echo "<meta name=\"COPYRIGHT\" content=\"Copyright (c) by ".addslashes($sitename)."\" />\n";
			echo "<meta name=\"KEYWORDS\" content=\"".addslashes($pagetags)."\" />\n";
			echo "<meta name=\"DESCRIPTION\" content=\"".addslashes($slogan)."\" />\n";
			echo "<meta name=\"ROBOTS\" content=\"INDEX, FOLLOW\" />\n";
			echo "<meta name=\"REVISIT-AFTER\" content=\"1 DAYS\" />\n";
			echo "<meta name=\"RATING\" content=\"GENERAL\" />\n";
		}else
		{
			if($username == $anonymous){include("includes/meta.php");}}
			@include("includes/javascript.php");
			if (file_exists("themes/$ThemeSel/images/favicon.ico")) {
				echo "<link rel=\"shortcut icon\" href=\"themes/$ThemeSel/images/favicon.ico\" type=\"image/x-icon\" />\n";
			}
			 echo "</script>\n";
			 echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"backend.php\" />\n";


و این قسمت رو


کد: انتخاب همه



		echo "</head>\n";
	if($preloader == 1){

		echo "<div id=\"waitDiv\" onclick=\"this.style.visibility='hidden'\" style=\"text-align:center; line-height:17px; position:fixed; z-index:1000; width:100%; height:100%; background-color:#000; color:#fff; font-size:11px; margin:0px auto;\"><div style=\"position:fixed; margin:0px auto; \" id=\"loadingimage\" ><img src=\"images/loader.gif\" /></div></div>";
		echo "<script>showWaitm('waitDiv', 1);</script>\n";
		echo "</div>\n";
	}
		$u_agent = $_SERVER['HTTP_USER_AGENT'];

		themeheader();
	}





کد: انتخاب همه

			 echo "<script  src=\"includes/preloader.js\" type=\"text/javascript\"></script>\n";
			if (file_exists("includes/custom_files/custom_head.php"))
			{
				@include_once("includes/custom_files/custom_head.php");
			}
			if($ab_config['site_switch'] == 1)
			{
				echo "<center><img src='images/nukesentinel/disabled.png' border='0' width='120' height='34'></center><br />\n";
			}
		echo "</head>\n";
		echo "<DIV id=\"waitDiv\" style=\"VISIBILITY: hidden; direction:rtl; text-align:center; line-height:17px; position:fixed; z-index:0; float:right; top:0; right:0; width:100px; height:20px; background-color:#CC0000; color:#fff; font-size:11px;\">در حال بارگذاري...</DIV>";
			 echo "<SCRIPT>showWaitm('waitDiv', 1);</SCRIPT>\n";
			 echo "</DIV>\n";
		$u_agent = $_SERVER['HTTP_USER_AGENT'];
	   if(preg_match('/MSIE/i',$u_agent))
	   {
		echo "<script type=\"text/javascript\">document.getElementById('waitDiv').style.position='absolute';</script>\n";
	   }
		themeheader();
	}





و این قمست رو


کد: انتخاب همه

function themeheader()
{
	global $db, $prefix,$user,$cookie,$name,$datetype,$hijri, $align ,$sitename ,$nukeurl ,$HeaderImage;
	$ThemeSel = get_theme();
	$username = $cookie[1];
	theme_lang();
    $query = $db->sql_query("SELECT name FROM ".$prefix."_users WHERE username='$username'");
    $row = $db->sql_fetchrow($query);
    $real_name = mysql_escape_string($row['name']);
	$dateTime = time();
	$dateTime = nuketimes($dateTime);
	$now = date("H:i");
	if(($datetype == 1) OR ($datetype == 2)){
	$time = "<span id=\"timeofnuke\"></span> $dateTime";
	}else{
	$time = "<span dir=\"ltr\"><span id=\"timeofnuke\"></span> $dateTime</span>";
	}
	if($row = $db->sql_fetchrow($db->sql_query("SELECT * from ".$prefix."_nukesql")))
	{
	?>





تبدیل میکنید به



کد: انتخاب همه




function themeheader()
{
	global $db, $prefix,$user,$cookie,$name,$TlinkTitle,$TlinkURL,$HeaderImage;
	$username = $cookie[1];
    $query = $db->sql_query("SELECT name FROM ".$prefix."_users WHERE username='$username'");
    $row = $db->sql_fetchrow($query);
    $real_name = mysql_escape_string($row['name']);
	$dateTime = date("Y-m-d");
	$dateTime = FormalDate2Hejri1($dateTime);
	$now = date("H:i");
	$week = date("N");
	switch($week)
	{
		case "1":
			$weekname = "دوشنبه";
			break;
		case "2":
			$weekname = "سه شنبه";
			break;
		case "3":
			$weekname = "چهارشنبه";
			break;
		case "4":
			$weekname = "پنج شنبه";
			break;
		case "5":
			$weekname = "جمعه";
			break;
		case "6":
			$weekname = "شنبه";
			break;
		case "7":
			$weekname = "يكشنبه";
			break;
	}
	$time = "$now $weekname  $dateTime";
	if($_COOKIE['HeaderShow'])
	{
		if($_COOKIE['HeaderShow'] == 'hidden')
		{
			$ArrowClass = "DOWN";
			$HeaderStyle = " style=\"display:none;\"";
		}
		else
		{
			$ArrowClass = "UP";
			$HeaderStyle = "";
		}
	}
	else
	{
		$ArrowClass = "UP";
	}
	if($row = $db->sql_fetchrow($db->sql_query("SELECT * from ".$prefix."_nukesql")))
	{
	?>


خب بعد از این قسمت

این قسمت ها رو حذف میکنید


کد: انتخاب همه

$ThemeSel = get_theme();
	theme_lang();
	$result = $db->sql_query("SELECT * FROM ".$prefix."_blocks_sides WHERE sideid='$themetype'");
	$row = $db->sql_fetchrow($result);
	$sidename = filter($row['sidename'], "nohtml");
	if($sidename == ""){



کد: انتخاب همه


	
	}else{
		include("themes/$ThemeSel/blocks/block-$sidename.html");
	}


کد: انتخاب همه

$ThemeSel = get_theme();
theme_lang();
$result = $db->sql_query("SELECT * FROM ".$prefix."_blocks_sides WHERE sideid='$themetype'");
$row = $db->sql_fetchrow($result);
$sidename = filter($row['sidename'], "nohtml");
if($sidename == ""){


کد: انتخاب همه



	}else{
		include("themes/$ThemeSel/blocks/block-$sidename.html");
	}


این کد رو

کد: انتخاب همه

    <div class="<?=$side?>Block">
	 <?php blocks(left); ?>
    </div>




تبدیل کنید به


کد: انتخاب همه

	   <? if ($name == "Forums") {} else { ?>
    
    <div class="<?=$side?>Block">
	 <?php blocks(left); ?>
    </div>
    
	 <? } ?>




خب تا اینجا تقریباً قالب نمایش پیدا کرده ولی هنوز مشکلاتی داره


اگه توجه کرده باشید تو نیوک 8.3 استایل زیبان فارسی با style-rtl.css مشخص میشه ، خب چس باید هر چی کد تو این فایل هست به یکی از css های دیگه انتقال بدیم یا style-rtl.css رو تو قالبمون تعریف کنیم

برای تعریف این قسمت تو قالب این کد رو

کد: انتخاب همه


		echo "<link rel=\"StyleSheet\" href=\"themes/$ThemeSel/style/style-rtl.css\" type=\"text/css\" />\n";



زیر این کد قرار میدیم


کد: انتخاب همه


		echo "<link rel=\"StyleSheet\" href=\"themes/$ThemeSel/style/nuketools.css\" type=\"text/css\" />\n";



خب تقریباً اکثر جاهای قالب نمایان شد فقط یه مشکل کوچیک وجود داره اونم اینه کلمات رو ما تو پوشه language و lang-farsi تعریف میکردیم حالا باید اون کلمات رو درست کینم

مثلاً <?=_HOME?> میشه صفحه اصلی


خب بعد از اینکه این قسمت رو هم درست کردیم



بعد این قسمت رو


کد: انتخاب همه

function themeindex($aid, $informant, $datetime, $title, $counter, $topics, $hometext, $notes, $r_options, $comments, $score, $ratings,$sid, $topic_link, $topictext_link, $topicname_link, $topicimage_link)
{
	global $ShowTopic,$tipath,$RateUnitWidth;
	$ThemeSel = get_theme();
	theme_lang();



تبدیل میکنید به

کد: انتخاب همه


function themeindex($aid, $informant, $datetime, $title, $counter, $topic, $hometext, $notes, $morelink, $topicname, $topicimage, $topictext, $commentlink, $comments, $score, $ratings,$sid,$newsLink)
{
	global $ShowTopic,$tipath,$RateUnitWidth;
	$ThemeSel = get_theme();


بعدش لینک مطالب رو درست میکنیم

یعنی ایم کد رو

<?=newslink($sid);?>

تبدیل میکنید

به


<?=$newsLink?>

بعد این کدو


کد: انتخاب همه


function themearticle($aid, $informant, $datetime, $title, $bodytext, $hometext, $topics, $topicname_link, $topicimage_link, $topictext_link, $printpage, $notes, $counter, $score, $ratings, $sid, $topic_link)
{
	global $admin, $tipath;
	$ThemeSel = get_theme();
	theme_lang();




تبدیل میکنید به



کد: انتخاب همه


function themearticle($aid, $informant, $datetime, $title, $bodytext, $hometext, $topics, $topicname_link, $topicimage_link, $topictext_link, $printpage, $notes, $counter, $score, $ratings, $sid, $topic_link)
{
	global $admin, $tipath;
	$ThemeSel = get_theme();
	theme_lang();




این کد رو هم حذف کنید


کد: انتخاب همه

	$notes = str_replace(" ","_",$notes);
	$notes = explode(":",$notes);
	foreach($notes as $tag){
		$tags .= "<i><a href=\"modules.php?name=News&file=tags&tags=$tag\">".str_replace("_"," ",$tag)."</a></i> ";
	}



این قسمت هم

کد: انتخاب همه

<?=$hometext?>
	   <br />
	   <br />
	   <?=$bodytext?>
	   <br />
	   <br />
	   <?=$tags?>
تبدیل شه به


کد: انتخاب همه

<?=$bodytext?>



خب کار theme.php تموم شد

حالا یه سری کدهای style رو تغییر میدیم تا جاهایی مثل امتیاز دهی درست بشه

استایلی که برای امتیاز دهی تعریف شده این قسمت هست (فایل nuketools.css)


کد: انتخاب همه


.unit-rating2 {
	list-style:none;
	width:125px;
	height:25px;
	position:relative;
	background:url(../images/starrating.gif) top left repeat-x;
	margin:0;
	padding:0;
}
.unit-rating2 li {
	float:right;
	margin:0;
	padding:0;
}
.unit-rating2 li a {
	outline:none;
	display:block;
	width:25px;
	height:25px;
	text-decoration:none;
	z-index:20;
	position:absolute;
	padding:0;
}
.unit-rating2 li a:hover {
	background:url(../images/starrating.gif) right center;
	z-index:2;
	right:0;
}
.unit-rating2 a.r1-unit2 {
	right:0;
}
.unit-rating2 a.r1-unit2:hover {
	width:25px;
}
.unit-rating2 a.r2-unit2 {
	right:25px;
}
.unit-rating2 a.r2-unit2:hover {
	width:50px;
}
.unit-rating2 a.r3-unit2 {
	right:50px;
}
.unit-rating2 a.r3-unit2:hover {
	width:75px;
}
.unit-rating2 a.r4-unit2 {
	right:75px;
}
.unit-rating2 a.r4-unit2:hover {
	width:100px;
}
.unit-rating2 a.r5-unit2 {
	right:100px;
}
.unit-rating2 a.r5-unit2:hover {
	width:125px;
}
.unit-rating2 li.current-rating2 {
	background:url(../images/starrating.gif) right bottom;
	position:absolute;
	height:25px;
	display:block;
	z-index:1;
}
.ratingblock {
	display:block;
}
.loading {
	height:25px;
	background:url(../images/working.gif) 50% 50% no-repeat;
}
.unit-rating {
	list-style:none;
	width:60px;
	height:15px;
	position:relative;
	padding-top: 5px;
}
.unit-rating li {
	float:right;
	margin:0;
	padding-right:5px;
}
.unit-rating li a {
	outline:none;
	display:block;
	width:15px;
	height:15px;
	text-decoration:none;
	z-index:20;
	position:absolute;
	padding:0;
	text-align:center;
}
.unit-rating a.r1-unit {
	right:0;
	background:url(../images/starrating2.png) right;
	background-repeat:no-repeat
}
.unit-rating a.r1-unit:hover {
	width:15px;
	background:url(../images/starrating3.png) right;
	background-repeat:no-repeat
}
.unit-rating a.r2-unit {
	right:22px;
}
.unit-rating a.r3-unit {
	right:50px;
	background:url(../images/starrating2.png) left;
	background-repeat:no-repeat
}
.unit-rating a.r3-unit:hover {
	width:15px;
	background:url(../images/starrating3.png) left;
	background-repeat:no-repeat
}
.unit-rating li.current-rating {
	background:url(../images/starrating2.png);
	position:absolute;
	height:15px;
	display:block;
	background-repeat:no-repeat;
}



که این کد رو تبدیل میکنید به


کد: انتخاب همه


.ratingblock{display:block;}
.loading{height:25px;background:url(../images/working.gif) 50% 50% no-repeat;}
.unit-rating{list-style:none;width:125px;height:25px;position:relative;background:url(../images/starrating.gif) top left repeat-x;margin:0;padding:0;}
.unit-rating li{float:right;margin:0;padding:0;}
.unit-rating li a{outline:none;display:block;width:25px;height:25px;text-decoration:none;z-index:20;position:absolute;padding:0;}
.unit-rating li a:hover{background:url(../images/starrating.gif) right center;z-index:2;right:0;}
.unit-rating a.r1-unit{right:0;}
.unit-rating a.r1-unit:hover{width:25px;}
.unit-rating a.r2-unit{right:25px;}
.unit-rating a.r2-unit:hover{width:50px;}
.unit-rating a.r3-unit{right:50px;}
.unit-rating a.r3-unit:hover{width:75px;}
.unit-rating a.r4-unit{right:75px;}
.unit-rating a.r4-unit:hover{width:100px;}
.unit-rating a.r5-unit{right:100px;}
.unit-rating a.r5-unit:hover{width:125px;}
.unit-rating li.current-rating{background:url(../images/starrating.gif) right bottom;position:absolute;height:25px;display:block;z-index:1;}



این یه روشی بود برای تبدیل امتیاز دهی که امتیاز دهی دیفال نیوک 8.2 رو قرار میداد ولی تو این قالب امتیاز دهی کوچیکتر شده پس باید یه روش دیگه رو انجام بدیم اون اینه که

فایل style.css (قالب دیفالت 8.3) رو باز میکنید این کد رو

کد: انتخاب همه

/* News Rank */

.NewsRank:hover {
	background-image:url(../images/newsrank.png);
	background-repeat:no-repeat;
	float:left;
	margin-top:23px;
	width:18px;
	height:15px;
	background-position:0 -19px;
}
.NewsRank:active {
	background-image:url(../images/newsrank.png);
	background-repeat:no-repeat;
	float:left;
	margin-top:23px;
	width:18px;
	height:15px;
	background-position:0 -38px;
}
.NewsRating .unit-rating2 {
	list-style:none;
	width:100px;
	height:25px;
	position:relative;
	background:url(../images/newsrank.png) top left repeat-x;
	margin:0;
	padding:0;
}
.NewsRating .unit-rating2 li {
	float:right;
	margin:0;
	padding:0;
}
.NewsRating .unit-rating2 li a {
	outline:none;
	display:block;
	width:20px;
	height:25px;
	text-decoration:none;
	z-index:20;
	position:absolute;
	padding:0;
}
.NewsRating .unit-rating2 li a:hover {
	background:url(../images/newsrank.png) right center;
	z-index:2;
	right:0;
}
.NewsRating .unit-rating2 a.r1-unit2 {
	right:0;
}
.NewsRating .unit-rating2 a.r1-unit2:hover {
	width:20px;
}
.NewsRating .unit-rating2 a.r2-unit2 {
	right:20px;
}
.NewsRating .unit-rating2 a.r2-unit2:hover {
	width:40px;
}
.NewsRating .unit-rating2 a.r3-unit2 {
	right:40x;
}
.NewsRating .unit-rating2 a.r3-unit2:hover {
	width:60px;
}
.NewsRating .unit-rating2 a.r4-unit2 {
	right:60px;
}
.NewsRating .unit-rating2 a.r4-unit2:hover {
	width:80px;
}
.NewsRating .unit-rating2 a.r5-unit2 {
	right:80px;
}
.NewsRating .unit-rating2 a.r5-unit2:hover {
	width:100px;
}
.NewsRating .unit-rating2 li.current-rating2 {
	background:url(../images/newsrank.png) right bottom;
	position:absolute;
	height:25px;
	display:block;
	z-index:1;
}
/* //News Rank */


تبدیلش میکنید به

کد: انتخاب همه

/* News Rank */

.NewsRank:hover {
	background-image:url(../images/newsrank.png);
	background-repeat:no-repeat;
	float:left;
	margin-top:23px;
	width:18px;
	height:15px;
	background-position:0 -19px;
}
.NewsRank:active {
	background-image:url(../images/newsrank.png);
	background-repeat:no-repeat;
	float:left;
	margin-top:23px;
	width:18px;
	height:15px;
	background-position:0 -38px;
}
.NewsRating .unit-rating {
	list-style:none;
	width:100px;
	height:25px;
	position:relative;
	background:url(../images/newsrank.png) top left repeat-x;
	margin:0;
	padding:0;
}
.NewsRating .unit-rating li {
	float:right;
	margin:0;
	padding:0;
}
.NewsRating .unit-rating li a {
	outline:none;
	display:block;
	width:20px;
	height:25px;
	text-decoration:none;
	z-index:20;
	position:absolute;
	padding:0;
}
.NewsRating .unit-rating li a:hover {
	background:url(../images/newsrank.png) right center;
	z-index:2;
	right:0;
}
.NewsRating .unit-rating a.r1-unit {
	right:0;
}
.NewsRating .unit-rating a.r1-unit:hover {
	width:20px;
}
.NewsRating .unit-rating a.r2-unit {
	right:20px;
}
.NewsRating .unit-rating a.r2-unit:hover {
	width:40px;
}
.NewsRating .unit-rating a.r3-unit {
	right:40x;
}
.NewsRating .unit-rating a.r3-unit:hover {
	width:60px;
}
.NewsRating .unit-rating a.r4-unit {
	right:60px;
}
.NewsRating .unit-rating a.r4-unit:hover {
	width:80px;
}
.NewsRating .unit-rating a.r5-unit {
	right:80px;
}
.NewsRating .unit-rating a.r5-unit:hover {
	width:100px;
}
.NewsRating .unit-rating li.current-rating {
	background:url(../images/newsrank.png) right bottom;
	position:absolute;
	height:25px;
	display:block;
	z-index:1;
}
/* //News Rank */


بعد این کد رو هم از nuketools.css حذف کنید



کد: انتخاب همه


.unit-rating2 {
	list-style:none;
	width:125px;
	height:25px;
	position:relative;
	background:url(../images/starrating.gif) top left repeat-x;
	margin:0;
	padding:0;
}
.unit-rating2 li {
	float:right;
	margin:0;
	padding:0;
}
.unit-rating2 li a {
	outline:none;
	display:block;
	width:25px;
	height:25px;
	text-decoration:none;
	z-index:20;
	position:absolute;
	padding:0;
}
.unit-rating2 li a:hover {
	background:url(../images/starrating.gif) right center;
	z-index:2;
	right:0;
}
.unit-rating2 a.r1-unit2 {
	right:0;
}
.unit-rating2 a.r1-unit2:hover {
	width:25px;
}
.unit-rating2 a.r2-unit2 {
	right:25px;
}
.unit-rating2 a.r2-unit2:hover {
	width:50px;
}
.unit-rating2 a.r3-unit2 {
	right:50px;
}
.unit-rating2 a.r3-unit2:hover {
	width:75px;
}
.unit-rating2 a.r4-unit2 {
	right:75px;
}
.unit-rating2 a.r4-unit2:hover {
	width:100px;
}
.unit-rating2 a.r5-unit2 {
	right:100px;
}
.unit-rating2 a.r5-unit2:hover {
	width:125px;
}
.unit-rating2 li.current-rating2 {
	background:url(../images/starrating.gif) right bottom;
	position:absolute;
	height:25px;
	display:block;
	z-index:1;
}
.ratingblock {
	display:block;
}
.loading {
	height:25px;
	background:url(../images/working.gif) 50% 50% no-repeat;
}
.unit-rating {
	list-style:none;
	width:60px;
	height:15px;
	position:relative;
	padding-top: 5px;
}
.unit-rating li {
	float:right;
	margin:0;
	padding-right:5px;
}
.unit-rating li a {
	outline:none;
	display:block;
	width:15px;
	height:15px;
	text-decoration:none;
	z-index:20;
	position:absolute;
	padding:0;
	text-align:center;
}
.unit-rating a.r1-unit {
	right:0;
	background:url(../images/starrating2.png) right;
	background-repeat:no-repeat
}
.unit-rating a.r1-unit:hover {
	width:15px;
	background:url(../images/starrating3.png) right;
	background-repeat:no-repeat
}
.unit-rating a.r2-unit {
	right:22px;
}
.unit-rating a.r3-unit {
	right:50px;
	background:url(../images/starrating2.png) left;
	background-repeat:no-repeat
}
.unit-rating a.r3-unit:hover {
	width:15px;
	background:url(../images/starrating3.png) left;
	background-repeat:no-repeat
}
.unit-rating li.current-rating {
	background:url(../images/starrating2.png);
	position:absolute;
	height:15px;
	display:block;
	background-repeat:no-repeat;
}


خب این هم از امتیاز دهی نیوک 8.2




قالب تبدیل شد :|


فقط تنها مشکلی که داره اینه تالارگفتمان 8.2 به صورت ماژول هست و واسه جدا کردنش از این آموزش استفاده کنید


forum-f31/topic-t22588-15.html


چون تمام قالب ها رو نمیشه بر یه اساس گفت که چطور تالارش رو درست کرد و مشکل ساز میشه



قالب رو خودم بر اساس همین آموزش تبدیل و ضمیمه کردم که میتونید استفاده کنید



دوستان لطف کنن آموزش رو با دقت بخونن چون یکم طولانیه ممکنه یه سری جاها رو اشتباه کنن


یه لطف دیگه هم اگه بشه خیلی خوب میشه اونم اینه تو پ خ یا تاپیم ها نگن که فلان قالب رو تبدیل کن ، یا خودتون انجام بدید یا بدید سرویس نیوک این کار رو انجام بده


در پایان این آموزش پیشنهاد میکنم که نیوک 8.2 رو به 8.3 تبدیل کنید نه اینکه قالب رو تبدیل کنید از 8.3 به 8.2 چون همونطور که میبینید خیلی سخت تر از آپگرید نیوک هست و امکانات 8.2 خیلی بیشتر و بهتره نسبت به 8.2
پیوست ها
Mashhadteam-Default.zip
(358 کیلو بایت) 219 مرتبه دانلود شده
آخرین ويرايش توسط 2 on Ehsan_Pc, ويرايش شده در 0.


به پایان آمدیم دفتر, حکایت همچنان باقیست.

بازگشت به “سئوالات متداول”