Light Portal

Started by Bugo, March 25, 2020, 07:36:36 AM

Previous topic - Next topic

Bugo

@~Souza~, did you set up the portal from scratch or did you upgrade? In any case, try performing a reinstallation with a complete removal of the tables in the database (I mean the portal tables!). What is your version of PHP and the database?

What were you doing before this problem occurred? What other modifications have you installed? Which theme is being used?

~Souza~

I'll try a new install one more time. I will report back!

~Souza~

So the plugins page is back after a new install, so that works. I didn't do anything IMO that caused it, so I am not sure what the problem was. I tried upgrading but that broke my forum every time, so in the end I tried a fresh install (also of the forum) and that worked. But then the weird stuff happened about an hour later.

What I still can't get to work (never was able to) and not sure if I am just missing something obvious, is the blog function? It's in the menu, in the profiles etc. but I can't find anywhere to actually post a blog?

~Souza~

Quote from: ~Souza~ on December 02, 2024, 05:28:17 AMAlso got this.

I am still getting these errors though. I did fix the who's online avatar stuff already as you mention on the previous page.

Bugo

Errors may be related to missing settings in the database. You just need to go to the settings of the specific block or plugin that is causing the errors, select the settings you need, and save the changes.

As for the blog, when creating a page, you can specify its type - regular (default), internal, or blog post. Accordingly, blog posts will be displayed at the address ?action=blog (or another one if specified in the settings of the BlogMode plugin). Also, don't forget to configure the appropriate permissions for your members.

~Souza~

Quote from: Bugo on December 02, 2024, 01:34:34 PMErrors may be related to missing settings in the database. You just need to go to the settings of the specific block or plugin that is causing the errors, select the settings you need, and save the changes.

Didn't do the trick. I even deleted the block from the portal and still get the error. On any theme by the way.


This is what I get in the file that has an error on line 178:

178:          if ($parameters['show_whos_online'] && $boardStats['whos_online']) {
179:                $onlineTitle = User::hasPermission('who_view')
180:                    ? Str::html('a', Lang::$txt['online_users'])->href(Config::$scripturl . '?action=who')
181:                    : Lang::$txt['online_users'];
182:   
183:                $whosOnlineDiv = Str::html('div');
184:                $whosOnlineHeader = Str::html('h4')->addHtml(
185:                    ($parameters['use_fa_icons']
186:                        ? Str::html('i', ['class' => 'fas fa-users'])
187:                        : Str::html('span', ['class' => 'main_icons people'])) .
188:                    ' ' . $onlineTitle
189:                );

~Souza~

Quote from: Bugo on December 02, 2024, 01:34:34 PMAs for the blog, when creating a page, you can specify its type - regular (default), internal, or blog post. Accordingly, blog posts will be displayed at the address ?action=blog (or another one if specified in the settings of the BlogMode plugin). Also, don't forget to configure the appropriate permissions for your members.

Ahhhh! Got it.

Bugo

Find this line
$parameters['show_latest_member'] ??= false; in the file Sources/LightPortal/Plugins/BoardStats.php and add the following lines after it:

$parameters['show_whos_online'] ??= false;
$parameters['show_basic_info'] ??= false;
$parameters['use_fa_icons'] ??= false;

~Souza~

That worked, thanks. But now the plugin page is messed up again.

~Souza~

Quote from: ~Souza~ on December 02, 2024, 05:00:21 PMThat worked, thanks. But now the plugin page is messed up again.

I figured out what causes it. The Plugins page gets messed up when I add the simple chat block to my portal, goes back to normal when I remove it again. At least I know a way around it now but maybe you can see if you can replicate and fix it?

Bugo

I knew chat blocks were evil! :) Open Sources/LightPortal/Plugins/PluginHandler.php, find this block:

$this->prepareAssets();
$this->prepareListeners($plugins);

and replace it with:

$this->prepareListeners($plugins);
$this->prepareAssets();

Then clear the forum cache.

razor1995

How to increase the height of Simple Chat?
Currently it looks like the screenshot - I would like more messages to be visible.

Bugo

You need to edit the property max-height: 100px; in the file Sources/LightPortal/Plugins/SimpleChat/style.css.

razor1995

Hi @Bugo, unfortunately it's not working, I changed the value like this:
.block_simple_chat {
.moderation_notes {
height: 100%;
max-height: 400px;
margin-bottom: 10px;
padding-right: 1em;
}

.avatar {
width: 20px;
vertical-align: bottom;
}

.main_icons.delete {
cursor: pointer;
margin-top: -1px;
margin-left: 10px;
}

.full_width {
float: none;
width: 100%;
}
}

Bugo

Did you clear cache?

Try to remove Themes/default/css/light_portal/plugins.css after your changes.

razor1995

#395
@Bugo, yes, cache was cleaned.
View when you're logged in:
https://i.imgur.com/oLxLGzE.png [nofollow]

View without login (it should be high like this every time):
https://i.imgur.com/90Z6UzZ.png [nofollow]

Bugo

Browser cache, forum cache?

Perhaps I should add a chat window height setting to the block settings?

kurapika

#397
I have a problem with a single user who is generating hundreds of errors in a few hours.
The errors are all related to the /Sources/LightPortal/Hooks/Init.php file.

The error messages that only affect this user are all as follows:
  • Constant LP_ADDON_PATTERN already defined
  • Constant LP_AREAS_PATTERN already defined
  • Constant LP_ALIAS_PATTERN already defined
  • Constant LP_BASE_URL already defined
  • Constant LP_PAGE_PARAM already defined
  • Constant LP_CACHE_TIME already defined
  • Constant LP_ADDON_URL already defined
usw.


One of the reports in detail:
19.12.2024 | 21:20
Benutzername
12.345.78.99
adg848ba0ccb5648c20dpc2a3f39zda
https://forum.example.com/index.php?action=profile;area=forumprofile;u=7
/www/htdocs/w05fan27/forum.example.com/Sources/LightPortal/Hooks/Init.php (Zeile 44)

Art des Fehlers: Generell
Fehlermeldung Auswählen
2: Constant LP_ADDON_PATTERN already defined


What can I do?


EDIT: It occurs for every user (except the admin), every time action=profile;area=forumprofile;u=123 is accessed/changed! Each access results in exactly 13 errors

Bugo

Open that Init.php and add this code before Utils::$context['lp_load_time']:

if (defined('LP_NAME'))
return;

kurapika

Unfortunately that didn't bring any improvement, there were still 13 errors per visit in the profile.
Think I'll remove the portal again.
Because even if such a code works, it will be gone with the next update.

Advertisement: