ok so trying to update some things and get rid of depreciated notices
but I've no clue really what I'm doing, looking online the each() needs to be rewritten to a foreach()
so this is the line of code
while((list($key, $val) = each($menu_buttons)) && $key != 'search')
$fnd++;
so er??? is this correct?
foreach(($menu_buttons as $key => $val) && $key != 'search')
$fnd++;
--
edit: so I gave it a shot and nope :laugh: that does not work
Parse error: syntax error, unexpected 'as' (T_AS)
I don't think you can use && in a foreach definition.
Perhaps something like this
foreach($menu_buttons as $key => $val)
{
if ($key == 'search')
break;
$find_me++;
}
Where you find that? I've seen that in adk portal? Or an old mod from smfpacks probably
Quote from: Diego Andrés on October 18, 2021, 02:14:11 PMPerhaps something like this
foreach($menu_buttons as $key => $val)
{
if ($key == 'search')
break;
$find_me++;
}
Where you find that? I've seen that in adk portal? Or an old mod from smfpacks probably
thank you that does work but now getting
Undefined variable: find_me :laugh: :laugh:
and yeah it's SMFPacks Dynamic Directory
I reported it to them back in march and they just said to ignore the error
I already paid live to help before to do some custom coding on the mod for me since nibogo was busy
well I can't really ignore it anymore as php 7.2 is now obsolete
I'm using 7.3 for this site but would like to be able to move to 7.4
so I'll have to update things on my own it seems, hopefully with some help from folks here when I have no clue what I'm doing ;D
Oh it's actually $fnd, the name of the var I didn't read correctly, just verify that
changed find_me to find
still
8: Undefined variable: find
but I can live with that if undefended variable is my only error :D
You fell for the same, it says $fnd not $find :P
son of a.... :laugh: :laugh: :laugh:
ok changed to $fnd++;
no more errors
thank you :)
test running php 7.4, no errors atm so all seems good...i'll give it a few days and see what may pop up
thank you