News:

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

Main Menu

temp_topics what name did this code take

Started by Seyit replikacep.com, February 10, 2022, 02:37:35 PM

Previous topic - Next topic

Seyit replikacep.com

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

Diego Andrés

I can't find that, so if the code is from a mod you'd have to ask in the appropriate support topic

SMF Tricks - Free & Premium Responsive Themes for SMF.

Seyit replikacep.com

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

Diego Andrés


SMF Tricks - Free & Premium Responsive Themes for SMF.

Aleksi "Lex" Kilpinen

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Arantor

Yes, but the /e part has been deprecated since PHP 5.5. The whole thing needs a rewrite to use preg_replace_callback.

shawnb61

I'm with Diego...  Can't find that in 2.1.  Maybe a mod?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Diego Andrés

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?

SMF Tricks - Free & Premium Responsive Themes for SMF.

Arantor

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.

Seyit replikacep.com

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

Seyit replikacep.com

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

Kindred

Сл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."

Seyit replikacep.com

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?

Diego Andrés


SMF Tricks - Free & Premium Responsive Themes for SMF.

Advertisement: