function simpleSignMessage($password, $body)
{
    if (!WITH_SIGNATURE) {
        return;
    }
    $textEncrypted = cryptMail($body);
    return cryptMail($textEncrypted . $password);
}
Exemplo n.º 2
0
function createTeamData($res, $parse)
{
    global $apx, $db, $set, $user;
    $userdata = array();
    if ($res['birthday']) {
        $bd = explode('-', $res['birthday']);
        $birthday = intval($bd[0]) . '. ' . getcalmonth($bd[1]) . iif($bd[2], ' ' . $bd[2]);
        if ($bd[2]) {
            $age = date('Y') - $bd[2];
            if (intval(sprintf('%02d%02d', $bd[1], $bd[0])) > intval(date('md'))) {
                $age -= 1;
            }
        }
    }
    $userdata['ID'] = $res['userid'];
    $userdata['USERID'] = $res['userid'];
    $userdata['NAME'] = replace($res['username']);
    $userdata['USERNAME'] = replace($res['username']);
    $userdata['GROUPID'] = $res['groupid'];
    $userdata['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email']));
    $userdata['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email'])));
    $userdata['ONLINE'] = iif(!$res['pub_invisible'] && $res['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0);
    $userdata['ISONLINE'] = $userdata['ONLINE'];
    $userdata['REALNAME'] = replace($res['realname']);
    $userdata['GENDER'] = $res['gender'];
    $userdata['CITY'] = replace($res['city']);
    $userdata['PLZ'] = replace($res['plz']);
    $userdata['COUNTRY'] = $res['country'];
    $userdata['REGTIME'] = $res['reg_time'];
    $userdata['REGDAYS'] = floor((time() - $res['reg_time']) / (24 * 3600));
    $userdata['LASTACTIVE'] = $res['lastactive'];
    $userdata['AVATAR'] = $user->mkavatar($res);
    $userdata['AVATAR_TITLE'] = $user->mkavtitle($res);
    $userdata['BIRTHDAY'] = $birthday;
    $userdata['AGE'] = $age;
    if (in_array($varname . '.ISBUDDY', $parse)) {
        $userdata['ISBUDDY'] = $user->is_buddy($res['userid']);
    }
    //Custom-Felder
    for ($ii = 1; $ii <= 10; $ii++) {
        $userdata['CUSTOM' . $ii . '_NAME'] = $set['user']['cusfield_names'][$ii - 1];
        $userdata['CUSTOM' . $ii] = compatible_hsc($res['custom' . $ii]);
    }
    //Interaktions-Links
    if ($user->info['userid']) {
        $userdata['LINK_SENDPM'] = mklink('user.php?action=newpm&amp;touser='******'userid'], 'user,newpm,' . $res['userid'] . '.html');
        $userdata['LINK_SENDEMAIL'] = mklink('user.php?action=newmail&amp;touser='******'userid'], 'user,newmail,' . $res['userid'] . '.html');
        if (in_array($varname . '.LINK_BUDDY', $parse) && !$user->is_buddy($res['userid'])) {
            $userdata['LINK_BUDDY'] = mklink('user.php?action=addbuddy&amp;id=' . $res['userid'], 'user,addbuddy,' . $res['userid'] . '.html');
        }
    }
    return $userdata;
}
Exemplo n.º 3
0
function misc_articlesfeed()
{
    global $set, $db, $apx;
    $apx->tmpl->loaddesign('blank');
    header('Content-type: application/rss+xml');
    //Verwendete Variablen
    $parse = $apx->tmpl->used_vars('rss', 'articles');
    //Baum holen, wenn nur eine bestimmte Kategorie gezeigt werden soll
    $cattree = articles_tree($_REQUEST['catid']);
    $data = $db->fetch("SELECT a.id,a.type,a.catid,a.title,a.subtitle,a.teaser,a.starttime,a.top,b.username,b.email,b.pub_hidemail FROM " . PRE . "_articles AS a LEFT JOIN " . PRE . "_user AS b USING (userid) WHERE ( " . time() . " BETWEEN starttime AND endtime " . iif(count($cattree), "AND catid IN (" . @implode(',', $cattree) . ")") . " " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20");
    //Kategorien auslesen
    $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');
            //Text: Teaser oder Artikelseite
            if ($res['teaser'] && $set['articles']['teaser']) {
                $text = $res['teaser'];
            } else {
                list($text) = $db->first("SELECT text FROM " . PRE . "_articles_pages WHERE artid='" . $res['id'] . "' ORDER BY ord ASC LIMIT 1");
                $text = $text;
            }
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TITLE'] = rss_replace($res['title']);
            $tabledata[$i]['SUBTITLE'] = rss_replace($res['subtitle']);
            $tabledata[$i]['TIME'] = date('r', $res['starttime']);
            //Kein TIMEDIFF weil Zeitverschiebung mit angegeben!
            $tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $text));
            $tabledata[$i]['CATTITLE'] = rss_replace($catinfo[$res['catid']]['title']);
            $tabledata[$i]['LINK'] = HTTP_HOST . $link;
            $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]['TOP'] = $res['top'];
        }
    }
    $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
    $apx->tmpl->assign('ARTICLE', $tabledata);
    $apx->tmpl->parse('rss', 'articles');
}
Exemplo n.º 4
0
 function display()
 {
     global $db, $apx, $user, $set;
     $apx->lang->drop('comments', 'comments');
     $page = $this->getpage(array('p'));
     //Seitenzahlen
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='" . addslashes($this->module) . "' AND mid='" . $this->mid . "' AND active='1' )");
     pages($page, $count, $this->set['epp'], 'comp', 'COMMENT');
     //Sortierreihenfolge
     if ($this->set['order'] == 1) {
         $order = "a.time ASC";
     } else {
         $order = "a.time DESC";
     }
     //Kommentare auslesen
     $data = $db->fetch("SELECT a.* FROM " . PRE . "_comments AS a WHERE ( module='" . addslashes($this->module) . "' AND a.mid='" . $this->mid . "' AND a.active='1' ) ORDER BY " . $order . " " . getlimit($this->set['epp'], 'comp'));
     if (!count($data)) {
         return;
     }
     //Nummerierungs-Anfang
     if ($this->set['epp']) {
         if ($this->set['order'] == 0) {
             $entrynumber = $count - ($_REQUEST['comp'] - 1) * $this->set['epp'];
         } else {
             $entrynumber = 1 + ($_REQUEST['comp'] - 1) * $this->set['epp'];
         }
     } else {
         if ($this->set['order'] == 0) {
             $entrynumber = $count;
         } else {
             $entrynumber = 1;
         }
     }
     foreach ($data as $res) {
         ++$i;
         if ($res['userid'] && !isset($userinfo[$res['userid']])) {
             $userinfo[$res['userid']] = $user->get_info($res['userid'], 'username,email,pub_hidemail,homepage,avatar,avatar_title,signature,lastactive,pub_invisible,custom1,custom2,custom3,custom4,custom5,custom6,custom7,custom8,custom9,custom10');
         }
         if ($res['userid'] && $userinfo[$res['userid']]) {
             $tabledata[$i]['USERID'] = $res['userid'];
             $tabledata[$i]['NAME'] = replace($userinfo[$res['userid']]['username']);
             $tabledata[$i]['EMAIL'] = replace(iif(!$userinfo[$res['userid']]['pub_hidemail'], $userinfo[$res['userid']]['email']));
             $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$userinfo[$res['userid']]['pub_hidemail'], cryptMail($userinfo[$res['userid']]['email'])));
             $tabledata[$i]['HOMEPAGE'] = replace($userinfo[$res['userid']]['homepage']);
             $tabledata[$i]['AVATAR'] = $user->mkavatar($userinfo[$res['userid']]);
             $tabledata[$i]['AVATAR_TITLE'] = $user->mkavtitle($userinfo[$res['userid']]);
             $tabledata[$i]['SIGNATURE'] = $user->mksig($userinfo[$res['userid']]);
             $tabledata[$i]['ONLINE'] = iif(!$userinfo[$res['userid']]['pub_invisible'] && $userinfo[$res['userid']]['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0);
             $tabledata[$i]['ISONLINE'] = $tabledata[$i]['ONLINE'];
             //Custom-Felder
             for ($ii = 1; $ii <= 10; $ii++) {
                 $tabledata[$i]['CUSTOM' . $ii . '_NAME'] = $set['user']['cusfield_names'][$ii - 1];
                 $tabledata[$i]['CUSTOM' . $ii] = compatible_hsc($userinfo[$res['userid']]['custom' . $ii]);
             }
         } else {
             $tabledata[$i]['NAME'] = replace($res['username']);
             $tabledata[$i]['EMAIL'] = replace($res['email']);
             $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(cryptMail($res['email']));
             $tabledata[$i]['HOMEPAGE'] = replace($res['homepage']);
         }
         //Text
         $text = $res['text'];
         if ($this->set['badwords']) {
             $text = badwords($text);
         }
         $text = replace($text, 1);
         if ($this->set['breakline']) {
             $text = wordwrapHTML($text, $this->set['breakline'], "\n");
         }
         if ($this->set['allowsmilies']) {
             $text = dbsmilies($text);
         }
         if ($this->set['allowcode']) {
             $text = dbcodes($text);
         }
         //Titel
         $title = $res['title'];
         if ($this->set['breakline']) {
             $title = wordwrap($title, $this->set['breakline'], "\n", 1);
         }
         if ($this->set['badwords']) {
             $title = badwords($title);
         }
         $title = replace($title);
         $tabledata[$i]['TEXT'] = $text;
         $tabledata[$i]['TITLE'] = $title;
         $tabledata[$i]['TIME'] = $res['time'];
         $tabledata[$i]['NUMBER'] = $entrynumber;
         //Admin-Links
         if ($_COOKIE[$set['main']['cookie_pre'] . '_admin_userid'] && $_COOKIE[$set['main']['cookie_pre'] . '_admin_password']) {
             $tabledata[$i]['EDITLINK'] = HTTPDIR . 'admin/action.php?action=comments.edit&amp;module=' . $this->module . '&amp;mid=' . $this->mid . '&amp;id=' . $res['id'] . '&amp;outer=1';
             $tabledata[$i]['DELETELINK'] = HTTPDIR . 'admin/action.php?action=comments.del&amp;module=' . $this->module . '&amp;mid=' . $this->mid . '&amp;id=' . $res['id'] . '&amp;outer=1';
         }
         //Melden
         $link_report = "javascript:popupwin('misc.php?action=comments_report&amp;id=" . $res['id'] . "&amp;url='+escape(window.location.href),500,300);";
         $tabledata[$i]['REPORTLINK'] = $link_report;
         //Kommentarnummer
         if ($this->set['order'] == 0) {
             --$entrynumber;
         } else {
             ++$entrynumber;
         }
     }
     return $tabledata;
 }
Exemplo n.º 5
0
 $data = $db->fetch("SELECT * FROM " . PRE . "_user_guestbook WHERE owner='" . $_REQUEST['id'] . "' ORDER BY time DESC " . getlimit($set['user']['guestbook_epp']));
 $entrynumber = $count - ($_REQUEST['p'] - 1) * $set['user']['guestbook_epp'];
 //Benutzer-Info
 $userids = get_ids($data, 'userid');
 $userinfo = array();
 if (count($userids)) {
     $userinfo = $user->get_info_multi($userids, 'username,email,pub_hidemail,homepage,avatar,avatar_title,signature,lastactive,pub_invisible');
 }
 if (count($data)) {
     foreach ($data as $res) {
         ++$i;
         //Benutzer
         $tabledata[$i]['USERID'] = $res['userid'];
         $tabledata[$i]['NAME'] = replace($userinfo[$res['userid']]['username']);
         $tabledata[$i]['EMAIL'] = replace(iif(!$userinfo[$res['userid']]['pub_hidemail'], $userinfo[$res['userid']]['email']));
         $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$userinfo[$res['userid']]['pub_hidemail'], cryptMail($userinfo[$res['userid']]['email'])));
         $tabledata[$i]['HOMEPAGE'] = replace($userinfo[$res['userid']]['homepage']);
         $tabledata[$i]['AVATAR'] = $user->mkavatar($userinfo[$res['userid']]);
         $tabledata[$i]['AVATAR_TITLE'] = $user->mkavtitle($userinfo[$res['userid']]);
         $tabledata[$i]['SIGNATURE'] = $user->mksig($userinfo[$res['userid']]);
         $tabledata[$i]['ONLINE'] = iif(!$res['pub_invisible'] && $res['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0);
         $tabledata[$i]['ISONLINE'] = $tabledata[$i]['ONLINE'];
         //Text
         $text = $res['text'];
         if ($set['user']['guestbook_breakline']) {
             $text = wordwrap($text, $set['user']['guestbook_breakline'], "\n", 1);
         }
         if ($set['user']['guestbook_badwords']) {
             $text = badwords($text);
         }
         $text = replace($text, 1);
Exemplo n.º 6
0
 }
 list($bd['bd_day'], $bd['bd_month'], $bd['bd_year']) = explode('-', $user->info['birthday']);
 if (count($set['main']['smilies'])) {
     foreach ($set['main']['smilies'] as $res) {
         ++$i;
         $smiledata[$i]['CODE'] = $res['code'];
         $smiledata[$i]['INSERTCODE'] = addslashes($res['code']);
         $smiledata[$i]['IMAGE'] = $res['file'];
         $smiledata[$i]['DESCRIPTION'] = $res['description'];
     }
 }
 $apx->tmpl->assign('SMILEY', $smiledata);
 $apx->tmpl->assign('STATUS', compatible_hsc($user->info['status']));
 $apx->tmpl->assign('STATUS_SMILEY', compatible_hsc($user->info['status_smiley']));
 $apx->tmpl->assign('EMAIL', compatible_hsc($user->info['email']));
 $apx->tmpl->assign('EMAIL_ENCRYPTED', compatible_hsc(cryptMail($user->info['email'])));
 $apx->tmpl->assign('HOMEPAGE', compatible_hsc($user->info['homepage']));
 $apx->tmpl->assign('ICQ', (int) $user->info['icq']);
 $apx->tmpl->assign('AIM', compatible_hsc($user->info['aim']));
 $apx->tmpl->assign('YIM', compatible_hsc($user->info['yim']));
 $apx->tmpl->assign('MSN', compatible_hsc($user->info['msn']));
 $apx->tmpl->assign('SKYPE', compatible_hsc($user->info['skype']));
 $apx->tmpl->assign('REALNAME', compatible_hsc($user->info['realname']));
 $apx->tmpl->assign('CITY', compatible_hsc($user->info['city']));
 $apx->tmpl->assign('COUNTRY', compatible_hsc($user->info['country']));
 $apx->tmpl->assign('PLZ', compatible_hsc($user->info['plz']));
 $apx->tmpl->assign('INTERESTS', compatible_hsc($user->info['interests']));
 $apx->tmpl->assign('WORK', compatible_hsc($user->info['work']));
 $apx->tmpl->assign('GENDER', (int) $user->info['gender']);
 $apx->tmpl->assign('BD_DAY', (int) $bd['bd_day']);
 $apx->tmpl->assign('BD_MONTH', (int) $bd['bd_month']);
Exemplo n.º 7
0
function calendar_print($data, $template)
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $parse = $tmpl->used_vars($template, 'calendar');
    //Kategorie-Info
    $catids = get_ids($data, 'catid');
    $catdata = array();
    if (count($catids)) {
        $catdata = $db->fetch_index("SELECT * FROM " . PRE . "_calendar_cat WHERE id IN (" . implode(',', $catids) . ")", 'id');
    }
    //Termine auflisten
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            $event = array();
            //Kategorie-Info
            $catinfo = $catdata[$res['catid']];
            //Link zum Termin
            $link = mklink('events.php?id=' . $res['id'], 'events,id' . $res['id'] . urlformat($res['title']) . '.html');
            //Aufmacher
            $picture = $picture_popup = '';
            if (in_template(array('EVENT.PICTURE', 'EVENT.PICTURE_POPUP', 'EVENT.PICTURE_POPUPPATH'), $parse)) {
                list($picture, $picture_popup, $picture_popuppath) = calendar_pic($res['picture']);
            }
            //Start berechnen
            $startday = $starttime = $endday = $endtime = 0;
            if (in_template(array('EVENT.STARTDAY', 'EVENT.STARTTIME'), $parse)) {
                $startday = calendar_stamp2time($res['startday']);
                if ($res['starttime'] != -1) {
                    $time_comp = calendar_explode_stamp($res['startday']);
                    $tmpstamp = sprintf('%04d', $res['starttime']);
                    $time_comp['hour'] = substr($tmpstamp, 0, 2);
                    $time_comp['minute'] = substr($tmpstamp, 2, 2);
                    $starttime = mktime($time_comp['hour'], $time_comp['minute'], 0, $time_comp['month'], $time_comp['day'], $time_comp['year']) + TIMEDIFF;
                }
            }
            //Ende berechnen (falls nötig)
            if (in_template(array('EVENT.ENDDAY', 'EVENT.ENDTIME'), $parse)) {
                if ($res['endday'] != $res['startday'] || $res['endtime'] != -1) {
                    $endday = calendar_stamp2time($res['endday']);
                    if ($res['endtime'] != -1) {
                        $time_comp = calendar_explode_stamp($res['endday']);
                        $tmpstamp = sprintf('%04d', $res['endtime']);
                        $time_comp['hour'] = substr($tmpstamp, 0, 2);
                        $time_comp['minute'] = substr($tmpstamp, 2, 2);
                        $endtime = mktime($time_comp['hour'], $time_comp['minute'], 0, $time_comp['month'], $time_comp['day'], $time_comp['year']) + TIMEDIFF;
                    }
                }
            }
            //Username + eMail
            if ($res['userid']) {
                $username = $res['username'];
                $email = iif(!$res['pub_hidemail'], $res['email']);
            } else {
                $username = $res['send_username'];
                $email = $res['send_email'];
            }
            //Text
            $eventtext = '';
            if (in_array('EVENT.TEXT', $parse)) {
                $eventtext = mediamanager_inline($res['text']);
                if ($apx->is_module('glossar')) {
                    $eventtext = glossar_highlight($eventtext);
                }
            }
            //Datehead
            if ($laststamp != $res['startday']) {
                $event['DATEHEAD'] = $startday;
            }
            //Tags
            if (in_array('EVENT.TAG', $parse) || in_array('EVENT.TAG_IDS', $parse) || in_array('EVENT.KEYWORDS', $parse)) {
                list($tagdata, $tagids, $keywords) = calendar_tags($res['id']);
            }
            $event['ID'] = $res['id'];
            $event['TITLE'] = $res['title'];
            $event['TEXT'] = $eventtext;
            $event['LINK'] = $link;
            $event['LOCATION'] = compatible_hsc($res['location']);
            $event['LOCATION_LINK'] = compatible_hsc($res['location_link']);
            $event['PRIORITY'] = $res['priority'];
            $event['RESTRICTED'] = $res['restricted'];
            $event['PRIVATE'] = $res['private'];
            $event['HITS'] = $res['hits'];
            $event['RELATED'] = calendar_links($res['links']);
            $event['PICTURE'] = $picture;
            $event['PICTURE_POPUP'] = $picture_popup;
            $event['PICTURE_POPUPPATH'] = $picture_popuppath;
            $event['STARTDAY'] = $startday;
            $event['STARTTIME'] = $starttime;
            $event['ENDDAY'] = $endday;
            $event['ENDTIME'] = $endtime;
            $event['USERID'] = $res['userid'];
            $event['USERNAME'] = replace($username);
            $event['EMAIL'] = replace($email);
            $event['EMAIL_ENCRYPTED'] = replace(cryptMail($email));
            $event['CATID'] = $res['catid'];
            $event['CATTITLE'] = $catinfo['title'];
            $event['CATICON'] = $catinfo['icon'];
            //Tags
            $event['TAG'] = $tagdata;
            $event['TAG_IDS'] = $tagids;
            $event['KEYWORDS'] = $keywords;
            //Galerie
            if ($apx->is_module('gallery') && $res['galid'] && !$res['private'] && in_template(array('EVENT.GALLERY_ID', 'EVENT.GALLERY_TITLE', 'EVENT.GALLERY_LINK'), $parse)) {
                $galinfo = gallery_info($res['galid']);
                $event['GALLERY_ID'] = $galinfo['id'];
                $event['GALLERY_TITLE'] = $galinfo['title'];
                $event['GALLERY_LINK'] = mklink('gallery.php?id=' . $galinfo['id'], 'gallery,list' . $galinfo['id'] . ',1' . urlformat($galinfo['title']) . '.html');
            }
            //Kommentare
            if ($apx->is_module('comments') && $set['calendar']['coms'] && $res['allowcoms']) {
                require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
                if (!isset($coms)) {
                    $coms = new comments('calendar', $res['id']);
                } else {
                    $coms->mid = $res['id'];
                }
                $link = mklink('events.php?id=' . $res['id'], 'events,id' . $res['id'] . urlformat($res['title']) . '.html');
                $event['COMMENT_COUNT'] = $coms->count();
                $event['COMMENT_LINK'] = $coms->link($link);
                $event['DISPLAY_COMMENTS'] = 1;
                if (in_template(array('EVENT.COMMENT_LAST_USERID', 'EVENT.COMMENT_LAST_NAME', 'EVENT.COMMENT_LAST_TIME'), $parse)) {
                    $event['COMMENT_LAST_USERID'] = $coms->last_userid();
                    $event['COMMENT_LAST_NAME'] = $coms->last_name();
                    $event['COMMENT_LAST_TIME'] = $coms->last_time();
                }
            }
            $eventdata[$i] = $event;
            $laststamp = $res['startday'];
        }
    }
    $tmpl->assign('EVENT', $eventdata);
    $tmpl->parse($template, 'calendar');
}
Exemplo n.º 8
0
     $bd = explode('-', $res['birthday']);
     $birthday = intval($bd[0]) . '. ' . getcalmonth($bd[1]) . iif($bd[2], ' ' . $bd[2]);
     if ($bd[2]) {
         $age = date('Y') - $bd[2];
         if (intval(sprintf('%02d%02d', $bd[1], $bd[0])) > intval(date('md'))) {
             $age -= 1;
         }
     }
 }
 $tabledata[$i]['ID'] = $res['userid'];
 $tabledata[$i]['USERID'] = $res['userid'];
 $tabledata[$i]['NAME'] = replace($res['username']);
 $tabledata[$i]['USERNAME'] = replace($res['username']);
 $tabledata[$i]['GROUPID'] = $res['groupid'];
 $tabledata[$i]['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email']));
 $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email'])));
 $tabledata[$i]['ONLINE'] = iif(!$res['pub_invisible'] && $res['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0);
 $tabledata[$i]['ISONLINE'] = $tabledata[$i]['ONLINE'];
 $tabledata[$i]['REALNAME'] = replace($res['realname']);
 $tabledata[$i]['GENDER'] = $res['gender'];
 $tabledata[$i]['CITY'] = replace($res['city']);
 $tabledata[$i]['PLZ'] = replace($res['plz']);
 $tabledata[$i]['COUNTRY'] = $res['country'];
 $tabledata[$i]['REGTIME'] = $res['reg_time'];
 $tabledata[$i]['REGDAYS'] = floor((time() - $res['reg_time']) / (24 * 3600));
 $tabledata[$i]['LASTACTIVE'] = $res['lastactive'];
 $tabledata[$i]['AVATAR'] = $user->mkavatar($res);
 $tabledata[$i]['AVATAR_TITLE'] = $user->mkavtitle($res);
 $tabledata[$i]['BIRTHDAY'] = $birthday;
 $tabledata[$i]['AGE'] = $age;
 if (in_array('BUDDY.ISBUDDY', $parse)) {
Exemplo n.º 9
0
| 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!');
}
////////////////////////////////////////////////////////////////////////////////////////////
//Statische Variablen setzen
$apx->tmpl->assign_static('LOGGED_ID', $user->info['userid']);
$apx->tmpl->assign_static('LOGGED_GROUPID', $user->info['groupid']);
$apx->tmpl->assign_static('LOGGED_GROUPNAME', replace($user->info['name']));
if ($user->info['userid']) {
    $apx->tmpl->assign_static('LOGGED_USERNAME', replace($user->info['username']));
    $apx->tmpl->assign_static('LOGGED_EMAIL', replace($user->info['email']));
    $apx->tmpl->assign_static('LOGGED_EMAIL_ENCRYPTED', replace(cryptMail($user->info['email'])));
    $apx->tmpl->assign_static('LOGGED_ISTEAM', $user->is_team_member());
    $apx->tmpl->assign_static('LOGGED_PROFILE', $user->mkprofile($user->info['userid'], $user->info['username']));
    //Noch mehr davon
    $apx->tmpl->assign_static('LOGGED_ICQ', replace($user->info['icq']));
    $apx->tmpl->assign_static('LOGGED_AIM', replace($user->info['aim']));
    $apx->tmpl->assign_static('LOGGED_YIM', replace($user->info['yim']));
    $apx->tmpl->assign_static('LOGGED_MSN', replace($user->info['msn']));
    $apx->tmpl->assign_static('LOGGED_SKYPE', $user->info['skype']);
    $apx->tmpl->assign_static('LOGGED_HOMEPAGE', replace($user->info['homepage']));
    $apx->tmpl->assign_static('LOGGED_REALNAME', replace($user->info['realname']));
    $apx->tmpl->assign_static('LOGGED_GENDER', $user->info['gender']);
    $apx->tmpl->assign_static('LOGGED_CITY', replace($user->info['city']));
    $apx->tmpl->assign_static('LOGGED_PLZ', replace($user->info['plz']));
    $apx->tmpl->assign_static('LOGGED_COUNTRY', $user->info['country']);
    $apx->tmpl->assign_static('LOGGED_INTERESTS', replace($user->info['interests']));
Exemplo n.º 10
0
function calendar_events_from_day($thisdaystamp, $parse, $parseprefix = 'DAY.')
{
    global $set, $apx, $db, $user;
    static $eventcache, $catdata;
    if (!isset($eventcache)) {
        $eventcache = array();
    }
    //Termin-Kategorien auslesen
    if (!isset($catdata)) {
        $catdata = array();
        if (in_template(array($parseprefix . 'EVENT.CATTITLE', $parseprefix . 'EVENT.CATICON'), $parse)) {
            $catdata = $db->fetch_index("SELECT * FROM " . PRE . "_calendar_cat", 'id');
        }
    }
    //Modefilter
    if ($_REQUEST['mode'] == 'private') {
        $modefilter = " AND a.private='1' AND a.userid='" . $user->info['userid'] . "' ";
    } else {
        $modefilter = " AND a.private='0' ";
    }
    //Sortby
    if ($set['calendar']['sortby'] == 2) {
        $sortby = " title ASC ";
    } else {
        $sortby = " startday DESC, starttime ASC ";
    }
    //Termine auslesen
    $edata = $db->fetch("SELECT a.*,b.username FROM " . PRE . "_calendar_events AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE '" . $thisdaystamp . "' BETWEEN startday AND endday AND a.active!=0 " . section_filter(true, 'a.secid') . " " . $modefilter . " ORDER BY " . $sortby);
    $eventdata = array();
    if (count($edata)) {
        foreach ($edata as $res) {
            ++$i;
            //Termin wurde schon verarbeitet => Übernehmen und fertig
            if (isset($eventcache[$res['id']])) {
                $eventdata[$i] = $eventcache[$res['id']];
                continue;
            }
            //Kategorie-Info
            $catinfo = $catdata[$res['catid']];
            //Link zum Termin
            $link = mklink('events.php?id=' . $res['id'], 'events,id' . $res['id'] . urlformat($res['title']) . '.html');
            //Aufmacher
            $picture = $picture_popup = $picture_popuppath = '';
            if (in_template(array($parseprefix . 'EVENT.PICTURE', $parseprefix . 'EVENT.PICTURE_POPUP', $parseprefix . 'EVENT.PICTURE_POPUPPATH'), $parse)) {
                list($picture, $picture_popup, $picture_popuppath) = calendar_pic($res['picture']);
            }
            //Start berechnen
            $startday = $starttime = $endday = $endtime = 0;
            if (in_template(array($parseprefix . 'EVENT.STARTDAY', $parseprefix . 'EVENT.STARTTIME'), $parse)) {
                $startday = calendar_stamp2time($res['startday']);
                if ($res['starttime'] != -1) {
                    $time_comp = calendar_explode_stamp($res['startday']);
                    $tmpstamp = sprintf('%04d', $res['starttime']);
                    $time_comp['hour'] = substr($tmpstamp, 0, 2);
                    $time_comp['minute'] = substr($tmpstamp, 2, 2);
                    $starttime = mktime($time_comp['hour'], $time_comp['minute'], 0, $time_comp['month'], $time_comp['day'], $time_comp['year']) + TIMEDIFF;
                }
            }
            //Ende berechnen (falls nötig)
            if (in_template(array($parseprefix . 'EVENT.ENDDAY', $parseprefix . 'EVENT.ENDTIME'), $parse)) {
                if ($res['endday'] != $res['startday'] || $res['endtime'] != -1) {
                    $endday = calendar_stamp2time($res['endday']);
                    if ($res['endtime'] != -1) {
                        $time_comp = calendar_explode_stamp($res['endday']);
                        $tmpstamp = sprintf('%04d', $res['endtime']);
                        $time_comp['hour'] = substr($tmpstamp, 0, 2);
                        $time_comp['minute'] = substr($tmpstamp, 2, 2);
                        $endtime = mktime($time_comp['hour'], $time_comp['minute'], 0, $time_comp['month'], $time_comp['day'], $time_comp['year']) + TIMEDIFF;
                    }
                }
            }
            //Username + eMail
            if ($res['userid']) {
                $username = $res['username'];
                $email = iif(!$res['pub_hidemail'], $res['email']);
            } else {
                $username = $res['send_username'];
                $email = $res['send_email'];
            }
            //Text
            $eventtext = '';
            if (in_array($parseprefix . 'EVENT.TEXT', $parse)) {
                $eventtext = mediamanager_inline($res['text']);
            }
            //Tags
            if (in_array($parseprefix . 'EVENT.TAG', $parse) || in_array($parseprefix . 'EVENT.TAG_IDS', $parse) || in_array($parseprefix . 'EVENT.KEYWORDS', $parse)) {
                list($tagdata, $tagids, $keywords) = calendar_tags($res['id']);
            }
            $event = array();
            $event['ID'] = $res['id'];
            $event['TITLE'] = $res['title'];
            $event['TEXT'] = $eventtext;
            $event['LINK'] = $link;
            $event['PRIORITY'] = $res['priority'];
            $event['RESTRICTED'] = $res['restricted'];
            $event['LOCATION'] = compatible_hsc($res['location']);
            $event['LOCATION_LINK'] = compatible_hsc($res['location_link']);
            $event['PRIVATE'] = $res['private'];
            $event['HITS'] = $res['hits'];
            $event['RELATED'] = calendar_links($res['links']);
            $event['PICTURE'] = $picture;
            $event['PICTURE_POPUP'] = $picture_popup;
            $event['PICTURE_POPUPPATH'] = $picture_popuppath;
            $event['STARTDAY'] = $startday;
            $event['STARTTIME'] = $starttime;
            $event['ENDDAY'] = $endday;
            $event['ENDTIME'] = $endtime;
            $event['USERID'] = $res['userid'];
            $event['USERNAME'] = replace($username);
            $event['EMAIL'] = replace($email);
            $event['EMAIL_ENCRYPTED'] = replace(cryptMail($email));
            $event['CATID'] = $res['catid'];
            $event['CATTITLE'] = $catinfo['title'];
            $event['CATICON'] = $catinfo['icon'];
            //Tags
            $event['TAG'] = $tagdata;
            $event['TAG_IDS'] = $tagids;
            $event['KEYWORDS'] = $keywords;
            $eventcache[$res['id']] = $event;
            $eventdata[$i] = $event;
        }
    }
    return $eventdata;
}
Exemplo n.º 11
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');
}
Exemplo n.º 12
0
 $tabledata[$i]['NEW'] = $new;
 $tabledata[$i]['GOTO'] = $gotolink;
 //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'];
 //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));
 //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'];
     }
Exemplo n.º 13
0
function user_info($userid = 0, $template = 'information')
{
    global $set, $db, $apx, $user;
    $userid = (int) $userid;
    if (!$userid) {
        return;
    }
    $tmpl = new tengine();
    $apx->lang->drop('profile', 'user');
    //Verwendete Variablen auslesen
    $parse = $tmpl->used_vars('functions/' . $template, 'user');
    $res = $db->first("SELECT * FROM " . PRE . "_user WHERE userid='" . $userid . "' LIMIT 1");
    $userid = $res['userid'];
    if (!$res['userid']) {
        return;
    }
    list($groupname) = $db->first("SELECT name FROM " . PRE . "_user_groups WHERE groupid='" . $res['groupid'] . "' LIMIT 1");
    $age = 0;
    if ($res['birthday']) {
        $bd = explode('-', $res['birthday']);
        $birthday = intval($bd[0]) . '. ' . getcalmonth($bd[1]) . iif($bd[2], ' ' . $bd[2]);
        if ($bd[2]) {
            $age = date('Y') - $bd[2];
            if (intval(sprintf('%02d%02d', $bd[1], $bd[0])) > intval(date('md'))) {
                $age -= 1;
            }
        }
    }
    $tmpl->assign('USERID', $res['userid']);
    $tmpl->assign('USERNAME', replace($res['username']));
    $tmpl->assign('GROUP', replace($groupname));
    $tmpl->assign('REGDATE', $res['reg_time']);
    $tmpl->assign('REGDAYS', floor((time() - $res['reg_time']) / (24 * 3600)));
    $tmpl->assign('LASTACTIVE', (int) $res['lastactive']);
    $tmpl->assign('IS_ONLINE', iif(!$res['pub_invisible'] && $res['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0));
    $tmpl->assign('EMAIL', replace($res['email']));
    $tmpl->assign('EMAIL_ENCRYPTED', replace(cryptMail($res['email'])));
    $tmpl->assign('HIDEMAIL', $res['pub_hidemail']);
    $tmpl->assign('HOMEPAGE', replace($res['homepage']));
    $tmpl->assign('ICQ', replace($res['icq']));
    $tmpl->assign('AIM', replace($res['aim']));
    $tmpl->assign('YIM', replace($res['yim']));
    $tmpl->assign('MSN', replace($res['msn']));
    $tmpl->assign('SKYPE', replace($res['skype']));
    $tmpl->assign('REALNAME', replace($res['realname']));
    $tmpl->assign('CITY', replace($res['city']));
    $tmpl->assign('PLZ', replace($res['plz']));
    $tmpl->assign('COUNTRY', replace($res['country']));
    $tmpl->assign('INTERESTS', replace($res['interests']));
    $tmpl->assign('WORK', replace($res['work']));
    $tmpl->assign('GENDER', (int) $res['gender']);
    $tmpl->assign('BIRTHDAY', $birthday);
    $tmpl->assign('AGE', $age);
    $tmpl->assign('SIGNATURE', $user->mksig($res, 1));
    $tmpl->assign('AVATAR', $user->mkavatar($res));
    $tmpl->assign('AVATAR_TITLE', $user->mkavtitle($res));
    //Custom-Felder
    for ($i = 1; $i <= 10; $i++) {
        $tmpl->assign('CUSTOM' . $i . '_NAME', replace($set['user']['cusfield_names'][$i - 1]));
        $tmpl->assign('CUSTOM' . $i, replace($res['custom' . $i]));
    }
    //Forum-Variablen
    if ($apx->is_module('forum')) {
        if ($res['forum_lastactive'] == 0) {
            $res['forum_lastactive'] = $res['lastactive'];
        }
        $tmpl->assign('FORUM_LASTACTIVE', (int) $res['forum_lastactive']);
        $tmpl->assign('FORUM_POSTS', (int) $res['forum_posts']);
        $tmpl->assign('FORUM_FINDPOSTS', HTTPDIR . $set['forum']['directory'] . '/search.php?send=1&author=' . urlencode($res['username']));
    }
    //Kommentare
    if ($apx->is_module('comments') && in_array('COMMENTS', $parse)) {
        require_once BASEDIR . getmodulepath('comments') . 'functions.php';
        $tmpl->assign('COMMENTS', comments_count($res['userid']));
    }
    //Interaktionen
    $link_buddy = iif($user->info['userid'] && !$user->is_buddy($res['userid']), mklink('user.php?action=addbuddy&amp;id=' . $res['userid'], 'user,addbuddy,' . $res['userid'] . '.html'));
    $link_sendpm = iif($user->info['userid'], mklink('user.php?action=newpm&amp;touser='******'userid'], 'user,newpm,' . $res['userid'] . '.html'));
    $link_sendmail = iif($user->info['userid'], mklink('user.php?action=newmail&amp;touser='******'userid'], 'user,newmail,' . $res['userid'] . '.html'));
    $tmpl->assign('LINK_BUDDY', $link_buddy);
    $tmpl->assign('LINK_SENDPM', $link_sendpm);
    $tmpl->assign('LINK_SENDEMAIL', $link_sendmail);
    //Links zu den Profil-Funktionen
    require_once dirname(__FILE__) . '/functions.php';
    user_assign_profile_links($tmpl, $res);
    //Buddyliste
    $tabledata = array();
    if ($res['pub_showbuddies'] && in_array('BUDDY', $parse)) {
        $data = $db->fetch("SELECT friendid FROM " . PRE . "_user_friends WHERE userid='" . $res['userid'] . "'");
        $buddies = get_ids($data, 'friendid');
        if (count($buddies)) {
            $data = $db->fetch("SELECT userid,username,groupid,reg_time,realname,gender,city,plz,country,city,lastactive,pub_invisible,avatar,avatar_title,birthday,pub_hidemail,custom1,custom2,custom3,custom4,custom5,custom6,custom7,custom8,custom9,custom10 FROM " . PRE . "_user WHERE userid IN (" . implode(',', $buddies) . ") ORDER BY username ASC");
            if (count($data)) {
                foreach ($data as $res) {
                    ++$i;
                    $age = 0;
                    if ($res['birthday']) {
                        $bd = explode('-', $res['birthday']);
                        $birthday = intval($bd[0]) . '. ' . getcalmonth($bd[1]) . iif($bd[2], ' ' . $bd[2]);
                        if ($bd[2]) {
                            $age = date('Y') - $bd[2];
                            if (intval(sprintf('%02d%02d', $bd[1], $bd[0])) > intval(date('md'))) {
                                $age -= 1;
                            }
                        }
                    }
                    $tabledata[$i]['ID'] = $res['userid'];
                    $tabledata[$i]['USERID'] = $res['userid'];
                    $tabledata[$i]['NAME'] = replace($res['username']);
                    $tabledata[$i]['USERNAME'] = replace($res['username']);
                    $tabledata[$i]['GROUPID'] = $res['groupid'];
                    $tabledata[$i]['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email']));
                    $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email'])));
                    $tabledata[$i]['ONLINE'] = iif(!$res['pub_invisible'] && $res['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0);
                    $tabledata[$i]['ISONLINE'] = $tabledata[$i]['ONLINE'];
                    $tabledata[$i]['REALNAME'] = replace($res['realname']);
                    $tabledata[$i]['GENDER'] = $res['gender'];
                    $tabledata[$i]['CITY'] = replace($res['city']);
                    $tabledata[$i]['PLZ'] = replace($res['plz']);
                    $tabledata[$i]['COUNTRY'] = $res['country'];
                    $tabledata[$i]['REGTIME'] = $res['reg_time'];
                    $tabledata[$i]['REGDAYS'] = floor((time() - $res['reg_time']) / (24 * 3600));
                    $tabledata[$i]['LASTACTIVE'] = $res['lastactive'];
                    $tabledata[$i]['AVATAR'] = $user->mkavatar($res);
                    $tabledata[$i]['AVATAR_TITLE'] = $user->mkavtitle($res);
                    $tabledata[$i]['BIRTHDAY'] = $birthday;
                    $tabledata[$i]['AGE'] = $age;
                    //Custom-Felder
                    for ($ii = 1; $ii <= 10; $ii++) {
                        $tabledata[$i]['CUSTOM' . $ii . '_NAME'] = $set['user']['cusfield_names'][$ii - 1];
                        $tabledata[$i]['CUSTOM' . $ii] = compatible_hsc($res['custom' . $ii]);
                    }
                    //Interaktions-Links
                    if ($user->info['userid']) {
                        $tabledata[$i]['LINK_SENDPM'] = mklink('user.php?action=newpm&amp;touser='******'userid'], 'user,newpm,' . $res['userid'] . '.html');
                        $tabledata[$i]['LINK_SENDEMAIL'] = mklink('user.php?action=newmail&amp;touser='******'userid'], 'user,newmail,' . $res['userid'] . '.html');
                    }
                    //Nur Buddy-Liste
                    if ($buddylist) {
                        $tabledata[$i]['LINK_DELBUDDY'] = mklink('user.php?action=delbuddy&amp;id=' . $res['userid'], 'user,delbuddy,' . $res['userid'] . '.html');
                    }
                }
            }
        }
    }
    $tmpl->assign('BUDDY', $tabledata);
    //Template ausgeben
    $tmpl->parse('functions/' . $template, 'user');
}
Exemplo n.º 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');
}
Exemplo n.º 15
0
     }
     //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]['WEBSITE'] = $res['website'];
     $tabledata[$i]['PRODUCT_COUNT'] = $prodcount;
     $tabledata[$i]['PICTURE'] = $picture;
     $tabledata[$i]['PICTURE_POPUP'] = $picture_popup;
     $tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath;
     $tabledata[$i]['FULLNAME'] = $res['fullname'];
     $tabledata[$i]['ADDRESS'] = $res['address'];
     $tabledata[$i]['EMAIL'] = $res['email'];
     $tabledata[$i]['EMAIL_ENCRYPTED'] = cryptMail($res['email']);
     $tabledata[$i]['PHONE'] = $res['phone'];
     //Nur Firma
     if ($res['type'] == 'company') {
         $tabledata[$i]['FOUNDER'] = $res['founder'];
         $tabledata[$i]['FOUNDING_YEAR'] = $res['founding_year'];
         $tabledata[$i]['FOUNDING_COUNTRY'] = $res['founding_country'];
         $tabledata[$i]['LEGALFORM'] = $res['legalform'];
         $tabledata[$i]['HEADQUATERS'] = $res['headquaters'];
         $tabledata[$i]['EXECUTIVE'] = $res['executive'];
         $tabledata[$i]['EMPLOYEES'] = $res['employees'];
         $tabledata[$i]['TURNOVER'] = $res['turnover'];
         $tabledata[$i]['SECTOR'] = $res['sector'];
         $tabledata[$i]['PRODUCTS'] = $res['products'];
     }
 }
Exemplo n.º 16
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&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('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');
}
Exemplo n.º 17
0
 titlebar(strip_tags($last));
 //Alte Platzhalter für Abwärtskompatiblität
 $apx->tmpl->assign('USERID', $res['userid']);
 $apx->tmpl->assign('USERNAME', replace($res['username']));
 $apx->tmpl->assign('EMAIL', replace(iif(!$res['pub_hidemail'], $res['email'])));
 $apx->tmpl->assign('EMAIL_ENCRYPTED', replace(iif(!$res['pub_hidemail'], cryptMail($res['email']))));
 //Autor
 $apx->tmpl->assign('AUTHOR_USERID', $res['userid']);
 $apx->tmpl->assign('AUTHOR_USERNAME', replace($res['username']));
 $apx->tmpl->assign('AUTHOR_EMAIL', replace(iif(!$res['pub_hidemail'], $res['email'])));
 $apx->tmpl->assign('AUTHOR_EMAIL_ENCRYPTED', replace(iif(!$res['pub_hidemail'], cryptMail($res['email']))));
 //Letzte Änderung
 $apx->tmpl->assign('LASTCHANGE_TIME', $res['lastchange']);
 $apx->tmpl->assign('LASTCHANGE_USERID', $res['lastchange_userid']);
 $apx->tmpl->assign('LASTCHANGE_USERNAME', replace($res['lc_username']));
 $apx->tmpl->assign('LASTCHANGE_EMAIL_ENCRYPTED', replace(iif(!$res['lc_pub_hidemail'], cryptMail($res['email']))));
 //Content
 $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
Exemplo n.º 18
0
function misc_videosfeed()
{
    global $set, $db, $apx;
    $apx->tmpl->loaddesign('blank');
    header('Content-type: application/rss+xml');
    //Baum holen, wenn nur eine bestimmte Kategorie gezeigt werden soll
    $cattree = videos_tree($_REQUEST['catid']);
    $data = $db->fetch("SELECT a.id,a.catid,a.title,a.text,a.starttime,a.top,b.username,b.email,b.pub_hidemail FROM " . PRE . "_videos AS a LEFT JOIN " . PRE . "_user AS b USING (userid) WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) " . iif(count($cattree), "AND catid IN (" . @implode(',', $cattree) . ")") . " " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20");
    if (count($data)) {
        //Kategorien auslesen
        $catids = get_ids($data, 'catid');
        if (count($catids)) {
            $catdata = $db->fetch("SELECT id,title FROM " . PRE . "_videos_cat WHERE id IN (" . implode(',', $catids) . ")");
            if (count($catdata)) {
                foreach ($catdata as $catres) {
                    $catinfo[$catres['id']] = $catres;
                }
            }
        }
        foreach ($data as $res) {
            ++$i;
            //Link
            $link = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html');
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TITLE'] = rss_replace($res['title']);
            $tabledata[$i]['TIME'] = date('r', $res['starttime']);
            //Kein TIMEDIFF weil Zeitverschiebung mit angegeben!
            $tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $res['text']));
            $tabledata[$i]['CATTITLE'] = rss_replace($catinfo[$res['catid']]['title']);
            $tabledata[$i]['LINK'] = HTTP_HOST . $link;
            $tabledata[$i]['USERNAME'] = rss_replace($res['username']);
            $tabledata[$i]['EMAIL'] = rss_replace(iif(!$res['pub_hidemail'], $res['email']));
            $tabledata[$i]['EMAIL_ENCRYPTED'] = rss_replace(iif(!$res['pub_hidemail'], cryptMail($res['email'])));
            $tabledata[$i]['TOP'] = $res['top'];
        }
    }
    $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
    $apx->tmpl->assign('VIDEO', $tabledata);
    $apx->tmpl->parse('rss', 'videos');
}
Exemplo n.º 19
0
     }
 } 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'];
Exemplo n.º 20
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');
}
Exemplo n.º 21
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');
}
Exemplo n.º 22
0
        }
        $title = replace($title);
        $tabledata[$i]['TEXT'] = $text;
        $tabledata[$i]['TITLE'] = $title;
        $tabledata[$i]['TIME'] = $res['time'];
        $tabledata[$i]['NUMBER'] = $entrynumber--;
        //Custom-Felder
        for ($ii = 1; $ii <= 5; $ii++) {
            $tabledata[$i]['CUSTOM' . $ii] = replace($res['custom' . $ii]);
        }
        //Admin-Kommentar
        if ($res['com_text']) {
            $tabledata[$i]['COMMENT_USERID'] = $res['com_userid'];
            $tabledata[$i]['COMMENT_USERNAME'] = replace($res['com_username']);
            $tabledata[$i]['COMMENT_EMAIL'] = replace(iif(!$res['com_hidemail'], $res['com_email']));
            $tabledata[$i]['COMMENT_EMAIL_ENCRYPTED'] = replace(iif(!$res['com_hidemail'], cryptMail($res['com_email'])));
            $tabledata[$i]['COMMENT_TIME'] = $res['com_time'];
            $text = replace($res['com_text'], 1);
            $text = dbsmilies($text);
            $text = dbcodes($text);
            $tabledata[$i]['COMMENT_TEXT'] = $text;
        }
        //Admin-Links
        if ($_COOKIE[$set['main']['cookie_pre'] . '_admin_userid'] && $_COOKIE[$set['main']['cookie_pre'] . '_admin_password']) {
            $tabledata[$i]['EDITLINK'] = HTTPDIR . 'admin/action.php?action=guestbook.edit&amp;id=' . $res['id'];
            $tabledata[$i]['DELETELINK'] = HTTPDIR . 'admin/action.php?action=guestbook.del&amp;id=' . $res['id'];
        }
    }
}
//Custom-Titel
for ($i = 1; $i <= 5; $i++) {