Sutanu... ([info]sutanu) wrote in [info]php_dev,
@ 2005-04-25 05:34:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Current mood: confused
Current music:Guns 'n Roses - Sweet Child O - Sweet Child O Mine

One Problem
But there is one problem in the code what i have given in the previous entry.

it shows the entry with date, time, current mood, current music and even the number of comments in that post...
But the problem i encountered in case of LJ-Cut... It doesn't keep the LJ-cut contents hiden. It shows the whole document. Coz in the XML of the entry the code is like this <a name="cutid1"></a> then followed by the entry...

Even the XML given through RSS doesn't provide any option to find where the LJ-cut ends. Can anyone help regarding this problem?




(Post a new comment)


[info]acidofil
2005-04-25 02:36 am UTC (link)
checking out http://www.livejournal.com/community/php_dev/data/rss and it starts with <lj-cut> and ends with </lj-cut>

so it should b quite easy to hide it using some simple regexp..

$text = preg_replace('#<lj-cut text="(.*?)">(.*?)</lj-cut>#is', 'CUT_[\\1]_IS HERE', $text);

where \\1 is the short text of the cut.

however I didn't try it out, came straight from my head just now but i hope itll work :)

hope it helped!

(Reply to this)


[info]acidofil
2005-04-25 02:38 am UTC (link)
oh.. and where \\2 is the full text of the ljcut :)

(Reply to this)


Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…