Answer the question
In order to leave comments, you need to log in
How to change the joomla component - to import news from a group or VK page?
Hello! There was such a wonderful free component for Joomla VK machine 2.0., which I really need. It allows you to automatically or manually, but more automatically, publish news on the site, from the wall of a group or page in contact. The fact is that it has not been supported by developers for a long time, because "out of 170 downloaded components, no one donated it for coffee," and VKontakte programmers are constantly changing their integration tools and queries with similar CMS. As a result, at the moment the component does not work (in the settings it stubbornly does not see the added page ID in VK.
Tell me what needs to be fixed in the component so that it works?
In the comments on their site (which is no longer available as of this morning), one person wrote that in the add.php setting.php files, you need to change the versions of the wall.get methods to the current "&method=wall.get&v=5.130", and in setting. php add "&access_token='.$data['skey']" at the end of outputs of users.get methods to send the service code.
As you understand, I did not succeed, because I do not work with this, I have neither knowledge nor experience in this.
But it's interesting to me. I would like to figure it out, or at least make the component work.
I would be very happy if someone could tell me what to do and how to do it.
As I understand it, here is a call to methods and a request to a contact:
switch ( $data['type'] ) {
case 0:
$methods[] = 'users.get?v=5.130&user_ids='.$matches[1].'&fields=domain,id';
$methods[] = 'groups.getById?v=5.130&group_id='.$matches[1].'&fields=id,screen_name';
break;
case 1:
$methods[] = 'users.get?v=5.130&user_ids='.$matches[1].'&fields=domain,id';
break;
case 2:
$methods[] = 'groups.getById?v=5.130&group_id='.$matches[1].'&fields=id,screen_name';
break;
default:
$methods[] = 'users.get?v=5.130&user_ids='.$matches[1].'&fields=domain,id';
break;
}
$data['pageId'] = '';
$data[' pageName'] = '';
foreach ($methods as $key => $method) {
$response = json_decode(file_get_contents(' api.vk.com/method/'.$method ));
if ( property_exists( $response, 'response') && property_exists( $response->response[0], 'id') ) {
$data['pageId'] = ( property_exists( $response->response[0], ' domain' ) )? $response->response[0]->id : '-'.$response->response[0]->id;
$data['pageName'] = ( property_exists( $response->response[0], 'domain' ) )? $response->response[0]->domain : $response->response[0]->screen_name;
// $data['type'] = ($data['type'] != 0)? $data['type'] : ( ( property_exists( $response, 'domain' ) )? 1 : 2 );
}
}
return parent::
Answer the question
In order to leave comments, you need to log in
so first open the error log and then treat them, and do not try to treat them at random by coffee grounds
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question