Ach ne! Kde je JavaScript?
Váš webový prohlížeč nemá povolen JavaScript nebo nepodporuje JavaScript. Pro správné zobrazení tohoto webu nebo pro upgrade na webový prohlížeč, který podporuje JavaScript, povolte JavaScript ve webovém prohlížeči.
PHP-Fusion 9 Jádro
v9.03.00
Překlad CZ/SK
Pravidelně aktualizovaný
Demo
Testovat PHP-Fusion

Related news panel PHP-Fusion 9

Poslední aktualizace před 2 lety
Z
Help me remake the Pf-7 panel, to work on Pf-9. I have on my old site a panel that shows the related news by title. This panel does not want to work in Pf-9.
The working code of the pf-7 panel. I paste it into the file news.php
//---***Start related news***---//
if ((FUSION_SELF == 'news.php') && isset($_GET['readmore']) && isNum($_GET['readmore']))
 {
 list($news_subject) = dbarraynum(dbquery("SELECT news_subject from ".DB_NEWS." WHERE news_id=".$_GET['readmore']));
 
 $rel_news_res = dbquery("SELECT news_id, news_subject, news_news, news_image FROM ".DB_NEWS." WHERE MATCH (news_subject) AGAINST ('".$news_subject."' IN BOOLEAN MODE) AND news_id != ".$_GET['readmore']." ORDER BY news_datestamp DESC LIMIT 10");

$langPanel['001'] = "Related news:";
$counter = 0;
$columns = 2; //number of columns per line
 
 if(dbrows($rel_news_res))
 {
 opentable($langPanel['001']);
 echo "<table width='100%'>\n<tr>\n";
 while($news = dbarray($rel_news_res))
 {
 if ($counter != 0 && ($counter % $columns == 0)) // close if you want to display in one line
echo "</tr>\n<tr>\n";
 echo "<td width='50%'>\n";
echo "<table cellpadding='4' cellspacing='2' width='100%'>\n<tr>\n";
 echo "<td><a href='".BASEDIR."news.php?readmore=".$news['news_id']."' alt='".$news['news_subject']."'><img src='".IMAGES_N."".$news['news_image']."' title='".$news['news_subject']."' align='left' width='100%' height='auto' /></a><br /><strong><a href='".BASEDIR."news.php?readmore=".$news['news_id']."'>".trimlink(strip_tags(stripslashes($news['news_subject'])), 39)."</a></strong></br>".trimlink(strip_tags(stripslashes($news['news_news'])), 69)."</td>\n</tr>\n";
 echo "</table>\n</td>\n";
 $counter++; // close if you want to display in one line
   }
 echo "</tr>\n</table>\n";
 closetable();
 }
 }
//---***End***---//

For testing in Pf-9, I inserted this code into the file ..infusions \ news \ templates \ news.php. I tried to change the BASEDIR on INFUSIONS."news/   - this is not enough, I need to edit somewhere else, but I do not know. Help who can.
Kvido
I think the code must be INFUSIONS through which news is also in v.9. In v.7 it was in the root directory ...
So maybe this way:

Place:
echo "<td> <a href='" BASEDIR."news.php?readmore=".$news['news_id']."' alt ='".$news['news_subject']."'>


Change to
<a class='text-white' href='".INFUSIONS."news/news.php?readmore=".$news_item['news_id']."'>
RobiNN
Now works on PF9

if ((FUSION_SELF == 'news.php') && isset($_GET['readmore']) && isnum($_GET['readmore'])) {
 list($news_subject) = dbarraynum(dbquery("SELECT news_subject from ".DB_NEWS." WHERE news_id=:news_id", [':news_id' => $_GET['readmore']]));

 $rel_news_res = dbquery("SELECT n.news_id, n.news_subject, n.news_news, i.news_image
 FROM ".DB_NEWS." AS n
 LEFT JOIN ".DB_NEWS_IMAGES." AS i ON n.news_id = i.news_id
 WHERE MATCH (n.news_subject) AGAINST ('".$news_subject."' IN BOOLEAN MODE) AND n.news_id != :news_id
 ORDER BY n.news_datestamp DESC LIMIT 10
 ", [':news_id' => $_GET['readmore']]);

 $langPanel['001'] = "Related news:";
 $counter = 0;
 $columns = 2; // number of columns per line

 if (dbrows($rel_news_res)) {
 opentable($langPanel['001']);
 echo "<table width='100%'>\n<tr>\n";
 while ($news = dbarray($rel_news_res)) {
 if ($counter != 0 && ($counter % $columns == 0)) // close if you want to display in one line
 echo "</tr>\n<tr>\n";
 echo "<td width='50%'>\n";
 echo "<table cellpadding='4' cellspacing='2' width='100%'>\n<tr>\n";
 echo "<td>";
 if (!empty($news['news_image'])) {
 echo "<a href='".INFUSIONS."news/news.php?readmore=".$news['news_id']."' title='".$news['news_subject']."'>";
 echo "<img src='".IMAGES_N.$news['news_image']."' alt='".$news['news_subject']."' align='left' width='100%' height='auto' />";
 echo "</a>";
 }
 echo "<strong><a href='".INFUSIONS."news/news.php?readmore=".$news['news_id']."'>".trimlink(strip_tags(stripslashes($news['news_subject'])), 39)."</a></strong>";
 echo "</br>".trimlink(strip_tags(stripslashes($news['news_news'])), 69)."</td>\n</tr>\n";
 echo "</table>\n</td>\n";

 $counter++; // close if you want to display in one line
 }
 echo "</tr>\n</table>\n";
 closetable();
 }
}
Z
RobiNN! Thank you very much. Works good.
Vy můžete zobrazit všechny příspěvky v tomto fóru.
Vy nemůžete začít nový diskusní příspěvek v tomto fóru.
Vy nemůžete odpovědět v této diskusi.
Vy nemůžete začít v anketu v tomto fóru.
Vy nemůžete na tomto fóru nahrát přílohy.
Vy můžete stáhnout přílohy v tomto fóru.
Uživatelé, kteří se účastnili diskuse: Kvido, RobiNN, zizub
Nejnovější témata fóra
  Vlákno Zobrazení Odpovědi Poslední příspěvek
Užívatelské polia
v PHP-Fusion 9
2041 23 Balin50
20-04-2019 15:40
ban užívateľa
v PHP-Fusion 9
1871 3 Balin50
16-04-2019 08:54
9.03.10
v PHP-Fusion 9
459 13 Balin50
16-04-2019 08:44
Registrácia - token
v PHP-Fusion 9
233 8 Balin50
15-04-2019 16:40
Chyba inštalácie
v PHP-Fusion 9
1021 12 RobiNN
10-04-2019 13:41
Videa
v Administrace obsahu
431 5 Balin50
10-04-2019 10:48
Instalace na Ubuntu serveru
v PHP-Fusion 9
2325 11 jany
03-04-2019 16:23