[support] update related

Victor Kane victorkane at gmail.com
Fri Jul 4 07:21:26 UTC 2008


In case you never came across a certain setting in Administer > Content
Management > Post settings, you can regulate the default length of trimmed
posts (assuming there is no <!--break-->  (notice "!" as part of syntax of
HTML comment) ).

On Fri, Jul 4, 2008 at 2:21 AM, bharani kumar <bharanikumariyerphp at gmail.com>
wrote:

> Hi dear
>
>
> am having the more then 1000 records,
>
> I want to insert the <--break-->,in that 1000 record ,
>
> in that there is field called body, which contain article, too big content
> in that ,
> now i want to insert the <--break-->, after every 1075 character has meet,
>
>
> also Never broke the  html tag...that is dont put the <--break-->
>
> between <<--break-->table>..
>
>
> for this i written the code
>
>
> <?php
> mysql_connect("localhost","root","admin");
> mysql_select_db("sample") or die("could not select the database");
> $sql = "select * from node_revisions";
> $rs = mysql_query($sql);
> if(mysql_num_rows($rs)>0)
> {
> while($obj=mysql_fetch_object($rs))
> {
> $body_chunksplit = $obj->body;
> $nid=$obj->nid;
> $body_chunksplit=str_replace("'", "\'", $body_chunksplit);
>  $lrn = strlen($body_chunksplit);
> $length=$lrn*2;
>
> if(strlen($body_chunksplit) >= 4500)
>   {
> $body_content=substr(chunk_split($body_chunksplit, 4500,
> "<--pagebreak-->"), 0, $length);
> //drupal_set_message(wordcount($body_content));
> }
> else
> {
> $body_content=$body_chunksplit;
> }
> mysql_query("UPDATE node_revisions SET body='$body_content' where
> nid='$nid'") or die("could not");
> }
>
>
> }
>
> ?>
>
> This is will not solved my total problem,
>
> Can any find the bug and solve it...
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20080704/87643d55/attachment-0001.htm 


More information about the support mailing list