Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Naujienos pavadinimas spaudžiant ant pavadinimo

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."&amp;action=edit&amp;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&amp;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."&amp;action=edit&amp;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&amp;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

Parašė Žmogus· 2014 Sau. 23 19:01:47
#2

O linkas pasispaudžia ir url adresas pasikeičia ar tiesiog refreshinas puslapis?

Parašė 1941· 2014 Sau. 23 20:01:31
#3

Jei kalbi apie tai, kai būni pačiam readmore, tai jo, linkas pasispaudžia ir refreshinas tas pats readmoras. ta prasme būni www.adresas.lt/news.php?readmore=1 ir naujienos pavadinimas tuomet būna jau Linkas/Nuoroda, ant kurio paspaudus refreshinasi tas pats readmoras. Ta prasme vistiek lieki www.adresas.lt/news.php?readmore=1

Parašė Žmogus· 2014 Sau. 23 21:01:42
#4

Hmm įdomiai tada, čia turiu seną kažkokį kodą, lyg su juo veikdavo

global $news_subject,$data,$locale;
 
 
echo "<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='naujienos'><a href='news.php?readmore=".$info['news_id']."'>".$data['news_subject']."</a></td>