Customizing SMF > Modifications and Packages

SimplePortal

<< < (1077/1077)

WantSome:
Hello!

I've noticed this error on my error log which I believe is related to this mod...


--- Quote ---forum/index.php?action=forum
8: Undefined variable: scripturl
File: /home/wnsecmxs/public_html/forum/Sources/BoardIndex.php
Line: 44
--- End quote ---

This is the section it is referring to...


--- Quote ---42:      // Set a canonical URL for this page.
43:      if (!empty($modSettings['sp_portal_mode']) && $modSettings['sp_portal_mode'] == 1)
==>44:         $context['canonical_url'] = $scripturl . '?action=forum';
45:      else
46:         $context['canonical_url'] = $scripturl;

--- End quote ---

I understand this is code that the simple portal modification adds, but from the package parse information it's not critical.

Should I just remove / undo this code?  Or can you please advise if there is a better solution?

Thanks!

Chen Zhen:

The edits are needed.
$scripturl is a global that should be located at the onset of that SMF function by default.
Although Simple Portal added the lines you posted, $scripturl should have been declared prior to using it.
Ensure that it is included in the list of globals at the beginning of the BoardIndex() function.

Navigation

[0] Message Index

[*] Previous page

Go to full version