Ale nie! Kde je JavaScript?
Váš webový prehliadač nemá povolený JavaScript alebo nepodporuje JavaScript. Ak chcete správne zobraziť túto webovú lokalitu, povoľte JavaScript vo svojom webovom prehliadači, alebo inovujte na webový prehliadač, ktorý podporuje JavaScript.

Fórum

Popular news panel with photo

4 príspevky
2661 zobrazení
Naposledy aktualizované pred 3 rokmi
Z
Člen 67
Odoslané pred 3 rokmi
#1
I have a side panel of popular news, without photos, only the news title 'News Subject'. She works for PF9. I tried to make this panel with photos, like here https://www.phpfusion.cz/infusions/fo...read_id=24 Related panel, but without result. I can not do it at all. Maybe someone can help me add code to show photos in this panel.
The code of the panel :
<?php
if (!defined("IN_FUSION")) { die("Access Denied"); }

openside("Top 5 News");

$result = dbquery("SELECT news_id, news_subject, news_reads FROM ".DB_NEWS." WHERE (".time()." > news_start OR news_start = 0) AND (".time()." < news_end OR news_end = 0) AND (news_datestamp > ".(time() - 2592000).") AND ".groupaccess('news_visibility')." ORDER BY news_reads DESC LIMIT 5");

if (dbrows($result)) {
   echo "<ul>\n";
   while ($data = dbarray($result)) {
      echo "<li>".THEME_BULLET." <a href='".INFUSIONS."news/news.php?readmore=".$data['news_id']."'>".$data['news_subject']." (".$data['news_reads'].")</a></li>\n";
   };
   echo "</ul>\n";
} else {
   echo $locale['lnp_021'];
}

closeside();
?>


I have a major difficulty creating this part of the code :
$result = dbquery("SELECT news_id, news_subject, news_reads FROM ".DB_NEWS." WHERE (".time()." > news_start OR news_start = 0) AND (".time()." < news_end OR news_end = 0) AND (news_datestamp > ".(time() - 2592000).") AND ".groupaccess('news_visibility')." ORDER BY news_reads DESC LIMIT 5");

Upravil/a zizub dňa 30/09/2017 23:45, pred 3 rokmi
Kvido
Člen 293
Odoslané pred 3 rokmi
#2
@zizub:
Nyní, kdy je před spuštěním již nová verze 9.1 nemá význam do kódu zasahovat. Počkej nějaký čas, pak se na to podíváme.
RobiNN
Hlavný administrátor 780
Odoslané pred 3 rokmi
#3
 openside("Top 5 News");

 $result = dbquery("SELECT n.news_id, n.news_subject, n.news_reads, i.news_image
 FROM ".DB_NEWS." n
 LEFT JOIN ".DB_NEWS_IMAGES." AS i ON n.news_id = i.news_id
 WHERE (".time()." > n.news_start OR n.news_start = 0) AND (".time()." < n.news_end OR n.news_end = 0) AND (n.news_datestamp > ".(time() - 2592000).") AND ".groupaccess('n.news_visibility')."
 ORDER BY n.news_reads DESC LIMIT 5
 ");

 if (dbrows($result)) {
 echo "<ul>\n";
 while ($data = dbarray($result)) {
 echo "<li>";
 echo "<img class='img-responsive display-inline-block' style='width: 100px;' src='".IMAGES_N.$data['news_image']."' alt='".$data['news_subject']."'/>";
 echo "<a href='".INFUSIONS."news/news.php?readmore=".$data['news_id']."'>".$data['news_subject']." (".$data['news_reads'].")</a>";
 echo "</li>\n";
 };
 echo "</ul>\n";
 } else {
 echo $locale['lnp_021'];
 }

 closeside();

PHP-Fusion Development Manager
GitHub profil: GitHub
PHP Fusion témy: PF-Projects/PHP-Fusion-Themes
PHP Fusion infúzie: PF-Projects/PHP-Fusion-Infusions, php-fusion/Addons
Z
Člen 67
Odoslané pred 3 rokmi
#4
RobiNN! Thank you very much. Works good. Páči sa mi to