Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.
Forgot Password?
Navigation

Database request to display news image

Last updated on 9 months ago
L
Layzee71Newbie
Posted 9 months ago
Hello there,

up to last week i only used the V7.2 of PHP-Fusion.
Now I'm about to change to the new Version.
The Problem is, on V7 my theme, especialy the startpage, displays the last 5 news in a little slider with image, subject and date - you can see it here: https://60minuten.net

My code to display the news on my startpage is the follow:
// NEWS SEKTION
 echo '<div class="block block--fullbg block--bgcover bottom-null inset-125 block-bg-11">
 <div class="container">
 <div class="title-wrap text-center">
 <h2 class="h--lg">News</h2>
 </div>';

 // DATENBANK AUSLESEN
 $resultln = dbquery("SELECT tn.*, tc.*, tu.user_id, tu.user_name, tu.user_status, news_reads, news_image
 FROM ".DB_NEWS." tn
 LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
 LEFT JOIN ".DB_NEWS_CATS." tc ON tn.news_cat=tc.news_cat_id
 WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().")
 AND (news_end='0'||news_end>=".time().") AND news_draft='0'
 GROUP BY news_id
 ORDER BY news_sticky DESC, news_datestamp DESC LIMIT 0,5"
 );

 // GLOBALE VARIABLEN SETZEN
 global $locale, $settings, $aidlink, $data, $dataln, $info, $infoln;

 // AUSGABE DER NEWS
 echo '<div class="row news-slider ini-news-slider-mobile">';
 if (dbrows($resultln)) {
 $i = 0;
while ($dataln= dbarray($resultln)) {
 $subjectln = trimlink(strip_tags(parseubb($dataln['news_subject'])), 60);
 $shortnews = trimlink(strip_tags(parseubb($dataln['news_news'])), 100);

 echo '<div class="col-sm-4 news-item">
 <div class="news-item-inside">
 <a href="'.BASEDIR.'news.php?readmore='.$dataln['news_id'].'" class="news-item-photo">
 <img src="'.IMAGES_N.''.$dataln["news_image"].'" alt="'.$subjectln.'" style="width:370px; height:370px;">
 </a>
 <div class="news-item-date"> '.showdate("%d.%b.%Y", $dataln["news_datestamp"]).'</div>
 <h4 class="news-item-title"><a href="'.BASEDIR.'news.php?readmore='.$dataln['news_id'].'">'.$subjectln.'</a></h4>
 </div>
 </div>';
 }
 }
 echo '</div>
 <!-- <div class="text-center offset-50">
 <h3><a href="'.BASEDIR.'news.php">»Alle Beiträge«</a></h3>
 </div> -->
 </div>
 </div>';


The same theme on V9 can be viewed here: https://60minuten.net/f9/home.php
As you can see, the news images are not visible. I used the same code as above.

What's the right code/database request to show the (correct) news images on my startpage?

Thank's in advance.
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
You cannot set up a bounty in this discussion thread.
Moderator: Support Team
Users who participated in discussion: Layzee71