1
Hadesteam
Comments per page / News
  • 2017/5/25 13:59

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


Hi,

I have a problem with the News module, I have checked to display 20 comments on 1 page, while entering here "Aerobiczna 6 Weidera"https://www.kulturystyka.org.pl/modules/news/article.php?storyid=176 are displayed all 1.5k where comments are VERY long page loads - how to change it?
xoops 2.5.7 News module: 1,68 RC1 (01.07.2012)

Resized Image

2
zyspec
Re: Comments per page / News
  • 2017/5/25 22:44

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


@Hadesteam,

This looks like it may be a core bug - if it's what I think it is...

Can you try something to see if this fixes the issue you're seeing:

in ./include/comment_view.php around line 76 change:
$comments $comment_handler->getByItemId($xoopsModule->getVar('mid'), $com_itemid$com_dborder);

to:
$comments $comment_handler->getByItemId($xoopsModule->getVar('mid'), $com_itemid$com_dbordernull, (int)$comment_config['comments_pager']);


Then look at your page with the comments mode set to "Flat" to see if this fixes the problem.

3
Hadesteam
Re: Comments per page / News
  • 2017/5/26 15:06

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


Hi Zyspec, thanks for the reply.

I changed this line of code, in settings I changed the display of comments on; Thread, flat, indented but no reaction, just as it was.

4
zyspec
Re: Comments per page / News
  • 2017/5/26 16:19

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Hmmm, would it be possible for you to do the following?
* Temporarily turn on the inline debugger (Administration->Preferences->System Options->General Settings and then set 'Debug Mode' to 'Enable Debug (inline mode)')
* Load the page and then click 'Queries' at the bottom of the page.
* Copy the query text and either post it here or send me a PM so I can see what database queries are being run.
* Also look at the 'Errors' tab at the bottom of the page to make sure that there aren't any PHP errors being displayed.
* Turn debug off again

5
Hadesteam
Re: Comments per page / News
  • 2017/5/27 11:59

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


Zapytania (Queries)
0,000085 SET NAMES 'utf8'
0,000053 SET SQL_BIG_SELECTS 1
0
,000460 SELECT FROM config WHERE (conf_modid '0' AND conf_catid '1'ORDER BY conf_order ASC
0
,000224 SELECT sess_datasess_ip FROM session WHERE sess_id 'ce0f04d8932d3089cd28fbff06967082'
0,000149 SELECT FROM users WHERE uid '1'
0,000170 SELECT FROM modules WHERE dirname 'news'
0,000295 SELECT FROM config WHERE (conf_modid '17'ORDER BY conf_order ASC
0
,000244 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=208) AND (s.topicid=t.topic_id)
0,000122 SELECT COUNT(*) FROM banner
0
,000146 SELECT FROM banner LIMIT 01
0
,000174 UPDATE banner SET impmade 335741 WHERE bid 54
0
,000225 SELECT FROM config WHERE (conf_modid '0' AND conf_catid '3'ORDER BY conf_order ASC
0
,000745 SELECT DISTINCT gperm_itemid FROM group_permission WHERE gperm_name 'block_read' AND gperm_modid AND gperm_groupid IN (2,1)
0,000840 SELECT b.* FROM newblocks bblock_module_link m WHERE m.block_id=b.bid AND b.isactive=AND b.visible=AND m.module_id IN (0,17) AND b.bid IN (180,372,363,362,173,165,296,141,449,87,4,374,294,293,156,134,154,122,121,107,131,109,13,12,11,361,375,161,451,177,155,116,120,113,98,176,5,390,468,3,359,99,292,445,167,444,168,443,297,299,442,441,300,291,440,439,303,438,304,437,305,436,384,307,383,308,309,382,312,381,313,380,314,379,315,378,295,311,310,282,391,377,376,306,450,402,356,259,251,246,392,249,247,403,289,186,189,188,187,448,185,184,447,183,181,453ORDER BY b.weightm.block_id
0
,000336 SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset 'default' AND tpl_file 'system_block_dummy.html'ORDER BY tpl_refid
0
,000290 SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset 'default' AND tpl_file 'news_block_topics.html'ORDER BY tpl_refid
0
,001887 SELECT storyid FROM mod_news_stories WHERE (published AND published <= 1495886308) AND (expired OR expired 1495886308) AND topicid IN (5,6,13,15,16,23,34,35,39,40,41,46,68,79ORDER BY counter DESC
0
,000224 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=854) AND (s.topicid=t.topic_id)
0,000217 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=510) AND (s.topicid=t.topic_id)
0,000195 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=1023) AND (s.topicid=t.topic_id)
0,000183 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=790) AND (s.topicid=t.topic_id)
0,000148 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=285) AND (s.topicid=t.topic_id)
0,000177 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=311) AND (s.topicid=t.topic_id)
0,000145 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=674) AND (s.topicid=t.topic_id)
0,000180 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=422) AND (s.topicid=t.topic_id)
0,000173 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=848) AND (s.topicid=t.topic_id)
0,000170 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=1051) AND (s.topicid=t.topic_id)
0,000144 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=60) AND (s.topicid=t.topic_id)
0,000146 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=916) AND (s.topicid=t.topic_id)
0,000192 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=1077) AND (s.topicid=t.topic_id)
0,000179 SELECT s.*, t.* FROM mod_news_stories smod_news_topics t WHERE (storyid=1122) AND (s.topicid=t.topic_id)
0,000146 SELECT FROM smiles
0
,000596 SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset 'default' AND tpl_file 'news_block_randomnews.html'ORDER BY tpl_refid
0
,000295 SELECT FROM modules WHERE (hasmain '1' AND isactive '1' AND weight '0'ORDER BY weight ASCmid ASC
0
,000359 SELECT FROM group_permission WHERE (gperm_name 'module_read' AND gperm_modid '1' AND (gperm_groupid '2' OR gperm_groupid '1'))
0,000200 SELECT FROM modules WHERE dirname 'xoopstube'
0,000185 SELECT COUNT(*) as cpt FROM mod_news_topics WHERE menu=1
0
,000155 SELECT `name`, `pageFROM `icontent_shortcutsWHERE `submenu`=1
0
,000505 SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset 'default' AND tpl_file 'system_block_mainmenu.html'ORDER BY tpl_refid
0
,000231 SELECT FROM mod_news_stories_files WHERE storyid=208
0
,001012 SELECT storyidtitle FROM mod_news_stories WHERE (published AND published <= 1495886308) AND (expired OR expired 1495886308) AND storyid 208 ORDER BY storyid ASC LIMIT 01
0
,000911 SELECT storyidtitle FROM mod_news_stories WHERE (published AND published <= 1495886308) AND (expired OR expired 1495886308) AND storyid 208 ORDER BY storyid DESC LIMIT 01
0
,000250 SELECT FROM modules WHERE dirname 'tag'
0,000178 SELECT FROM config WHERE (conf_modid '108'ORDER BY conf_order ASC
0
,000350 SELECT o.tag_ido.tag_term FROM tag_link AS l LEFT JOIN tag_tag AS o ON o.tag_id l.tag_id WHERE l.tag_itemid 208 AND l.tag_modid 17 ORDER BY o.tag_count DESC
0
,000823 SELECT FROM xoopscomments WHERE (com_modid '17' AND com_itemid '208' AND com_pid '0'ORDER BY com_id ASC
0
,001501 SELECT FROM xoopscomments WHERE (com_rootid '1081' AND com_id >= '190'ORDER BY com_id ASC
0
,001208 SELECT FROM xoopscomments WHERE (com_rootid '504' AND com_id >= '193'ORDER BY com_id ASC
0
,001261 SELECT FROM xoopscomments WHERE (com_rootid '626' AND com_id >= '254'ORDER BY com_id ASC
0
,001015 SELECT FROM xoopscomments WHERE (com_rootid '643' AND com_id >= '272'ORDER BY com_id ASC
0
,001251 SELECT FROM xoopscomments WHERE (com_rootid '692' AND com_id >= '322'ORDER BY com_id ASC
0
,001070 SELECT FROM xoopscomments WHERE (com_rootid '1090' AND com_id >= '522'ORDER BY com_id ASC
0
,001074 SELECT FROM xoopscomments WHERE (com_rootid '916' AND com_id >= '575'ORDER BY com_id ASC
0
,000999 SELECT FROM xoopscomments WHERE (com_rootid '906' AND com_id >= '591'ORDER BY com_id ASC
0
,001116 SELECT FROM xoopscomments WHERE (com_rootid '3240' AND com_id >= '709'ORDER BY com_id ASC
0
,001233 SELECT FROM xoopscomments WHERE (com_rootid '1460' AND com_id >= '886'ORDER BY com_id ASC
0
,001596 SELECT FROM xoopscomments WHERE (com_rootid '1451' AND com_id >= '891'ORDER BY com_id ASC
0
,001086 SELECT FROM xoopscomments WHERE (com_rootid '1435' AND com_id >= '892'ORDER BY com_id ASC
0
,002023 SELECT FROM xoopscomments WHERE (com_rootid '2016' AND com_id >= '980'ORDER BY com_id ASC
0
,001975 SELECT FROM xoopscomments WHERE (com_rootid '2259' AND com_id >= '992'ORDER BY com_id ASC
0
,001790 SELECT FROM xoopscomments WHERE (com_rootid '1997' AND com_id >= '1013'ORDER BY com_id ASC
0
,001040 SELECT FROM xoopscomments WHERE (com_rootid '2145' AND com_id >= '1034'ORDER BY com_id ASC
0
,000968 SELECT FROM xoopscomments WHERE (com_rootid '2151' AND com_id >= '1040'ORDER BY com_id ASC
0
,001423 SELECT FROM xoopscomments WHERE (com_rootid '2376' AND com_id >= '1044'ORDER BY com_id ASC
0
,000982 SELECT FROM xoopscomments WHERE (com_rootid '1956' AND com_id >= '1080'ORDER BY com_id ASC
0
,000958 SELECT FROM xoopscomments WHERE (com_rootid '1690' AND com_id >= '1088'ORDER BY com_id ASC
0
,001166 SELECT FROM xoopscomments WHERE (com_rootid '1708' AND com_id >= '1115'ORDER BY com_id ASC
0
,001055 SELECT FROM xoopscomments WHERE (com_rootid '1873' AND com_id >= '1135'ORDER BY com_id ASC
0
,001051 SELECT FROM xoopscomments WHERE (com_rootid '1894' AND com_id >= '1154'ORDER BY com_id ASC
0
,001013 SELECT FROM xoopscomments WHERE (com_rootid '1863' AND com_id >= '1179'ORDER BY com_id ASC
0
,001051 SELECT FROM xoopscomments WHERE (com_rootid '1864' AND com_id >= '1180'ORDER BY com_id ASC
0
,001776 SELECT FROM xoopscomments WHERE (com_rootid '1865' AND com_id >= '1181'ORDER BY com_id ASC
0
,001162 SELECT FROM xoopscomments WHERE (com_rootid '1870' AND com_id >= '1186'ORDER BY com_id ASC
0
,001453 SELECT FROM xoopscomments WHERE (com_rootid '1827' AND com_id >= '1211'ORDER BY com_id ASC
0
,001835 SELECT FROM xoopscomments WHERE (com_rootid '1834' AND com_id >= '1221'ORDER BY com_id ASC
0
,001143 SELECT FROM xoopscomments WHERE (com_rootid '2172' AND com_id >= '1237'ORDER BY com_id ASC
0
,000980 SELECT FROM xoopscomments WHERE (com_rootid '2173' AND com_id >= '1238'ORDER BY com_id ASC
0
,000953 SELECT FROM xoopscomments WHERE (com_rootid '2179' AND com_id >= '1244'ORDER BY com_id ASC
0
,001008 SELECT FROM xoopscomments WHERE (com_rootid '2192' AND com_id >= '1297'ORDER BY com_id ASC
0
,000942 SELECT FROM xoopscomments WHERE (com_rootid '2168' AND com_id >= '1315'ORDER BY com_id ASC
0
,000981 SELECT FROM xoopscomments WHERE (com_rootid '3213' AND com_id >= '1329'ORDER BY com_id ASC
0
,000929 SELECT FROM xoopscomments WHERE (com_rootid '2371' AND com_id >= '1335'ORDER BY com_id ASC
0
,001002 SELECT FROM xoopscomments WHERE (com_rootid '2051' AND com_id >= '1359'ORDER BY com_id ASC
0
,000957 SELECT FROM xoopscomments WHERE (com_rootid '2296' AND com_id >= '1398'ORDER BY com_id ASC
0
,000943 SELECT FROM xoopscomments WHERE (com_rootid '2527' AND com_id >= '1415'ORDER BY com_id ASC
0
,000993 SELECT FROM xoopscomments WHERE (com_rootid '2528' AND com_id >= '1416'ORDER BY com_id ASC
0
,000951 SELECT FROM xoopscomments WHERE (com_rootid '2561' AND com_id >= '1445'ORDER BY com_id ASC
0
,000948 SELECT FROM xoopscomments WHERE (com_rootid '2575' AND com_id >= '1458'ORDER BY com_id ASC
0
,001003 SELECT FROM xoopscomments WHERE (com_rootid '2448' AND com_id >= '1483'ORDER BY com_id ASC
0
,001459 SELECT FROM xoopscomments WHERE (com_rootid '3147' AND com_id >= '1491'ORDER BY com_id ASC
0
,001288 SELECT FROM xoopscomments WHERE (com_rootid '3337' AND com_id >= '1537'ORDER BY com_id ASC
0
,001472 SELECT FROM xoopscomments WHERE (com_rootid '3378' AND com_id >= '1573'ORDER BY com_id ASC
0
,000657 SELECT FROM xoopscomments WHERE (com_rootid '3491' AND com_id >= '1644'ORDER BY com_id ASC
0
,004529 SELECT FROM xoopscomments WHERE (com_rootid '4530' AND com_id >= '1666'ORDER BY com_id ASC
0
,001054 SELECT FROM xoopscomments WHERE (com_rootid '5300' AND com_id >= '1677'ORDER BY com_id ASC
0
,000482 SELECT FROM xoopscomments WHERE (com_rootid '1728' AND com_id >= '1728'ORDER BY com_id ASC
0
,000457 SELECT FROM xoopscomments WHERE (com_rootid '1850' AND com_id >= '1850'ORDER BY com_id ASC
0
,000285 SELECT rank_title AS titlerank_image AS image FROM ranks WHERE rank_id 7
0
,000116 SELECT COUNT(*) FROM online WHERE online_uid '1'
0,000431 SELECT FROM xoopscomments WHERE (com_rootid '1880' AND com_id >= '1880'ORDER BY com_id ASC
0
,000424 SELECT FROM xoopscomments WHERE (com_rootid '1886' AND com_id >= '1886'ORDER BY com_id ASC
0
,000396 SELECT FROM xoopscomments WHERE (com_rootid '1900' AND com_id >= '1900'ORDER BY com_id ASC
0
,000963 SELECT FROM xoopscomments WHERE (com_rootid '1920' AND com_id >= '1920'ORDER BY com_id ASC
0
,001134 SELECT FROM xoopscomments WHERE (com_rootid '1933' AND com_id >= '1933'ORDER BY com_id ASC
0
,000483 SELECT FROM xoopscomments WHERE (com_rootid '2019' AND com_id >= '2019'ORDER BY com_id ASC
0
,000467 SELECT FROM xoopscomments WHERE (com_rootid '2020' AND com_id >= '2020'ORDER BY com_id ASC
0
,000406 SELECT FROM xoopscomments WHERE (com_rootid '2022' AND com_id >= '2022'ORDER BY com_id ASC
0
,000392 SELECT FROM xoopscomments WHERE (com_rootid '2031' AND com_id >= '2031'ORDER BY com_id ASC
0
,000372 SELECT FROM xoopscomments WHERE (com_rootid '2050' AND com_id >= '2050'ORDER BY com_id ASC
0
,000351 SELECT FROM xoopscomments WHERE (com_rootid '2187' AND com_id >= '2187'ORDER BY com_id ASC
0
,000311 SELECT FROM xoopscomments WHERE (com_rootid '2315' AND com_id >= '2315'ORDER BY com_id ASC
0
,000434 SELECT FROM xoopscomments WHERE (com_rootid '2426' AND com_id >= '2426'ORDER BY com_id ASC
0
,000340 SELECT FROM xoopscomments WHERE (com_rootid '2465' AND com_id >= '2465'ORDER BY com_id ASC
0
,000302 SELECT FROM xoopscomments WHERE (com_rootid '2718' AND com_id >= '2718'ORDER BY com_id ASC
0
,000271 SELECT FROM xoopscomments WHERE (com_rootid '2776' AND com_id >= '2776'ORDER BY com_id ASC
0
,000333 SELECT FROM xoopscomments WHERE (com_rootid '2882' AND com_id >= '2882'ORDER BY com_id ASC
0
,000306 SELECT FROM xoopscomments WHERE (com_rootid '2890' AND com_id >= '2890'ORDER BY com_id ASC
0
,000288 SELECT FROM xoopscomments WHERE (com_rootid '2891' AND com_id >= '2891'ORDER BY com_id ASC
0
,000202 SELECT FROM xoopscomments WHERE (com_rootid '3245' AND com_id >= '3245'ORDER BY com_id ASC
0
,000414 SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset 'default' AND tpl_file 'news_article.html'ORDER BY tpl_refid
0
,000307 SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset 'default' AND tpl_file 'news_item.html'ORDER BY tpl_refid
0
,000270 SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset 'default' AND tpl_file 'tag_bar.html'ORDER BY tpl_refid
0
,000232 SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset 'default' AND tpl_file 'system_comments_nest.html'ORDER BY tpl_refid
0
,000226 SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset 'default' AND tpl_file 'system_comment.html'ORDER BY tpl_refid
0
,000354 SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset 'default' AND tpl_file 'system_notification_select.html'ORDER BY tpl_refid
0
,000524 SELECT COUNT(*) FROM priv_msgs WHERE (read_msg '0' AND to_userid '1')


and 2 errors:

Błędy (Errors)
OstrzeżenieCannot modify header information headers already sent by (output started at /modules/news/article.php:6w pliku /kernel/session.php na linii 258
Zawiadomienie
Undefined variabletitle w pliku /modules/news/class/class.newsstory.php na linii 622


This is from this article:
https://www.kulturystyka.org.pl/modules/news/article.php?storyid=208

6
zyspec
Re: Comments per page / News
  • 2017/5/27 16:27

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Thanks @Hadesteam...

I will look into this a little further although I'm only able to look at this a little bit as I'll be "out of touch" for most of the next 10 days.

7
Hadesteam
Re: Comments per page / News
  • 2017/5/28 11:46

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


ok no problem.

8
zyspec
Re: Comments per page / News
  • 2017/6/12 23:00

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


@Hadesteam,

I think this changes the rendering of comments in FLAT mode to only show the number of comments based on the setting in System Config...

In ./include/comment_view.php change lines 75-81 from:
if ($com_mode == 'flat') {
    
$comments $comment_handler->getByItemId($xoopsModule->getVar('mid'), $com_itemid$com_dborder);
    include_once 
$GLOBALS['xoops']->path('class/commentrenderer.php');
    
$renderer =& XoopsCommentRenderer::instance($xoopsTpl);
    
$renderer->setComments($comments);
    
$renderer->renderFlatView($admin_view);
} elseif (
$com_mode == 'thread') {


to:
if ($com_mode == 'flat') {
    
$module_handler xoops_getHandler('module');
    
$sys_module     $module_handler->getByDirname('system');
    
$config_handler xoops_getHandler('config');
    
$sys_config     $config_handler->getConfigsByCat(0$sys_module->getVar('mid'));
    
$comments $comment_handler->getByItemId($xoopsModule->getVar('mid'), $com_itemid$com_dbordernull, (int)$sys_config['comments_pager']);
    include_once 
$GLOBALS['xoops']->path('class/commentrenderer.php');
    
$renderer =& XoopsCommentRenderer::instance($xoopsTpl);
    
$renderer->setComments($comments);
    
$renderer->renderFlatView($admin_view);
} elseif (
$com_mode == 'thread') {


Hopefully we got it fixed this time.

9
Hadesteam
Re: Comments per page / News
  • 2017/6/13 17:20

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


I did as you wrote, but I do not see any reaction. Something is wrong because when I change the method of displaying comments (in administration) from thread to flat or indented or First, the latest comments are completely nothing on the page does not change ... but as I change under the article to flat it then displays the 25 oldest comments, But there is nowhere: "second page of comments", "third page of comments".

I care about showing 25 most recent comments obligatory and the rest on the other numbered pages.

Since I do not know why my system displays comments by: "thread" - can it be changed instead of "flat"?

Login

Who's Online

230 user(s) are online (113 user(s) are browsing Support Forums)


Members: 0


Guests: 230


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits