Simone,<br><br>My opinion (which is not authoritative) regarding the easiest strategy to solve your problem would be to write a query which would select the contents of the teaser field and put it into a variable (remember to include the write the &quot;WHERE&quot; clause in the query to only pull the nodes you want to affect). Then you write another query which replaces the current content of the body field with the content of the teaser field that is in the variable that you stored. <br>

<br>The snippet you write can be run using Devel module&#39;s
&quot;drupal execute&quot; tool. That way you would avoid having to write a
module to implement a one-time task.<br><br>f you are not experienced writing code like this I&#39;ll give you this unsolicited advice to help get you started... <br><br>The first thing you need to do is to write your SELECT query and make sure it works and pulls in only the right rows from the node revisions table. The good part about this part is that you don&#39;t need to mess with PHP at this stage. You just query the database directly, using a tool like phpMyAdmin or the command line, whatever. When doing SELECT queries your blood preassure stays low because SELECT queries don&#39;t change the DB. [But still, back up the db before you even start, because you might forget after you start working.] <br>
<br>Next you write the query for replacing the body field with the teaser field contents. Again, no PHP, you just copy teaser contents from one node and hard code that into your query. (Be careful to add a clause &quot;WHERE nid=25&quot; --- where &quot;25&quot; is the node id where you copied the teaser from. This part raises your blood pressure a bit, since the test query actually does change the database. But by cleary limiting the query to one row, you keep things under good control.)<br>
<br>Once you have tested that the second query works, you can build the PHP snippet to cycle through each record creating new body fields using the variable which will have stored the results of the first query. <br><br>By having tested that your queries are correct first, you&#39;ll have much greater confidence building and then debugging the PHP snippet.<br>
<br>As an alternative to this whole approach to your problem, you might be able to write complicated custom views which would sometimes display the teaser field and sometimes display the full node based on taxonomy, url strings, or whatever. But I think it is cleaner to simply change the body field by putting in the data there that you actually want.<br>
<br>Good luck, report back,<br><br>Shai<br><br><div class="gmail_quote">On Wed, Dec 10, 2008 at 5:10 AM, Simone Dal Maso <span dir="ltr">&lt;<a href="mailto:simone.dalmaso@juvox.it">simone.dalmaso@juvox.it</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
I have a big problem.<br>
I have a ejournal in my website and I have about 1000 articles.<br>
Unfortunately, some of these are token from a website that has changed its<br>
policy and don&#39;t allow us to publish its material: only the 25% of articles<br>
can be published.<br>
We can distinguish these articles because there is always the original link<br>
that obviously starts with the same strings.<br>
We must select all the articles containing these strings in their body, and<br>
tells drupal to take the first 4 5 lines and delete the rest of contents.<br>
I have 2 ideas, but I&#39; not able to make it:<br>
1. with a sql query, I think all contents are in the node_revisions table.<br>
2. publishing only the teaser of the article.<br>
I think the second method is easier, but have you got some ideas how publish<br>
only a teaser and hide the entire body of some nodes?<br>
<br>
thanks for your attention and patience.<br>
Bye.<br>
<font color="#888888"><br>
--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</font></blockquote></div><br>