M
M
Maila2017-10-14 19:21:20
Yii
Maila, 2017-10-14 19:21:20

How to add a social media service to a blog?

The task is this: there are blog articles in the 'blog' section ( site.com/blog) that are displayed in fronted on the local server. How to make social media buttons visible at the end of each article? On the example of this service: https://ulogin.ru
It is not entirely clear where exactly you need to insert this top script:

<script src="//ulogin.ru/js/ulogin.js"></script>
<div id="uLogin" data-ulogin="display=panel;theme=classic;fields=first_name,last_name;providers=vkontakte,odnoklassniki,mailru,facebook;hidden=other;redirect_uri=http%3A%2F%2Fsite.com;mobilebuttons=0;"></div>

Next, you need to place the bottom code at site.com
and where exactly?
$s = file_get_contents('http://ulogin.ru/token.php?token=' . $_POST['token'] . '&host=' . $_SERVER['HTTP_HOST']);
                    $user = json_decode($s, true);
                    //$user['network'] - соц. сеть, через которую авторизовался пользователь
                    //$user['identity'] - уникальная строка определяющая конкретного пользователя соц. сети
                    //$user['first_name'] - имя пользователя
                    //$user['last_name'] - фамилия пользователя

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2017-10-14
@slo_nik

Good evening.
Above the button "Get code" there is a line "... and other settings", to the right of it there is an arrow. Click on it and see the list of supported platforms.
Find yii in the list, select and get a link to the plugin specifically for yii.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question