قصد داریم قسمت اخبار در قالب کاسپین در نیوک 8.3 رو دوستونه کنیم
انجام 3 مرحله زیر الزامیست و باید هر سه مرحله انجام بشه
1 - فایل theme.php در قالب کاسپین رو وا کنین و به جای کد زیر
کد: انتخاب همه
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();
if(file_exists("themes/$ThemeSel/images/topics/$topicimage_link")){
$t_image = "themes/$ThemeSel/images/topics/$topicimage_link";
}else{
$t_image = "$tipath$topicimage_link";
}
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="News">
<div class="Title"><a href="<?=newslink($sid);?>"><?=$title?></a></div>
<div class="Contents">
<?=$content?>
</div>
<div class="NewsBottom">
<div class="NewsDetails">
<div class="NewsBreak"></div>
<div class="Rank">
<?=rating_load($sid)?>
</div>
<div class="Date"><?=$datetime?></div>
<div class="Author"><?=_AUTHOR?>:<?=$aid?></div>
<div class="Comments">
<a href="<?=newslink($sid);?>#comments" title="<?=$comments?>">
<img border="0" alt="<?=_COMMENTS?>" src="themes/<?=$ThemeSel?>/images/comment.gif" />
</a>
</div>
<div class="Counter">
<?=_VISIT?>:<?=$counter?> <?=_TIMES?>
</div>
<a class="More" href="<?=newslink($sid);?>" title="<?=_MORE?>"></a>
<div class="Clear"></div>
</div>
</div>
</div>
کد زیر رو قرار میدین
کد: انتخاب همه
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();
if(file_exists("themes/$ThemeSel/images/topics/$topicimage_link")){
$t_image = "themes/$ThemeSel/images/topics/$topicimage_link";
}else{
$t_image = "$tipath$topicimage_link";
}
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="News" style="width:282px;">
<div class="Title"><a href="<?=newslink($sid);?>"><?=$title?></a></div>
<div class="Contents" style="height:185px;">
<?
$doc=new DOMDocument();
$doc->loadHTML($hometext);
$xml=simplexml_import_dom($doc); //www.Iranpoetry.org
$img = $doc->getElementsByTagName('img')->item(0);
if (!empty($img)) {
$imgoutofTXT = $img->getAttribute('src');
} else { $imgoutofTXT = "images/no-picp.jpg";}
$hometext = strip_tags($hometext);
$hometext = substr($hometext, 0,700) . '...';
echo"
<a href=\"$newsLink\"><img src=\"$imgoutofTXT\" align=\"right\" width=\"100\" height=\"100\"></a>
<p>$hometext</p> ";
?>
</div>
<div class="NewsBottom">
<div class="NewsDetails">
<div class="NewsBreak"></div>
<div class="Rank">
<?=rating_load($sid)?>
</div>
<!--<div class="Date"><?=$datetime?></div>-->
<!--<div class="Author"><?=_AUTHOR?>:<?=$aid?></div>-->
<div class="Counter">
<?=_VISIT?>:<?=$counter?> <?=_TIMES?>
</div>
<div class="Comments">
</div>
<a class="More" href="<?=newslink($sid);?>" title="<?=_MORE?>"></a>
<div class="Clear"></div>
</div>
</div>
</div>
2 - عکس زیر رو در این مسیر آپلود کنین
public_html/images
3 - و فایل index.php رو در این مسیر جایگزین کنین
public_html/modules/News
در آخر هم این رو اضافه کنم که از فایلهایی که جایگزین میکنین بک آپ داشته باشین