Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: FragaCampos on March 27, 2021, 02:03:00 AM

Title: Help updating file to version 2.0.18
Post by: FragaCampos on March 27, 2021, 02:03:00 AM
Hi there.

I updated my forum from 2.0.17 to 2.0.18, but there's a file I'm not being able to edit correctly in order to make it work in 2.0.18.

The file is ManageSmileys.php and the changes the update asks are:
Code (find) Select
'function' => create_function('$rowData', '
global $txt;

if (empty($rowData[\'hidden\']))
return $txt[\'smileys_location_form\'];
elseif ($rowData[\'hidden\'] == 1)
return $txt[\'smileys_location_hidden\'];
else
return $txt[\'smileys_location_popup\'];
'),
'class' => 'windowbg',
),


Code (replace) Select
'function' => function($rowData) use ($txt)
{
if (empty($rowData['hidden']))
return $txt['smileys_location_form'];
elseif ($rowData['hidden'] == 1)
return $txt['smileys_location_hidden'];
else
return $txt['smileys_location_popup'];
},
'class' => 'windowbg',
),



The problem is I have a different line due to a mod and I can't get it work. If I edit it, I get a blank page when visiting the Smileys panel in admin section.
What I have is this:
'function' => create_function('$rowData', '
global $txt, $modSettings;

if (empty($rowData[\'hidden\']))
return $txt[\'smileys_location_form\'];
elseif ($rowData[\'hidden\'] == 1)
return $txt[\'smileys_location_hidden\'];
else

return $txt[\'smileys_location_popup\'] . \' (\' . $txt[\'tabbed_smileys_tab\']. \': \' . (!empty($modSettings[\'tabbed_smileys\'][\'popup\'][$rowData[\'smiley_row\']+1]) ? $modSettings[\'tabbed_smileys\'][\'popup\'][$rowData[\'smiley_row\']+1] : ($txt[\'additional_smileys\'] . \' \' . $rowData[\'smiley_row\']+1)) . \')\';
'),
'class' => 'windowbg',
),


Any help on how to change the line that starts with return $txt[\'smileys_location_popup\'] ?

I'm pretty sure is something simple, but I don't know what it is.

Thanks.
Title: Re: Help updating file to version 2.0.18
Post by: shadav on March 27, 2021, 05:05:24 AM
tabbed smiley mod
https://www.simplemachines.org/community/index.php?topic=417533.msg4080830#msg4080830

Title: Re: Help updating file to version 2.0.18
Post by: Kindred on March 27, 2021, 10:18:38 AM
try using this....


'function' => function($rowData) use ($txt)
{
if (empty($rowData['hidden']))
return $txt['smileys_location_form'];
elseif ($rowData['hidden'] == 1)
return $txt['smileys_location_hidden'];
else
return $txt['smileys_location_popup'] . ' (' . $txt['tabbed_smileys_tab']. ': ' . (!empty($modSettings['tabbed_smileys']['popup'][$rowData['smiley_row']+1]) ? $modSettings['tabbed_smileys']['popup'][$rowData['smiley_row']+1] : ($txt['additional_smileys'] . ' ' . $rowData['smiley_row']+1)) . ')';
},
'class' => 'windowbg',
),

Title: Re: Help updating file to version 2.0.18
Post by: FragaCampos on March 27, 2021, 02:37:18 PM
It worked flawlessly and without errors. :)

Thank you, Kindred!



Quote from: Kindred on March 27, 2021, 10:18:38 AM
try using this....


'function' => function($rowData) use ($txt)
{
if (empty($rowData['hidden']))
return $txt['smileys_location_form'];
elseif ($rowData['hidden'] == 1)
return $txt['smileys_location_hidden'];
else
return $txt['smileys_location_popup'] . ' (' . $txt['tabbed_smileys_tab']. ': ' . (!empty($modSettings['tabbed_smileys']['popup'][$rowData['smiley_row']+1]) ? $modSettings['tabbed_smileys']['popup'][$rowData['smiley_row']+1] : ($txt['additional_smileys'] . ' ' . $rowData['smiley_row']+1)) . ')';
},
'class' => 'windowbg',
),


Title: Re: Help updating file to version 2.0.18
Post by: shadav on March 27, 2021, 05:42:31 PM
you forgot the modsettings kindred ;)

if you follow the link I posted, I posted the fix there and also noted while it is "fixed" there are still some errors in the logs so it still needs something fixed but I don't know what/where
but it at least works