forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: linuxhata on October 29, 2005, 12:26:38 pm

Title: Problem adding link with unicode text
Post by: linuxhata on October 29, 2005, 12:26:38 pm
I've used search, and found no similar problem

I've added this code to theme.php (waterdrop), after the "albums" link

<!-- BEGIN forum_list -->
                        <a href="http://www.damireke.com/forum/" title="ფორუმი">ფორუმი</a>
                        <img src="themes/water_drop/images/orange_carret.gif" width="8" height="8" border="0" alt="" />
<!-- END forum_list -->

for some strange reasons, I'm getting error "unexpected $ in theme.php at line 1395"

What I'm doing wrong?
Title: Re: Problem adding link with unicode text
Post by: artistsinhawaii on October 29, 2005, 07:01:37 pm

I can't see anything wrong with the link you added.  I even ran it on my own setup. The problem lies elsewhere.  Did you check to see if you had an extra $ <--character in 1395? Or a space between the $ and the parameter that doesn't belong?

Dennis
Title: Re: Problem adding link with unicode text
Post by: linuxhata on October 30, 2005, 07:52:22 am
Problem only arises when I try to save edited theme.php in UTF-8. If I save it in plain format, there is no problems, but my text is converted to garbage in such case (it requires UTF-8 to be displayed). If I save to UTF-8, then again, we have this problem.
Title: Re: Problem adding link with unicode text
Post by: artistsinhawaii on October 30, 2005, 08:03:10 am
Possibly, the only way around this is to mimic the ALB_LIST_LNK menu pattern and place two declared parameters, appropriate to your link,  in your language file and have theme.inc.php call these from the language file.  Save the language file in utf-8, and the theme.inc.php file as text.
Dennis
Title: Re: Problem adding link with unicode text
Post by: Joachim Müller on October 30, 2005, 12:04:21 pm
don't save coppermine core files (except the language files) in utf-8, as most editors deliberately add a byte order mark (http://www.unicode.org/faq/utf_bom.html#22) (aka "BOM") at the very start of the page but don't display it. Don't add unicode special chars into the core code files. Instead: use html entities as a workaround, or define strings in your language file that hold your language stuff.
Title: Re: Problem adding link with unicode text
Post by: linuxhata on October 30, 2005, 01:42:45 pm
Hm, I've solved that problem in this way:

Instead editing theme.php in frontpage, I've opened it from notepad, made changes, and then saved as utf-8. Everything works ok now, thanks all for hints.
Title: Re: Problem adding link with unicode text
Post by: Joachim Müller on October 30, 2005, 01:53:28 pm
never, ever use a WYSIWYG editor like MS frontpage to edit coppermine files.
Title: Re: Problem adding link with unicode text
Post by: linuxhata on October 30, 2005, 02:09:59 pm
Personally, I'd prefer not to edit anything at all, but we have no choice..... :)
Title: Re: Problem adding link with unicode text
Post by: Joachim Müller on October 30, 2005, 02:14:47 pm
yeah, but when you feel the urge to edit anything, use an editor instead of an app that is meant to be used only by complete newbies to play with html pages they created in the first place. Frontpage can not be used with any pre-mad script, it is just plain wrong to use it at all. This is not meant to be a flame against the app or the company that created it, but you should use the tools for what they have been built to be used. Frontpage has been bult to doodle an html page on your local PC, you can't use it for anything else.