Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Tekyürek replikacep.com on February 10, 2022, 02:37:35 PM

Title: temp_topics what name did this code take
Post by: Tekyürek replikacep.com on February 10, 2022, 02:37:35 PM
preg_replace_callback('/"'.preg_quote($scripturl, '/').'\?topic=([0-9]*).*?"/e', $buffer, $temp_topics, PREG_PATTERN_ORDER);

$topic_pattern = $boardurl . '/{B_NAME}{TOPIC_SUBJECT}-t{TOPIC_ID}.{TREST}.html{OTHER}';

if (isset($temp_topics))
{
$temp_topics = array_unique($temp_topics[1]);
foreach ($temp_topics as $index => $value)
{
$temp_topics[$index] = (int) $value;

if ($value == 0)
unset($temp_topics[$index]);
}
}

if (!empty($temp_topics))
{
$request = $smcFunc['db_query']('', '
SELECT m.id_topic, m.id_board, m.subject' . ((!empty($modSettings['seo4smf_topic_board'])) ? ',b.name' : '') . '
FROM {db_prefix}topics as t
LEFT JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
' . ((!empty($modSettings['seo4smf_topic_board'])) ? 'LEFT JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)' : '') . '
WHERE t.id_topic IN ({array_int:topics_array})',
array
(
'topics_array' => $temp_topics,
)
);






temp_topicswhat name did this code take
Title: Re: temp_topics what name did this code take
Post by: Diego Andrés on February 10, 2022, 03:03:32 PM
I can't find that, so if the code is from a mod you'd have to ask in the appropriate support topic
Title: Re: temp_topics what name did this code take
Post by: Tekyürek replikacep.com on February 10, 2022, 03:09:41 PM
Quote from: Diego Andrés on February 10, 2022, 03:03:32 PMI can't find that, so if the code is from a mod you'd have to ask in the appropriate support topic


php 8 gives an error, the main source of error

preg_match_all('/"'.preg_quote($scripturl, '/').'\?topic=([0-9]*).*?"/e', $buffer, $temp_topics, PREG_PATTERN_ORDER);



preg_match_all  this is incompatible with php 8
Title: Re: temp_topics what name did this code take
Post by: Diego Andrés on February 10, 2022, 03:12:42 PM
preg_match_all is not deprecated  ???
Title: Re: temp_topics what name did this code take
Post by: Aleksi "Lex" Kilpinen on February 10, 2022, 03:16:56 PM
Quote from: Replikacep on February 10, 2022, 03:09:41 PMpreg_match_all  this is incompatible with php 8
Compatible with PHP 4 - PHP 8
https://www.php.net/manual/en/function.preg-match-all.php
Title: Re: temp_topics what name did this code take
Post by: Arantor on February 10, 2022, 03:18:43 PM
Yes, but the /e part has been deprecated since PHP 5.5. The whole thing needs a rewrite to use preg_replace_callback.
Title: Re: temp_topics what name did this code take
Post by: shawnb61 on February 10, 2022, 03:22:32 PM
I'm with Diego...  Can't find that in 2.1.  Maybe a mod?
Title: Re: temp_topics what name did this code take
Post by: Diego Andrés on February 10, 2022, 03:25:43 PM
I could find 2 mods with seo4smf in the name but they are deleted from the modsite.
Perhaps you should use a more recent alternative, such as Optimus mod?
Title: Re: temp_topics what name did this code take
Post by: Arantor on February 10, 2022, 03:28:29 PM
They were deleted from the mod site because they had major security flaws.

In any case, PMing me to do free work I didn't agree to do just guarantees I won't touch it.
Title: Re: temp_topics what name did this code take
Post by: Tekyürek replikacep.com on February 10, 2022, 03:29:54 PM
Quote from: Diego Andrés on February 10, 2022, 03:25:43 PMI could find 2 mods with seo4smf in the name but they are deleted from the modsite.
Perhaps you should use a more recent alternative, such as Optimus mod?

mod gives error in 1 place only
should i change for this

2: preg_match_all(): The /e modifier is no longer supported, use preg_replace_callback instead
Title: Re: temp_topics what name did this code take
Post by: Tekyürek replikacep.com on February 10, 2022, 03:30:36 PM
Quote from: Arantor on February 10, 2022, 03:28:29 PMThey were deleted from the mod site because they had major security flaws.

In any case, PMing me to do free work I didn't agree to do just guarantees I won't touch it.
:laugh:  ok
Title: Re: temp_topics what name did this code take
Post by: Kindred on February 10, 2022, 08:13:38 PM
You should use a mod with current support
Title: Re: temp_topics what name did this code take
Post by: Tekyürek replikacep.com on February 11, 2022, 01:04:02 AM
Quote from: Kindred on February 10, 2022, 08:13:38 PMYou should use a mod with current support
Is there a mod that translates links and has a sitemap?
Title: Re: temp_topics what name did this code take
Post by: Diego Andrés on February 11, 2022, 02:11:37 AM
https://custom.simplemachines.org/index.php?mod=2659