ilch Forum » Ilch Clan 1.1 » Module und Modifikationen » Benutzercenter 1.1 UserBanner ic1_profi

Geschlossen
  1. #1
    User Pic
    lude Mitglied
    Registriert seit
    13.12.2006
    Beiträge
    14
    Beitragswertungen
    1 Beitragspunkte
    Hallo habe mal wider eine bitte un das ist

    ich möchte gerne in den UserBanner was ein binden und das ist

    neues Profilefeld (stufe)
    //////////////////////////////////////////////
    SQL

    ic1_profilefields

    id show pos func

    17 stufe 20 1

    //////////////////////////////////////////
        <?php
        defined('main') or die('no direct access');
         
        $onlinetime = 600;
         
        if (!function_exists('arrayToDb')) {
            function arrayToDb($table, $ar, $where = '', $ar2 = array()) {
                $mode = empty($where) ? 'INSERT INTO' : 'UPDATE';
                $fields = '';
                foreach ($ar as $k => $v) {
                    if (in_array($k, $ar2)) {
                        continue;
                    }
                    $fields .= ", `$k` = " . (is_null($v) ? 'NULL' : "'$v'");
                }
                $fields = substr($fields, 2);
                $query = "$mode $table SET $fields $where;";
                if (db_query($query)) {
                    return true;
                } else {
                    return false;
                }
            }
        }
         
        if ($menu->get(1) == 'banner') {
            // Banner anzeigen
            $uid = intval($menu->get(2));
         
            $abf = "SELECT u.*, IF(u.spezrank>0,r.bez,r2.bez) AS rang, IF(o.uid=u.id,'Online','Offline') AS online
            FROM prefix_user u
                LEFT JOIN `prefix_ranks` r ON u.spezrank = r.id AND r.spez = 1
                LEFT JOIN `prefix_ranks` r2 ON IF(u.posts=0,1,u.posts) >= r2.min AND r2.spez = 0
                LEFT JOIN `prefix_online` o ON u.id = o.uid AND o.uptime > '".date('Y-m-d H:m:i', time() - $onlinetime)."'
            WHERE u.id = {$uid}";
            $qry = db_query($abf);
            if (db_num_rows($qry) == 0) {
                $fehler = 'Benutzer nicht gefunden';
            } elseif ($row = db_fetch_assoc($qry) and $row['recht'] > $allgAr['userbannerrecht']) {
                $fehler = 'Banner für diesen User nicht erlaubt';
            } elseif (!file_exists($allgAr['userbannerlink'])) {
                $fehler = 'Bannervorlagenbild nicht gefunden';
            } elseif ($tmp = getimagesize($allgAr['userbannerlink']) and $tmp[2] != 3) {
                $fehler = 'Bannervorlagenbild kein PNG';
            } else {
                $banner = $allgAr['userbannerlink'];
         
                if ($row['gebdatum'] !== "0000-00-00") {
                    list($y, $m, $d) = explode('-', $row['gebdatum']);
                    $gebdatum = "$d.$m.$y";
                    $alter = '('.((date('Y') - $y) - ((date('m') < $m or (date('m') == $m and date('d') < $d)) ? 1 : 0)).')';
                } else {
                    $gebdatum = "n/a";
                    $alter = "";
                }
                if (empty($row['wohnort'])) {
                    $row['wohnort'] = 'n/a';
                }
         
                if ($row['geschlecht'] == 1) {
                    $geschlecht = "Männlich";
                } elseif ($row['geschlecht'] == 2) {
                    $geschlecht = "Weiblich";
                } else {
                    $geschlecht = "n/a";
                }
         
                $j = date('d.m.Y', $row['regist']);
                $ll = date('d.m.Y', $row['llogin']);
                $im = ImageCreateFromPNG($banner);
                $text1 = 'Name: ' . $row['name'];
                $text2 = 'Posts: ' . $row['posts'];
                $text3 = 'Dabei seit: ' . $j;
                $text5 = 'Letzer Login: ' . $ll;
                $text8 = 'Geschlecht: ' . $geschlecht;
                $text7 = 'Wohnort: ' . $row['wohnort'];
                $text4 = 'Rang: ' . $row['rang'];
                $text9 = $row['name'] . ' ist grade ' . $row['online'];
                $text6 = 'Geburtsdatum: ' . $gebdatum . ' ' . $alter;
                $fo = 2;
                $schwarz = ImageColorAllocate($im, 0, 0, 0);
                imagestring ($im, $fo, 20, 10, $text1, $schwarz);
                imagestring ($im, $fo, 20, 20, $text2, $schwarz);
                imagestring ($im, $fo, 20, 30, $text3, $schwarz);
                imagestring ($im, $fo, 20, 40, $text4, $schwarz);
                imagestring ($im, $fo, 170, 10, $text5, $schwarz);
                imagestring ($im, $fo, 170, 20, $text6, $schwarz);
                imagestring ($im, $fo, 170, 30, $text8, $schwarz);
                imagestring ($im, $fo, 170, 40, $text7, $schwarz);
                imagestring ($im, 1, 380, 2, '(c) Ilch-Mods.de', $schwarz);
            }
            if (!empty($fehler)) {
                $im = imagecreate(strlen($fehler)*7, 18);
                $color = imagecolorallocate($im, 0, 0, 0);
                $color = imagecolorallocate($im, 255, 255, 255);
                imagestring($im, 2, 4, 2, $fehler, $color);
            }
            header("Content-type: image/png");
            ImagePNG($im);
            exit();
        } else {
            //Benutzercenter anzeigen
            $title = $allgAr['title'] . ' :: Benutzercenter';
            $hmenu = 'Benutzercenter';
            $design = new design ($title , $hmenu);
         
            if ($_SESSION['authid'] == 0) {
                $design->header();
                echo 'Bitte logge dich ein!!!';
            } else {
                $tpl = new tpl('benutzercenter');
                $design->addheader($tpl->get(0));
                $design->header();
         
                $row = db_fetch_assoc(db_query('SELECT u.*, b.* FROM prefix_user u LEFT JOIN prefix_benutzercenter b ON u.id = b.notizuid WHERE u.id = ' . $_SESSION['authid']));
                if (isset($_POST['submit'])) {
                    //Notiztext updaten
                    $update = !is_null($row['notiztext']);
                    $row['notiztext'] = escape($_POST['notiztext'], 'textarea');
                    if ($update) {
                        db_query("UPDATE `prefix_benutzercenter` SET notiztext = '{$row['notiztext']}' WHERE notizuid = " . $_SESSION['authid']);
                    } else {
                        db_query("INSERT INTO `prefix_benutzercenter` (notizuid, notiztext) VALUES ({$_SESSION['authid']}, '{$row['notiztext']}')");
                    }
                    //Usertabelle updaten
                    $updateUser = array();
                    if ($row['status'] != $_POST['status']) {
                        $row['status'] = $updateUser['status'] = escape($_POST['status'], 'integer');
                    }
                    if ($row['opt_pm'] != $_POST['msg']) {
                        $row['opt_pm'] = $updateUser['opt_pm'] = escape($_POST['msg'], 'integer');
                    }
                    if ($row['opt_mail'] != $_POST['mails']) {
                        $row['opt_mail'] = $updateUser['opt_mail'] = escape($_POST['mails'], 'integer');
                    }
                    if (!empty($updateUser)) {
                        arrayToDb('prefix_user', $updateUser, 'WHERE id = '.$_SESSION['authid']);
                    }
                }
         
                $erg = db_query("SELECT COUNT(id) FROM `prefix_pm` WHERE gelesen = 0 AND status < 1 AND eid = " . $_SESSION['authid']);
                $row['check_pm'] = db_result($erg, 0);
         
                $scriptlink = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
         
                $row['profillink'] = $scriptlink . '?user-details-' . $_SESSION['authid'];
                if ($allgAr['userhtaccess'] == 1) {
                    $row['imgsrc'] = dirname($scriptlink) . '/stats-' . $_SESSION['authid'] . '.png';
                } else {
                    $row['imgsrc'] = $scriptlink . '?benutzercenter-banner-' . $_SESSION['authid'];
                }
         
                $row['sitename'] = $allgAr['title'];
                $row['showNotiz'] = $allgAr['usernotiz'];
                $row['showBanner'] = $allgAr['userbanner'];
                if ($row['showBanner'] and $row['recht'] > $allgAr['userbannerrecht']) {
                    $row['showBanner'] = 0;
                }
         
                $row['colspan'] = $row['showBanner'] ? 1 : 3;
         
                $anzahl = intval($allgAr['userlastforum']);
                $query = "SELECT a.id, a.name, a.rep, c.erst as last, c.id as pid, c.time
        FROM prefix_topics a
         LEFT JOIN prefix_forums b ON b.id = a.fid
         LEFT JOIN prefix_posts c ON c.id = a.last_post_id
         LEFT JOIN prefix_groupusers vg ON vg.uid = " . $_SESSION['authid'] . " AND vg.gid = b.view
         LEFT JOIN prefix_groupusers rg ON rg.uid = " . $_SESSION['authid'] . " AND rg.gid = b.reply
         LEFT JOIN prefix_groupusers sg ON sg.uid = " . $_SESSION['authid'] . " AND sg.gid = b.start
        WHERE ((" . $_SESSION['authright'] . " <= b.view AND b.view < 1)
          OR (" . $_SESSION['authright'] . " <= b.reply AND b.reply < 1)
          OR (" . $_SESSION['authright'] . " <= b.start AND b.start < 1)
             OR vg.fid IS NOT NULL
             OR rg.fid IS NOT NULL
             OR sg.fid IS NOT NULL
             OR -9 >= " . $_SESSION['authright'] . ")
        ORDER BY c.time DESC
        LIMIT 0,$anzahl";
                $row['last_forum'] = '<table>';
                $resultID = db_query($query);
                while ($r = db_fetch_assoc($resultID)) {
                    $r['date'] = date('d.m.y - H:i', $r['time']);
                    $r['page'] = ceil (($r['rep'] + 1) / $allgAr['Fpanz']);
                    $row['last_forum'] .= '<tr><td valign="top"><b> &raquo; </b></td><td><a href="?forum-showposts-' . $r['id'] . '-p' . $r['page'] . '#' . $r['pid'] . '" title="' . $r['date'] . '">' . ((strlen($r['name']) < 60) ? $r['name'] : substr($r['name'], 0, 60) . '...') . '<br /><span class="smalfont"> von ' . $r['last'] . '</span></a></td></tr>';
                }
                $row['last_forum'] .= '</table>';
         
                $tpl->set_ar_out($row, 1);
            }
         
            $design->footer();
        }
        ?>


    betroffene Homepage: siedler.duesseldorfer-fungamer.de
    0 Mitglieder finden den Beitrag gut.
  2. #2
    User Pic
    lude Mitglied
    Registriert seit
    13.12.2006
    Beiträge
    14
    Beitragswertungen
    1 Beitragspunkte
    gelöst

        $abf = "SELECT a.val AS stufe, b.val AS Name, u.*, IF(u.spezrank>0,r.bez,r2.bez) AS rang, IF(o.uid=u.id,'Online','Offline') AS online
        FROM prefix_user u
            LEFT JOIN `prefix_ranks` r ON u.spezrank = r.id AND r.spez = 1
    		LEFT JOIN `prefix_userfields` AS a ON u.id = a.uid AND a.fid = 17 
            LEFT JOIN `prefix_userfields` AS b ON u.id = b.uid AND b.fid = 20 
            LEFT JOIN `prefix_ranks` r2 ON IF(u.posts=0,1,u.posts) >= r2.min AND r2.spez = 0
            LEFT JOIN `prefix_online` o ON u.id = o.uid AND o.uptime > '".date('Y-m-d H:m:i', time() - $onlinetime)."'	
        WHERE u.id = {$uid}";
    0 Mitglieder finden den Beitrag gut.
  3. #3
    User Pic
    oink Mitglied
    Registriert seit
    23.09.2010
    Beiträge
    740
    Beitragswertungen
    227 Beitragspunkte
    custom profile fields?

    kann ilch von haus aus
    before creation there must be destruction
    0 Mitglieder finden den Beitrag gut.
  4. #4
    User Pic
    Tr3icio gelöschter User
    Er woltel , dass im userBanner des Benutzercenters noch was drinne steht :-)
    0 Mitglieder finden den Beitrag gut.
Geschlossen

Zurück zu Module und Modifikationen

Optionen: Bei einer Antwort zu diesem Thema eine eMail erhalten