N
N
Nicholas2016-03-17 05:31:10
HTML
Nicholas, 2016-03-17 05:31:10

How to hide the news image?

How to hide the news image from the visitor, but make it visible for the share button?
What I tried to do:
I made a news field under the image link and wrote the code as a comment in fullstory.tpl like this:

<!-- [xfgiven_image] <img src="[xfvalue_image]" alt="{title}" width="400" height="300" border="0"> [/xfgiven_image] -->
, but in offers to share (let's say "VKontakte") this news, then I only show pictures visible to the visitor. Is it possible to implement the idea?
ZwC10.png
Thank you very much in advance ;)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Andrey Molchanov, 2016-03-28
@Android0

Question 1: Why do you comment the image output code if you don't use it there at all?
Isn't it easier to remove it?
In 2: Everything is implemented there through Open Graph
To do this, you will need to slightly correct the code in the show.full.php file
Go along the /engine/modules path open the show.full.php file there
And somewhere on line 500 you will notice the variables $social_tags
below add :

$xfieldsdata = xfieldsdataload( $row['xfields'] );
$social_tags['image'] = $xfieldsdata['image'];

upd For version 9.6 (your case)
Go to show.full.php file
and somewhere on line 900 BEFORE
$tpl->clear();
unset( $row );

Add:
$xfieldsdata = xfieldsdataload( $row['xfields'] );
$poster = $xfieldsdata['image'];

Then go to the engine.php file
and at about line 780 AFTER
Add:
Must earn

A
Alexander, 2016-03-17
@aspetek

And if through meta?

<meta property="og:image" content="{ссылка_на_картинку}">

S
Sergey Goryachev, 2016-03-17
@webirus

canonium.com/articles/html-meta-tags

<meta name="og:title" content="The Rock">
<meta name="og:type" content="movie">
<meta name="og:url" content="http://www.imdb.com/title/tt0117500/">
<meta name="og:image" content="http://ia.media-imdb.com/rock.jpg">
<meta name="og:site_name" content="IMDb">
<meta name="og:description" content="A group of U.S. Marines, under command of...">

S
Sayger, 2017-01-14
@Sayger

I have so!

$xfieldsdata = xfieldsdataload( $row['xfields'] );
        $social_tags['image'] = "http://сайт.ру/uploads/posts/".$xfieldsdata['image'];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question