miniBB ®miniBB®
Support Forums
  
 · Start · Sign in · Register · Search · Statistics · File Bank · Manual ·
Official Addons and Solutions miniBB Support Forums / Official Addons and Solutions /  
 

First Page News

 
 
Page  Page 9 of 9 :  « Previous  1  2  3  4  5  6  7  8  9

Author marsbar
Associated Member
#121 · Posted: 24 Sep 2026 16:20
Hi, Paul.

Is there a way to configure addon_1stpagenews.php so that locked topics are excluded from the topics displayed by the add-on?

With thanks,
marsbar

Author Paul
Lead Lead Developer
#122 · Posted: 24 Sep 2026 16:23
Yes, there is such a way — modify addon_1stpagenews.php and locate the following line of code (it's approx. line #75):

if($res=db_simpleSelect(0, $Tt, 'topic_id, topic_title, topic_poster_name, topic_time, topic_last_post_id, forum_id, posts_count, topic_time, topic_last_poster', $tw, $te, $tv, $sort, $limit)){
Extend it with the following code:

if($res=db_simpleSelect(0, $Tt, 'topic_id, topic_title, topic_poster_name, topic_time, topic_last_post_id, forum_id, posts_count, topic_time, topic_last_poster', $tw, $te, $tv, $sort, $limit, 'topic_status', '!=', 1)){

Author marsbar
Associated Member
#123 · Posted: 24 Sep 2026 17:01
Hi, Paul.

Thanks for the code. I have tried the change; but unfortunately, the entire forum feed disappears from the homepage!

Any idea why this might be happening?

Thanks again!
marsbar

Author Paul
Lead Lead Developer
#124 · Posted: 28 Sep 2026 14:56
addon_1stpagenews.php — on your side, this file is included/called from another PHP script, right?

The reason is definitely in some wrong request which is generated for mySQL. But I couldn't say exactly what's wrong.

You can try to debug the script — in setup_mysqli.php there should be a commented line:

//echo "!-- ".$sql." --><br>";
Uncommenting it should bring mySQL outputs on the screen, copy here the one which would contain the topic_status field.

Another way is to review the error_log file on your server, if it's present. In most cases it should record PHP error.

Author marsbar
Associated Member
#125 · Posted: 28 Sep 2026 17:25
Hi, Paul.

Thanks for your reply!

Paul:
this file is included/called from another PHP script, right?
No, it's included using SSI on an HTML page.

Bleary-eyed marsbar, past midnight over here!

Author Paul
Lead Lead Developer
#126 · Posted: 29 Sep 2026 15:32
marsbar:
No, the files are not called from another PHP script; they are included using SSI on an HTML page.
Then the best way for you is to look up the errors log. Do you have it on the server?

Default filename for Apache and nginx is error_log and it could be located anywhere depending on your server configuration. You may ask the hoster about that.

Author marsbar
Associated Member
#127 · Posted: 29 Sep 2026 17:46
Hi, Paul.

Here is the server error I get when I add the exclusion for locked topics:

PHP Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND topic_status!='1' where ( forum_id=1 or forum_id=2 or forum_id=3 or forum_id' at line 1
The addon works normally and topics are displayed until I try to exclude locked topics.

I am using the mysqli version of miniBB.

Cheers,
marsbar

Author Paul
Lead Lead Developer
#128 · Posted: 29 Sep 2026 17:55
Ok — do you have a setting named $newsTimeLimit specified, and if so, what value it has?

Author marsbar
Associated Member
#129 · Posted: 30 Sep 2026 10:29
Hi, Paul.

$newsTimeLimit is set to 0 (zero).

--marsbar

Author Paul
Lead Lead Developer
#130 · Posted: 30 Sep 2026 16:46
Now I see there could be variations of code, so — please forget the solution I've suggested earlier. It will work only if newsTimeLimit option is greater than 0.

The code below should be more universal — please try it out.

Find out the code block starting with f(sizeof($displayForums)>0){ — you have to extend it that way (new lines to add in bold):

if(sizeof($displayForums)>0){
$firstForum=$displayForums[0];
$xtr=getClForums($displayForums,$xtrSep,'','forum_id','or','=');
$xtr.=' and topic_status!=1';
}
else{
$xtr=" {$xtrSep} topic_status!=1";
}


Author marsbar
Associated Member
#131 · Posted: 30 Sep 2026 19:11
Thanks for the solution, Paul! It's working now!
Cheers,
marsbar

Page  Page 9 of 9 :  « Previous  1  2  3  4  5  6  7  8  9 
Official Addons and Solutions miniBB Support Forums / Official Addons and Solutions /
 First Page News
Share Link Share Topic's Link
 Click this icon to move up to the quoted message

 ∅ ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

  
 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Try the Polls & Surveys add-on: organize surveys on miniBB-forums, collecting them in one place.


⇑