News:

Wondering if this will always be free?  See why free is better.

Main Menu

TinyPortal

Started by lurkalot, February 12, 2005, 04:43:00 AM

Previous topic - Next topic

Kindred

Probably because images can be included or displayed in tp blocks that include bbc img tags?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

@rjen

I probably added it for a reason (usually do) but cannot remember
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

cookdandbombd

Quote from: @rjen on December 13, 2024, 01:14:24 AMThat css is rule is there specifically meant to target images in tinyportal articles if I am remembering correctly. That is needed there for responsive behaviour.

Please explain what use case this is iterfering with: WHERE are users adding images with height settings? I forum posts?

Thanks for the fix - just to confirm, yeah it's when users are making forum posts, some of them have only been using height and it's messed up their conversation. 

cihancan

Hello friends. Error records constantly occur on my site. I am attaching the error_log file regarding the error records. What is this error and how can it be fixed?

@rjen

Quote from: cihancan on January 10, 2025, 04:36:44 AMHello friends. Error records constantly occur on my site. I am attaching the error_log file regarding the error records. What is this error and how can it be fixed?

Please provide information:

SMF version
Tinyportal version
Php version
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

cihancan

Quote from: @rjen on January 10, 2025, 05:58:12 AM
Quote from: cihancan on January 10, 2025, 04:36:44 AMHello friends. Error records constantly occur on my site. I am attaching the error_log file regarding the error records. What is this error and how can it be fixed?

Please provide information:

SMF version
Tinyportal version
Php version

Smf version : 2.1.4
Tinyportal version : 3.0.1c
PHP version : 8.3

@rjen

I will check php version 8.3, that seems to be the most likely cause. For now, can you change php version to 8.2?
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

@rjen

The TinyPortal Team is pleased to announce the release of TinyPortal 3.0.2

TinyPortal 3.0.2 can be used on SMF 2.1 and should also work on SMF 3.0
Minimum required PHP version : 7.0.0
Highest supported PHP version (tested): 8.3.1

This includes the following updates and fixes:

Functional changes:
- updated functionality for setting image upload path.
- added option to userbox to show captions on login form for support screen reader
- update blockcode for most liked users

Technical changes and Bugfixes:
- moved to smf_strftime for PHP compatibility
- fixed error in PHP8.3: array_sum(): Addition is not supported on type string
- fixed error 8: Only variables should be passed by reference in TPdlmanager.php
- fixed shoutbox not positioning correctly on opening when new posts are set to show at the bottom
- update X-share link to new syntax for X
- updated catlist to use short names in URL when available

Notes:
Support for SMF2.0.x has been dropped starting TinyPortal version 3.0.0.
SMF2.0.x is still supported by TinyPortal, but only up to TinyPortal version 2.3.1.

Note that SMF3.0 is under development, we cannot guarantee stable support for 3.0 untill a Final version is released.
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

smap

Hi

1st of all thanks for the Tinyportal mode.

Just to let you know that Tinyportal version 3.02 with my current server Debian 12 with PHP 8.2.28 was having a bunch of errors like the following

2: Undefined array key "useavatar"
I looked for a solution and found something on this link - https://sentry.io/answers/notice-undefined-variable-index-array-key-and-offset-using-php/ [nofollow]

here's an example on file TPortal.php (/var/www/html/forum/Sources/TPortal.php) how I fixed it

Original code
$context['TPortal']['useavatar'] = $block['useavatar'];

Modified code with fix
//$context['TPortal']['useavatar'] = $block['useavatar'];
// Start - fix PHP 8 "Warning: Undefined array key"
if (!empty($context['TPortal']['useavatar']))
{
$context['TPortal']['useavatar'] = $block['useavatar'];
}
// End - fix PHP 8 "Warning: Undefined array key"

The problem on my forum happens basically with 2 files
- TPortal.php (/var/www/html/forum/Sources/TPortal.php)
- TPsubs.template.php (/var/www/html/forum/Themes/default/TPsubs.template.php)

Here are the files that I moded

You cannot view this attachment.

And here are the original files

You cannot view this attachment.

So it's really easy to compare. I don't know how great my changes are since I'm not a "developer", but it stopped having all the annoying errors that I was getting on my forum

@rjen

Thanks for reporting this.

Checking variables is a good thing generally, but since you are the only person reporting the issue it may be caused by something specific in your forum.

Can you please give some details on your forum and the procedure taken that resulted in the issue?

I also would like to know what TP version you had before (if any) and if you have any custom php blocks in your forum
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

@rjen

Checking the code this error can only be caused by an "Online" block or "Recent topics".

Somehow you have one of these blocks and managed to 'save' it without the "useavatar" value being saved for the block.
This should not happen in normal use, and if it does it would suffice opening the block and hit SAVE: no need to change Tinyportal code.

Now the question is: what did you change just before these errors started happening?
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Kindred

rjen--   might this happen if the forum allows guest posting? Because Guests would not have an avatar defined.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

@rjen

No, it does not have anything to do with guests. It is actually a block setting that is not set in the database.
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

smap

I did a lot of things because of a problem that I had on my main server and then had to get a new main server

I went from 2.0.15 to 2.1.4, with a big upgrade (files of 2.1.4 on top of the files of 2.0.15), then migrated from AEVA to LevGaL and everything was running fine without errors on my backup server Debian 10 with PHP 7.3

php -v
PHP 7.3.31-1~deb10u7 (cli) (built: Jun 17 2024 21:48:38) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.31, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.31-1~deb10u7, Copyright (c) 1999-2018, by Zend Technologies

Then I got a new server with Debian 12 and PHP 8.2.28

php -v
PHP 8.2.28 (cli) (built: Mar 13 2025 18:21:38) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.28, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.28, Copyright (c), by Zend Technologies

Both servers are provided by the same company, main (debian 12) and backup (Debian 10), just that on the backup server I never upgraded above Debian 10.

I did the upgrade from 2.0.15 to 2.1.4 on the backup server (Debian 10 with PHP 7.3), then I copied all the files to the new main server (Debian 12 with PHP 8.2.28). Exported the DB from the backup server and Imported it on the main server.

For instance on the backup server LevGal also works without problems, but on the new main server PHP 8.2.28 also had problems as you can read here - https://www.simplemachines.org/community/index.php?msg=4188478

Do you want me to show you both forums (on the backup server without issues and on the new one with issues) running?

@rjen

I am mostly interested in your Tinyportal upgrade, which you did not mention. I suspect you had a previous TinyPortal version running on SMF 2.0.14?

What version and how did you upgrade?
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

smap

I had TinyPortal 1.6.5 on 2.0.15, after upgrading SMF to 2.1.4, I installed 3.02

@rjen

I suspect you did not change any blocks after the upgrade?

We have had a similar report before. I suspect the Tinyportal upgrader has missed a step between 1.6.5 and 3.0.2
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

smap

Quote from: @rjen on April 14, 2025, 07:59:52 AMChecking the code this error can only be caused by an "Online" block or "Recent topics".

Somehow you have one of these blocks and managed to 'save' it without the "useavatar" value being saved for the block.
This should not happen in normal use, and if it does it would suffice opening the block and hit SAVE: no need to change Tinyportal code.

Now the question is: what did you change just before these errors started happening?

After I changed the code the avatars on the "Recent Topics" (sidebar) came back again, they had disappeared after the upgrade at same point and now they are back

You cannot view this attachment.

smap

Went to check the recent block configuration and t was like this on both forum, main server with PHP 8.2 and backup server PHP 7.3

You cannot view this attachment.

I set avatar to yes and it also asked to include or exclude boards.

Thanks for your help, I didn't know I had this problem, just tried to fix it, apparently without the need to do it.

I'm going to put the original files after saving the block on TinyPortal recent block


@rjen

Yep, that's the problem , and the solution.

This is not related to the php version, just a glitch when updating TinyPortal from this pretty old version to the latest version.

I will see sometime if I can reproduce this upgrade issue: at least we have established the cause...
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Advertisement: