Could you, please, specify the photo source? Will the photo be inserted into the additional field or wil it be extracted from the text?

In the first case, you just need to use $entry['mf']['the additional field name'], for example

echo '<meta property="og:image" content="'.htmlspecialchars($entry['mf']['myimage']).'" />';

myimage is the field name here.

To do this, use some of the built-in API CuteNews tools. At first, add the strings below to the very beginning of the file, which contains the code <head>,

require_once("cn_api.php");
$entry = cn_api_get_entry();

Then, you can use such strings as
if ($entry) {
       echo '<meta property="og:title" content="'.htmlspecialchars($entry['t']).'" />';
       echo '<meta property="og:description" content="'.htmlspecialchars(substr($entry['s'], 0, 100)).'" />';
   }

The new version of CuteNews escapes all the characters in the <title> for security reasons, so it appears in this form. You can switch to the HTML display mode by ticking the option in the article.

29

(3 replies, posted in Problem Solving / Help & Support)

Your password can be restored if it's saved on the FTP server and you have access to it. To see or edit your password, you need to go to the Data folder > Users.

Yes, that is right, you need to change

eregi

for

preg_match

, but make sure that 'match' is surrounded by

~*~i

.
For example

eregi("<\?")

is equal to

preg_match("~<\?~i")

You have version 2.1.2 installed, everything went fine. Please correct in the file 'core/init.php' to have

define('VERSION',       '2.1.2');

or download the new version. Thank you for the remark. We will correct the issue.

Old versions of Cutenews do have problems with PHP7 compatibility. One of the possible solutions to the problem  - to update CUtenews code to the latest version, which is compatible with PHP7. To do this follow the instructions here https://cutephp.com/cutenews/upgrade.php.

Old versions of Cutenews do have problems with PHP7 compatibility. One of the possible solutions to the problem  - to update CUtenews code to the latest version, which is compatible with PHP7. To do this follow the instructions here https://cutephp.com/cutenews/upgrade.php

This functionality was implemented on April, 26 2018.

35

(3 replies, posted in Problem Solving / Help & Support)

Dear mstevens, we are sorry for the delay.
We have solved the issue. We will send you the news by email.

36

(5 replies, posted in Problem Solving / Help & Support)

It is possible to sort by title, to do it you should insert

$sortby = 'title'; $dir = 'D';

(Descending) or

$sortby = 'title'; $dir = 'A';

(Ascending) before

include 'show_news.php'

.

37

(8 replies, posted in Problem Solving / Help & Support)

This may be an indication that the hosting PHP version is out of date, it should be not less than 5.3. If you have the possibility, you may check apache or PHP-fpm logs and find the problem.

Youcan perform the conversion using PHP-function:

preg_split("~\s~", "this is string");

39

(3 replies, posted in Problem Solving / Help & Support)

There is no way to do this directly, as "Powered by CuteNews" appears after the news list is produced.
You may try editing the "Active News" pattern using CSS and adding 'padding-bottom' to each news item.

40

(2 replies, posted in Problem Solving / Help & Support)

Dear jwbird,

If you are not the Administrator, it may be that the Administrator has prohibited access to the section. In case you are the Administrator, you can temporarily solve the issue by changing the code in 'core/core.php', in 'function test()', by adding after the line 'if (!$user) return FALSE;' the line 'if ($user['acl'] == 1) return true;'.

edwards wrote:

hi Thanks  version number 2.0.2 build ID-202

We appologize for the code. It misses ";" and the version 2.0.2 is compatible with it.

The corrected code:
You should use the code below instead of the one above

// Check category (exclude for search)
               if ($item['c']) {
                   $categories = explode(',', $item['c']);
                   $_categoryex = explode(',', $category_exclude);
                   if (isset($category_exclude) && array_intersect($categories, $_categoryex)) {
                       continue;
                   }
               }

It may be that the code is not compatible with the version you are using. Please indicate the version number of the Cutenews you are using, i.e. 2.0, 2.3, 1.3, etc.

To create a new template follow these steps:
Go to "Templates", at the bottom near the "Clone template" button, write the new template name and press "Clone template", then you will be redirected to the page informing of a successful pattern creation. After all these actions you can go to Templates.

To include Youtube, you should insert such code:

<iframe width="854" height="480" src="https://www.youtube.com/embed/<YoutubeID>" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

Then in the "Article options" tab allow to "Use HTML in this article", and save the changes.
Nite:<YoutubeID> - is the Youtube video Id, you can get iframe codes from Youtube.

44

(3 replies, posted in Problem Solving / Help & Support)

Alphabetical sorting is made by the parameters setup before the connection:

 $sortby = 'title';  // title, tg, author supported yet
  $dir = 'A';         // D - desc, A - asc
  include 'show_news.php';

At the moment the functionality is not implemented. To sort articles you should take the following steps:
Sorting parameters should be set as

  $sortby = 'title';  // title, tg, author supported yet
  $dir = 'D';         // D - desc, A - asc
  include 'content/show_news.php';

  The functionality is prepared for the release and it will be rolled out with the next release. Also, the new sorting type will be introduced:vcnt
  i.e. sorting by the number of views

46

(2 replies, posted in Problem Solving / Help & Support)

If everything was correctly integrated then index.php?id=2 should open normally. For its correct work, it is enough to create the file index.php with the contents:
 

<?php include 'content/show_news.php'; ?>

For the news to be presented as a listing and would show on a click.

If we get it right, you need to perform a search that would exclude some categories from the search results. This functionality hasn't been introduced yet, but you can use this "trick":

   // Check category (exclude for search)
   if ($item['c']) {
       $categories = explode(',', $item['c']);
    if (isset($category_exclude) && array_intersect($categories, $category_exclude)) {
        continue;
       }
   }

in the search.php file before the line

  $MB = function_exists('mb_strtolower');

Before

include 'search.php'

set the parameter

$category_exclude = '1,2,3,4'

(numbers are the ones for the categories to be excluded from the search results). If you insert

$category_exclude = ''

nothing will be excluded, if

$category_exclude = '1'

then the news with category '1' will be excluded (the numbers for the categories can be checked in the admin panel under the categories tab).

48

(5 replies, posted in Script Feedback and Suggestion)

Thank you!  The patches will be implemented soon.

49

(4 replies, posted in Problem Solving / Help & Support)

At the very beginning of the script which posts the news, you can insert such pieces of code:

   

require_once("cn_api.php");
$entry = cn_api_get_entry();

Use the following contruction with the <title> tag:

 <title><?php echo ($entry) ? $entry['t'] : 'Example page'; ?></title> 

Dear l2eclipse,

If the question is related to patterns then the avatar should be written as

<img src="{avatar}" />

instead of

{avatar}

.