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
Pravidelně aktualizovaný
Demo
Testovat PHP-Fusion

Related news panel PHP-Fusion 9

Poslední aktualizace před 1 rokem
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
instalace phpMyadmin for Windows 10
v PHP-Fusion 9
10 1 RobiNN
21-02-2019 11:05
Vstup z jiného PC
v Obecná diskuse
56 2 Kvido
20-02-2019 09:51
Video addon questions
v Infuze, panely, vzhledy
1357 8 zizub
18-02-2019 09:24
Fórum - reputacia
v PHP-Fusion 9
112 1 Balin50
17-02-2019 17:26
Stránka bola aktualizovaná na 9.03.00
v Obecná diskuse
118 0 RobiNN
16-02-2019 13:24
FAQ
v PHP-Fusion 9
455 4 Balin50
12-02-2019 09:55
Vlastný panel - editacia
v Administrace obsahu
213 0 Balin50
12-02-2019 09:52