Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: Language variable duplicated  (Read 309 times)

infomix

  • Newbie
  • *
  • Karma: 7
  • Posts: 19
Language variable duplicated
« on: May 29, 2012, 12:29:56 AM »

This is a little bug, and that's exactly why this should have gone unnoticed for so long, but the correction should be made.

In the language file (default: lang / EN.php), the variable 'freeze_comments' is found in two instances, (in the inverse order) the first is used in the form of articles, the other is inactive due to duplication (which could not exist), and should be used in the settings panel.

EN.php
Line 64: $l['freeze_comments'] = 'Freeze All Comments (SiteWide)';
Line 199: $l['freeze_comments'] = 'Freeze comments';

The incorrect string appear in the settings panel:


Little Fix - just change the name of the variable from 'freeze_comments' to 'freeze_all_comments' is in two places:
1) EN.php - Line 64: $l['freeze_all_comments'] = 'Freeze All Comments (SiteWide)';
2) snews.php - Line 1687: echo html_input('checkbox','freeze_comments','dc','',l('freeze_all_comments'),'','','','',(s('freeze_comments') == 'YES' ? 'ok' : ''),'','','','','');

Result:

« Last Edit: June 01, 2012, 02:48:03 PM by infomix »
Logged

sibas

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 451
    • www.simply4all.net
Re: Language variable duplicated
« Reply #1 on: May 29, 2012, 03:41:32 PM »

Aha! Thats why I dont see the (SiteWide)
Thanks infomix karma to you!
Logged

infomix

  • Newbie
  • *
  • Karma: 7
  • Posts: 19
Re: Language variable duplicated
« Reply #2 on: May 29, 2012, 09:36:55 PM »

Aha! Thats why I dont see the (SiteWide)
Thanks infomix karma to you!

Thanks  :)

I consider duplicate, why should not exist two identical variables in the same language file, but in the logical sense, is just the same variable receiving two values​​, so the second string overwrites the first.

I am preparing a new post now, about a logical error / bug in the 'extra content' section. ;)
Logged