I changed the below from the lowest code with three quote marks to the immediate below with quote mark, apostrophe, quote mark; I wanted to have apostrophes in this field show properly on the website. When I then uploaded this (part of a custom module) I got a php error and the site did not appear. I had to restore to a backup of the module. My question is how do I get it to do what I want? Further, I need to change for the same filed "<br>" to a new line. I have text in there which is exported from a database and sometimes has <br> to create a new line in straight html.
$node->field_book_title['und']['0']['value'] = str_replace("'","'",$node->field_book_title['und']['0']['value']);
it used to be: $node->field_book_title['und']['0']['value'] = str_replace("'","" ",$node->field_book_title['und']['0']['value']);
thanks,
Pia
You're using the wrong escaping syntax for php. You could use \ but I find it easier to use single quotes like this:
The double quote is surrounded by ' if you can't read it.
_replace("'",'"',$node->field_book_title['und']['0']['value']);
________________________________ From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Pia Oliver Sent: Thursday, April 25, 2013 3:58 PM To: support@drupal.org Subject: [support] asci and html question in Drupal
I changed the below from the lowest code with three quote marks to the immediate below with quote mark, apostrophe, quote mark; I wanted to have apostrophes in this field show properly on the website. When I then uploaded this (part of a custom module) I got a php error and the site did not appear. I had to restore to a backup of the module. My question is how do I get it to do what I want? Further, I need to change for the same filed "<br>" to a new line. I have text in there which is exported from a database and sometimes has <br> to create a new line in straight html.
$node->field_book_title['und']['0']['value'] = str_replace("'","'",$node->field_book_title['und']['0']['value']);
it used to be: $node->field_book_title['und']['0']['value'] = str_replace("'","" ",$node->field_book_title['und']['0']['value']);
thanks,
Pia
--
www.piasworld.com
"But where is the ambiguity? It's over there, in a box." --J.Cleese
perhaps I copied the wrong instance; what I want to do is to replace ' with an apostrophe. Your response to me looks like it's a quote mark? I mean a single quote mark/apostrophe like in "Pia's question"
thanks,
Pia
Metzler, David mailto:metzlerd@evergreen.edu April 25, 2013 17:01
You're using the wrong escaping syntax for php. You could use \ but I find it easier to use single quotes like this:
The double quote is surrounded by ' if you can't read it.
_replace("'",'"',$node->field_book_title['und']['0']['value']);
On 4/25/13 8:29 PM, Pia Oliver wrote:
perhaps I copied the wrong instance; what I want to do is to replace ' with an apostrophe. Your response to me looks like it's a quote mark? I mean a single quote mark/apostrophe like in "Pia's question"
thanks,
Pia
use "'" (double-quote apostrophe double-quote) or ''' (slash escape the ')
That is an apostrophe. You can also do
$node->field_book_title['und']['0']['value'] = html_entity_decode($node->field_book_title['und']['0']['value']);
That will get any other HTML entites that might be hiding in there.
For the <br>:
$node->field_book_title['und']['0']['value'] = str_replace('<br>', "\n", $node->field_book_title['und']['0']['value']);
That's if you're sure all your <br> all the same. Better option:
$node->field_book_title['und']['0']['value'] = preg_replace('#<br\s*/?>#i', "\n", $node->field_book_title['und']['0']['value'] );
That get's all the variations (<br>, <BR>, <br />, etc.)
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 4/25/2013 8:29 PM, Pia Oliver wrote:
perhaps I copied the wrong instance; what I want to do is to replace ' with an apostrophe. Your response to me looks like it's a quote mark? I mean a single quote mark/apostrophe like in "Pia's question"
thanks,
Pia
Metzler, David mailto:metzlerd@evergreen.edu April 25, 2013 17:01 asci and html question in Drupal
You're using the wrong escaping syntax for php. You could use \ but I find it easier to use single quotes like this:
The double quote is surrounded by ' if you can't read it.
_replace("'",'"',$node->field_book_title['und']['0']['value']);
-- Pia Oliver
I am getting the message
"
No profiles available
We were unable to find any installer profiles. Installer profiles tell us what modules to enable and what schema to install in the database. A profile is necessary to continue with the installation process."
This is on a new site I am attempting to set up in a somewhat non-standard environment and I am unfamiliar with profiles.
How can I get started? Googling didn't quite do it for me.
Marty
Marty, When I got started with Drupal, I purchased one of the Drupal for Dummies books. Drupal is now at version 7 (8 is too new to use yet) and you need to make sure the book covers the version you are using. One gotcha is the invisible .htaccess file that must be in the root of your installation. Another important file is the setups.php file in the sites/default folder. I use MAMP on Mac or WAMP on windows to create a local version to play with.
Get a book. It will save you loads of time and orient you to the drupal way of doing things.
Good luck. Bill
William Prothero http://es.earthednet.org
On Apr 26, 2013, at 5:32 AM, Marty Landman mlandman@face2interface.com wrote:
I am getting the message
"
No profiles available
We were unable to find any installer profiles. Installer profiles tell us what modules to enable and what schema to install in the database. A profile is necessary to continue with the installation process."
This is on a new site I am attempting to set up in a somewhat non-standard environment and I am unfamiliar with profiles.
How can I get started? Googling didn't quite do it for me.
Marty
-- [ Drupal support list | http://lists.drupal.org/ ]
Bill,
I appreciate the advice, I'm a newbie to profiles but not to Drupal. However am taking on a setup which is non-standard and in production. One of the things I noticed right away is there is no .htaccess for our sites. The developers have put all the mod_rewrite directives on the httpd.conf file.
Not the only problem I'm gonna be dealing with here, needless to say.
Marty
At 09:45 AM 4/26/2013, Waprothero@gmail.com wrote:
Marty, When I got started with Drupal, I purchased one of the Drupal for Dummies books. Drupal is now at version 7 (8 is too new to use yet) and you need to make sure the book covers the version you are using. One gotcha is the invisible .htaccess file that must be in the root of your installation. Another important file is the setups.php file in the sites/default folder. I use MAMP on Mac or WAMP on windows to create a local version to play with.
Get a book. It will save you loads of time and orient you to the drupal way of doing things.
Good luck. Bill
William Prothero http://es.earthednet.org
On Apr 26, 2013, at 5:32 AM, Marty Landman mlandman@face2interface.com wrote:
I am getting the message
"
No profiles available
We were unable to find any installer profiles. Installer profiles tell us what modules to enable and what schema to install in the database. A profile is necessary to continue with the
installation process."
This is on a new site I am attempting to set up in a somewhat non-standard environment and I am unfamiliar with profiles.
How can I get started? Googling didn't quite do it for me.
Marty
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
My wife uses Drupal for her website. We've long lost track of the developer that set it up for her but have discovered that she's running v.6.12 and really aught to update.
I've found a HowTo on the Drupal site - Updating Drupal 6.x to newer minor version.
Are there other links with perhaps a 'simpler' version of the same?
Can we safely go from 6.12 to whatever the latest version is? Or do we need to some interim steps?
Any advice would be MUCH appreciated.
Thanks.
Bill,
You can upgrade from 6.x to any 6.x version, easily. But to upgrade from 6.x to 7.x is not that easy.
Currently, it would be great if you go ahead and upgrade your core 6.x files.
On Fri, Apr 26, 2013 at 8:09 PM, Bill Whitacre bw@his.com wrote:
My wife uses Drupal for her website. We've long lost track of the developer that set it up for her but have discovered that she's running v.6.12 and really aught to update.
I've found a HowTo on the Drupal site - Updating Drupal 6.x to newer minor version.
Are there other links with perhaps a 'simpler' version of the same?
Can we safely go from 6.12 to whatever the latest version is? Or do we need to some interim steps?
Any advice would be MUCH appreciated.
Thanks.
[ Drupal support list | http://lists.drupal.org/ ]
You can go from 6.12 to the latest/last version of 6.x. Once there you can upgrade to 7.x.
Bob
-----Original Message----- From: Bill Whitacre Sent: Friday, April 26, 2013 10:39 AM To: support@drupal.org Subject: [support] Any tricks to updating an old version of Drupal?
My wife uses Drupal for her website. We've long lost track of the developer that set it up for her but have discovered that she's running v.6.12 and really aught to update.
I've found a HowTo on the Drupal site - Updating Drupal 6.x to newer minor version.
Are there other links with perhaps a 'simpler' version of the same?
Can we safely go from 6.12 to whatever the latest version is? Or do we need to some interim steps?
Any advice would be MUCH appreciated.
Thanks.
Make sure you also update all contributed modules and themes to their latest versions before going 6 -> 7.
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 4/26/2013 11:20 AM, Bob Turner wrote:
You can go from 6.12 to the latest/last version of 6.x. Once there you can upgrade to 7.x.
Bob
-----Original Message----- From: Bill Whitacre Sent: Friday, April 26, 2013 10:39 AM To: support@drupal.org Subject: [support] Any tricks to updating an old version of Drupal?
My wife uses Drupal for her website. We've long lost track of the developer that set it up for her but have discovered that she's running v.6.12 and really aught to update.
I've found a HowTo on the Drupal site - Updating Drupal 6.x to newer minor version.
Are there other links with perhaps a 'simpler' version of the same?
Can we safely go from 6.12 to whatever the latest version is? Or do we need to some interim steps?
Any advice would be MUCH appreciated.
Thanks.
And if you have contributed modules, you need to know if they upgraded from D6 to D7 as well. If not you need to decide if you need the module.
Earnie
On Fri, Apr 26, 2013 at 11:48 AM, Jamie Holly hovercrafter@earthlink.net wrote:
Make sure you also update all contributed modules and themes to their latest versions before going 6 -> 7.
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 4/26/2013 11:20 AM, Bob Turner wrote:
You can go from 6.12 to the latest/last version of 6.x. Once there you can upgrade to 7.x.
Bob
-----Original Message----- From: Bill Whitacre Sent: Friday, April 26, 2013 10:39 AM To: support@drupal.org Subject: [support] Any tricks to updating an old version of Drupal?
My wife uses Drupal for her website. We've long lost track of the developer that set it up for her but have discovered that she's running v.6.12 and really aught to update.
I've found a HowTo on the Drupal site - Updating Drupal 6.x to newer minor version.
Are there other links with perhaps a 'simpler' version of the same?
Can we safely go from 6.12 to whatever the latest version is? Or do we need to some interim steps?
Any advice would be MUCH appreciated.
Thanks.
-- [ Drupal support list | http://lists.drupal.org/ ]
I have located the profiles directory which wasn't on my directory tree but is on another site's on the server. The developers are not around so I'm on my own but seem to be making progress.
However am wondering how the Drupal installation would even know it needed a profile. Does there have to be at least a profiles directory with a default folder on it for installation to proceed? Funny, I've done prolly a few dozen Drupal installations but never took note of that.
Marty
At 08:32 AM 4/26/2013, Marty Landman wrote:
I am getting the message
"
No profiles available
We were unable to find any installer profiles. Installer profiles tell us what modules to enable and what schema to install in the database. A profile is necessary to continue with the installation process."
This is on a new site I am attempting to set up in a somewhat non-standard environment and I am unfamiliar with profiles.
How can I get started? Googling didn't quite do it for me.
Marty
-- [ Drupal support list | http://lists.drupal.org/ ]