AnonSec Shell
Server IP : 54.36.91.62  /  Your IP : 216.73.217.112
Web Server : Apache
System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : coopiak ( 151928)
PHP Version : 8.3.23
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/coopiak/amisdesseniors-fr/nice/administrator/components/com_community/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/coopiak/amisdesseniors-fr/nice/administrator/components/com_community/models/migratorCB.php
<?php
/**
* @copyright (C) 2017 JoomlArt, Inc. - All rights reserved.
* @license GNU General Public License, version 2 (http://www.gnu.org/licenses/gpl-2.0.html)
* @author iJoomla.com <webmaster@ijoomla.com>
* @url https://www.jomsocial.com/license-agreement
* The PHP code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript *are NOT GPL, and are released under the IJOOMLA Proprietary Use License v1.0
* More info at https://www.jomsocial.com/license-agreement
*/

use Joomla\CMS\Factory;

// Disallow direct access to this file
defined('_JEXEC') or die('Restricted access');

jimport( 'joomla.application.component.model' );
require_once 'migrators.php';

class CommunityModelMigratorCB extends CommunityModelMigrators
{
	var $db;

	public function __construct()
	{
		$mainframe	= Factory::getApplication();
		$jinput     = $mainframe->input;
		$this->db = Factory::getDBO();

		// Call the parents constructor
		parent::__construct();
	}

	public function checkTableExistCB(){
		try{
			$this->getFields();
			return true;
		}catch(exception $e){
			return false;
		}
	}


	/**
	* get avatar from CB
	*
	*/
	public function getAvatar($lastid=0,$limit=0){
		
		$query		= 'SELECT '.$this->db->quoteName( 'user_id' ).', '.$this->db->quoteName( 'avatar' ).' FROM ' . $this->db->quoteName( '#__comprofiler' ) .' as a ';
		$query .= ' WHERE '.$this->db->quoteName('user_id').'>'.$lastid;
		$query .= ' ORDER BY user_id ASC ';
		$query .= ' LIMIT '.$limit;

		$this->db->setQuery($query);
		return $this->db->loadObjectList();
	}

	public function getCountAvatar($lastid=0){
		
		$query		= 'SELECT count(*) FROM ' . $this->db->quoteName( '#__comprofiler' ) .' as a ';
		if($lastid){
			$query .= ' WHERE '.$this->db->quoteName('user_id').'<='.$lastid;
		}

		$this->db->setQuery($query);
		return $this->db->loadResult();
	}

	/**
	* get cover from CB
	*
	*/
	public function getCover($lastid=0,$limit=0){
		
		$query		= 'SELECT '.$this->db->quoteName( 'user_id' ).', '.$this->db->quoteName( 'canvas' ).' FROM ' . $this->db->quoteName( '#__comprofiler' ) .' as a ';

		$query .= ' WHERE '.$this->db->quoteName('user_id').'>'.$lastid;
		$query .= ' ORDER BY user_id ASC ';
		$query .= ' LIMIT '.$limit;

		$this->db->setQuery($query);
		return $this->db->loadObjectList();
	}

	public function getCountCover($lastid=0){
		return $this->getCountAvatar($lastid);
	}

	/**
	* get pofile from CB
	*
	*/
	public function getProfile($fields,$lastid=0,$limit=0){
		
		$query		= 'SELECT user_id,'.$fields.' FROM '.  $this->db->quoteName( '#__comprofiler' ) .' as a ';

		$query .= ' WHERE '.$this->db->quoteName('user_id').'>'.$lastid;
		$query .= ' ORDER BY user_id ASC ';
		$query .= ' LIMIT '.$limit;

		$this->db->setQuery($query);
		return $this->db->loadObjectList();
	}

	public function getCountProfile($lastid=''){
		return $this->getCountAvatar($lastid);
	}
	/**
	* get fields community builder
	*
	*/
	public function getFields(){
		
		$query		= 'SELECT a.* FROM ' . $this->db->quoteName( '#__comprofiler_fields' ) .' as a WHERE tablecolumns LIKE '.$this->db->Quote('cb%');
		
		$this->db->setQuery($query);
		return $this->db->loadObjectList();
	}

	/**
	* get fields value based on field of CB
	*
	*/ 
	public function getFieldsValueCB($field_id){

		
		$query		= 'SELECT '.$this->db->quoteName( 'fieldtitle' ).' FROM ' . $this->db->quoteName( '#__comprofiler_field_values' ) .' as a WHERE '.$this->db->quoteName( 'fieldid' ).'='.$this->db->Quote( $field_id );
		$this->db->setQuery($query);
		return $this->db->loadObjectList();
	}

	/**
	* get friend connections  of CB
	*
	*/ 
	public function getFriends($lastid=0,$limit=0){
		
		$query		= 'SELECT * FROM ' . $this->db->quoteName( '#__comprofiler_members' );

		$query .= ' WHERE '.$this->db->quoteName('referenceid').'>'.$lastid;
		$query .= ' ORDER BY referenceid ASC ';
		$query .= ' LIMIT '.$limit;

		$this->db->setQuery($query);
		return $this->db->loadObjectList();
	}

	public function getCountFriends($lastid=0){
		
		$query		= 'SELECT count(*) FROM ' . $this->db->quoteName( '#__comprofiler_members' );

		if($lastid){
			$query .= ' WHERE '.$this->db->quoteName('referenceid').'<='.$lastid;
		}
		
		$this->db->setQuery($query);
		return $this->db->loadResult();
	}
	
}

Anon7 - 2022
AnonSec Team