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.

News Items Display In 9.03

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?

CodeDownload  
$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.
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
What I see on your site is BLOG POSTS; not NEWS POSTS.
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:
CodeDownload  
ORDER BY ns.news_datestamp DESC LIMIT ". $ Limit = 3;

@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
Thanks RobiNN; I'll give that a try!
smile
Yeah I found out the hard way; no problem. Now comes the question. How to upgrade from 9.03.00 to 9.03.20 ? The readme file only covers a ver7 0r 8 upgrade ?
You start the install and click it thru, it auto upgrades when completed.
OK thanks... I should've remembered that I think I'm getting senile!

@Falk: OK upgrade was successful but I now have a very strange anomaly. I have time code in my theme 'Atom-X/classes/AtomX.inc' thusly:

CodeDownload  
echo "<div class='pull-right'><span style='font-size:11px; color:#ffff00;'><b>".showdate("forumdate",'')." @</b> <span id='tick2'></span>
<script type='text/Javascript'>
<!--
/*By JavaScript Kit
http://javascriptkit.com
Credit MUST stay intact for use
*/
function show2(){
if (!document.all&&!document.getElementById)
return
thelement=document.getElementById? document.getElementById('tick2'): document.all.tick2
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn='pm'
if (hours<12)
dn='am'
if (hours>12)
hours=hours-12
if (hours==0)
hours=12
if (minutes<=9)
minutes='0'+minutes
if (seconds<=9)
seconds='0'+seconds
var ctime=hours+':'+minutes+':'+seconds+' '+dn
thelement.innerHTML='<b style=\'font-size:11px;\'>'+ctime+'</b>'
setTimeout('show2()',1000)
}
window.onload=show2
//-->
</script>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>\n";



I have used this code for years on many different websites with no problems. After the upgrade (which does not touch Atom-X theme), the time will not display at all on my front page. Here is an image of one of my Site User Pages where the same code is used to show you what it should look like:
fortworthbonsai.org/images/time2.jpg
And this is an image from my front page:
fortworthbonsai.org/images/time1.jpg
I don't understand what happened. ??
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.
Well there is no other onload function. The script appears properly if you look at View Source in the browser. I compared the view source to the view source from my main site whisperwillow.com(ver 9.03.00) and they are exactly the same. So according to view source it should be working. I just don't understand and cannot find a reason for this behavior.
Try with this,
CodeDownload  
add_to_footer('<script>....</script>');


If nothing else see if you can find a jQuery equivalent version of your script.
Problem solved. After much searching I found a totally different JS script that works just fine.
Thread Information
Author
Replies
14 posts
Views
257 times
Last Post
Last updated on 1 month ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can 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.
Users who participated in discussion: Falk, Kvido, Grimloch, RobiNN