Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Help & Support Foreign Characters Error
1 2
Pretorian
Posted on 29 May 2008, 20:19:53

Access: Member
Total Posts: 17
Joined: 2008-05-29

I tried to make a localization of this script For my Language "Georgian" (Tried to create categories and post news in my native Language),
But I have problem, foreign characters do not show correctly. It shows me octets
Quote:
ưƮưưƯ
Like this.. Then I Tried to alter the MySql collation to only UTF8_Unicode_ci, Not Worked. Then I tried to replace the function: "htmlspecialchars" with "htmlspecialcharsltgt". I Can't solve the problem. Read More About This Function _______________________

Chris! How To Overcome this problem, what do you thing
#201
Last edited by Pretorian at 2008-05-29 20:24:46 Reason:
Chris
Posted on 29 May 2008, 20:28:41

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Can you post some of the characters your trying to add as categories so I can do some testing with it?
#202
Pretorian
Posted on 29 May 2008, 20:34:52

Access: Member
Total Posts: 17
Joined: 2008-05-29

In Categories I created new category in "Georgian" Language, I also created a news in my language too.
In News List it is shown correctly, but when I click edit button it shows incorrectly "octets"
#203
Chris
Posted on 29 May 2008, 20:40:21

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

What you need to do is, edit the 'modcategories.mod' file which is in the modules directory, on line 131 find this line

Quote:
echo "<tr bgcolor=\"$color\"><td><a href=\"?action=options&mod=categories&edit=true&id=$row[id]\">". htmlspecialchars($row[name]) . "</a></td><td>$posts</td><td><input value=\"$row[id]\" name=\"selectedcats[]\" type=\"checkbox\" /></td></tr>\n";

and replace it with this line

Quote:
echo "<tr bgcolor=\"$color\"><td><a href=\"?action=options&mod=categories&edit=true&id=$row[id]\">$row[name]</a></td><td>$posts</td><td><input value=\"$row[id]\" name=\"selectedcats[]\" type=\"checkbox\" /></td></tr>\n";

Save and upload that file, the categories should display fine after that.
#204
Last edited by Chris at 2008-05-29 20:42:10 Reason:
Pretorian
Posted on 29 May 2008, 20:57:31

Access: Member
Total Posts: 17
Joined: 2008-05-29

Cool! Chris Thanks
Categories Problem now Solved :smile:

We need to solve a news section, also posted news are displayed incorrectly too at the index page
#205
Last edited by Pretorian at 2008-05-29 21:02:21 Reason:
Chris
Posted on 29 May 2008, 20:59:49

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Ok what you need to do is, add the following function to config.php

Code:
function htmlspecialchars2($str) {
$str = str_replace('<','&lt;',$str);
$str = str_replace('>','&gt;',$str);
return $str;
}

Then edit the following files and replace 'htmlspecialchars' with 'htmlspecialchars2', you can do a search and replace to do an entire file at once.

These are the files you'll need to edit

Quote:
modules/addnews.mod
modules/editnews.mod
modules/private.mod
index.php
#206
Last edited by Chris at 2008-05-29 21:20:38 Reason:
Pretorian
Posted on 29 May 2008, 21:33:59

Access: Member
Total Posts: 17
Joined: 2008-05-29

Cool Chris! you're Super

News Management Section Works OK, Just one thing the first index.php shows errors....

#207
Chris
Posted on 29 May 2008, 21:35:39

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Can you post the error messages it shows?
#208
Pretorian
Posted on 29 May 2008, 21:41:45

Access: Member
Total Posts: 17
Joined: 2008-05-29

Chris this is not a system or php error.
I mean my language is displayed incorrectly "octets" at the index.php where the post is seen
#209
Chris
Posted on 29 May 2008, 21:52:12

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Edit 'bbparser.php', on line 84 it says

Quote:
$bb2html = htmlentities($bb2html, ENT_NOQUOTES, 'utf-8');

If you comment out this line by putting a # infront or just delete it, it should solve your problem.

What this means is the Allow/Disallow HTML function won't work, meaning if you create an Access Level and don't allow it to use HTML they still will be able.
#5
1 2
Network-13.com © 2013