News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Help updating file to version 2.0.18

Started by FragaCampos, March 27, 2021, 02:03:00 AM

Previous topic - Next topic

FragaCampos

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.


Kindred

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',
),

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

FragaCampos

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',
),



shadav

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

Advertisement: