Commit 5d532e57 authored by Dieudonne Timma Meyatchie's avatar Dieudonne Timma Meyatchie
Browse files

Fehler gelöst..!!

parent 77552dc4
<?php
/**
* @version 1.0.0
* @package com_thm_reverscookings
* @copyright Copyright (C) 2012. All rights reserved.
* @license GNU General Public
* @author Bassing <dominik.bassing@mni.thm.de>
* @author Seefeldt <Stefan.Seefeldt@mni.thm.de>
* @author Schneider <stefan.schneider@mni.thm.de>
* @author Omoko <guy.bertrand.omoko@hotmail.com>
* @author Noubeva <guylene.deutcho.noubevam@mni.thm.de>
* @author Timma<dieudonne.timma.meyatchie@mni.thm.de>
*/
// No direct access to this file
// No direct access to this file
defined('_JEXEC') or die;
require_once JPATH_COMPONENT.'/helpers/thm_reverscookings.php';
class THMReversCookings
{
static $attribs;
static $attribs;
public function __construct(){
$this->attribs['width'] = '335px';
$this->attribs['width'] = '335px';
$this->attribs['height'] = '250px';
}
public static function hasbild($datenbanktabel,$element, $element_value){
$db = JFactory::getDbo();
$query = "SELECT * FROM ".$datenbanktabel." WHERE ".$element." = '$element_value'";
$db->setQuery($query);
$db->query();
$result = $db->loadObjectList();
if(empty($result))
return false;
return $result;
}
public static function myprofil($userid, $element){
$db = JFactory::getDbo();
$query = 'SELECT * FROM #__thm_reverscookingsprofils WHERE '.$element.' ='.$userid;
$db->setQuery($query);
$userdata = $db->loadObjectList();
$image = Thm_reverscookingsHelper::hasbild('#__thm_reverscookingsprofils_bild', 'profilid', $userdata[0]->id);
$image = self::hasbild('#__thm_reverscookingsprofils_bild', 'profilid', $userdata[0]->id);
$result='<div>';
$result .= '<div><h3>'.$userdata[0]->uname.'</h3></div>';
$result .= '<div><a href="mailto:'.$userdata[0]->email.'">Email</a></div>';
......@@ -42,7 +44,7 @@ class THMReversCookings
public static function getprofilid($userid){
$db = JFactory::getDbo();
$query = 'SELECT id FROM #__thm_reverscookingsprofils WHERE created_by ='.$userid;
$db->setQuery($query);
$db->setQuery($query);
$userdata = $db->loadObjectList();
return intval($userdata[0]->id);
}
......@@ -61,14 +63,14 @@ class THMReversCookings
for ($i=0; $i<count($ingdata); $i++){
$ing=$ingdata[$i];
$whererequest .=$ing->ingid;
if($i< count($ingdata)-1)
if($i< count($ingdata)-1)
$whererequest.=' OR ingid=';
}
$userquery = 'SELECT userid , count(ingid) AS treffer
FROM #__thm_reverscookings_virtual_fridge WHERE userid <>'.$profilid.' AND ('.$whererequest.' ) GROUP BY userid ORDER BY treffer DESC';
$db->setQuery($userquery);
$db->query();
$db->setQuery($userquery);
$db->query();
$userdata = $db->loadObjectList();
$result = array();
$inganzahl = count($ingdata)/2;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment