Parašė 1941· 2014 Sau. 23 16:01:09
#1
function render_news($subject, $news, $info) {
global $locale, $settings, $aidlink;
set_image("edit", THEME."images/icons/news_edit.png");
echo "<div class='capmain-top'></div>\n";
echo "<div class='capmain-news floatfix'>\n";
echo "<div class='flleft capmain-font'>".$subject."</div>\n";
if (iADMIN && checkrights("N")) {
echo "<div class='flright clearfix' style='padding-right: 5px;'>\n";
echo "<a href='".ADMIN."news.php".$aidlink."&action=edit&news_id=".$info['news_id']."'><img src='".get_image("edit")."' alt='".$locale['global_076']."' title='".$locale['global_076']."' /></a>\n";
echo "</div>\n"; }
echo "</div>\n";
echo "<div class='spacer'>\n";
echo "<div class='news_info middle-border floatfix'>\n";
echo "<ul>\n";
echo "<li class='print'><a href='".BASEDIR."print.php?type=N&item_id=".$info['news_id']."'><span>".$locale['global_075']."</span></a></li>\n";
echo "<li class='date'>".showdate("%d %b %Y", $info['news_date'])."</li>\n";
if ($info['cat_id']) { echo "<li class='cat'><a href='".BASEDIR."news_cats.php?cat_id=".$info['cat_id']."'>".$info['cat_name']."</a></li>\n";
} else { echo "<li class='cat'><a href='".BASEDIR."news_cats.php?cat_id=0'>".$locale['global_080']."</a></li>\n"; }
if ($info['news_ext'] == "y" || ($info['news_allow_comments'] && $settings['comments_enabled'] == "1")) {
echo "<li class='reads'>".$info['news_reads'].$locale['global_074']."</li>\n"; }
if ($info['news_allow_comments'] && $settings['comments_enabled'] == "1") {
echo "<li class='comments'><a href='".BASEDIR."news.php?readmore=".$info['news_id']."#comments'>".$info['news_comments'].($info['news_comments'] == 1 ? $locale['global_073b'] : $locale['global_073'])."</a></li>\n"; }
echo "</ul>\n";
echo "</div>\n";
echo "<div class='main-body floatfix'>\n";
if ($info['news_sticky'] == "1") {
echo "<div style='position:absolute; padding-top:3px;'><img src='".THEME."images/icons/sticky.png' alt='sticky' width='41px' border='0' height='41px' /></div>";
}
echo $info['cat_image'].$news."<br />\n";
if (!isset($_GET['readmore']) && $info['news_ext'] == "y") {
echo "<div class='flright'>\n";
echo "<a href='".BASEDIR."news.php?readmore=".$info['news_id']."' class='button'><span class='rightarrow icon'></span>".$locale['global_072']."</a>\n";
echo "</div>\n";
}
echo "</div>\n";
echo "</div>\n";
}
Mano nevykęs bandymas:
function render_news($subject, $news, $info) {
global $locale, $settings, $aidlink;
set_image("edit", THEME."images/icons/news_edit.png");
echo "<div class='capmain-top'></div>\n";
echo "<div class='capmain-news floatfix'>\n";
echo "<div class='flleft capmain-font'><a href='".BASEDIR."news.php?readmore=".$info['news_id']."'>".$subject."</a></div>\n";
if (iADMIN && checkrights("N")) {
echo "<div class='flright clearfix' style='padding-right: 5px;'>\n";
echo "<a href='".ADMIN."news.php".$aidlink."&action=edit&news_id=".$info['news_id']."'><img src='".get_image("edit")."' alt='".$locale['global_076']."' title='".$locale['global_076']."' /></a>\n";
echo "</div>\n"; }
echo "</div>\n";
echo "<div class='spacer'>\n";
echo "<div class='news_info middle-border floatfix'>\n";
echo "<ul>\n";
echo "<li class='print'><a href='".BASEDIR."print.php?type=N&item_id=".$info['news_id']."'><span>".$locale['global_075']."</span></a></li>\n";
echo "<li class='date'>".showdate("%d %b %Y", $info['news_date'])."</li>\n";
if ($info['cat_id']) { echo "<li class='cat'><a href='".BASEDIR."news_cats.php?cat_id=".$info['cat_id']."'>".$info['cat_name']."</a></li>\n";
} else { echo "<li class='cat'><a href='".BASEDIR."news_cats.php?cat_id=0'>".$locale['global_080']."</a></li>\n"; }
if ($info['news_ext'] == "y" || ($info['news_allow_comments'] && $settings['comments_enabled'] == "1")) {
echo "<li class='reads'>".$info['news_reads'].$locale['global_074']."</li>\n"; }
if ($info['news_allow_comments'] && $settings['comments_enabled'] == "1") {
echo "<li class='comments'><a href='".BASEDIR."news.php?readmore=".$info['news_id']."#comments'>".$info['news_comments'].($info['news_comments'] == 1 ? $locale['global_073b'] : $locale['global_073'])."</a></li>\n"; }
echo "</ul>\n";
echo "</div>\n";
echo "<div class='main-body floatfix'>\n";
if ($info['news_sticky'] == "1") {
echo "<div style='position:absolute; padding-top:3px;'><img src='".THEME."images/icons/sticky.png' alt='sticky' width='41px' border='0' height='41px' /></div>";
}
echo $info['cat_image'].$news."<br />\n";
if (!isset($_GET['readmore']) && $info['news_ext'] == "y") {
echo "<div class='flright'>\n";
echo "</div>\n";
}
echo "</div>\n";
echo "</div>\n";
}
Keičiau paryškintą eilutę. Šiuo mano keitimo atveju pagrindiniame puslapyje spaudziant ant naujienos pavadinimo nieko nevyksta, tačiau nuėjus į readmore jau rodo, kad ten linkas.
Redagavo 1941· 2014 Sau. 23 16:01:14