I discovered that the reason all the content and stories that will NOT post to my Nuke 6.5 site is because it won't allow any SINGLE QUOTATION MARKS in the content! That means I can't use contractions like "can't" or possessive nouns like "Sherri's website."
I can use single quotation marks in Articles' titles and stories, but not in Content.
PLEASE tell me how to fix this horribly annoying problem. I have WAY too many documents to publish that cannot go without single quotation marks, and they can't all be published as articles (which wouldn't be a fix but merely an inconvenient workaround).
The problem is not in the php.ini file.
Thanks,
Sherri
Imago Captain
Joined: Jan 17, 2003
Posts: 629
Location: Europe
Posted:
Mon Apr 14, 2003 10:09 am
Before publishing the documents paste them in your Word and replace all single quotations marks with single quotations marks.
As a result you will get this
"can’t" or possessive nouns like "Sherri’s website.
which is rather different from the initial
"can't" or possessive nouns like "Sherri's website.
And your DB will accept the round single QMs.
Their code is Alt+0146
Raven General
Joined: Mar 22, 2003
Posts: 5233
Location: USA
Posted:
Mon Apr 14, 2003 10:18 am
I haven't tested Imago's code but I will assume that it works. However, the work-around is totally unacceptable and needs to be fixed. I'm sure that one of us will resolve this soon for you. I will take this up with the other Elites.
Oh, I never tested it either. But I am entering much encyclopedia articles directly to the encyclopedia_text table and the replace SQMs is a must, otherwise I will get errors.
Raven General
Joined: Mar 22, 2003
Posts: 5233
Location: USA
Posted:
Mon Apr 14, 2003 10:30 am
This is obviously an oversight in the 6.5 code and needs to be addressed. Man, I'm surprised that others haven't been raising cain over this before now. Or, maybe they have and I just missed it. I see where it can be fixed but I have to test it thoroughly before I would publish it.
Total pain indeed! Someone else told me on another board that you can't use double quotation marks in the Submit_News feature, but I haven't tried it myself.
One other workaround method if you're using MS Word is just to paste or type your document in Word as you normally do, and then from the Edit menu choose "Replace" (or you can just type Ctrl+H). Type a single quotation mark in the find field and in the replace place, type in \'. Press "Relace All" and it will place a backslash in front of every single quotation mark in less than a second. Luckily the backslash makes php ignore the quotation mark or something to that effect.
~ Sherri
Raven General
Joined: Mar 22, 2003
Posts: 5233
Location: USA
Posted:
Mon Apr 14, 2003 7:57 pm
That's exactly the correction I'm referring to. Check your php.ini setting and see if magic_quotes are on. Chances are they aren't and that's why you have the 'problem'. I, as well as many others, choose to NOT enable magic_quotes by default. So, the code needs to use the addslashes() function. If you have magic_quotes on and you're still having the problem, that's even worse. Please let us know.
I'm not all that clear about the exact problem discussed here so i will assume you can't add pages to the Content module when there are single quotes in what is being added, i've encountered similar problems but in my case it wouldn't block me from getting the data into the database, it would just return something like susy's dress as susy\'s dress, i take it that is not what is happening here but anyway i'll suggest opening admin/modules/content.php and replacing:
function content_save_edit($pid, $title, $subtitle, $page_header, $text, $page_footer, $signature, $clanguage, $active, $cid) {
global $prefix, $dbi;
$text = stripslashes(FixQuotes($text));
sql_query("update ".$prefix."_pages set cid='$cid', title='$title', subtitle='$subtitle', active='$active', page_header='$page_header', text='$text', page_footer='$page_footer', signature='$signature', clanguage='$clanguage' where pid='$pid'", $dbi);
Header("Location: admin.php?op=content");
}
Of course if this had nothing to do with the Content module just ignore this post.
_________________ Feed a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
ScriptHeaven | NukeResources
cakepro Corporal
Joined: Apr 11, 2003
Posts: 55
Posted:
Mon Apr 14, 2003 9:35 pm
Raven,
I went back and reread Imago's post and realized I just repeated what he said about replacing single quotes in Word.
My webhost refused to change the magic_quotes to on but told me I could do it myself somehow using an .htaccess file that they didn't know how to create but they are sure I could find the information on Google. Sheesh.
Like I know enough about all this to go creating new files.
Chatserv ~ I am definitely referring to being unable to post in the Contents module. I'll go change that file now and see what happens.
Thanks, you guys!
~ Sherri
chatserv General
Joined: Jan 12, 2003
Posts: 3128
Location: Puerto Rico
Posted:
Mon Apr 14, 2003 9:45 pm
The modification i suggested which is basically inserting the $text = stripslashes(FixQuotes($text)); line would only have an effect on the main text, if it even works and you also have the problem with titles and subtitles you'd need to add additional lines like:
_________________ Feed a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
ScriptHeaven | NukeResources
cakepro Corporal
Joined: Apr 11, 2003
Posts: 55
Posted:
Mon Apr 14, 2003 9:57 pm
I included the two additional lines of code in that file as you instructed and sure enough, I can now add single quotes to my heart's content in the Contents module.
The only thing that still doesn't work is adding single quotes in the titles of pages in Contents.
It must be nice knowing what you're doing!
Thank you, and please let me know if you can come up with the code to let me add single quotes in the titles and subtitles of pages in the Content section.
and still can't use single quotes in titles & subtitles? odd, i'll have to look into it tomorrow if no one else gets it first as it is over 2 am here and i'm a bit tired.
_________________ Feed a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
ScriptHeaven | NukeResources
cakepro Corporal
Joined: Apr 11, 2003
Posts: 55
Posted:
Mon Apr 14, 2003 10:19 pm
The first fix you posted didn't have the fix for the title and subtitle, but I just modified that file again with your second fix and BOOM! Single quotes EVERYWHERE!
LOL ~ thanks so much. It's pretty exhilarating to modify files like that and have it work. I really hope I eventually get to the point where I can figure out things like this by myself.
Thanks again!
Sherri
Davidwatterson Nuke Cadet
Joined: Apr 19, 2003
Posts: 1
Posted:
Sat Apr 19, 2003 7:09 am
I'm encountering similar problems but with the Journal module - it won't save posts with quotation marks and doesn't correctly interpret <P> tags. Other modules I'm using treat these fine.
I discovered the single quotes problem also applies to weblinks' titles and descriptions. Not being one who understands the language of php, I would appreciate it if someone would provide instructions on modifying those associated files as clearly as the instructions above.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum