Topic: [HELP] [HACK] Automated Short Story

Hi Team,
I have just installed CuteNews 2.0.2 for the first time and I am looking for a way to generate an automated Short Story based on the content of the Long Story.

I have found an hack (link) that I believe was created for version 1.x of the script.

Can anybody suggest a way to fix this for version 2.x?

Ideally, I would like the user to type the Long Story (only) and have the Short Story generated automatically. The Short Story field should not appear at all when a user is writing the article.

Any help would be much appreciated and apologies if I am trying to do something that already has a solution.

Re: [HELP] [HACK] Automated Short Story

Hi Team,
I have just installed CuteNews 2.0.2 for the first time and I am looking for a way to generate an automated Short Story based on the content of the Long Story.

I have found an hack (link) that I believe was created for version 1.x of the script.

Can anybody suggest a way to fix this for version 2.x?

Ideally, I would like the user to type the Long Story (only) and have the Short Story generated automatically. The Short Story field should not appear at all when a user is writing the article.

Any help would be much appreciated and apologies if I am trying to do something that already has a solution.

+1, it would be great...

Re: [HELP] [HACK] Automated Short Story

Hi Support Team,

It would be great because it would a gain of time for writers...

Best regards.

Re: [HELP] [HACK] Automated Short Story

To generate an automated Short Story you don't have to use hack in version 2.0.2.
You can get the result in a quite simple way:
1. Go to  Dashboard > Templates > Active News and edit the template. Instead of {short-story} you need to insert [truncate=20]{full-story}[/truncate] and save the changes.
2. Go to  Dashboard > System configurations > News and tick Short story field will not be required, then save the changes.
3. That's it!

Best regards,
CN Support team

Re: [HELP] [HACK] Automated Short Story

Yes it works but in the <head> section, I use : echo '<meta name="description" content="'.$trunc_short.'"/>'

Consequently, there is no text in meta description...

Thanks.

Re: [HELP] [HACK] Automated Short Story

... and for the RSS it's the same problem, I don't want to use full story because in RSS feed, all the text is not really good...

<item>
   <title><![CDATA[{title}]]></title>
   <link>{rss-news-include-url}</link>
   <description><![CDATA[{short-story}]]></description>
   <guid isPermaLink="false">{news-id}</guid>
   <pubDate>{date}</pubDate>
</item>

Re: [HELP] [HACK] Automated Short Story

... and for the RSS it's the same problem, I don't want to use full story because in RSS feed, all the text is not really good...

<item>
   <title><![CDATA[{title}]]></title>
   <link>{rss-news-include-url}</link>
   <description><![CDATA[{short-story}]]></description>
   <guid isPermaLink="false">{news-id}</guid>
   <pubDate>{date}</pubDate>
</item>


Problem is solved similarly:

<description><![CDATA[{short-story}]]></description>


change to

<description><![CDATA[[truncate=20]{full-story}[/truncate]]]></description>
Best regards,
CN Support team

Re: [HELP] [HACK] Automated Short Story

yes thanks you, it's ok for RSS but for meta description ?

Re: [HELP] [HACK] Automated Short Story

yes thanks you, it's ok for RSS but for meta description ?


Cutenews doesn't know anything about meta tags on your page as it displays news on already processed php webpage. You need to alter the displaying of meta tags using CMS, which you integrate CuteNews into.

Best regards,
CN Support team

Re: [HELP] [HACK] Automated Short Story

Hi Support Team.

Actually it's ok but if I don't use short story (for gain of time for writers), the meta description are empty because I use this code :

<?PHP require_once "../news/cn_api.php";$entry = cn_api_get_entry();if ($entry['t']){$header_title = ($entry['t']);$short_story = ($entry['s']);$tagline = ($entry['tg']);$category_name = ( join(' / ', $entry[':cot']) );$trunc_short = trim( (strip_tags($short_story)) );$entry['mf']['photo'];$entry['mf']['photoxxl'];$entry['mf']['video'];$entry['mf']['videoxxl'];$entry['mf']['daily'];$entry['mf']['dailyxxl'];$entry['mf']['twitter'];}echo '<title>'.$header_title.' - '.$category_name.'</title>';echo '<meta name="description" content="'.$trunc_short.'"/>'

The meta <meta name="description" content="'.$trunc_short.'"/> is linked to the short story.

How to do this with full story in meta description ? And of course truncate the full story because a meta description doesn't exceed 160/165 words...

Is it possible ?

Thaks you.

Re: [HELP] [HACK] Automated Short Story

Hi Support Team.

Actually it's ok but if I don't use short story (for gain of time for writers), the meta description are empty because I use this code :

<?PHP require_once "../news/cn_api.php";$entry = cn_api_get_entry();if ($entry['t']){$header_title = ($entry['t']);$short_story = ($entry['s']);$tagline = ($entry['tg']);$category_name = ( join(' / ', $entry[':cot']) );$trunc_short = trim( (strip_tags($short_story)) );$entry['mf']['photo'];$entry['mf']['photoxxl'];$entry['mf']['video'];$entry['mf']['videoxxl'];$entry['mf']['daily'];$entry['mf']['dailyxxl'];$entry['mf']['twitter'];}echo '<title>'.$header_title.' - '.$category_name.'</title>';echo '<meta name="description" content="'.$trunc_short.'"/>'

The meta <meta name="description" content="'.$trunc_short.'"/> is linked to the short story.

How to do this with full story in meta description ? And of course truncate the full story because a meta description doesn't exceed 160/165 words...

Is it possible ?

Thaks you.

Chenge

$short_story = ($entry['s']);


to

$short_story = ($entry['f']);


on your code.

Best regards,
CN Support team

Re: [HELP] [HACK] Automated Short Story

Hi Support Team,

It's ok, the meta description works but a little problem. The meta description is not truncated and all the text of the full story appears in the meta description... Is it possible to limit it to 160 characters for example (better for SEO...) ?

Thanks you.

Re: [HELP] [HACK] Automated Short Story

Hi Support Team,

It's ok, the meta description works but a little problem. The meta description is not truncated and all the text of the full story appears in the meta description... Is it possible to limit it to 160 characters for example (better for SEO...) ?

Thanks you.


Cut your full-story by modify this code:

$short_story = (substr($entry['f'],0,160));
Best regards,
CN Support team

Re: [HELP] [HACK] Automated Short Story

Fantastic ! Thanks you.

Last request, is it possible to hide the short story in cutenews and to show full story (without to click on button "Toggle Full Story").

It's probably possible but what files to modify ?

Re: [HELP] [HACK] Automated Short Story

I found it in the file main.php, thanks you Support Team.