Roman
С нами с 21 августа 2017; Место в рейтинге пользователей: #136Есть ли какой либо онлайн-консультант без стороннего сервиса
Есть ли плагин онлайн-консультанта для modx revo без стороннего сервиса (не JivoSite, siteheart.ru и т.д.)
Как в пагинации убрать limit
Как в пагинации убрать параметр limit и при этом не нарушить работу пагинации?
Примеры страниц:
krovlya-yuga.ru/products/sajding/shtukaturnyie-fasadyi/?page=2 ссылается на страницу krovlya-yuga.ru/products/sajding/shtukaturnyie-fasadyi/?limit=24
Примеры страниц:
krovlya-yuga.ru/products/sajding/shtukaturnyie-fasadyi/?page=2 ссылается на страницу krovlya-yuga.ru/products/sajding/shtukaturnyie-fasadyi/?limit=24
Диспетчер файлов перестал загружать файлы
Диспетчер файлов перестал загружать файлы. Кто сталкивался с таким?
Вопрос по верстке
Всем привет! Есть блок, обернутый ссылкой, внутри него есть блок с надписью «быстрый просмотр», нужно чтобы по клику на него не переходило по ссылке. Кто знает ка сделать? Сейчас просто происходит переход по ссылке. Сижу голову ломаю.
Делаю здесь krovlya-yuga.ru/products/gibkaya-cherepicza/
Делаю здесь krovlya-yuga.ru/products/gibkaya-cherepicza/
<div class="col-md-3 ms2_product"><a href="products/gibkaya-cherepicza/cherepica_shinglas/rulonnaya-cherepicza/rulonnaya-cherepicza-green/">
<div class="item">
<div class="media-left">
<div class="image">
<img src="/assets/images/products/1593/150x150/cherepica-texnonikol-green.jpg" width="180" height="180" alt="Рулонная черепица Шинглас зеленая" title="Рулонная черепица Шинглас зеленая">
<div class="item-fast-view quickview" data-click="" data-data-element="msProduct.content" data-data-topics="["minishop2:product"]" data-data-id="1593" data-dialog-title="Рулонная черепица Шинглас зеленая" data-dialog-size="size-wide" data-dialog-buttons="["prev","next"]"><span class="">быстрый просмотр </span>
</div>
</div>
</div>
<div class="media-body">
<div class="rating-wrapper"><i class="glyphicon glyphicon-star" title="Популярность товара"></i>
<i class="glyphicon glyphicon-star" title="Популярность товара"></i>
<i class="glyphicon glyphicon-star" title="Популярность товара"></i>
<i class="glyphiconoff glyphicon-star" title="Популярность товара"></i>
<i class="glyphiconoff glyphicon-star" title="Популярность товара"></i></div>
<div class="price">175<span class="rub">Руб.</span> </div>
<div class="but-zakaz zakazat sm modal" data-id="5500" data-name="Рулонная черепица Шинглас зеленая" onclick="yaCounter21215212.reachGoal('t-zakaz'); return true;">КУПИТЬ</div>
</div>
<form method="post" class="ms2_form">
<span class="nametovar">Рулонная черепица Шинглас зеленая</span>
<div>
</div>
<input type="hidden" name="id" value="1593"><input type="hidden" name="count" value="1"><input type="hidden" name="options" value="[]">
</form>
<div class="properties">
<div class=" prop-item prop-guarant" data-placement="top" data-toggle="tooltip" title="" data-original-title="Гарантия: 10 лет">
<span class="value">10</span><span class="val-ed">лет</span>
</div>
<div class="prop-item prop-kolvosloev" data-placement="top" data-toggle="tooltip" title="" data-original-title="Количество слоев: 1">
<span class="value">
один слой
</span>
</div>
<div class=" prop-item prop-thickness" data-placement="top" data-toggle="tooltip" title="" data-original-title="Толщина: 4.5 мм">
<span class="value">4.5</span>
</div>
</div>
</div>
</a></div>
Не работают вложенные URL
Доброго времени суток! Проблема в том что не отображаются вложенные url.
1) настроены дружественные URL
2) в head присутствует тег base
3)В системных настройках «Использовать вложенные URL
» стоит — Да.
Куда копать не знаю.
в htacces не особо разбираюсь, может быть там причина. скину сюда.
1) настроены дружественные URL
2) в head присутствует тег base
3)В системных настройках «Использовать вложенные URL
» стоит — Да.
Куда копать не знаю.
в htacces не особо разбираюсь, может быть там причина. скину сюда.
не работает авторизация через Одноклассники в hybridauth
Не могу получить email
Odnoklassniki.php
Odnoklassniki.php
<?php
/*!
* HybridAuth
* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
* (c) 2009-2015, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
*/
/**
* Hybrid_Providers_Odnoklassniki provider adapter based on OAuth2 protocol
*/
class Hybrid_Providers_Odnoklassniki extends Hybrid_Provider_Model_OAuth2
{
/**
* ID wrappers initializer
*/
function initialize()
{
parent::initialize();
// Provider apis end-points
$this->api->api_base_url = "http://api.ok.ru/fb.do";
$this->api->authorize_url = "http://connect.ok.ru/oauth/authorize";
$this->api->token_url = "http://api.odnoklassniki.ru/oauth/token.do";
$this->api->sign_token_name = "access_token";
}
private function request($url, $params=false, $type="GET")
{
Hybrid_Logger::info("Enter OAuth2Client::request($url)");
Hybrid_Logger::debug("OAuth2Client::request(). dump request params: ", serialize($params));
if ($type === "GET"){
$url = $url . (strpos($url, '?') ? '&' : '?') . http_build_query($params, '', '&');
}
$this->http_info = array();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL , $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER , 1);
curl_setopt($ch, CURLOPT_TIMEOUT , $this->api->curl_time_out);
curl_setopt($ch, CURLOPT_USERAGENT , $this->api->curl_useragent);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , $this->api->curl_connect_time_out);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER , $this->api->curl_ssl_verifypeer);
curl_setopt($ch, CURLOPT_HTTPHEADER , $this->api->curl_header);
if ($this->api->curl_proxy) {
curl_setopt($ch, CURLOPT_PROXY , $this->api->curl_proxy);
}
if ($type === "POST") {
curl_setopt($ch, CURLOPT_POST, 1);
if ($params) curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
}
$response = curl_exec($ch);
Hybrid_Logger::debug("OAuth2Client::request(). dump request info: ", serialize(curl_getinfo($ch)));
Hybrid_Logger::debug("OAuth2Client::request(). dump request result: ", serialize($response));
$this->http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$this->http_info = array_merge($this->http_info, curl_getinfo($ch));
curl_close ($ch);
return $response;
}
private function parseRequestResult($result)
{
if (json_decode($result)) return json_decode($result);
parse_str($result, $output);
$result = new StdClass();
foreach ($output as $k => $v) {
$result->$k = $v;
}
return $result;
}
function authodnoklass($code)
{
$params = array(
"client_id" => $this->api->client_id,
"client_secret" => $this->api->client_secret,
"grant_type" => "authorization_code",
"redirect_uri" => $this->api->redirect_uri,
"code" => $code
);
$response = $this->request($this->api->token_url, http_build_query($params, '', '&'), $this->api->curl_authenticate_method);
$response = $this->parseRequestResult($response);
if (!$response || !isset($response->access_token)) {
throw new Exception("The Authorization Service has return: " . $response->error);
}
if (isset($response->access_token)) $this->api->access_token = $response->access_token;
if (isset($response->refresh_token)) $this->api->refresh_token = $response->refresh_token;
if (isset($response->expires_in)) $this->api->access_token_expires_in = $response->expires_in;
// Calculate when the access token expire.
// At this moment Odnoklassniki does not return expire time in response.
// 30 minutes expire time staten in dev docs http://apiok.ru/wiki/pages/viewpage.action?pageId=42476652
if (isset($response->expires_in)) {
$this->api->access_token_expires_at = time() + $response->expires_in;
}
else {
$this->api->access_token_expires_at = time() + 1800;
}
return $response;
}
function loginFinish()
{
$error = (array_key_exists('error',$_REQUEST))?$_REQUEST['error']:"";
// Check for errors
if ($error) {
throw new Exception("Authentication failed! {$this->providerId} returned an error: $error", 5);
}
// Try to authenticate user
$code = (array_key_exists('code',$_REQUEST))?$_REQUEST['code']:"";
try {
$this->authodnoklass($code);
}
catch (Exception $e) {
throw new Exception("User profile request failed! {$this->providerId} returned an error: $e->getMessage() ", 6);
}
// Check if authenticated
if (!$this->api->access_token) {
throw new Exception("Authentication failed! {$this->providerId} returned an invalid access token.", 5);
}
// Store tokens
$this->token("access_token" , $this->api->access_token);
$this->token("refresh_token", $this->api->refresh_token);
$this->token("expires_in" , $this->api->access_token_expires_in);
$this->token("expires_at" , $this->api->access_token_expires_at);
// Set user connected locally
$this->setUserConnected();
}
/**
* Load the user profile.
*/
function getUserProfile()
{
// Set fields you want to get from OK user profile.
// @see https://apiok.ru/wiki/display/api/users.getCurrentUser+ru
// @see https://apiok.ru/wiki/display/api/fields+ru
$fields = "UID,LOCALE,FIRST_NAME,LAST_NAME,NAME,GENDER,AGE,BIRTHDAY,HAS_EMAIL,EMAIL,CURRENT_STATUS,CURRENT_STATUS_ID,CURRENT_STATUS_DATE,ONLINE,PHOTO_ID,PIC190X190,PIC640X480,LOCATION";
// Signature
$sig = md5('application_key=' . $this->config['keys']['key'] . 'fields=' . $fields .'method=users.getCurrentUser' . md5($this->api->access_token . $this->api->client_secret));
// Signed request
$response = $this->api->api('?application_key=' . $this->config['keys']['key'] . '&fields=' . $fields .'&method=users.getCurrentUser&sig=' . $sig);
if (!isset($response->uid)) {
throw new Exception("User profile request failed! {$this->providerId} returned an invalid response.", 6);
}
$copy=false;
if (property_exists($response,'pic_1')){
$path="assets/od_ava/".$response->uid.".jpg";
$copy=copy($response->pic_1,$path);
}
$this->user->profile->photoURL = ($copy)?$path:"";
$this->user->profile->identifier = (property_exists($response,'uid'))?$response->uid:"";
$this->user->profile->firstName = (property_exists($response,'first_name'))?$response->first_name:"";
$this->user->profile->lastName = (property_exists($response,'last_name'))?$response->last_name:"";
$this->user->profile->displayName = (property_exists($response,'name'))?$response->name:"";
// Get better size of user avatar
$this->user->profile->photoURL = (property_exists($response,'pic190x190'))?$response->pic190x190:"";
$this->user->profile->photoBIG = (property_exists($response,'pic640x480'))?$response->pic640x480:"";
$this->user->profile->profileURL = (property_exists($response,'link'))?$response->link:"";
$this->user->profile->gender = (property_exists($response,'gender'))?$response->gender:"";
$this->user->profile->email = (property_exists($response,'email'))?$response->email:"";
$this->user->profile->emailVerified = (property_exists($response,'email'))?$response->email:"";
if (property_exists($response, 'birthday')) {
list($birthday_year, $birthday_month, $birthday_day) = explode('-', $response->birthday);
$this->user->profile->birthDay = (int) $birthday_day;
$this->user->profile->birthMonth = (int) $birthday_month;
$this->user->profile->birthYear = (int) $birthday_year;
}
return $this->user->profile;
}
}
не знаю в чем дело… не работает авторизация через Google hybridauth
Всем привет! не работает в плашине hybridauth авторизация через гугл, через яндекс настроил а вот с гуглом проблемы.
В настройках гугла вот что
Хочу сделать связку Tickets + hybridauth.
s12861.h8.modhost.pro/otzyivyi
В настройках гугла вот что
Хочу сделать связку Tickets + hybridauth.
s12861.h8.modhost.pro/otzyivyi
Как вывести значения tv дочерних элементов?
Всем привет!
Столкнулся с такой задачей: у фотошколы есть курсы, в курсах есть группы обучения (вечерние, утренние, воскресные и т.д.) Мне нужно выводить в карточке курса следующую информацию:
название группы 1 — дата начала проведения
название группы 2 — дата начала проведения
Препод 1
Препод 2
Реализовал данную структуру
Для имен преподов завел тв teacher, а за дату начала проведения буду брать значения из созданного ранее tv datebegin
Столкнулся с такой задачей: у фотошколы есть курсы, в курсах есть группы обучения (вечерние, утренние, воскресные и т.д.) Мне нужно выводить в карточке курса следующую информацию:
название группы 1 — дата начала проведения
название группы 2 — дата начала проведения
Препод 1
Препод 2
Реализовал данную структуру
Для имен преподов завел тв teacher, а за дату начала проведения буду брать значения из созданного ранее tv datebegin
пробемы с ВМ на debian8
Всем привет! Появились проблемы на хостинге. Не могу залить файлы по FTP, а так же после редактирования файла на сайте (допустим style.css) часть файла обрезается и все, больше ничего сделать нельзя. Кто сталкивался с такой проблемой?