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.
Not a member yet? Click here to register.
Forgot Password?

News Items Display In 9.03

Asked Modified Viewed 1,190 times
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
asked
Senior Member

I don't quite understand what's going on here with my News infusion. I have 4 news items but only 3 will display in Latest News.
https://fortworthbonsai.org
OK. I figured out how to change it in home_panel.php by changing the $limit variable from 3 to 6 for the news code block. I fully expected it to again display 3 items and wrap the fourth to the next line but it doesn't. Is there a way to add an item row counter to this code block?

$limit = 6;

if (defined('DB_NEWS')) {
 $configs[DB_NEWS] = [
 'select' => "SELECT
 ns.news_id as id, ns.news_subject as title, ns.news_news as content,
 ns.news_datestamp as datestamp, us.user_id, us.user_name,
 us.user_status, nc.news_cat_id as cat_id, nc.news_cat_name as cat_name,
 ni.news_image as image,
 ni.news_image_t1 as image_thumb,
 nc.news_cat_image as cat_image,
 count(c1.comment_id) as comment_count,
 count(r1.rating_id) as rating_count
 FROM ".DB_NEWS." as ns
 LEFT JOIN ".DB_NEWS_IMAGES." as ni ON ni.news_id=ns.news_id
 LEFT JOIN ".DB_NEWS_CATS." as nc ON nc.news_cat_id = ns.news_cat
 LEFT JOIN ".DB_COMMENTS." as c1 on (c1.comment_item_id = ns.news_id and c1.comment_type = 'NS')
 LEFT JOIN ".DB_RATINGS." as r1 on (r1.rating_item_id = ns.news_id AND r1.rating_type = 'NS')
 INNER JOIN ".DB_USERS." as us ON ns.news_name = us.user_id
 WHERE (".time()." > ns.news_start OR ns.news_start = 0)
 AND ns.news_draft = 0
 AND (".time()." < ns.news_end OR ns.news_end = 0)
 AND ".groupaccess('ns.news_visibility')." ".(multilang_table("NS") ? "AND news_language='".LANGUAGE."'" : "")."
 group by ns.news_id
 ORDER BY ns.news_id ASC LIMIT ".$limit,
 'locale' => [
 'norecord' => $locale['home_0050'],
 'blockTitle' => $locale['home_0000'],
 ],
 'infSettings' => get_settings("news"),
 'categoryLinkPattern' => INFUSIONS."news/news.php?cat_id={cat_id}",
 'contentLinkPattern' => INFUSIONS."news/news.php?readmore={id}",
 ];
}


I also changed the ORDER BY from ns.news_datestamp DESC to ns.news_id ASC... that's just the way I want it.
Edited by Grimloch on 19-01-2020 16:22,
0 replies

5 posts

K
Kvido
K
Kvido 10
Linux-Ubuntu 09.03.60, Linux/Ubuntu, PHP5, HTML5, Mozilla-Firefox 3.6.3, Opera 10.51, IE 8.0.6
https://www.nekecamweb.cz
  • Senior Member, joined since
  • Contributed 524 posts on the community forums.
  • Started 108 threads in the forums
answered
Senior Member

Try in your www / home.php
set on line 34: $ limit = 6;
Attention, file home_panel.php, I think in version 9.3.20 is not at all !!!
Mein web is:
https://www.nekecamweb.cz
Edited by Kvido on 19-01-2020 18:08,
1 reply
K
Kvido
K
Kvido 10
Linux-Ubuntu 09.03.60, Linux/Ubuntu, PHP5, HTML5, Mozilla-Firefox 3.6.3, Opera 10.51, IE 8.0.6
https://www.nekecamweb.cz
  • Senior Member, joined since
  • Contributed 524 posts on the community forums.
  • Started 108 threads in the forums
answered
Senior Member

I understand. I only work with BLOG. I don't use news ... Just for information.
But again, in version 9.3.20 I don't have the home_panel.php file in the root directory: / news, as you say. That's why you probably can't set it!
Try setting the change in /home.php, line 34:
$ limit = 6;
and in the news, line 58:
ORDER BY ns.news_datestamp DESC LIMIT ". $ Limit = 3;
Edited by Kvido on 21-01-2020 17:13,
0 replies
R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

@Grimloch
I assume you don't have an updated system.
Update whole system to latest 9.03.20 or you can use only home.php from latest version. Then just edit $limit variable, that's all.

snipboard.io/pM37bm.jpg
1 reply
R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

I forgot, also this file must be uploaded https://github.com/PHPFusion/PHPFusio...mepage.php

But I recommend to update whole system.
1 reply
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

If another window.onload exist the others can fail, there are ways to stack these, I did it from VArcade once, but not sure where the script is now.
1 reply

Labels

None yet

Statistics

  • Views 0 views
  • Posts 5 posts
  • Votes 0 votes
  • Topic users 4 members

4 participants

F
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
K
K
Kvido 10
Linux-Ubuntu 09.03.60, Linux/Ubuntu, PHP5, HTML5, Mozilla-Firefox 3.6.3, Opera 10.51, IE 8.0.6
https://www.nekecamweb.cz
  • Senior Member, joined since
  • Contributed 524 posts on the community forums.
  • Started 108 threads in the forums
G
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
R
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet