You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 56 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - [Fixed]Bug in Content - unable to use single quotation marks [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
cakepro
Corporal
Corporal


Joined: Apr 11, 2003
Posts: 55


PostPosted: Mon Apr 14, 2003 9:19 am Reply with quoteBack to top

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
Find all posts by cakeproView user's profileSend private message
Imago
Captain
Captain


Joined: Jan 17, 2003
Posts: 629

Location: Europe

PostPosted: Mon Apr 14, 2003 10:09 am Reply with quoteBack to top

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
Find all posts by ImagoView user's profileSend private messageVisit poster's website
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Mon Apr 14, 2003 10:18 am Reply with quoteBack to top

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.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
Imago
Captain
Captain


Joined: Jan 17, 2003
Posts: 629

Location: Europe

PostPosted: Mon Apr 14, 2003 10:26 am Reply with quoteBack to top

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.
Find all posts by ImagoView user's profileSend private messageVisit poster's website
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Mon Apr 14, 2003 10:30 am Reply with quoteBack to top

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.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
cakepro
Corporal
Corporal


Joined: Apr 11, 2003
Posts: 55


PostPosted: Mon Apr 14, 2003 7:41 pm Reply with quoteBack to top

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. Smile Luckily the backslash makes php ignore the quotation mark or something to that effect.


~ Sherri
Find all posts by cakeproView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Mon Apr 14, 2003 7:57 pm Reply with quoteBack to top

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.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
chatserv
General
General


Joined: Jan 12, 2003
Posts: 3128

Location: Puerto Rico

PostPosted: Mon Apr 14, 2003 8:57 pm Reply with quoteBack to top

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:
Code:
function content_save($title, $subtitle, $page_header, $text, $page_footer, $signature, $clanguage, $active, $cid) {
    global $prefix, $dbi;
    sql_query("insert into ".$prefix."_pages values (NULL, '$cid', '$title', '$subtitle', '$active', '$page_header', '$text', '$page_footer', '$signature', now(), '0', '$clanguage')", $dbi);
    Header("Location: admin.php?op=content");
}

function content_save_edit($pid, $title, $subtitle, $page_header, $text, $page_footer, $signature, $clanguage, $active, $cid) {
    global $prefix, $dbi;
    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");
}

with:
Code:
function content_save($title, $subtitle, $page_header, $text, $page_footer, $signature, $clanguage, $active, $cid) {
    global $prefix, $dbi;
    $text = stripslashes(FixQuotes($text));
    sql_query("insert into ".$prefix."_pages values (NULL, '$cid', '$title', '$subtitle', '$active', '$page_header', '$text', '$page_footer', '$signature', now(), '0', '$clanguage')", $dbi);
    Header("Location: admin.php?op=content");
}

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
Find all posts by chatservView user's profileSend private messageVisit poster's website
cakepro
Corporal
Corporal


Joined: Apr 11, 2003
Posts: 55


PostPosted: Mon Apr 14, 2003 9:35 pm Reply with quoteBack to top

Raven,
I went back and reread Imago's post and realized I just repeated what he said about replacing single quotes in Word. Embarassed

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
Find all posts by cakeproView user's profileSend private message
chatserv
General
General


Joined: Jan 12, 2003
Posts: 3128

Location: Puerto Rico

PostPosted: Mon Apr 14, 2003 9:45 pm Reply with quoteBack to top

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:
Code:
    $title = stripslashes(FixQuotes($title));
    $subtitle = stripslashes(FixQuotes($subtitle));

_________________
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
Find all posts by chatservView user's profileSend private messageVisit poster's website
cakepro
Corporal
Corporal


Joined: Apr 11, 2003
Posts: 55


PostPosted: Mon Apr 14, 2003 9:57 pm Reply with quoteBack to top

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! Smile

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.

~ Sherri
Find all posts by cakeproView user's profileSend private message
chatserv
General
General


Joined: Jan 12, 2003
Posts: 3128

Location: Puerto Rico

PostPosted: Mon Apr 14, 2003 10:09 pm Reply with quoteBack to top

So you changed the code to:
Code:
function content_save($title, $subtitle, $page_header, $text, $page_footer, $signature, $clanguage, $active, $cid) {
    global $prefix, $dbi;
    $text = stripslashes(FixQuotes($text));
    $title = stripslashes(FixQuotes($title));
    $subtitle = stripslashes(FixQuotes($subtitle));
    sql_query("insert into ".$prefix."_pages values (NULL, '$cid', '$title', '$subtitle', '$active', '$page_header', '$text', '$page_footer', '$signature', now(), '0', '$clanguage')", $dbi);
    Header("Location: admin.php?op=content");
}

function content_save_edit($pid, $title, $subtitle, $page_header, $text, $page_footer, $signature, $clanguage, $active, $cid) {
    global $prefix, $dbi;
    $text = stripslashes(FixQuotes($text));
    $title = stripslashes(FixQuotes($title));
    $subtitle = stripslashes(FixQuotes($subtitle));
    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");
}

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
Find all posts by chatservView user's profileSend private messageVisit poster's website
cakepro
Corporal
Corporal


Joined: Apr 11, 2003
Posts: 55


PostPosted: Mon Apr 14, 2003 10:19 pm Reply with quoteBack to top

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
Find all posts by cakeproView user's profileSend private message
Davidwatterson
Nuke Cadet
Nuke Cadet


Joined: Apr 19, 2003
Posts: 1


PostPosted: Sat Apr 19, 2003 7:09 am Reply with quoteBack to top

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.

See my associated post on phpnuke.org:

http://www.phpnuke.org/modules.php?name=Forums&file=viewtopic&t=6161&highlight=

An interesting problem!

David
Find all posts by DavidwattersonView user's profileSend private messageVisit poster's website
cakepro
Corporal
Corporal


Joined: Apr 11, 2003
Posts: 55


PostPosted: Sat Apr 19, 2003 10:40 am Reply with quoteBack to top

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.

Thanks,
Sherri
Find all posts by cakeproView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.254 Seconds - 474 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::