Example #1
0
 public function index()
 {
     parent::view("shared/header");
     parent::view("intern/menu");
     //Si l'usager à envoyer une évaluation, l'enregistrer
     if (isset($_POST['id'])) {
         parent::model("ratings");
         $rating = new ratings();
         $rating->RatingProject($_SESSION['ID'], $_POST['id'], $_POST['rating']);
     }
     parent::model("projects");
     $model = new projects();
     //Obtenir le projet assigné.
     $data['project'] = $model->ShowProjectByIntern($_SESSION['ID']);
     //Sinon obtenir tous les projets.
     if ($data['project'] == null) {
         $data['projects'] = $model->ShowProjectByStatus(1);
         parent::model("business");
         $model = new business();
         parent::model("ratings");
         $rating = new ratings();
         if ($data['projects'] != null) {
             foreach ($data['projects'] as $project) {
                 //Obtenir les informations de l'entreprise.
                 $data['cie'][$project->businessID] = $model->ShowCieByID($project->businessID);
                 //Obtenir le rating.
                 $data['ratings'][$project->ID] = $rating->FindRateByID($_SESSION['ID'], $project->ID);
             }
         }
         parent::view("intern/list", $data);
     } else {
         parent::model("business");
         $model = new business();
         //Obtenir les informations de l'entreprise.
         $data['cie'][$data['project']->ID] = $model->ShowCieByID($data['project']->businessID);
         parent::view("intern/index", $data);
     }
     parent::view("shared/footer");
 }
Example #2
0
    $content = mediamanager_inline($res['text']);
    if ($apx->is_module('glossar')) {
        $content = glossar_highlight($content);
    }
    $apx->tmpl->assign('ID', $res['id']);
    $apx->tmpl->assign('HEADLINE', $headline);
    $apx->tmpl->assign('TITLE', $last);
    $apx->tmpl->assign('CONTENT', $content);
    $apx->tmpl->assign_static('META_DESCRIPTION', replace($res['meta_description']));
    $apx->tmpl->assign('HITS', number_format($res['hits'], 0, '', '.'));
    //Kategorie
    $apx->tmpl->assign('CATID', $res['catid']);
    $apx->tmpl->assign('CATTITLE', $set['content']['groups'][$res['catid']]);
    //Kommentare
    if ($apx->is_module('comments') && $set['content']['coms'] && $res['allowcoms']) {
        require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
        $coms = new comments('content', $res['id']);
        $coms->assign_comments();
    }
    //Bewertung
    if ($apx->is_module('ratings') && $set['content']['ratings'] && $res['allowrating']) {
        require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
        $rate = new ratings('content', $res['id']);
        $rate->assign_ratings();
    }
    $apx->tmpl->parse('content');
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
require 'lib/_end.php';
/////////////////////////////////////////////////////////// SCRIPT BEENDEN ///
////////////////////////////////////////////////////////////////////////////////////////////////////////
Example #3
0
function downloads_print($data, $template)
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $apx->lang->drop('global', 'downloads');
    //Verwendete Variablen auslesen
    $parse = $apx->tmpl->used_vars($template, 'downloads');
    //Kategorien auslesen
    if (in_array('DOWNLOAD.CATTITLE', $parse) || in_array('DOWNLOAD.CATTEXT', $parse) || in_array('DOWNLOAD.CATICON', $parse) || in_array('DOWNLOAD.CATLINK', $parse)) {
        $catids = get_ids($data, 'catid');
        if (count($catids)) {
            $catdata = $db->fetch("SELECT id,title,text,icon FROM " . PRE . "_downloads_cat WHERE id IN (" . implode(',', $catids) . ")");
            if (count($catdata)) {
                foreach ($catdata as $catres) {
                    $catinfo[$catres['id']] = $catres;
                }
            }
        }
    }
    //User auslesen
    $userinfo = array();
    if (in_template(array('DOWNLOAD.UPLOADER', 'DOWNLOAD.UPLOADER_EMAIL', 'DOWNLOAD.UPLOADER_EMAIL_ENCRYPTED'), $parse)) {
        $userids = get_ids($data, 'userid');
        if ($userids) {
            $userinfo = $db->fetch_index("\n\t\t\t\tSELECT userid, username, email, pub_hidemail\n\t\t\t\tFROM " . PRE . "_user\n\t\t\t\tWHERE userid IN (" . implode(',', $userids) . ")\n\t\t\t", 'userid');
        }
    }
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            //Link
            $link = mklink('downloads.php?id=' . $res['id'], 'downloads,id' . $res['id'] . urlformat($res['title']) . '.html');
            //Teaserbild
            if (in_array('DOWNLOAD.TEASERPIC', $parse) || in_array('DOWNLOAD.TEASERPIC_POPUP', $parse) || in_array('DOWNLOAD.TEASERPIC_POPUPPATH', $parse)) {
                list($picture, $picture_popup, $picture_popuppath) = downloads_teaserpic($res['teaserpic']);
            }
            //Dateigröße auslesen
            if (in_array('DOWNLOAD.SIZE', $parse)) {
                $thefsize = downloads_filesize($res);
            }
            //Download-Link
            if (!$set['downloads']['regonly'] && !$res['regonly'] || $user->info['userid']) {
                $sechash = md5($_SERVER['HTTP_HOST'] . $res['file'] . date('Y/m/d', time() - TIMEDIFF));
                $dllink = 'misc.php?action=downloadfile&id=' . $res['id'] . '&sechash=' . $sechash . iif($apx->section_id(), '&sec=' . $apx->section_id());
            } else {
                $dllink = mklink('user.php', 'user.html');
            }
            //Bilder
            if (in_array('DOWNLOAD.PICTURE', $parse)) {
                $picdata = downloads_pictures($res['pictures']);
            }
            //Neu?
            if ($res['addtime'] + $set['downloads']['new'] * 24 * 3600 >= time()) {
                $new = 1;
            } else {
                $new = 0;
            }
            //Username + eMail
            if ($res['userid']) {
                $userdata = $userinfo[$res['userid']];
                $uploader = $userdata['username'];
                $uploader_email = iif(!$userdata['pub_hidemail'], $userdata['email']);
            } else {
                $uploader = $res['send_username'];
                $uploader_email = $res['send_email'];
            }
            //Datehead
            if ($laststamp != date('Y/m/d', $res['starttime'] - TIMEDIFF)) {
                $tabledata[$i]['DATEHEAD'] = $res['starttime'];
            }
            //Text
            $text = '';
            if (in_array('DOWNLOAD.TEXT', $parse)) {
                $text = mediamanager_inline($res['text']);
                if ($apx->is_module('glossar')) {
                    $text = glossar_highlight($text);
                }
            }
            //Tags
            if (in_array('DOWNLOAD.TAG', $parse) || in_array('DOWNLOAD.TAG_IDS', $parse) || in_array('DOWNLOAD.KEYWORDS', $parse)) {
                list($tagdata, $tagids, $keywords) = downloads_tags($res['id']);
            }
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['SECID'] = $res['secid'];
            $tabledata[$i]['TITLE'] = $res['title'];
            $tabledata[$i]['TEXT'] = $text;
            $tabledata[$i]['LINK'] = $link;
            $tabledata[$i]['TEASERPIC'] = $picture;
            $tabledata[$i]['TEASERPIC_POPUP'] = $picture_popup;
            $tabledata[$i]['TEASERPIC_POPUPPATH'] = $picture_popuppath;
            $tabledata[$i]['SIZE'] = downloads_getsize($thefsize);
            $tabledata[$i]['FORMAT'] = downloads_getformat($res);
            $tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.');
            $tabledata[$i]['TIME'] = $res['starttime'];
            $tabledata[$i]['PICTURE'] = $picdata;
            $tabledata[$i]['TOP'] = $res['top'];
            $tabledata[$i]['RESTRICTED'] = $res['restricted'];
            $tabledata[$i]['NEW'] = $new;
            $tabledata[$i]['DOWNLOADLINK'] = $dllink;
            //Tags
            $tabledata[$i]['TAG'] = $tagdata;
            $tabledata[$i]['TAG_IDS'] = $tagids;
            $tabledata[$i]['KEYWORDS'] = $keywords;
            //Kategorien
            $tabledata[$i]['CATID'] = $res['catid'];
            $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title'];
            $tabledata[$i]['CATTEXT'] = $catinfo[$res['catid']]['text'];
            $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon'];
            $tabledata[$i]['CATLINK'] = mklink('downloads.php?catid=' . $res['catid'], 'downloads,' . $res['catid'] . ',1' . urlformat($catinfo[$res['catid']]['title']) . '.html');
            //Produkt
            $tabledata[$i]['PRODUCT_ID'] = $res['prodid'];
            //Uploader
            $tabledata[$i]['UPLOADER_ID'] = $res['userid'];
            $tabledata[$i]['UPLOADER'] = replace($uploader);
            $tabledata[$i]['UPLOADER_EMAIL'] = replace($uploader_email);
            $tabledata[$i]['UPLOADER_EMAIL_ENCRYPTED'] = replace(cryptMail($uploader_email));
            //Autor
            $tabledata[$i]['AUTHOR'] = replace($res['author']);
            $tabledata[$i]['AUTHOR_LINK'] = replace($res['author_link']);
            //Galerie
            if ($apx->is_module('gallery') && $res['galid']) {
                $galinfo = gallery_info($res['galid']);
                $tabledata[$i]['GALLERY_ID'] = $galinfo['id'];
                $tabledata[$i]['GALLERY_TITLE'] = $galinfo['title'];
                $tabledata[$i]['GALLERY_LINK'] = mklink('gallery.php?id=' . $galinfo['id'], 'gallery,list' . $galinfo['id'] . ',1' . urlformat($galinfo['title']) . '.html');
            }
            //Kommentare
            if ($apx->is_module('comments') && $set['downloads']['coms'] && $res['allowcoms']) {
                require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
                if (!isset($coms)) {
                    $coms = new comments('downloads', $res['id']);
                } else {
                    $coms->mid = $res['id'];
                }
                $link = mklink('downloads.php?id=' . $res['id'], 'downloads,id' . $res['id'] . urlformat($res['title']) . ',1.html');
                $tabledata[$i]['COMMENT_COUNT'] = $coms->count();
                $tabledata[$i]['COMMENT_LINK'] = $coms->link($link);
                $tabledata[$i]['DISPLAY_COMMENTS'] = 1;
                if (in_template(array('DOWNLOAD.COMMENT_LAST_USERID', 'DOWNLOAD.COMMENT_LAST_NAME', 'DOWNLOAD.COMMENT_LAST_TIME'), $parse)) {
                    $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid();
                    $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name();
                    $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time();
                }
            }
            //Bewertungen
            if ($apx->is_module('ratings') && $set['downloads']['ratings'] && $res['allowrating']) {
                require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
                if (!isset($rate)) {
                    $rate = new ratings('downloads', $res['id']);
                } else {
                    $rate->mid = $res['id'];
                }
                $tabledata[$i]['RATING'] = $rate->display();
                $tabledata[$i]['RATING_VOTES'] = $rate->count();
                $tabledata[$i]['DISPLAY_RATING'] = 1;
            }
            $laststamp = date('Y/m/d', $res['starttime'] - TIMEDIFF);
        }
    }
    $tmpl->assign('DOWNLOAD', $tabledata);
    $tmpl->parse($template, 'downloads');
}
Example #4
0
<?php

$rating = new ratings($_POST['widget_id']);
isset($_POST['fetch']) ? $rating->get_ratings() : $rating->vote();
class ratings
{
    var $data_file = './ratings.data.txt';
    private $widget_id;
    private $data = array();
    function __construct($wid)
    {
        $this->widget_id = $wid;
        $all = file_get_contents($this->data_file);
        if ($all) {
            $this->data = unserialize($all);
        }
    }
    public function get_ratings()
    {
        if ($this->data[$this->widget_id]) {
            echo json_encode($this->data[$this->widget_id]);
        } else {
            $data['widget_id'] = $this->widget_id;
            $data['number_votes'] = 0;
            $data['total_points'] = 0;
            $data['dec_avg'] = 0;
            $data['whole_avg'] = 0;
            echo json_encode($data);
        }
    }
    public function vote()
Example #5
0
function links_print($data, $template)
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $apx->lang->drop('global', 'links');
    //Verwendete Variablen auslesen
    $parse = $apx->tmpl->used_vars($template, 'links');
    //Kategorien auslesen
    if (in_array('LINK.CATTITLE', $parse) || in_array('LINK.CATTEXT', $parse) || in_array('LINK.CATICON', $parse) || in_array('LINK.CATLINK', $parse)) {
        $catids = get_ids($data, 'catid');
        if (count($catids)) {
            $catdata = $db->fetch("SELECT id,title,text,icon FROM " . PRE . "_links_cat WHERE id IN (" . implode(',', $catids) . ")");
            if (count($catdata)) {
                foreach ($catdata as $catres) {
                    $catinfo[$catres['id']] = $catres;
                }
            }
        }
    }
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            //Dateillink
            $link = mklink('links.php?id=' . $res['id'], 'links,id' . $res['id'] . urlformat($res['title']) . '.html');
            //Neu?
            if ($res['starttime'] + $set['links']['new'] * 24 * 3600 >= time()) {
                $new = 1;
            } else {
                $new = 0;
            }
            //Goto-Link
            $gotolink = 'misc.php?action=gotolink&amp;id=' . $res['id'] . iif($apx->section_id(), '&amp;sec=' . $apx->section_id());
            //Linkpic
            if (in_array('LINK.PICTURE', $parse) || in_array('LINK.PICTURE_POPUP', $parse) || in_array('LINK.PICTURE_POPUPPATH', $parse)) {
                list($picture, $picture_popup, $picture_popuppath) = links_linkpic($res['linkpic']);
            }
            //Username + eMail
            if ($res['userid']) {
                $author = $res['username'];
                $author_email = iif(!$res['pub_hidemail'], $res['email']);
            } else {
                $author = $res['send_username'];
                $author_email = $res['send_email'];
            }
            //Text
            $text = '';
            if (in_array('LINK.TEXT', $parse)) {
                $text = mediamanager_inline($res['text']);
                if ($apx->is_module('glossar')) {
                    $text = glossar_highlight($text);
                }
            }
            //Datehead
            if ($laststamp != date('Y/m/d', $res['starttime'] - TIMEDIFF)) {
                $tabledata[$i]['DATEHEAD'] = $res['starttime'];
            }
            //Tags
            if (in_array('LINK.TAG', $parse) || in_array('LINK.TAG_IDS', $parse) || in_array('LINK.KEYWORDS', $parse)) {
                list($tagdata, $tagids, $keywords) = links_tags($res['id']);
            }
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TITLE'] = $res['title'];
            $tabledata[$i]['URL'] = $res['url'];
            $tabledata[$i]['TEXT'] = $text;
            $tabledata[$i]['LINK'] = $link;
            $tabledata[$i]['PICTURE'] = $picture;
            $tabledata[$i]['PICTURE_POPUP'] = $picture_popup;
            $tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath;
            $tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.');
            $tabledata[$i]['TIME'] = $res['starttime'];
            $tabledata[$i]['TOP'] = $res['top'];
            $tabledata[$i]['RESTRICTED'] = $res['restricted'];
            $tabledata[$i]['NEW'] = $new;
            $tabledata[$i]['GOTO'] = $gotolink;
            //Tags
            $tabledata[$i]['TAG'] = $tagdata;
            $tabledata[$i]['TAG_IDS'] = $tagids;
            $tabledata[$i]['KEYWORDS'] = $keywords;
            //Autor
            $tabledata[$i]['USERID'] = $res['userid'];
            $tabledata[$i]['USERNAME'] = replace($author);
            $tabledata[$i]['EMAIL'] = replace($author_email);
            $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(cryptMail($author_email));
            //Kategorien
            $tabledata[$i]['CATID'] = $res['catid'];
            $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title'];
            $tabledata[$i]['CATTEXT'] = $catinfo[$res['catid']]['text'];
            $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon'];
            $tabledata[$i]['CATLINK'] = mklink('links.php?catid=' . $res['catid'], 'links,' . $res['catid'] . ',1' . urlformat($catinfo[$res['catid']]['title']) . '.html');
            //Galerie
            if ($apx->is_module('gallery') && $res['galid']) {
                $galinfo = gallery_info($res['galid']);
                $tabledata[$i]['GALLERY_ID'] = $galinfo['id'];
                $tabledata[$i]['GALLERY_TITLE'] = $galinfo['title'];
                $tabledata[$i]['GALLERY_LINK'] = mklink('gallery.php?id=' . $galinfo['id'], 'gallery,list' . $galinfo['id'] . ',1' . urlformat($galinfo['title']) . '.html');
            }
            //Kommentare
            if ($apx->is_module('comments') && $set['links']['coms'] && $res['allowcoms']) {
                require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
                if (!isset($coms)) {
                    $coms = new comments('links', $res['id']);
                } else {
                    $coms->mid = $res['id'];
                }
                $link = mklink('links.php?id=' . $res['id'], 'links,id' . $res['id'] . urlformat($res['title']) . '.html');
                $tabledata[$i]['COMMENT_COUNT'] = $coms->count();
                $tabledata[$i]['COMMENT_LINK'] = $coms->link($link);
                $tabledata[$i]['DISPLAY_COMMENTS'] = 1;
                if (in_template(array('LINK.COMMENT_LAST_USERID', 'LINK.COMMENT_LAST_NAME', 'LINK.COMMENT_LAST_TIME'), $parse)) {
                    $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid();
                    $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name();
                    $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time();
                }
            }
            //Bewertungen
            if ($apx->is_module('ratings') && $set['links']['ratings'] && $res['allowrating']) {
                require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
                if (!isset($rate)) {
                    $rate = new ratings('links', $res['id']);
                } else {
                    $rate->mid = $res['id'];
                }
                $tabledata[$i]['RATING'] = $rate->display();
                $tabledata[$i]['RATING_VOTES'] = $rate->count();
                $tabledata[$i]['DISPLAY_RATING'] = 1;
            }
            $laststamp = date('Y/m/d', $res['starttime'] - TIMEDIFF);
        }
    }
    $tmpl->assign('LINK', $tabledata);
    $tmpl->parse($template, 'links');
}
					$career_pur = $common->is_module_purchased_check($db_object,$path,$common->cavar);
					if($career_pur==1)
					{
						$ski_qry = "select count(rater_id) from $textqsort_rating where rater_id='$uid'";
						$ski_res = $db_object->get_single_column($ski_qry);
						$inter = $ski_res[0];

						$skt_qry = "select count(rater_id) from $other_raters_tech where rater_id='$uid'";
						$skt_res = $db_object->get_single_column($skt_qry);
						$tech = $skt_res[0];
						$skill = ($inter + $tech);
					}
				//total
					$total = ($performance+$learning+$skill);

					
					$str.=preg_replace("/<{(.*?)}>/e","$$1",$match);
				}//i loop
		
				$file = preg_replace($pattern,$str,$file);
			
				
			$file = $common->direct_replace($db_object,$file,$val);
			echo $file;
		}
	}
	$ob = new ratings;
	$ob->view_form($db_object,$common,$user_id,$default,$err);
include_once("footer.php");
?>
Example #7
0
 public function fullList()
 {
     $ratings = ratings::all();
     return view('app.list', ['ratings' => $ratings]);
 }
Example #8
0
<?php

/***************************************************************\
|                                                               |
|                   apexx CMS & Portalsystem                    |
|                 ============================                  |
|           (c) Copyright 2005-2009, Christian Scheb            |
|                  http://www.stylemotion.de                    |
|                                                               |
|---------------------------------------------------------------|
| THIS SOFTWARE IS NOT FREE! MAKE SURE YOU OWN A VALID LICENSE! |
| DO NOT REMOVE ANY COPYRIGHTS WITHOUT PERMISSION!              |
| SOFTWARE BELONGS TO ITS AUTHORS!                              |
\***************************************************************/
//Security-Check
if (!defined('APXRUN')) {
    die('You are not allowed to execute this file directly!');
}
////////////////////////////////////////////////////////////////////////////////////////////
//Bewertung senden
if ($_POST['sendrate']) {
    require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
    $rate = new ratings($_POST['module'], $_POST['mid']);
    $rate->addrate();
}
Example #9
0
function videos_print($data, $template)
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $apx->lang->drop('globalwohl', 'videos');
    //Verwendete Variablen auslesen
    $parse = $apx->tmpl->used_vars($template, 'videos');
    //Kategorien auslesen
    if (in_array('VIDEO.CATTITLE', $parse) || in_array('VIDEO.CATTEXT', $parse) || in_array('VIDEO.CATICON', $parse) || in_array('VIDEO.CATLINK', $parse)) {
        $catids = get_ids($data, 'catid');
        if (count($catids)) {
            $catdata = $db->fetch("SELECT id,title,text,icon FROM " . PRE . "_videos_cat WHERE id IN (" . implode(',', $catids) . ")");
            if (count($catdata)) {
                foreach ($catdata as $catres) {
                    $catinfo[$catres['id']] = $catres;
                }
            }
        }
    }
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            //Link
            $link = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html');
            //Teaserbild
            if (in_array('VIDEO.PICTURE', $parse) || in_array('VIDEO.PICTURE_POPUP', $parse) || in_array('VIDEO.PICTURE_POPUPPATH', $parse)) {
                list($picture, $picture_popup, $picture_popuppath) = videos_teaserpic($res['teaserpic']);
            }
            //Dateigröße auslesen
            if (in_array('VIDEO.SIZE', $parse)) {
                $thefsize = videos_filesize($res);
            }
            //Download-Link
            if (!$set['videos']['regonly'] && !$res['regonly'] || $user->info['userid']) {
                $sechash = md5($_SERVER['HTTP_HOST'] . $res['file'] . date('Y/m/d', time() - TIMEDIFF));
                $dllink = 'misc.php?action=videofile&amp;id=' . $res['id'] . '&amp;sechash=' . $sechash . iif($apx->section_id(), '&amp;sec=' . $apx->section_id());
            } else {
                $dllink = mklink('user.php', 'user.html');
            }
            //Bilder
            if (in_array('VIDEO.SCREENSHOT', $parse)) {
                $picdata = videos_screenshots($res['id']);
            }
            //Neu?
            if ($res['addtime'] + $set['videos']['new'] * 24 * 3600 >= time()) {
                $new = 1;
            } else {
                $new = 0;
            }
            //Username + eMail
            if ($res['userid']) {
                $uploader = $res['username'];
                $uploader_email = iif(!$res['pub_hidemail'], $res['email']);
            } else {
                $uploader = $res['send_username'];
                $uploader_email = $res['send_email'];
            }
            //Datehead
            if ($laststamp != date('Y/m/d', $res['starttime'] - TIMEDIFF)) {
                $tabledata[$i]['DATEHEAD'] = $res['starttime'];
            }
            //Text
            $text = '';
            if (in_array('VIDEO.TEXT', $parse)) {
                $text = mediamanager_inline($res['text']);
                if ($apx->is_module('glossar')) {
                    $text = glossar_highlight($text);
                }
            }
            //Tags
            if (in_array('VIDEO.TAG', $parse) || in_array('VIDEO.TAG_IDS', $parse) || in_array('VIDEO.KEYWORDS', $parse)) {
                list($tagdata, $tagids, $keywords) = videos_tags($res['id']);
            }
            //Embeded?
            if ($res['source'] != 'apexx' && $res['source'] != 'external') {
                $embedcode = videos_embedcode($res['source'], $res['flvfile']);
                $file = '';
                $flvfile = '';
                $dllink = '';
            } elseif ($res['source'] == 'external') {
                $embedcode = '';
                $flvfile = $res['flvfile'];
                if ($res['file']) {
                    $file = $res['file'];
                } else {
                    $dllink = '';
                }
            } else {
                $embedcode = '';
                $flvfile = HTTPDIR . getpath('uploads') . $res['flvfile'];
                if ($res['file']) {
                    $file = HTTP_HOST . HTTPDIR . getpath('uploads') . $res['file'];
                } else {
                    $dllink = '';
                }
            }
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['SECID'] = $res['secid'];
            $tabledata[$i]['USERID'] = $res['userid'];
            $tabledata[$i]['USERNAME'] = replace($uploader);
            $tabledata[$i]['EMAIL'] = replace($uploader_email);
            $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(cryptMail($uploader_email));
            $tabledata[$i]['TITLE'] = $res['title'];
            $tabledata[$i]['TEXT'] = $text;
            $tabledata[$i]['LINK'] = $link;
            $tabledata[$i]['PICTURE'] = $picture;
            $tabledata[$i]['PICTURE_POPUP'] = $picture_popup;
            $tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath;
            $tabledata[$i]['SIZE'] = videos_getsize($thefsize);
            $tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.');
            $tabledata[$i]['TIME'] = $res['starttime'];
            $tabledata[$i]['SCREENSHOT'] = $picdata;
            $tabledata[$i]['SOURCE'] = $res['source'] == 'external' ? 'apexx' : $res['source'];
            $tabledata[$i]['VIDEOFILE'] = $flvfile;
            $tabledata[$i]['EMBEDCODE'] = $embedcode;
            $tabledata[$i]['LOCAL'] = $res['source'] == 'apexx';
            $tabledata[$i]['TOP'] = $res['top'];
            $tabledata[$i]['RESTRICTED'] = $res['restricted'];
            $tabledata[$i]['NEW'] = $new;
            $tabledata[$i]['DOWNLOADLINK'] = $dllink;
            $tabledata[$i]['DOWNLOADFILE'] = $file;
            $tabledata[$i]['DOWNLOADS'] = number_format($res['downloads'], 0, '', '.');
            //Tags
            $tabledata[$i]['TAG'] = $tagdata;
            $tabledata[$i]['TAG_IDS'] = $tagids;
            $tabledata[$i]['KEYWORDS'] = $keywords;
            //Kategorie
            $tabledata[$i]['CATID'] = $res['catid'];
            $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title'];
            $tabledata[$i]['CATTEXT'] = $catinfo[$res['catid']]['text'];
            $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon'];
            //Produkt
            $tabledata[$i]['PRODUCT_ID'] = $res['prodid'];
            //Kommentare
            if ($apx->is_module('comments') && $set['videos']['coms'] && $res['allowcoms']) {
                require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
                if (!isset($coms)) {
                    $coms = new comments('videos', $res['id']);
                } else {
                    $coms->mid = $res['id'];
                }
                $link = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html');
                $tabledata[$i]['COMMENT_COUNT'] = $coms->count();
                $tabledata[$i]['COMMENT_LINK'] = $coms->link($link);
                $tabledata[$i]['DISPLAY_COMMENTS'] = 1;
                if (in_template(array('VIDEO.COMMENT_LAST_USERID', 'VIDEO.COMMENT_LAST_NAME', 'VIDEO.COMMENT_LAST_TIME'), $parse)) {
                    $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid();
                    $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name();
                    $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time();
                }
            }
            //Bewertungen
            if ($apx->is_module('ratings') && $set['videos']['ratings'] && $res['allowrating']) {
                require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
                if (!isset($rate)) {
                    $rate = new ratings('videos', $res['id']);
                } else {
                    $rate->mid = $res['id'];
                }
                $tabledata[$i]['RATING'] = $rate->display();
                $tabledata[$i]['RATING_VOTES'] = $rate->count();
                $tabledata[$i]['DISPLAY_RATING'] = 1;
            }
            $laststamp = date('Y/m/d', $res['starttime'] - TIMEDIFF);
        }
    }
    $tmpl->assign('VIDEO', $tabledata);
    $tmpl->parse($template, 'videos');
}
Example #10
0
        $pre['LASTPOST_TIME'] = $res['lastposttime'];
        $pre['LASTPOST_LINK'] = 'thread.php?id=' . $res['threadid'] . '&amp;goto=lastpost';
        $pre['LINK_UNREAD'] = 'thread.php?id=' . $res['threadid'] . '&amp;goto=firstunread';
        $pre['STICKY'] = replace($res['sticky_text']);
        $pre['POSTS'] = number_format($res['posts'] - 1, 0, '', '.');
        $pre['VIEWS'] = number_format($res['views'], 0, '', '.');
        $pre['HOT'] = iif($res['posts'] >= $set['forum']['hot_posts'] || $res['views'] >= $set['forum']['hot_views'], 1, 0);
        $pre['MOVED'] = $res['moved'];
        $pre['NEWPOSTS'] = iif($res['lastposttime'] && $res['lastposttime'] > $lastview, 1, 0);
        $pre['CLOSED'] = !$res['open'];
        $pre['DELETED'] = $res['del'];
        //Bewertungen
        if ($apx->is_module('ratings') && $set['forum']['ratings']) {
            require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
            if (!isset($rate)) {
                $rate = new ratings('forum', $res['threadid']);
            } else {
                $rate->mid = $res['threadid'];
            }
            $pre['RATING'] = $rate->display();
            $pre['RATING_VOTES'] = $rate->count();
            $pre['DISPLAY_RATING'] = 1;
        }
        if ($res['sticky'] && !$res['del']) {
            $pinneddata[] = $pre;
        } else {
            $threaddata[] = $pre;
        }
    }
}
//Sortieren nach...
Example #11
0
function gallery_printsingle($res, $template)
{
    global $set, $db, $apx, $user;
    if (!$res['id']) {
        return;
    }
    $tmpl = new tengine();
    //Voreinstellungen
    if (!$set['gallery']['picwidth'] || !$set['gallery']['picheight']) {
        $set['gallery']['picwidth'] = 9999999;
        $set['gallery']['picheight'] = 9999999;
    }
    //Verwendete Variablen auslesen
    $parse = $apx->tmpl->used_vars($template, 'gallery');
    //GALERIE
    if (in_template(array('GALLERY_TITLE', 'GALLERY_DESCRIPTION', 'GALLERY_LINK', 'GALLERY_TIME', 'GALLERY_PRODUCT_ID', 'GALLERY_RESTRICTED'), $parse)) {
        $galinfo = $db->first("SELECT secid,title,prodid,description,restricted,starttime FROM " . PRE . "_gallery WHERE id='" . $res['galid'] . "'");
    }
    $gallink = mklink('gallery.php?id=' . $res['galid'], 'gallery,list' . $res['galid'] . ',1' . urlformat($galinfo['title']) . '.html');
    //Tags
    if (in_array('GALLERY_TAG', $parse) || in_array('GALLERY_TAG_IDS', $parse) || in_array('GALLERY_KEYWORDS', $parse)) {
        list($tagdata, $tagids, $keywords) = gallery_tags($res['galid']);
    }
    $tmpl->assign('GALLERY_ID', $res['galid']);
    $tmpl->assign('GALLERY_SECID', $galinfo['secid']);
    $tmpl->assign('GALLERY_TITLE', $galinfo['title']);
    $tmpl->assign('GALLERY_DESCRIPTION', $galinfo['description']);
    $tmpl->assign('GALLERY_RESTRICTED', $galinfo['restricted']);
    $tmpl->assign('GALLERY_TIME', $galinfo['starttime']);
    $tmpl->assign('GALLERY_LINK', $gallink);
    $tmpl->assign('GALLERY_PRODUCT_ID', $galinfo['prodid']);
    //Tags
    $tmpl->assign('TAG_IDS', $tagids);
    $tmpl->assign('TAG', $tagdata);
    $tmpl->assign('KEYWORDS', $keywords);
    //Enthaltene Bilder, Letzte Aktualisierung
    if (in_template(array('GALLERY_COUNT', 'GALLERY_UPDATETIME'), $parse)) {
        list($galcount, $updatetime) = $db->first("SELECT count(id), max(addtime) FROM " . PRE . "_gallery_pics WHERE ( galid='" . $res['galid'] . "' AND active='1' )");
        $tmpl->assign('GALLERY_COUNT', $galcount);
        $tmpl->assign('GALLERY_COUNT', $updatetime);
    }
    //BILD
    $link = mklink('gallery.php?pic=' . $res['id'], 'gallery,pic' . $res['id'] . urlformat($res['caption']) . '.html');
    if ($set['gallery']['popup']) {
        $link = "javascript:popupwin('" . $link . "','" . $set['gallery']['picwidth'] . "','" . $set['gallery']['picheight'] . "'," . iif($set['gallery']['popup_resizeable'], 1, 0) . ")";
    }
    $tmpl->assign('CAPTION', $res['caption']);
    $tmpl->assign('IMAGE', getpath('uploads') . $res['thumbnail']);
    $tmpl->assign('FULLSIZE', getpath('uploads') . $res['picture']);
    $tmpl->assign('LINK', $link);
    $tmpl->assign('TIME', $res['addtime']);
    $tmpl->assign('HITS', number_format($res['hits'], 0, '', '.'));
    //Kommentare
    if ($apx->is_module('comments') && $set['gallery']['coms'] && $res['allowcoms']) {
        require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
        $coms = new comments('gallery', $res['id']);
        //Link
        $gallink = mklink('gallery.php?id=' . $res['galid'], 'gallery,list' . $res['galid'] . ',1' . urlformat($galinfo['title']) . '.html');
        $tmpl->assign('COMMENT_COUNT', $coms->count());
        $tmpl->assign('COMMENT_LINK', $coms->link($link));
        $tmpl->assign('DISPLAY_COMMENTS', 1);
    }
    //Bewertungen
    if ($apx->is_module('ratings') && $set['gallery']['ratings'] && $res['allowrating']) {
        require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
        $rate = new ratings('gallery', $res['id']);
        $tmpl->assign('RATING', $rate->display());
        $tmpl->assign('RATING_VOTES', $rate->count());
        $tmpl->assign('DISPLAY_RATING', 1);
    }
    $tmpl->parse($template, 'gallery');
}
Example #12
0
function glossar_print($data, $template, $alphabetical = false)
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $apx->lang->drop('func', 'glossar');
    //Verwendete Variablen auslesen
    $parse = $apx->tmpl->used_vars($template, 'glossar');
    //Kategorien auslesen & Info vorbereiten
    if (in_array('INDEX.CATID', $parse) || in_array('INDEX.CATTITLE', $parse) || in_array('INDEX.CATTEXT', $parse) || in_array('INDEX.CATICON', $parse)) {
        $catids = get_ids($data, 'catid');
        if (count($catids)) {
            $catdata = $db->fetch("SELECT * FROM " . PRE . "_glossar_cat WHERE id IN (" . implode(',', $catids) . ")");
            foreach ($catdata as $res) {
                $catinfo[$res['id']] = $res;
                $catinfo[$res['id']]['link'] = mklink('glossar.php?catid=' . $res['id'], 'glossar,' . $res['id'] . ',0,1' . urlformat($res['title']) . '.html');
            }
        }
    }
    //Begriffe auflisten
    if (count($data)) {
        //Nach Buchstaben sortieren
        $letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ#';
        for ($i = 0; $i < strlen($letters); $i++) {
            $index[$letters[$i]] = array();
        }
        if ($alphabetical) {
            foreach ($data as $res) {
                $letter = glossar_letter($res['title']);
                $index[$letter][] = $res;
            }
        } else {
            foreach ($data as $res) {
                $index[0][] = $res;
            }
        }
        //Index erstellen
        foreach ($index as $letter => $data) {
            //Link: Nur Begriffe mit diesem Buchstaben
            $letterlink = mklink('glossar.php?catid=' . $_REQUEST['catid'] . '&amp;letter=' . iif($letter == '#', 'spchar', strtolower($letter)), 'glossar,' . $_REQUEST['catid'] . ',' . iif($letter == '#', 'spchar', strtolower($letter)) . ',1' . urlformat($catinfo['title']) . '.html');
            foreach ($data as $res) {
                ++$i;
                //Link
                $link = mklink('glossar.php?id=' . $res['id'], 'glossar,id' . $res['id'] . urlformat($res['title']) . '.html');
                //Tags
                if (in_array('INDEX.TAG', $parse) || in_array('INDEX.TAG_IDS', $parse) || in_array('INDEX.KEYWORDS', $parse)) {
                    list($tagdata, $tagids, $keywords) = glossar_tags($res['id']);
                }
                $tabledata[$i]['LETTER'] = $letter;
                $tabledata[$i]['LETTERLINK'] = $letterlink;
                $tabledata[$i]['TITLE'] = $res['title'];
                $tabledata[$i]['TEXT'] = $res['text'];
                $tabledata[$i]['SPELLING'] = $res['spelling'];
                $tabledata[$i]['LINK'] = $link;
                $tabledata[$i]['TIME'] = $res['starttime'];
                $tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.');
                //Tags
                $tabledata[$i]['TAG'] = $tagdata;
                $tabledata[$i]['TAG_IDS'] = $tagids;
                $tabledata[$i]['KEYWORDS'] = $keywords;
                $tabledata[$i]['CATID'] = $catinfo[$res['catid']]['id'];
                $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title'];
                $tabledata[$i]['CATTEXT'] = $catinfo[$res['catid']]['text'];
                $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon'];
                $tabledata[$i]['CATLINK'] = $catinfo[$res['catid']]['link'];
                //Kommentare
                if ($apx->is_module('comments') && $set['glossar']['coms'] && $res['allowcoms']) {
                    require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
                    if (!isset($coms)) {
                        $coms = new comments('glossar', $res['id']);
                    } else {
                        $coms->mid = $res['id'];
                    }
                    $link = mklink('glossar.php?id=' . $res['id'], 'glossar,id' . $res['id'] . urlformat($res['title']) . '.html');
                    $tabledata[$i]['COMMENT_COUNT'] = $coms->count();
                    $tabledata[$i]['COMMENT_LINK'] = $coms->link($link);
                    $tabledata[$i]['DISPLAY_COMMENTS'] = 1;
                    if (in_template(array('INDEX.COMMENT_LAST_USERID', 'INDEX.COMMENT_LAST_NAME', 'INDEX.COMMENT_LAST_TIME'), $parse)) {
                        $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid();
                        $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name();
                        $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time();
                    }
                }
                //Bewertungen
                if ($apx->is_module('ratings') && $set['glossar']['ratings'] && $res['allowrating']) {
                    require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
                    if (!isset($rate)) {
                        $rate = new ratings('glossar', $res['id']);
                    } else {
                        $rate->mid = $res['id'];
                    }
                    $tabledata[$i]['RATING'] = $rate->display();
                    $tabledata[$i]['RATING_VOTES'] = $rate->count();
                    $tabledata[$i]['DISPLAY_RATING'] = 1;
                }
            }
        }
    }
    $tmpl->assign('INDEX', $tabledata);
    $tmpl->parse($template, 'glossar');
}
Example #13
0
 public function DeleteUser()
 {
     if (isset($_POST["userID"]) && $_SESSION['form_timer'] + 300 > time()) {
         parent::model("accounts");
         $account = new accounts();
         $user = $account->ShowUserByID($_POST["userID"]);
         $advisors = $account->ShowUsersByRank(0);
         if ($_POST['userID'] != $_SESSION['ID']) {
             if ($user->rank == 0 && Count($advisors) >= 2 || $user->rank == 2) {
                 try {
                     if ($user->rank == 2) {
                         parent::model("docs");
                         $model = new docs();
                         parent::model("ratings");
                         $model1 = new ratings();
                         $model1->DeleteRatingsIntern($_POST["userID"]);
                         $account->DeleteUser($_POST["userID"]);
                         $model->DeleteXML($_POST["userID"]);
                     } else {
                         $account->DeleteUser($_POST["userID"]);
                     }
                     $data['alert'] = "alert-success";
                     $data['message'] = "Cet utilisateur a bien été supprimé.";
                 } catch (exception $ex) {
                     $data['alert'] = "alert-warning";
                     $data['message'] = "Cet utilisateur n'a pu être supprimé.";
                 }
             } else {
                 $data['alert'] = "alert-warning";
                 $data['message'] = "Il ne reste qu'un coordonnateur: vous ne pouvez le supprimer.";
             }
         } else {
             $data['alert'] = "alert-warning";
             $data['message'] = "Vous ne pouvez pas vous supprimer.";
         }
     }
     $this->ShowUsers($data);
 }
Example #14
0
function articles_print($data, $template, $bestreviews = false)
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $apx->lang->drop('global', 'articles');
    //Verwendete Variablen auslesen
    $parse = $apx->tmpl->used_vars($template, 'articles');
    //Datensatz erweitern durch Preview/Review-Daten, nur wenn keine Reviewbestenliste
    if (!$bestreviews) {
        $data = articles_extend_data($data, $parse);
    }
    //Kategorien auslesen
    if (in_array('ARTICLE.CATID', $parse) || in_array('ARTICLE.CATTITLE', $parse) || in_array('ARTICLE.CATICON', $parse) || in_array('ARTICLE.CATLINK', $parse)) {
        $catinfo = articles_catinfo(get_ids($data, 'catid'));
    }
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            //Wohin soll verlinkt werden?
            if ($res['type'] == 'normal') {
                $link2file = 'articles';
            } else {
                $link2file = $res['type'] . 's';
            }
            //Link
            $link = mklink($link2file . '.php?id=' . $res['id'], $link2file . ',id' . $res['id'] . ',0' . urlformat($res['title']) . '.html');
            //Artikelpic
            if (in_array('ARTICLE.PICTURE', $parse) || in_array('ARTICLE.PICTURE_POPUP', $parse) || in_array('ARTICLE.PICTURE_POPUPPATH', $parse)) {
                list($picture, $picture_popup, $picture_popuppath) = articles_artpic($res['artpic']);
            }
            //Artikeltext
            if (in_array('ARTICLE.TEXT', $parse)) {
                list($page1text) = $db->first("SELECT text FROM " . PRE . "_articles_pages WHERE artid='" . $res['id'] . "' ORDER BY ord ASC LIMIT 1");
                $page1text = mediamanager_inline($page1text);
                if ($apx->is_module('glossar')) {
                    $page1text = glossar_highlight($page1text);
                }
            }
            //Datehead
            if ($laststamp != date('Y/m/d', $res['starttime'] - TIMEDIFF)) {
                $tabledata[$i]['DATEHEAD'] = $res['starttime'];
            }
            //Links
            if (in_array('ARTICLE.RELATED', $parse)) {
                $tabledata[$i]['RELATED'] = articles_links($res['links']);
            }
            //Bilderserie
            if (in_array('ARTICLE.PICSERIES', $parse)) {
                $tabledata[$i]['PICSERIES'] = articles_picseries($res['pictures'], $res['id'], $link2file);
            }
            //Teaser
            $teaser = '';
            if (in_array('ARTICLE.TEASER', $parse)) {
                $teaser = mediamanager_inline($res['teaser']);
                if ($apx->is_module('glossar')) {
                    $teaser = glossar_highlight($teaser);
                }
            }
            //Tags
            if (in_array('ARTICLE.TAG', $parse) || in_array('ARTICLE.TAG_IDS', $parse) || in_array('ARTICLE.KEYWORDS', $parse)) {
                list($tagdata, $tagids, $keywords) = articles_tags($res['id']);
            }
            //Index
            $pageIndex = array();
            if (in_array('ARTICLE.INDEX', $parse)) {
                $pageIndex = articles_index($res['id'], $res['title'], $link2file);
            }
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['SECID'] = $res['secid'];
            $tabledata[$i]['TYPE'] = $res['type'];
            $tabledata[$i]['TITLE'] = $res['title'];
            $tabledata[$i]['SUBTITLE'] = $res['subtitle'];
            $tabledata[$i]['TEASER'] = $teaser;
            $tabledata[$i]['TEXT'] = $page1text;
            $tabledata[$i]['LINK'] = $link;
            $tabledata[$i]['TIME'] = $res['starttime'];
            $tabledata[$i]['INDEX'] = $pageIndex;
            $tabledata[$i]['PICTURE'] = $picture;
            $tabledata[$i]['PICTURE_POPUP'] = $picture_popup;
            $tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath;
            $tabledata[$i]['USERID'] = $res['userid'];
            $tabledata[$i]['USERNAME'] = replace($res['username']);
            $tabledata[$i]['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email']));
            $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email'])));
            $tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.');
            $tabledata[$i]['TOP'] = $res['top'];
            $tabledata[$i]['RESTRICTED'] = $res['restricted'];
            //Tags
            $tabledata[$i]['TAG'] = $tagdata;
            $tabledata[$i]['TAG_IDS'] = $tagids;
            $tabledata[$i]['KEYWORDS'] = $keywords;
            //Kategorie
            $tabledata[$i]['CATID'] = $res['catid'];
            $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title'];
            $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon'];
            $tabledata[$i]['CATLINK'] = $catinfo[$res['catid']]['link'];
            //Produkt
            $tabledata[$i]['PRODUCT_ID'] = $res['prodid'];
            //Zusätzliche Felder: PREVIEWS
            if ($res['type'] == 'preview') {
                for ($ii = 1; $ii <= 10; $ii++) {
                    if (!$set['articles']['custom_preview'][$ii - 1]) {
                        continue;
                    }
                    $tabledata[$i]['CUSTOM' . $ii . '_TITLE'] = $set['articles']['custom_preview'][$ii - 1];
                    $tabledata[$i]['CUSTOM' . $ii] = $res['custom' . $ii];
                }
                $tabledata[$i]['IMPRESSION'] = $res['impression'];
            } elseif ($res['type'] == 'review') {
                for ($ii = 1; $ii <= 10; $ii++) {
                    if (!$set['articles']['custom_review'][$ii - 1]) {
                        continue;
                    }
                    $tabledata[$i]['CUSTOM' . $ii . '_TITLE'] = $set['articles']['custom_review'][$ii - 1];
                    $tabledata[$i]['CUSTOM' . $ii] = $res['custom' . $ii];
                }
                $tabledata[$i]['FINAL_RATING'] = $res['final_rate'];
                $tabledata[$i]['POSITIVE'] = $res['positive'];
                $tabledata[$i]['NEGATIVE'] = $res['negative'];
                $tabledata[$i]['AWARD'] = $res['award'];
            }
            //Galerie
            if ($apx->is_module('gallery') && $res['galid']) {
                $galinfo = gallery_info($res['galid']);
                $tabledata[$i]['GALLERY_ID'] = $galinfo['id'];
                $tabledata[$i]['GALLERY_TITLE'] = $galinfo['title'];
                $tabledata[$i]['GALLERY_LINK'] = mklink('gallery.php?id=' . $galinfo['id'], 'gallery,list' . $galinfo['id'] . ',1' . urlformat($galinfo['title']) . '.html');
            }
            //Kommentare
            if ($apx->is_module('comments') && $set['articles']['coms'] && $res['allowcoms']) {
                require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
                if (!isset($coms)) {
                    $coms = new comments('articles', $res['id']);
                } else {
                    $coms->mid = $res['id'];
                }
                $link = mklink($link2file . '.php?id=' . $res['id'], $link2file . ',id' . $res['id'] . ',1' . urlformat($res['title']) . '.html');
                $tabledata[$i]['COMMENT_COUNT'] = $coms->count();
                $tabledata[$i]['COMMENT_LINK'] = $coms->link($link);
                $tabledata[$i]['DISPLAY_COMMENTS'] = 1;
                if (in_template(array('ARTICLE.COMMENT_LAST_USERID', 'ARTICLE.COMMENT_LAST_NAME', 'ARTICLE.COMMENT_LAST_TIME'), $parse)) {
                    $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid();
                    $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name();
                    $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time();
                }
            }
            //Bewertungen
            if ($apx->is_module('ratings') && $set['articles']['ratings'] && $res['allowrating']) {
                require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
                if (!isset($rate)) {
                    $rate = new ratings('articles', $res['id']);
                } else {
                    $rate->mid = $res['id'];
                }
                $tabledata[$i]['RATING'] = $rate->display();
                $tabledata[$i]['RATING_VOTES'] = $rate->count();
                $tabledata[$i]['DISPLAY_RATING'] = 1;
            }
            $laststamp = date('Y/m/d', $res['starttime'] - TIMEDIFF);
        }
    }
    $tmpl->assign('ARTICLE', $tabledata);
    $tmpl->parse($template, 'articles');
}
Example #15
0
            }
            $link = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html');
            $tabledata[$i]['COMMENT_COUNT'] = $coms->count();
            $tabledata[$i]['COMMENT_LINK'] = $coms->link($link);
            $tabledata[$i]['DISPLAY_COMMENTS'] = 1;
            if (in_template(array('VIDEO.COMMENT_LAST_USERID', 'VIDEO.COMMENT_LAST_NAME', 'VIDEO.COMMENT_LAST_TIME'), $parse)) {
                $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid();
                $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name();
                $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time();
            }
        }
        //Bewertungen
        if ($apx->is_module('ratings') && $set['videos']['ratings'] && $res['allowrating']) {
            require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
            if (!isset($rate)) {
                $rate = new ratings('videos', $res['id']);
            } else {
                $rate->mid = $res['id'];
            }
            $tabledata[$i]['RATING'] = $rate->display();
            $tabledata[$i]['RATING_VOTES'] = $rate->count();
            $tabledata[$i]['DISPLAY_RATING'] = 1;
        }
    }
}
//Sortby
ordervars($orderdef, mklink('videos.php?catid=' . $_REQUEST['catid'], 'videos,' . $_REQUEST['catid'] . ',1.html'));
$apx->tmpl->assign('VIDEO', $tabledata);
$apx->tmpl->parse('index');
////////////////////////////////////////////////////////////////////////////////////////////////////////
require 'lib/_end.php';
Example #16
0
<?php

//------------------------------------------------------------
// instantiate sessions
//------------------------------------------------------------
if (!isset($_SESSION)) {
    session_start();
}
//------------------------------------------------------------
// GET OR SET VOTES
//------------------------------------------------------------
$rating = new ratings($_POST['widget_id']);
$counter = 0;
$max_votes = 2;
if (isset($_POST['fetch'])) {
    $rating->get_ratings();
} elseif (!isset($_SESSION['voted'])) {
    $rating->vote();
    $_SESSION['voted'] = $counter + 1;
} elseif (isset($_SESSION['voted']) && $_SESSION['voted'] <= $max_votes - 1) {
    $rating->vote();
    $_SESSION['voted'] += 1;
}
//------------------------------------------------------------
// RATING CLASS
//------------------------------------------------------------
class ratings
{
    var $data_file = 'ratings.data.php';
    private $widget_id;
    private $data = array();
Example #17
0
function products_print($data, $template)
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $apx->lang->drop('fields', 'products');
    //Verwendet Variablen auslesen
    $parse = $apx->tmpl->used_vars($template, 'products');
    $ids = get_ids($data, 'id');
    $types = get_ids($data, 'type');
    if (count($data)) {
        $unitvars = array('PRODUCT.DEVELOPER', 'PRODUCT.DEVELOPER_WEBSITE', 'PRODUCT.DEVELOPER_LINK', 'PRODUCT.PUBLISHER', 'PRODUCT.PUBLISHER_WEBSITE', 'PRODUCT.PUBLISHER_LINK', 'PRODUCT.MANUFACTURER', 'PRODUCT.MANUFACTURER_WEBSITE', 'PRODUCT.MANUFACTURER_LINK', 'PRODUCT.STUDIO', 'PRODUCT.STUDIO_WEBSITE', 'PRODUCT.STUDIO_LINK', 'PRODUCT.LABEL', 'PRODUCT.LABEL_WEBSITE', 'PRODUCT.LABEL_LINK', 'PRODUCT.ARTIST', 'PRODUCT.ARTIST_WEBSITE', 'PRODUCT.ARTIST_LINK', 'PRODUCT.AUTHOR', 'PRODUCT.AUTHOR_WEBSITE', 'PRODUCT.AUTHOR_LINK');
        //Einheiten auslesen
        $unitinfo = array();
        if (in_template($unitvars, $parse)) {
            $unitids = array_merge(get_ids($data, 'manufacturer'), get_ids($data, 'publisher'));
            $unitinfo = $db->fetch_index("SELECT id,title,website FROM " . PRE . "_products_units WHERE id IN (" . implode(',', $unitids) . ")", 'id');
        }
        //Gruppen auslesen
        $groupinfo = array();
        $groups = array();
        /*if ( in_template(array('PRODUCT.MEDIA'),$parse) ) $groups = array_merge($groups,get_ids($data,'media'));
        		if ( in_array('PRODUCT.GENRE',$parse) ) $groups = array_merge($groups,get_ids($data,'genre'));
        		if ( in_array('game',$types) && in_template(array('PRODUCT.RELEASE.SYSTEM','PRODUCT.RELEASE.SYSTEM_ICON','PRODUCT.SYSTEM'),$parse) ) {
        			if ( count($groups)==0 ) $groups = array(0);
        			$groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).") OR grouptype='system'",'id');
        		}
        		elseif ( in_array('movie',$types) && in_template(array('PRODUCT.RELEASE.MEDIA','PRODUCT.RELEASE.MEDIA_ICON','PRODUCT.MEDIA'),$parse) ) {
        			if ( count($groups)==0 ) $groups = array(0);
        			$groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).") OR grouptype='media'",'id');
        		}
        		elseif ( count($groups) ) {
        			$groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).")",'id');
        		}*/
        $groupinfo = $db->fetch_index("SELECT id,title,icon FROM " . PRE . "_products_groups", 'id');
        //Veröffentlichungs-Daten auslesen
        $releaseinfo = array();
        if (in_array('PRODUCT.RELEASE', $parse)) {
            $releasedata = $db->fetch("SELECT prodid,system,data,stamp FROM " . PRE . "_products_releases WHERE prodid IN (" . implode(',', $ids) . ") ORDER BY stamp ASC");
            if (count($releasedata)) {
                foreach ($releasedata as $relres) {
                    $info = unserialize($relres['data']);
                    $releasedate = products_format_release($info);
                    $relentry = array('stamp' => $relres['stamp'], 'DATE' => $releasedate, 'SYSTEM' => $groupinfo[$relres['system']]['title'], 'SYSTEM_ICON' => $groupinfo[$relres['system']]['icon'], 'MEDIA' => $groupinfo[$relres['system']]['title'], 'MEDIA_ICON' => $groupinfo[$relres['system']]['icon']);
                    $releaseinfo[$relres['prodid']][] = $relentry;
                }
            }
        }
        //Produkte auflisten
        foreach ($data as $res) {
            ++$i;
            //Link
            $link = mklink('products.php?id=' . $res['id'], 'products,id' . $res['id'] . urlformat($res['title']) . '.html');
            //Produktbild
            if (in_array('PRODUCT.PICTURE', $parse) || in_array('PRODUCT.PICTURE_POPUP', $parse) || in_array('PRODUCT.PICTURE_POPUPPATH', $parse)) {
                list($picture, $picture_popup, $picture_popuppath) = products_pic($res['picture']);
            }
            //Teaserbild
            if (in_array('PRODUCT.TEASERPIC', $parse) || in_array('PRODUCT.TEASERPIC_POPUP', $parse) || in_array('PRODUCT.TEASERPIC_POPUPPATH', $parse)) {
                list($teaserpic, $teaserpic_popup, $teaserpic_popuppath) = products_pic($res['teaserpic']);
            }
            //Text
            $text = '';
            if (in_array('PRODUCT.TEXT', $parse)) {
                $text = mediamanager_inline($res['text']);
                if ($apx->is_module('glossar')) {
                    $text = glossar_highlight($text);
                }
            }
            //Datehead
            if ($laststamp != date('Y/m/d', $res['addtime'] - TIMEDIFF)) {
                $tabledata[$i]['DATEHEAD'] = $res['addtime'];
            }
            //Tags
            if (in_array('PRODUCT.TAG', $parse) || in_array('PRODUCT.TAG_IDS', $parse) || in_array('PRODUCT.KEYWORDS', $parse)) {
                list($tagdata, $tagids, $keywords) = products_tags($res['id']);
            }
            //Standard-Platzhalter
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TYPE'] = $res['type'];
            $tabledata[$i]['LINK'] = $link;
            $tabledata[$i]['TITLE'] = $res['title'];
            $tabledata[$i]['TEXT'] = $text;
            $tabledata[$i]['TIME'] = $res['addtime'];
            $tabledata[$i]['WEBSITE'] = $res['website'];
            $tabledata[$i]['BUYLINK'] = $res['buylink'];
            $tabledata[$i]['PRICE'] = $res['price'];
            $tabledata[$i]['HITS'] = $res['hits'];
            $tabledata[$i]['PICTURE'] = $picture;
            $tabledata[$i]['PICTURE_POPUP'] = $picture_popup;
            $tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath;
            $tabledata[$i]['TEASERPIC'] = $teaserpic;
            $tabledata[$i]['TEASERPIC_POPUP'] = $teaserpic_popup;
            $tabledata[$i]['TEASERPIC_POPUPPATH'] = $teaserpic_popuppath;
            $tabledata[$i]['PRODUCT_ID'] = $res['prodid'];
            $tabledata[$i]['RECOMMENDED_PRICE'] = $res['recprice'];
            $tabledata[$i]['GUARANTEE'] = $res['guarantee'];
            //Sammlung
            if ($user->info['userid']) {
                if (!products_in_coll($res['id'])) {
                    $tabledata[$i]['LINK_COLLECTION_ADD'] = mklink('products.php?id=' . $res['id'] . '&amp;addcoll=1', 'products,id' . $res['id'] . urlformat($res['title']) . '.html?addcoll=1');
                } else {
                    $tabledata[$i]['LINK_COLLECTION_REMOVE'] = mklink('products.php?id=' . $res['id'] . '&amp;removecoll=1', 'products,id' . $res['id'] . urlformat($res['title']) . '.html?removecoll=1');
                }
            }
            //Tags
            $tabledata[$i]['TAG'] = $tagdata;
            $tabledata[$i]['TAG_IDS'] = $tagids;
            $tabledata[$i]['KEYWORDS'] = $keywords;
            //NORMAL
            if ($res['type'] == 'normal') {
                $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html');
                $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title'];
                $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website'];
                $tabledata[$i]['MANUFACTURER_LINK'] = $manulink;
            } elseif ($res['type'] == 'game') {
                //System-Liste
                $systemdata = array();
                if (in_array('PRODUCT.SYSTEM', $parse)) {
                    $systems = dash_unserialize($res['systems']);
                    if (!is_array($systems)) {
                        $systems = array();
                    }
                    foreach ($systems as $sysid) {
                        ++$ii;
                        $systemdata[$ii]['TITLE'] = $groupinfo[$sysid]['title'];
                        $systemdata[$ii]['ICON'] = $groupinfo[$sysid]['icon'];
                    }
                }
                //Media-Liste
                $media = dash_unserialize($res['media']);
                if (!is_array($media)) {
                    $media = array();
                }
                $mediadata = array();
                foreach ($media as $medid) {
                    ++$ii;
                    $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title'];
                    $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon'];
                }
                $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html');
                $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html');
                $tabledata[$i]['DEVELOPER'] = $unitinfo[$res['manufacturer']]['title'];
                $tabledata[$i]['DEVELOPER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website'];
                $tabledata[$i]['DEVELOPER_LINK'] = $manulink;
                $tabledata[$i]['PUBLISHER'] = $unitinfo[$res['publisher']]['title'];
                $tabledata[$i]['PUBLISHER_WEBSITE'] = $unitinfo[$res['publisher']]['website'];
                $tabledata[$i]['PUBLISHER_LINK'] = $publink;
                $tabledata[$i]['USK'] = $res['sk'];
                $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title'];
                $tabledata[$i]['MEDIA'] = $mediadata;
                $tabledata[$i]['SYSTEM'] = $systemdata;
                $tabledata[$i]['REQUIREMENTS'] = $res['requirements'];
            } elseif ($res['type'] == 'hardware') {
                $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html');
                $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title'];
                $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website'];
                $tabledata[$i]['MANUFACTURER_LINK'] = $manulink;
                $tabledata[$i]['EQUIPMENT'] = $res['equipment'];
            } elseif ($res['type'] == 'software') {
                //Media-Liste
                $media = dash_unserialize($res['media']);
                if (!is_array($media)) {
                    $media = array();
                }
                $mediadata = array();
                foreach ($media as $medid) {
                    ++$ii;
                    $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title'];
                    $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon'];
                }
                $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html');
                $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title'];
                $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website'];
                $tabledata[$i]['MANUFACTURER_LINK'] = $manulink;
                $tabledata[$i]['OS'] = $res['os'];
                $tabledata[$i]['LANGUAGES'] = $res['languages'];
                $tabledata[$i]['REQUIREMENTS'] = $res['requirements'];
                $tabledata[$i]['LICENSE'] = $res['license'];
                $tabledata[$i]['VERSION'] = $res['version'];
                $tabledata[$i]['MEDIA'] = $mediadata;
            } elseif ($res['type'] == 'music') {
                //Media-Liste
                $media = dash_unserialize($res['media']);
                if (!is_array($media)) {
                    $media = array();
                }
                $mediadata = array();
                foreach ($media as $medid) {
                    ++$ii;
                    $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title'];
                    $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon'];
                }
                $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html');
                $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html');
                $tabledata[$i]['ARTIST'] = $unitinfo[$res['manufacturer']]['title'];
                $tabledata[$i]['ARTIST_WEBSITE'] = $unitinfo[$res['manufacturer']]['website'];
                $tabledata[$i]['ARTIST_LINK'] = $manulink;
                $tabledata[$i]['LABEL'] = $unitinfo[$res['publisher']]['title'];
                $tabledata[$i]['LABEL_WEBSITE'] = $unitinfo[$res['publisher']]['website'];
                $tabledata[$i]['LABEL_LINK'] = $publink;
                $tabledata[$i]['FSK'] = $res['sk'];
                $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title'];
                $tabledata[$i]['MEDIA'] = $mediadata;
            } elseif ($res['type'] == 'movie') {
                //Media-Liste
                $media = dash_unserialize($res['media']);
                if (!is_array($media)) {
                    $media = array();
                }
                $mediadata = array();
                foreach ($media as $medid) {
                    ++$ii;
                    $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title'];
                    $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon'];
                }
                $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html');
                $tabledata[$i]['STUDIO'] = $unitinfo[$res['publisher']]['title'];
                $tabledata[$i]['STUDIO_WEBSITE'] = $unitinfo[$res['publisher']]['website'];
                $tabledata[$i]['STUDIO_LINK'] = $publink;
                $tabledata[$i]['REGISSEUR'] = $res['regisseur'];
                $tabledata[$i]['ACTORS'] = $res['actors'];
                $tabledata[$i]['LENGTH'] = $res['length'];
                $tabledata[$i]['FSK'] = $res['sk'];
                $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title'];
                $tabledata[$i]['MEDIA'] = $mediadata;
            } elseif ($res['type'] == 'book') {
                //Media-Liste
                $media = dash_unserialize($res['media']);
                if (!is_array($media)) {
                    $media = array();
                }
                $mediadata = array();
                foreach ($media as $medid) {
                    ++$ii;
                    $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title'];
                    $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon'];
                }
                $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html');
                $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html');
                $tabledata[$i]['AUTHOR'] = $unitinfo[$res['manufacturer']]['title'];
                $tabledata[$i]['AUTHOR_WEBSITE'] = $unitinfo[$res['manufacturer']]['website'];
                $tabledata[$i]['AUTHOR_LINK'] = $manulink;
                $tabledata[$i]['PUBLISHER'] = $unitinfo[$res['publisher']]['title'];
                $tabledata[$i]['PUBLISHER_WEBSITE'] = $unitinfo[$res['publisher']]['website'];
                $tabledata[$i]['PUBLISHER_LINK'] = $publink;
                $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title'];
                $tabledata[$i]['MEDIA'] = $mediadata;
                $tabledata[$i]['ISBN'] = $res['isbn'];
            }
            //Benutzerdefinierte Felder
            for ($ii = 1; $ii <= 10; $ii++) {
                $tabledata[$i]['CUSTOM' . $ii . '_NAME'] = replace($set['products']['custom_' . $res['type']][$ii - 1]);
                $tabledata[$i]['CUSTOM' . $ii] = $res['custom' . $ii];
            }
            //Veröffentlichung
            if (in_array('PRODUCT.RELEASE', $parse)) {
                if ($res['releasestamp']) {
                    $temprel = $releaseinfo[$res['id']];
                    foreach ($temprel as $rel) {
                        if ($rel['stamp'] != $res['releasestamp']) {
                            continue;
                        }
                        ++$ii;
                        $tabledata[$i]['RELEASE'][$ii] = $rel;
                    }
                } else {
                    $tabledata[$i]['RELEASE'] = $releaseinfo[$res['id']];
                }
            }
            //Kommentare
            if ($apx->is_module('comments') && $set['products']['coms'] && $res['allowcoms']) {
                require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
                if (!isset($coms)) {
                    $coms = new comments('products', $res['id']);
                } else {
                    $coms->mid = $res['id'];
                }
                $link = mklink('products.php?id=' . $res['id'], 'products,id' . $res['id'] . urlformat($res['title']) . '.html');
                $tabledata[$i]['COMMENT_COUNT'] = $coms->count();
                $tabledata[$i]['COMMENT_LINK'] = $coms->link($link);
                $tabledata[$i]['DISPLAY_COMMENTS'] = 1;
                if (in_template(array('PRODUCT.COMMENT_LAST_USERID', 'PRODUCT.COMMENT_LAST_NAME', 'PRODUCT.COMMENT_LAST_TIME'), $parse)) {
                    $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid();
                    $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name();
                    $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time();
                }
            }
            //Bewertungen
            if ($apx->is_module('ratings') && $set['products']['ratings'] && $res['allowrating']) {
                require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
                if (!isset($rate)) {
                    $rate = new ratings('products', $res['id']);
                } else {
                    $rate->mid = $res['id'];
                }
                $tabledata[$i]['RATING'] = $rate->display();
                $tabledata[$i]['RATING_VOTES'] = $rate->count();
                $tabledata[$i]['DISPLAY_RATING'] = 1;
            }
            $laststamp = date('Y/m/d', $res['addtime'] - TIMEDIFF);
        }
    }
    $tmpl->assign('PRODUCT', $tabledata);
    $tmpl->parse($template, 'products');
}
Example #18
0
function news_print($data, $template)
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $apx->lang->drop('func', 'news');
    //Verwendete Variablen auslesen
    $parse = $apx->tmpl->used_vars($template, 'news');
    //Kategorien auslesen
    if (in_array('NEWS.CATID', $parse) || in_array('NEWS.CATTITLE', $parse) || in_array('NEWS.CATICON', $parse) || in_array('NEWS.CATLINK', $parse)) {
        $catinfo = news_catinfo(get_ids($data, 'catid'));
    }
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            //Link
            $link = mklink('news.php?id=' . $res['id'], 'news,id' . $res['id'] . urlformat($res['title']) . '.html');
            //Newspic
            if (in_array('NEWS.PICTURE', $parse) || in_array('NEWS.PICTURE_POPUP', $parse) || in_array('NEWS.PICTURE_POPUPPATH', $parse)) {
                list($picture, $picture_popup, $picture_popuppath) = news_newspic($res['newspic']);
            }
            //Username + eMail
            if ($res['userid']) {
                $username = $res['username'];
                $email = iif(!$res['pub_hidemail'], $res['email']);
            } else {
                $username = $res['send_username'];
                $email = $res['send_email'];
            }
            //Datehead
            if ($laststamp != date('Y/m/d', $res['starttime'] - TIMEDIFF)) {
                $tabledata[$i]['DATEHEAD'] = $res['starttime'];
            }
            //Links
            if (in_array('NEWS.RELATED', $parse)) {
                $tabledata[$i]['RELATED'] = news_links($res['links']);
            }
            //Text
            $text = '';
            if (in_array('NEWS.TEXT', $parse)) {
                $text = mediamanager_inline($res['text']);
                if ($apx->is_module('glossar')) {
                    $text = glossar_highlight($text);
                }
            }
            //Teaser
            $teaser = '';
            if (in_array('NEWS.TEASER', $parse) && $set['news']['teaser']) {
                $teaser = mediamanager_inline($res['teaser']);
                if ($apx->is_module('glossar')) {
                    $teaser = glossar_highlight($teaser);
                }
            }
            //Tags
            if (in_array('NEWS.TAG', $parse) || in_array('NEWS.TAG_IDS', $parse) || in_array('NEWS.KEYWORDS', $parse)) {
                list($tagdata, $tagids, $keywords) = news_tags($res['id']);
            }
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['SECID'] = $res['secid'];
            $tabledata[$i]['TITLE'] = $res['title'];
            $tabledata[$i]['SUBTITLE'] = $res['subtitle'];
            $tabledata[$i]['LINK'] = $link;
            $tabledata[$i]['TEASER'] = $teaser;
            $tabledata[$i]['TEXT'] = $text;
            $tabledata[$i]['TIME'] = $res['starttime'];
            $tabledata[$i]['PICTURE'] = $picture;
            $tabledata[$i]['PICTURE_POPUP'] = $picture_popup;
            $tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath;
            $tabledata[$i]['USERID'] = $res['userid'];
            $tabledata[$i]['USERNAME'] = replace($username);
            $tabledata[$i]['EMAIL'] = replace($email);
            $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(cryptMail($email));
            $tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.');
            $tabledata[$i]['TOP'] = $res['top'];
            $tabledata[$i]['RESTRICTED'] = $res['restricted'];
            //Tags
            $tabledata[$i]['TAG'] = $tagdata;
            $tabledata[$i]['TAG_IDS'] = $tagids;
            $tabledata[$i]['KEYWORDS'] = $keywords;
            //Kategorie
            $tabledata[$i]['CATID'] = $res['catid'];
            $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title'];
            $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon'];
            $tabledata[$i]['CATLINK'] = $catinfo[$res['catid']]['link'];
            //Produkt
            $tabledata[$i]['PRODUCT_ID'] = $res['prodid'];
            //Galerie
            if ($apx->is_module('gallery') && $res['galid']) {
                $galinfo = gallery_info($res['galid']);
                $tabledata[$i]['GALLERY_ID'] = $galinfo['id'];
                $tabledata[$i]['GALLERY_TITLE'] = $galinfo['title'];
                $tabledata[$i]['GALLERY_LINK'] = mklink('gallery.php?id=' . $galinfo['id'], 'gallery,list' . $galinfo['id'] . ',1' . urlformat($galinfo['title']) . '.html');
            }
            //Kommentare
            if ($apx->is_module('comments') && $set['news']['coms'] && $res['allowcoms']) {
                require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
                if (!isset($coms)) {
                    $coms = new comments('news', $res['id']);
                } else {
                    $coms->mid = $res['id'];
                }
                $link = mklink('news.php?id=' . $res['id'], 'news,id' . $res['id'] . urlformat($res['title']) . '.html');
                $tabledata[$i]['COMMENT_COUNT'] = $coms->count();
                $tabledata[$i]['COMMENT_LINK'] = $coms->link($link);
                $tabledata[$i]['DISPLAY_COMMENTS'] = 1;
                if (in_template(array('NEWS.COMMENT_LAST_USERID', 'NEWS.COMMENT_LAST_NAME', 'NEWS.COMMENT_LAST_TIME'), $parse)) {
                    $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid();
                    $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name();
                    $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time();
                }
            }
            //Bewertungen
            if ($apx->is_module('ratings') && $set['news']['ratings'] && $res['allowrating']) {
                require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
                if (!isset($rate)) {
                    $rate = new ratings('news', $res['id']);
                } else {
                    $rate->mid = $res['id'];
                }
                $tabledata[$i]['RATING'] = $rate->display();
                $tabledata[$i]['RATING_VOTES'] = $rate->count();
                $tabledata[$i]['DISPLAY_RATING'] = 1;
            }
            $laststamp = date('Y/m/d', $res['starttime'] - TIMEDIFF);
        }
    }
    $tmpl->assign('NEWS', $tabledata);
    $tmpl->parse($template, 'news');
}
		result: NO OLDRATING SPECIFIED.
	- http://localhost:8888/ratingsAPI.php?query=update&id=8&newRating=4&oldRating=2
		result: CollegeRating for college with id 8 is changed to 4.
	- http://localhost:8888/ratingsAPI.php?query=avg&id=8
		result: prints out "4" to the web page.
	- http://localhost:8888/ratingsAPI.php?query=avg&id=10
		result: "There are not enough ratings to show an average rating for this college." is printed out to the web page.
*/
// The function __autoload is the method for loading all the classes being used in the script. Use it at the beginning of every php main page.
function __autoload($class)
{
    require_once $class . '.php';
}
// change dbConnection parameters to reflect active MySQL setup.
$dbConnection = new relationalDbConnections('CollegeSummary', "localhost:8889", "root", "root");
$ratings = new ratings($dbConnection);
// instance of ratings class with which to write and read to db.
$query = $_GET["query"];
$id = $_GET["id"];
$oldRating = $_GET["oldRating"];
$newRating = $_GET["newRating"];
$outputcontent = "";
if (empty($id)) {
    error_log("Please specify the id parameter.");
    print 'ID NOT SPECIFIED.';
    return false;
}
switch ($query) {
    case 'avg':
        // the average rating will be printed to the page
        $outputcontent = $ratings->getAverageRating($id);
Example #20
0
         $threaddata[$i]['LASTPOST_LINK'] = 'thread.php?id=' . $res['threadid'] . '&amp;goto=lastpost';
         $threaddata[$i]['LINK_UNREAD'] = 'thread.php?id=' . $res['threadid'] . '&amp;goto=firstunread';
         $threaddata[$i]['STICKY'] = replace($res['sticky_text']);
         $threaddata[$i]['POSTS'] = $res['posts'] - 1;
         $threaddata[$i]['VIEWS'] = $res['views'];
         $threaddata[$i]['NEWPOSTS'] = iif($res['lastposttime'] && $res['lastposttime'] > $lastview, 1, 0);
         $threaddata[$i]['CLOSED'] = !$res['open'];
         //Forum
         $threaddata[$i]['FORUM_ID'] = $res['forumid'];
         $threaddata[$i]['FORUM_TITLE'] = replace($foruminfo[$res['forumid']]['title']);
         $threaddata[$i]['FORUM_LINK'] = $foruminfo[$res['forumid']]['link'];
         //Bewertungen
         if ($apx->is_module('ratings') && $set['forum']['ratings']) {
             require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php';
             if (!isset($rate)) {
                 $rate = new ratings('forum', $res['threadid']);
             } else {
                 $rate->mid = $res['threadid'];
             }
             $threaddata[$i]['RATING'] = $rate->display();
             $threaddata[$i]['RATING_VOTES'] = $rate->count();
             $threaddata[$i]['DISPLAY_RATING'] = 1;
         }
     }
 }
 //Sortieren nach...
 ordervars($orderdef, 'search.php?search=' . $search['id'] . '&amp;hash=' . $_REQUEST['hash']);
 //Hot-Parameter in Sprachplatzhalter
 $langvar = strtr($apx->lang->get('HOTTHREAD'), array('{HOT_POSTS}' => $set['forum']['hot_posts'], '{HOT_VIEWS}' => $set['forum']['hot_views']));
 $apx->lang->langpack['HOTTHREAD'] = $langvar;
 $apx->tmpl->assign('HOT_POSTS', $set['forum']['hot_posts']);