Recent Forum Topics on Boardindex For 2.0.x

Started by Pipke, May 05, 2014, 09:37:08 AM

Previous topic - Next topic

Pipke

Quote from: minimono on May 14, 2018, 04:31:49 AM
iam this error

https://.../index.php?action=forum;start=%1
2: A non-numeric value encountered
D:/.../Sources/RecentForumTopics.php
Line: 170
167: $query_this_board = '{query_wanna_see_board}' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
168: AND b.id_board != {int:recycle_board}' : ''). '
169: AND m.id_msg >= {int:max_id_msg}';
==>170: $query_parameters['max_id_msg'] = max(0, $modSettings['maxMsgID'] - 100 - $_REQUEST['start'] * 6);
171: $query_parameters['recycle_board'] = $modSettings['recycle_board'];
172:
173: $context['page_index'] = constructPageIndex($scripturl . '?action=forum', $_REQUEST['start'], min(100, $modSettings['totalTopics']), $rft_per_page, false);
174: }


How to fix it.


SMF 2.0.15 , PHP 7.1.15

It seems that in PHP 7.1, a Warning will be emitted if a non-numeric value is encountered.

Here is the relevant portion that pertains to the Warning notice you are getting:

New E_WARNING and E_NOTICE errors have been introduced when invalid strings are coerced using operators expecting numbers or their assignment equivalents. An E_NOTICE is emitted when the string begins with a numeric value but contains trailing non-numeric characters, and an E_WARNING is emitted when the string does not contain a numeric value.

working on it later, should be easy to fix.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Pipke

@minimono, how did you get to this url -> https://.../index.php?action=forum;start=%1
because the % character shouldn't be there and thats why you are getting the error, whats your forum url?
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

minimono

#142
บุคคลทั่วไป
 
2: A non-numeric value encountered
D:/.../Sources/RecentForumTopics.php
บรรทัด: 170



SMF 2.0.15 , PHP 7.1.15 on Windows host
SMF 2.0.15 | PHP 7.X | MySql 5.6 | Softer theme | SMFAds

Pipke

#143
Quote from: minimono on May 15, 2018, 01:14:42 AM
บุคคลทั่วไป


2: A non-numeric value encountered
D:/.../Sources/RecentForumTopics.php
บรรทัด: 170



SMF 2.0.15 , PHP 7.1.15 on Windows host

Here's the fix for now:

in Sources/RecentForumTopics.php

Find around line 30
Code (find) Select

if (isset($_REQUEST['start']) && $_REQUEST['start'] > 95)
$_REQUEST['start'] = 95;


Add this code after it:
Code (add after) Select

// Make sure start are numbers.
if (isset($_REQUEST['start']))
{
// Make sure its a string and not something else like an array
$_REQUEST['start'] = (string) $_REQUEST['start'];

// If there's a slash in it, we've got a start value! (old, compatible links.)
if (strpos($_REQUEST['start'], '/') !== false)
list ($_REQUEST['start'], $_REQUEST['start']) = explode('/', $_REQUEST['start']);

// Now make absolutely sure it's a number.
$_REQUEST['start'] = isset($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0;
}
// Well, start is going to be a number no matter what.
else
$_REQUEST['start'] = 0;
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

minimono

Past 7 days for fix A non-numeric value encountered is Ok. ;D


Today new Error Log.

IP address 144.48xxx.   
https://xxx.com/index.php?m=member&c=index&a=register&siteid=1
The database value you're trying to insert does not exist: category_list
Function: rft_mainbasic
file : D:/Inetpub/vhosts/xxx.com/httpdocs/Sources/RecentForumTopics.php
Line: 85

IP address 144.48xxx.   
https://xxx.com/index.php?m=member&c=index&a=register&siteid=1
2: Invalid argument supplied for foreach()
file : D:/Inetpub/vhosts/xxx.com/httpdocs/Sources/RecentForumTopics.php
Line: 53

IP address 144.48xxx.   
https://xxx.com/index.php?m=member&c=index&a=register&siteid=1
2: explode() expects parameter 2 to be string, array given
file : D:/Inetpub/vhosts/xxx.com/httpdocs/Sources/RecentForumTopics.php
Line: 52

IP address 144.48xxx.   
https://xxx.com/index.php?m=member&c=index&a=register&siteid=1
The database value you're trying to insert does not exist: category_list
Function: rft_mainbasic
file : D:/Inetpub/vhosts/xxx.com/httpdocs/Sources/RecentForumTopics.php
Line: 85

IP address 144.48xxx.   
https://xxx.com/index.php?m=member&c=index&a=register&siteid=1
2: Invalid argument supplied for foreach()
file : D:/Inetpub/vhosts/xxx.com/httpdocs/Sources/RecentForumTopics.php
Line: 53

IP address 144.48xxx.   
https://xxx.com/index.php?m=member&c=index&a=register&siteid=1
2: explode() expects parameter 2 to be string, array given
file : D:/Inetpub/vhosts/xxx.com/httpdocs/Sources/RecentForumTopics.php
Line: 52


my file RecentForumTopics.php
Thanks you.
SMF 2.0.15 | PHP 7.X | MySql 5.6 | Softer theme | SMFAds

Pipke

@minimono i cannot help with that if the user goes with IP address 144.48xxx goes to
https://xxx.com/index.php?m=member&c=index&a=register&siteid=1
that site isnt save.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

minimono

image on this error log http://postto.me/1r/24w



Sorry iam not good at English. Use translate by google.co.th
SMF 2.0.15 | PHP 7.X | MySql 5.6 | Softer theme | SMFAds

Pipke

this request -> ?m=member&c=index&a=register&siteid=1
has nothing todo with my mod and its also not a standard request that smf by default in core uses, sorry i cant help you with that, you need to find out from where the link is coming from, maybe from other mod idk?
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

minimono

SMF 2.0.15 | PHP 7.X | MySql 5.6 | Softer theme | SMFAds

jakes_t

Hi, very nice mod. I like how it exposes some of the topics immediately without having to dig. Just one issue - it's not responsive when viewed on a phone (if you have the responsive curve mod installed). Would it be hard to fix?

Pipke

Quote from: jakes_t on May 30, 2018, 01:14:08 AM
Hi, very nice mod. I like how it exposes some of the topics immediately without having to dig. Just one issue - it's not responsive when viewed on a phone (if you have the responsive curve mod installed). Would it be hard to fix?

fix for that is in this topic a view pages back:
https://www.simplemachines.org/community/index.php?topic=522114.msg3806914#msg3806914

and

https://www.simplemachines.org/community/index.php?topic=522114.msg3806942#msg3806942
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

jack208

I've implemented this mod and it's working fine on my 2.0.15 site. Love the mod. Has a very nicely structured layout with paging for the list of recent topics.

One que (or issue). During our migration (from IPBoard), we did a lot of review/re-formatting of some posts (due to HTML/BBCode compatibility) and those topics are being shown in the list of recent topics (even tho there is no "reply" to those topics since the migration). This resulted in a rather long list of recent topics (13 pages in total).

Is there a way for us to reset the list (flush some cut-off date?) so that this list starts with zero topics (yeah we might lose one or two "real" recent topics, but that's fine for us)? TQ

Pipke

Quote from: jack208 on June 26, 2018, 01:12:21 AM
I've implemented this mod and it's working fine on my 2.0.15 site. Love the mod. Has a very nicely structured layout with paging for the list of recent topics.

One que (or issue). During our migration (from IPBoard), we did a lot of review/re-formatting of some posts (due to HTML/BBCode compatibility) and those topics are being shown in the list of recent topics (even tho there is no "reply" to those topics since the migration). This resulted in a rather long list of recent topics (13 pages in total).

Is there a way for us to reset the list (flush some cut-off date?) so that this list starts with zero topics (yeah we might lose one or two "real" recent topics, but that's fine for us)? TQ

The recent forum topics are getting renewed(updated) when there are made new topics or replies, you only have to wait for that if it has about 100 new ones, if you have a busy forums that will happen within a week then or so, its better to wait for that instead of implenting a code to query after certain date. just my view on it.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

dekatria

I use Recent Forum Topics Extended.

I get too many errors in the error log.

Undefined index: poster_time

=>1250:
'delete_possible' => ($row['id_first_msg'] != $row['id_msg'] || $row['id_last_msg'] == $row['id_msg']) && (empty($modSettings['edit_disable_time']) || $row['poster_time'] + $modSettings['edit_disable_time'] * 60 >= time()),

Pipke

Quote from: dekatria on July 17, 2018, 05:25:21 AM
I use Recent Forum Topics Extended.

I get too many errors in the error log.

Undefined index: poster_time

=>1250:
'delete_possible' => ($row['id_first_msg'] != $row['id_msg'] || $row['id_last_msg'] == $row['id_msg']) && (empty($modSettings['edit_disable_time']) || $row['poster_time'] + $modSettings['edit_disable_time'] * 60 >= time()),


you can delete/remove that line entirely(1250), it has no function or purpose.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

dekatria

Thanks.
Waiting for the official version.

EthanR


FishingManMatt

Hi!

IMHO this is one of the greatest SMF mods!
Many thanks for sharing it with us!

Recently one of my moderators has noticed that on some mobile devices the RFT table extends past the right edge of the container. Please, take a look at my screenshot taken from the Chrome DevTools.
I'm using the default SMF template.

Is there anything I can do to fit the table to the main content section?

GigaWatt

Did this start happening over night or was it always like this?
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Pipke

Quote from: FishingManMatt on October 24, 2018, 03:17:06 PM
Is there anything I can do to fit the table to the main content section?

Can you provide a link to your forum, so we can see this behavior in action. At GigaWatt's site this looks all fine.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Advertisement: