Odpověď a realizace není tak jednoduchá jako u CS-NUKE, ale jde to.
Je jedno, jestli se jedná o vzhled, který je tvořen pomocí souborů html nebo nikoliv.
Takže se do toho pustíme.
Budeme vycházet z toho, že náš vzhled je tvořen pouze jedním souborem a to souborem theme.php.
hned za znak <?php vložte tento kód, jinak se vám stane, že to nebude fungovat.
{ Kód }:
define("UN_NEWTHEME_LOADED", "1.0");
Pak nejsou potřeba další úpravy až do funkce themeindex (function themeindex).
nad celou tuto funkci přidejte teno kód:
{ Kód }:
function un_is_bodytext($un_fullcount) {
if ($un_fullcount > 0) {
return 1;
} else {
return 0;
}
}
function un_get_story_link($story_id, $comments_mode, $style, $linkname, $link_param = "") {
$un_story_link = "<a href=\"modules.php?name=News&file=article&sid=".$story_id."".$comments_mode."".$link_param."\" class=\"$style\">".$linkname."</a>";
return $un_story_link;
}
function un_get_story_title($story_id, $comments_mode, $fullcount, $story_title) {
if (un_is_bodytext($fullcount)) {
$un_story_link = "<a href=\"modules.php?name=News&file=article&sid=".$story_id."".$comments_mode."\" class=\"un_story_title_link\">".$story_title."</a>";
} else {
$un_story_link = "<font class=\"un_story_title_text\">$story_title</font>";
}
return $un_story_link;
}
tu je potřeba přejmenovat na function un_themeindex a nakonec do závorek ještě přidat $un_story_details.
{ Kód }:
function un_themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext, $un_story_details) { //přidáno $un_story_details
dále je tam řádek podobný tomuto:
{ Kód }:
global $anonymous;
tam je nakonec potřeba přidat ještě definici $nadpis.
{ Kód }:
global $anonymous, $nadpis;
Hned pod tento řádek navíc přidejte následující kód:
{ Kód }:
if ($un_story_details['cat_id'] != 0) {
$cat_link = "<a href=\"modules.php?name=News&file=categories&op=newindex&catid=".$un_story_details['cat_id']."\" class=\"un_story_subtitle_cat\">".$un_story_details['cat_title']."</a>,";
} else {
$cat_link = "";
}
if ($un_story_details['c_count'] > 0 AND $un_story_details['acomm'] == "0") {
$comments_link = un_get_story_link($un_story_details['story_id'], $un_story_details['comments_mode'], "un_story_general_link" , "".UN_NEWS_MAINCOMMENTSLINK." (".$un_story_details['c_count'].")", "#comments") . "";
} elseif ($un_story_details['acomm'] == "0") {
$comments_link = "<a href=\"modules.php?name=News&file=comments&op=Reply&sid=".$un_story_details['story_id']."\" class=\"un_story_general_link\">"._COMMENTSQ."</a>";
} else {
$comments_link = "";
}
if ($un_story_details['rated'] == "0" AND un_is_bodytext($un_story_details['fullcount'])) {
$article_rating = "".UN_NEWS_STORYNOTRAITED."";
} elseif ($un_story_details['rated'] != "0") {
$article_rating = ""._RATEARTICLE.": ".$un_story_details['rated']."";
} else {
$article_rating = "";
}
if ($topic != 0) {
$topic_link = "<a href=\"modules.php?name=News&new_topic=$topic\" class=\"un_story_general_link\">$topictext</a>";
} else {
$topic_link = "";
}
if (un_is_bodytext($un_story_details['fullcount'])) {
$counter_fixed = "$counter "._READS.",";
} else {
$counter_fixed = "";
}
if ($nadpis != "") {
$nadpis = "".un_get_story_title($un_story_details['story_id'], $un_story_details['comments_mode'], $un_story_details['fullcount'], $un_story_details['story_title'])."\n";
} else {
$nadpis = "".un_get_story_title($un_story_details['story_id'], $un_story_details['comments_mode'], $un_story_details['fullcount'], $un_story_details['story_title'])."";//$title
}
Pak změňte na řádku kde se vyskytuje $title
{ Kód }:
."<b>$title</b><br>"
za $nadpis
{ Kód }:
."<b>$nadpis</b><br>"
Jako další krok je funkce themearticle (function themearticle).
Tu přejmenujte na function un_themearticle
{ Kód }:
function un_themearticle ($aid, $informant, $datetime, $title ..........
A nakonec před znak ?> přidejte ještě následující kód, jinak nebudou fungovat aktuality na úvodní stránce.
{ Kód }:
function un_themecenterbox($title, $content) {
OpenTable();
echo "<center><font color=\"$textcolor2\"><b>$title</b></font></center><br>"
."$content";
CloseTable();
echo "<br>";
}
To je vše, snad jsem na nic nezapoměl a funguje to.
Pokud máte vzhled, který je tvořen pomocí html , tak je změnu definice $title na $nadpis potřeba udělat v souboru story_home.html.
Bude to řádek podobný tomuto:
{ Kód }:
<font class="option" color="#363636"><b>$nadpis</b></font>
Autor: Blassen
Celý kód naleznete na tomto odkaze.