Advertisement:

Author Topic: SimplePortal  (Read 1544054 times)

Offline dodos26

  • Semi-Newbie
  • *
  • Posts: 46
Re: SimplePortal
« Reply #5500 on: February 19, 2020, 09:13:34 AM »
Hey I use smf utf8 and see this bug in shoutbox:

Offline Stirius

  • Semi-Newbie
  • *
  • Posts: 68
Re: SimplePortal
« Reply #5501 on: February 19, 2020, 11:01:31 AM »
Ok, so I am not the only one. I tried to check the database. If I change the text directly in the database, where utf-8 is correctly set up, everything shows fine. But as we can see, using different letters right now is not correctly inserted into the database. Something is blocking it. Some letters are completely denied and nothing is shown, some letters are changed to those symbols...

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,278
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: SimplePortal
« Reply #5502 on: February 19, 2020, 09:19:10 PM »
I was able to duplicate the issue & fix it.
It involves database collation & charset changes.
I will give you some instruction, please follow what I say precisely.

  • BACKUP your entire database. This will be necessary to keep your website data if something goes wrong with the process.
  • Enter your forum Admin section & navigate to: Forum Maintenance -> Database -> Convert HTML-entities to UTF-8 characters -> Run Task Now
  • Choose UTF-8 and commence the process
  • Download the following package from this link (click where it says Download): https://web-develop.ca/index.php?action=downloads;area=stable_smf_utilities;file=36
  • Install the package on your forum
  • Enter your forum Admin section & navigate to: Forum Maintenance ->Database Collations
  • Use the drop-down to select either one of these collations: utf8-general-ci or utf8-unicode-ci   ....  make sure NOT to choose utf8mb4
  • Press the "Save" button at the bottom
  • Be patient & wait for the process to adjust your database

It should work after that.
You also have the option of using "Convert VARCHAR and TEXT to UTF8" if you want to convert things already in the database.
Although this process may take a long time for large databases.


 

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline dodos26

  • Semi-Newbie
  • *
  • Posts: 46
Re: SimplePortal
« Reply #5503 on: February 20, 2020, 03:13:43 AM »
I try but I see error:
Hacking attempt...

Offline Stirius

  • Semi-Newbie
  • *
  • Posts: 68
Re: SimplePortal
« Reply #5504 on: February 20, 2020, 05:38:41 AM »
No, it doesn't work. We have our database in utf-8-czech-ci. Using the package with utf-general-ci or whatever does nothing. Converting VARCHAR to UTF-8 only completely changes czech chars to wrong ones. So this procedure is not working...

The problem is not with the database, that is correct. But most probably the connection and correctly added entries from the shoutbox. Just this one is making issues, forum is absolutely fine.

Offline dodos26

  • Semi-Newbie
  • *
  • Posts: 46
Re: SimplePortal
« Reply #5505 on: February 20, 2020, 06:16:35 AM »
The problem is that shoubox encodes characters by itself with any function, but when we use utf8 it doesn't decode it. The problem is in the code.
I don't remember what function it was but I found an entry somewhere in Google that it was coded by a function.

Offline Stirius

  • Semi-Newbie
  • *
  • Posts: 68
Re: SimplePortal
« Reply #5506 on: February 20, 2020, 07:11:51 AM »
Well, it was working earlier with lower version of smf and lower version of the simple portal. So the problem is there, in the update and a wrong code in one of them.

Offline dodos26

  • Semi-Newbie
  • *
  • Posts: 46
Re: SimplePortal
« Reply #5507 on: February 21, 2020, 11:07:21 AM »
have any ideas?

Offline Stirius

  • Semi-Newbie
  • *
  • Posts: 68
Re: SimplePortal
« Reply #5508 on: February 21, 2020, 11:35:37 AM »
I am not a programmer so I hope that the creator here will come up with the solution, update, fix...

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,278
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: SimplePortal
« Reply #5509 on: February 22, 2020, 12:27:36 PM »
Are the two of you able to make a file edit for testing?

Please use a proper file editor such as Notepad++ or something else that is designed for unix file editing.
Do not use Microsoft Notepad because it will change line ending characters and mess up any files you edit.

Notepad++ can be downloaded here: https://notepad-plus-plus.org/downloads/

Now edit this file: ../Themes/default/scripts/portal.js

find:
Code: [Select]
shout_body = escape(document.getElementById('new_shout_' + shoutbox_id).value.replace(/&#/g, "&#").php_to8bit()).replace(/\+/g, "%2B");

replace with:
Code: [Select]
shout_body = encodeURIComponent(document.getElementById('new_shout_' + shoutbox_id).value.replace(/&#/g, "&#").php_to8bit()).replace(/\+/g, "%2B");

 
After the edit & prior to testing please ensure that you delete your browser history.
This will make the browser reload the javascript file for the new edit to work.

Please let me know if this works for you.
Thanks.

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline Stirius

  • Semi-Newbie
  • *
  • Posts: 68
Re: SimplePortal
« Reply #5510 on: February 22, 2020, 05:57:33 PM »
Hurray, seems to be working. I had to also delete cache on Cloudflare but right now it looks good. Thanks.

Offline dodos26

  • Semi-Newbie
  • *
  • Posts: 46
Re: SimplePortal
« Reply #5511 on: February 23, 2020, 06:11:42 AM »
For me also work thanks! And I just wanted the escape function in the post above! I was looking for it but in php files instead of js file :DD

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,107
  • Gender: Male
Re: SimplePortal
« Reply #5512 on: March 26, 2020, 09:07:25 AM »
[...]

I did these changes in PortalBlocks.php (of SimplePortal 2.3.7) for SMF 2.0.14/2.0.15:

Code: (search) [Select]
global $smcFunc, $context, $scripturl, $modSettings, $txt, $color_profile;
Code: (replace) [Select]
global $smcFunc, $context, $scripturl, $modSettings, $txt, $color_profile;
global $image_proxy_enabled, $image_proxy_secret, $boardurl;

[...]
I noticed that after making this change, the "board news" function of simpleportal has a bug, it creates duplicates the topics connected to the board in the home. Solutions?
I suppose this function is sp_boardNews. Write here code of this function, perhaps you have an error.
I have reset the portalblocks.php file without the changes you indicated, and the problem is solved so I think there is some problem with your modification. Thanks  you and merry christmas :)
About this, my code was "correct" but I had a mistake in sp_boardNews function: I wrote two time same code and this shown topics duplicated. :-[



These are the changes in PortalBlocks.php (of SimplePortal 2.3.7) for SMF 2.0.16/2.0.17:

Code: (Search) [Select]
$members[] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'posts' => comma_format($row['posts']),
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
);
Code: (Replace by) [Select]
$members[] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'posts' => comma_format($row['posts']),
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . get_proxied_url($row['avatar']) . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? get_proxied_url($row['avatar']) : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? get_proxied_url($row['avatar']) : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
);

Code: (Search) [Select]
$members[] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
'output' => $output,
'complete_row' => $row,
);
Code: (Replace by) [Select]
$members[] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . get_proxied_url($row['avatar']) . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? get_proxied_url($row['avatar']) : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? get_proxied_url($row['avatar']) : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
'output' => $output,
'complete_row' => $row,
);

Code: (Search) [Select]
$return[] = array(
'id' => $row['id_topic'],
'message_id' => $row['id_msg'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
'subject' => $row['subject'],
'time' => timeformat($row['poster_time']),
'views' => $row['num_views'],
'body' => $row['body'],
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $txt['sp-read_more'] . '</a>',
'replies' => $row['num_replies'],
'comment_href' => !empty($row['locked']) ? '' : $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';num_replies=' . $row['num_replies'],
'comment_link' => !empty($row['locked']) ? '' : '| <a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';num_replies=' . $row['num_replies'] . '">' . $txt['ssi_write_comment'] . '</a>',
'new_comment' => !empty($row['locked']) ? '' : '| <a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . '">' . $txt['ssi_write_comment'] . '</a>',
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => !empty($row['id_member']) ? $scripturl . '?action=profile;u=' . $row['id_member'] : '',
'link' => !empty($row['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>' : $row['poster_name']
),
'locked' => !empty($row['locked']),
'is_last' => false,
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
);
Code: (Replace by) [Select]
$return[] = array(
'id' => $row['id_topic'],
'message_id' => $row['id_msg'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
'subject' => $row['subject'],
'time' => timeformat($row['poster_time']),
'views' => $row['num_views'],
'body' => $row['body'],
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $txt['sp-read_more'] . '</a>',
'replies' => $row['num_replies'],
'comment_href' => !empty($row['locked']) ? '' : $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';num_replies=' . $row['num_replies'],
'comment_link' => !empty($row['locked']) ? '' : '| <a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';num_replies=' . $row['num_replies'] . '">' . $txt['ssi_write_comment'] . '</a>',
'new_comment' => !empty($row['locked']) ? '' : '| <a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . '">' . $txt['ssi_write_comment'] . '</a>',
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => !empty($row['id_member']) ? $scripturl . '?action=profile;u=' . $row['id_member'] : '',
'link' => !empty($row['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>' : $row['poster_name']
),
'locked' => !empty($row['locked']),
'is_last' => false,
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . get_proxied_url($row['avatar']) . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? get_proxied_url($row['avatar']) : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? get_proxied_url($row['avatar']) : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
);

Code: (Search) [Select]
$staff_list[$row['type'] . '-' . $row['id_member']] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'group' => $row['group_name'],
'type' => $row['type'],
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
);
Code: (Replace by) [Select]
$staff_list[$row['type'] . '-' . $row['id_member']] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'group' => $row['group_name'],
'type' => $row['type'],
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . get_proxied_url($row['avatar']) . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? get_proxied_url($row['avatar']) : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? get_proxied_url($row['avatar']) : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
);

Code: (Search) [Select]
$articles[] = array(
'id' => $row['id_topic'],
'name' => $row['subject'],
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['subject'] . '</a>',
'poster' => array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
),
'image' => array(
'href' => $row['picture'],
'image' => '<img src="' . $row['picture'] . '" alt="' . $row['name'] . '" />',
),
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
);
Code: (Replace by) [Select]
$articles[] = array(
'id' => $row['id_topic'],
'name' => $row['subject'],
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['subject'] . '</a>',
'poster' => array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
),
'image' => array(
'href' => $row['picture'],
'image' => '<img src="' . $row['picture'] . '" alt="' . $row['name'] . '" />',
),
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . get_proxied_url($row['avatar']) . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? get_proxied_url($row['avatar']) : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? get_proxied_url($row['avatar']) : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
);

Code: (Search) [Select]
$blogs[] = array(
'id' => $row['blog_id'],
'name' => $row['name'],
'href' => $scripturl . '?blog=' . $row['blog_id'] . '.0',
'link' => '<a href="' . $scripturl . '?blog=' . $row['blog_id'] . '.0">' . $row['name'] . '</a>',
'article' => array(
'id' => $row['article_id'],
'subject' => strip_tags($row['subject']),
'link' => '<a href="' . $scripturl . '?article=' . $row['article_id'] . '.0">' . $row['subject'] . '</a>',
),
'owner' => array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
),
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
);
Code: (Replace by) [Select]
$blogs[] = array(
'id' => $row['blog_id'],
'name' => $row['name'],
'href' => $scripturl . '?blog=' . $row['blog_id'] . '.0',
'link' => '<a href="' . $scripturl . '?blog=' . $row['blog_id'] . '.0">' . $row['name'] . '</a>',
'article' => array(
'id' => $row['article_id'],
'subject' => strip_tags($row['subject']),
'link' => '<a href="' . $scripturl . '?article=' . $row['article_id'] . '.0">' . $row['subject'] . '</a>',
),
'owner' => array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
),
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . get_proxied_url($row['avatar']) . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? get_proxied_url($row['avatar']) : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? get_proxied_url($row['avatar']) : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
);

Code: (Search) [Select]
$blogs[$row['id_board']] += array(
'article' => array(
'id' => $row['id_topic'],
'subject' => $row['subject'],
'link' => '<a href="' . $scripturl . '?action=blog;sa=view_post;id=' . $row['id_topic'] . '">' . $row['subject'] . '</a>',
),
'owner' => array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
),
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
);
Code: (Replace by) [Select]
$blogs[$row['id_board']] += array(
'article' => array(
'id' => $row['id_topic'],
'subject' => $row['subject'],
'link' => '<a href="' . $scripturl . '?action=blog;sa=view_post;id=' . $row['id_topic'] . '">' . $row['subject'] . '</a>',
),
'owner' => array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
),
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . get_proxied_url($row['avatar']) . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? get_proxied_url($row['avatar']) : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? get_proxied_url($row['avatar']) : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
);

Offline ShanesTA

  • Semi-Newbie
  • *
  • Posts: 19
Re: SimplePortal
« Reply #5513 on: March 29, 2020, 08:53:34 PM »
Hi Team,

I'm having some problems with SimplePortal after upgrading SMF to 2.0.17 and upgrading to PHP 7.

My site now just shows:


An Error Has Occurred!
syntax error, unexpected 'new' (T_NEW)

I have enabled PHP logging on my host and thw following is the only information I have:

#0 /Sources/PortalBlocks.php(3593): eval()
#1 /Sources/Load.php(2266) : eval()'d code(234): sp_php(Array, '17')
#2 /Sources/Load.php(2266) : eval()'d code(148): template_block_curve(Array)
#3 /Sources/Load.php(2266) : eval()'d code(99): template_block(Array)
#4 /Sources/Load.php(1978): template_portal_below()
#5 /Sources/Subs.php(3565): loadSubTemplate('portal_below', true)
#6 /Sources/Subs.php(2918): template_footer()
#7 /Sources/Errors.php(334): obExit(NULL, true, false, true)
#8 /Sources/Errors.php(162): setup_fatal_error_context('syntax error, u...')
#9 /inde in /Sources/PortalBlocks.php(3593) : eval()'d code on line 10

I'm not sure if this is of any help?

Thank you
Shane

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,851
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SimplePortal
« Reply #5514 on: March 29, 2020, 10:49:12 PM »
Are you on the newest version of Simple Portal?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,278
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: SimplePortal
« Reply #5515 on: March 29, 2020, 10:53:20 PM »
I suspect you may have a PHP block with deprecated or corrupt code.

Navigate directly to your admin URL and disable all PHP type blocks.
If your site works afterward then you can enable PHP blocks one by one until you find which one is causing the error.

Let me know if this resolves the problem.

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline ShanesTA

  • Semi-Newbie
  • *
  • Posts: 19
Re: SimplePortal
« Reply #5516 on: March 30, 2020, 07:49:40 PM »
Thank you for the advice.

Unfortunately even going directly to the admin url is not possible as the same error appears. My web host allows me to switch between php versions so I was temporarily able to switch back to php 5.6.

I was then able to access the admin area and disable all the blocks. Unfortunately as soon as I switched back to php 7 the error occurred again.

Do you have any more ideas?

Thank you

Offline ShanesTA

  • Semi-Newbie
  • *
  • Posts: 19
Re: SimplePortal
« Reply #5517 on: March 30, 2020, 07:57:00 PM »
Thank you for your time. Unfortunately I have found the problem; it was the Gallery 2 Integration plugin :(

Thanks again
Shane

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,278
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: SimplePortal
« Reply #5518 on: March 31, 2020, 05:19:18 PM »
Glad you found the problem.

Is that the pro version of vbgamer45's mod?
If so, I suggest you ask him on his site to update that mod.

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,904
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: SimplePortal
« Reply #5519 on: April 18, 2020, 06:08:42 PM »
No, it's something I developed years ago to integrate the old Gallery 2 script with SMF. I stopped developing it because Gallery 2 was no longer in development and they also stopped development on Gallery 3 in mid-2014 (though someone else picked up development on that again back in November).

Unfortunately your only real option is to move on to something else as it would be way too much work to get Gallery2 to work with PHP 7 (too much work for one person anyway)
Michael Eshom
Cincy Space - now open!