News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SimplePortal

Started by SimplePortal Team, March 10, 2008, 11:16:07 PM

Previous topic - Next topic

Dave J

Quote from: Chen Zhen on October 03, 2021, 07:10:37 PMYour error message actually shows line 3591 of PortalBlocks.php which is just the eval function that executes the code from your custom PHP blocks.
Line 35 is what's triggering the error from a PHP custom block.

Disable every custom PHP block, switch back to PHP 7.4 and then enable your custom PHP blocks one at a time until the error occurs. This will allow you to determine which blocks are causing the error.
Keep in mind that you may have multiple custom PHP blocks containing deprecated code.
With that possibility this process may have to be repeated.
 
If you copy the problem block code in a proper code editor it will give you line numbers which should allow you to find the line of code causing the error.

I've only just seen this as I didn't get an alert/email to say it was posted.

Thanks UD I'll look into it.
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

Dave J

Quote from: Chen Zhen on October 03, 2021, 07:10:37 PMYour error message actually shows line 3591 of PortalBlocks.php which is just the eval function that executes the code from your custom PHP blocks.
Line 35 is what's triggering the error from a PHP custom block.

Disable every custom PHP block, switch back to PHP 7.4 and then enable your custom PHP blocks one at a time until the error occurs. This will allow you to determine which blocks are causing the error.
Keep in mind that you may have multiple custom PHP blocks containing deprecated code.
With that possibility this process may have to be repeated.
 
If you copy the problem block code in a proper code editor it will give you line numbers which should allow you to find the line of code causing the error.

I have found the issue now and removed the block. Thanks UD
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

Chen Zhen

Quote from: WellwisherI am trying to move a block to the 1st position. When I attempt to change it, I get the following new error:

It's never happened before, I have been running this mod for years  :-\

Current version I am using is SimplePortal version 2.3.7

The rest of my forum seems to be fine.

Database Error
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 'row = row + 1
WHERE col = 4
AND row >= 1
AND row < 3' at line 2
File: ////forum/Sources/PortalAdminBlocks.php
Line: 662

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.18, while your database is at version 2.0.4. The above error might possibly go away if you execute the latest version of upgrade.php.

I reported this to Sinan in the past: ref. https://github.com/SimplePortal/SimplePortal/issues/17
.. he used a column name in this mod that became a reserved word in MySQL.
There are only 2 ways to fix it but both involve editing the SP code..

(1) encase each instance of that column name with grave accents

or

(2) replace that column name with ie. rowx in the installer and the regular code. This will also involve editing the sp_blocks table in ie. PhpMyAdmin to change the column name.
 

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Wellwisher

Quote from: Chen Zhen on November 30, 2021, 09:43:25 PM
Quote from: WellwisherI am trying to move a block to the 1st position. When I attempt to change it, I get the following new error:

It's never happened before, I have been running this mod for years  :-\

Current version I am using is SimplePortal version 2.3.7

The rest of my forum seems to be fine.

Database Error
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 'row = row + 1
WHERE col = 4
AND row >= 1
AND row < 3' at line 2
File: ////forum/Sources/PortalAdminBlocks.php
Line: 662

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.18, while your database is at version 2.0.4. The above error might possibly go away if you execute the latest version of upgrade.php.

I reported this to Sinan in the past: ref. https://github.com/SimplePortal/SimplePortal/issues/17
.. he used a column name in this mod that became a reserved word in MySQL.
There are only 2 ways to fix it but both involve editing the SP code..

(1) encase each instance of that column name with grave accents

or

(2) replace that column name with ie. rowx in the installer and the regular code. This will also involve editing the sp_blocks table in ie. PhpMyAdmin to change the column name.
 

Thank you Chen Zhen. At least your reply has relaxed me knowing that there's nothing wrong with my Smf set-up / data base.

You reported that to the dev in 2020 and its still not fixed. I am assuming this is why people have moved to other portals and shame on me for finding out late lol.

I was trying to put my Christmas banner in first place  ;D .


Chen Zhen


@Wellwisher:
You can use this slightly updated/modified version which should fix your MySQL reserved word problem.
ref. https://simpleportal.net/index.php?action=downloads;area=stable_beta_packages;file=147

If you have any problems with it please ask for support in this thread.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Wellwisher

Quote from: Chen Zhen on December 02, 2021, 06:17:23 PM@Wellwisher:
You can use this slightly updated/modified version which should fix your MySQL reserved word problem.
ref. https://simpleportal.net/index.php?action=downloads;area=stable_beta_packages;file=147

If you have any problems with it please ask for support in this thread.

Thank you. How do you recommend I update this mod? Should I completely uninstall the previous version, or just install new version as is?

I am assuming either way, I will lose all the content in my boxes (which isn't too much of a biggie)?

Chen Zhen

You uninstall Simple Portal 2.3.7 and then install SP 2.3.8 ..
you will not lose any block data if you leave the "Remove all data associated with this modification" <-- unchecked.


My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

rcane

Good morning,

I'm getting the following error when trying to use the portal shoutbox.

The SMF side didn't see a problem with the db and suggested a post over here.


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 'FROM smfqg_sp_blocks
WHERE col = 5
ORDER BY row DESC
LIMIT 1' at line 2
File: /home/myDomain/public_html/myDomainName.com/Sources/PortalAdminBlocks.php
Line: 680

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.18, while your database is at version 2.0.17. The above error might possibly go away if you execute the latest version of upgrade.php.

Chen Zhen


It seems like you have the same issue that Wellwisher reported a few posts back in this thread.

Uninstall your current Simple Portal package & replace it with this one:
https://simpleportal.net/index.php?action=downloads;area=stable_beta_packages;file=147

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

xtian

Hi I am trying to uninstall 2.3.7 so I can install 2.3.8 but says module can't be found.
It is running, or was untill I deleted the files in admin package manager.
Now can't install either 2.8.7 or 8
And smf 2.0.19 has errors in the install
I think I broke something :-(
Not a program person just a user
cheers

Chen Zhen


@xtian:
re. Simple Portal & the SMF 2.0 branch

Having no idea what you did regarding deleting files & such, you do have the option of using the repair_settings.php to remove all hooks and then use the SMF 2.0.19 upgrade package.
If you do those 2 steps properly your forum will be back to square one with the database intact.
After which you can install all your mods again.

repair_settings.php instructions (remove hooks link is on bottom right when using the file):
https://wiki.simplemachines.org/smf/Repair_settings.php

Upgrade instructions:
https://wiki.simplemachines.org/smf/Upgrading


My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Chen Zhen


SimplePortal 2.3.8-BETA2 has been released for those that are interested.
This version appears to be necessary for custom PHP blocks to work with SMF 2.0.19.

It can be downloaded here:
https://simpleportal.net/index.php?action=downloads;area=stable_beta_packages;file=147

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

efk

Quote from: efk on February 05, 2022, 12:56:04 PMWhen tracking user IP
8: Undefined index: banUpdate
?action=shoutbox;sa=get;xml;row=40

Error log
8: Undefined index: banUpdate
Only show the errors from this file
File: /home/name/www/www/Sources/Subs-Shoutbox.php
Line: 93

Ok, so I just noticed that a single user is caught in this error, we have SimplePortal shoutboxes, 3-5, 1 or 2 are public, and SMFPacks Shoutbox which is public, but I don't think there are any bans visible to me.
We just moved to the new hosting. I see user last activity was from 1 hour ago, but this error keep spamming error log for single user, what could it be?
We are at 2.0.18, before upgrading to 19 I want to make sure everything works.

Ataru Moroboshi

got this error trying to update a custom php block:

Parse error: syntax error, unexpected ''&#39;;' (T_ENCAPSED_AND_WHITESPACE) in C:\xampp\domain\bcorg\Sources\PortalBlocks.php(3605) : eval()'d code on line 12

it works well on 2.0.18, this is what i get after updating to 2.0.19.
i'm on 2.3.8, in 2.3.7 it was a laconic "syntax error: unexpected '='", or something similar.

they changed something in parsing code?

dodos26

It work for me on 2.0.19 when use two update pack 2.0.17 -- > 18 --> 19. I recently made a clean forum from the begining and now have this error "syntax error, unexpected 'if' (T_IF)" php 7.4 x64 and sp 2.3.7
{
$global $txt;

$items = ssi_recentAttachments(2, array('torrent'), 'array');

if (empty($items))
{
echo '
', $txt['error_sp_no_attachments_found'];
return;
}

echo '
<ul class="sp_list">';

foreach ($items as $item)
echo '
<li style="word-wrap: break-word; max-width: 100%">', sp_embed_image('attach'), ' <a href="', $item['file']['href'], '">',$item['file']['filename'], '</a></li>
<li class="smalltext">', $txt['downloads'], ': ', $item['file']['downloads'], '</li>
<li class="smalltext">', $txt['filesize'], ': ', $item['file']['filesize'], '</li>';

echo '
</ul>';
}

dodos26

Also error: syntax error, unexpected '&', expecting ']'

<?php
{

global $smcFunc$scripturl$modSettings$user_info$txt$context$color_profile$settings$db_prefix;

$list_limit 10;
$category_id_array_list = array(2);

$request $smcFunc['db_query']('''
SELECT
m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, b.id_parent, b.name AS board_name, t.num_replies, t.num_views, c.id_cat,
. ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from'
) . '
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
INNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)
LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)' 
. (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' 
'') . '
WHERE t.id_board != 0 AND c.id_cat = {array_int:category_id_array}' 
. ($modSettings['postmod_active'] ? '
AND t.approved = {int:approved}
AND m.approved = {int:approved}' 
'') . '
ORDER BY t.id_topic DESC
LIMIT {int:limit}'
,
array(
'approved' => 1,
'limit' => $list_limit,
'category_id_array' => $category_id_array_list,
'current_member' => $user_info['id'],
)
);

$topics = array();
while ($row $smcFunc['db_fetch_assoc']($request))
{
censorText($row['subject']);
$topics[] = $row;
}
$smcFunc['db_free_result']($request);

if (empty($topics))
{
echo $txt['error_sp_no_posts_found'];
return;
}
else
$topics[count($topics) - 1]['is_last'] = true;

$colorids = array();
foreach ($topics as $item)
$colorids[] = $item['id_member'];
sp_loadColors($colorids);

echo '<table class="sp_fullwidth">';

foreach ($topics as $item)
{
$allOfParents = array();
$allOfParents array_reverse(getBoardParents($item['id_parent']));
echo '
<tr>
<td class="sp_recent_icon sp_center">
'
sp_embed_image('topic'), '
</td>
<td class="sp_recent_subject">
<a href="'
$scripturl '?topic=' $item['id_topic'] . '.msg' $item['id_msg'] . ';topicseen#new''">'$item['subject'], '</a> 
'
, !empty($item['is_read']) ? '' '<a href="' $scripturl '?topic=' $item['id_topic'] . '.msg' $item['new_from'] . ';topicseen#new"><img src="' $settings['images_url'] . '/' $context['user']['language'] . '/new.gif" alt="' $txt['new'] . '" border="0" /></a>',
'<br />';
foreach ($allOfParents as $Parents_Data)
{
echo isset($Parents_Data['url']) ? '[<a href="' $Parents_Data['url'] . '">' $Parents_Data['name'] . '</a>]' '[' $Parents_Data['name'] . ']';
echo ' » ';
}
echo '[''<a href="' $scripturl '?board=' $item['id_board'] . '.0">' $item['board_name'] . '</a>'']
</td>
<td class="sp_recent_info sp_right">
'
$color_profile[$item['id_member']]['link'], ' | '$txt['sp-articlesViews'], ': '$item['num_views'], ' | '$txt['sp-articlesComments'], ': '$item['num_replies'], '<br />'timeformat($item['poster_time']), '
</td>
</tr>'
;
}
echo '</table>';

}
?>

Arantor

Um, that can't be the code causing the error. Your error message says it found a &, there is no & in that sample.

In any case, SimplePortal has not been maintained in a while... your choices are to upgrade to 2.1 and use the 2.1 version called EhPortal, or move to TinyPortal.

dodos26

U read what i say???

Arantor

Yes, yes I did. Unexpected &... in a piece of code that doesn't HAVE a & in it. So it CAN'T be that.

dodos26

#5659
I mean, it used to work fine, also if use patch to 18 next to 19 work good, but after clear install it dont work.
It looks like it to me, that a clean update has a function not properly closed somewhere.

I do not intend to go to 2.1 is ugly and a huge flop, so the developers working on it promote it so strongly, including closing the modification only for 2.1 (I know that older versions are hardly available for the average person but also not developed.).

And yes i try 2.3.8 but always get this:
Table 'dbname.sob_sp_blocks' doesn't exist
Plik: /home/www2/www3/smf/Packages/temp/smf2/install.php
Linia: 30

Advertisement: