Beiträge von Ufo361

    HIER MEINE CODES:


    CONFIG.PHP IN DIESEM SPOILER! :

    Spoiler anzeigen

    <?php

    $sql_host = 'localhost';
    $sql_user = 'debbolive';

    $sql_pass = 'theking12';
    $sql_db = 'debbolive';
    $prefix = 'pb_';

    ?>

    Müsste alles richtig sein!


    CODE VON MYSQL.PHP! :

    Spoiler anzeigen

    <?php


    // Kontoauszugseinträge
    function konteintrag($userid, $betreff, $betrag, $art) {
    global $db, $prefix;
    $query = array( "date" => date("d.m.Y"), "time" => date("H:i"),
    "userid" => $userid, "betreff" => $betreff,
    "wert" => $betrag,
    "art" => $art, "status" => "0" );
    $db->insert( $prefix."kontoauszug", $query );

    }

    class dbc {

    var $link;
    var $mode = false; //"MYSQL40";
    var $commit = false;

    function dbc( $config, &$pre ) {
    if( @include( $config ) ) {
    $this->link = @mysql_connect( $sql_host, $sql_user, $sql_pass );
    if (!$this->link) trigger_error( "Could not connect Database!", E_USER_ERROR );
    $db = @mysql_select_db( $sql_db, $this->link );
    if (!$db) trigger_error( "Could not select Database!", E_USER_ERROR );

    if( $this->mode ) $this->query( "SET SESSIONSQL_MODE=".$this->mode );
    $pre = $prefix;
    } else trigger_error( "Config File missing!", E_USER_ERROR );
    }

    function query( $sql ) {
    if( $res = mysql_query( $sql, $this->link ))
    return $res;
    else trigger_error( "Bei dem Query: \"".htmlspecialchars( $sql )."\" ist folgender Fehler aufgeterten:<br>".mysql_error(), E_USER_ERROR );
    }

    function get( $table, $cond = 1, $limit = -1, $order = "" ) {
    $query = "SELECT * FROM ".$table." WHERE $cond";
    if( !empty( $order )) $query .= " ORDER BY $order";
    if( $limit > 0 ) $query .= " LIMIT $limit";

    $res = $this->query( $query );
    $result = array();
    while( $row = mysql_fetch_assoc( $res )) $result[] = $row;

    mysql_free_result( $res );
    if( $limit == 1 ) return $result[0];
    else return $result;
    }

    function fetch_query( $query ) {
    $res = $this->query( $query );
    $result = array();
    while( $row = mysql_fetch_assoc( $res )) $result[] = $row;

    mysql_free_result( $res );
    return $result;
    }

    function get_assoc( $table, $cond = 1, $value, $key = "id" ) {
    $query = "SELECT * FROM ".$table." WHERE $cond ORDER BY $value";

    $res = $this->query( $query );
    $result = array();
    while( $row = mysql_fetch_assoc( $res )) $result[$row[$key]] = $row[$value];

    mysql_free_result( $res );
    return $result;
    }

    function del( $table, $cond ) {
    return $this->query( "DELETE FROM ".$table." WHERE $cond" );
    }

    function id_get( $table, $id ) {
    $query = "SELECT * FROM ".$table." WHERE id = '$id' LIMIT 1";
    $res = $this->query( $query );
    $result = mysql_fetch_assoc( $res );
    mysql_free_result( $res );
    return $result;
    }

    function id_del( $table, $id ) {
    return $this->query( "DELETE FROM ".$table." WHERE id = '$id' LIMIT 1" );
    }

    function id() {
    return @mysql_insert_id( $this->link );
    }

    function close() {
    if( $this->commit ) $db->query( "COMMIT;" );
    mysql_close( $this->link );
    }

    function flist( $table ) {
    $res = $this->query( "SHOW COLUMNS FROM ".$table );
    $fields = array();

    while( $f = mysql_fetch_row( $res )) $fields[] = $f;
    mysql_free_result( $res );
    return $fields;
    }

    function insert( $table, $values, $type = "INSERT" ) {
    global $userdata;
    if( !empty( $userdata['id'] )) $values['create_by'] = $userdata['id'];
    $values['create_date'] = time();

    $fields = array(); $vals = array();
    foreach( $this->flist( $table ) as $f )
    if( isset( $values[$f[0]] )) {
    $fields[] = "`$f[0]`";
    $vals[] = (empty( $values[$f[0]] ) && $f[2] == 'YES') ? "NULL" : "'".$values[$f[0]]."'";
    }

    $this->query( "$type INTO $table ( ".implode( ", ", $fields ).")
    VALUES ( ".implode( ", ", $vals ).");" );
    }

    function update( $table, $values, $cond = 1 ) {
    global $userdata;
    if( !empty( $userdata['id'] )) $values['update_by'] = $userdata['id'];
    $values['update_date'] = time();

    $sql = "UPDATE $table SET "; $ups = array();
    foreach( $this->flist( $table ) as $f )
    if( isset( $values[$f[0]] ))
    if( empty( $values[$f[0]] ) && $f[2] == 'YES' ) $ups[] = "`$f[0]` = NULL";
    else $ups[] = "`$f[0]` = '".$values[$f[0]]."'";
    $this->query( $sql.implode( ", ", $ups )." WHERE $cond" );
    }

    function id_update( $table, $values, $id ) {
    $this->update( $table, $values, "id = '".(int)$id."'" );
    }

    function multi_insert( $table, $rows, $type = "INSERT" ) {
    global $userdata;
    $flist = $this->flist( $table );

    foreach( $rows as $row ) {
    if( !empty( $userdata['id'] )) $row['create_by'] = $userdata['id'];
    $row['create_date'] = time();

    $fields = array(); $vals = array();
    foreach( $flist as $f )
    if( isset( $row[$f[0]] )) {
    $fields[] = "`$f[0]`";
    $vals[] = (empty( $row[$f[0]] ) && $f[2] == 'YES') ? "NULL" : "'".$row[$f[0]]."'";
    }

    $this->query( "$type INTO $table ( ".implode( ", ", $fields ).")
    VALUES ( ".implode( ", ", $vals ).");" );
    }
    }

    function multi_update( $table, $rows ) {
    trigger_error( "Function is not implemented!", E_USER_ERROR );
    }
    }

    ?>

    Hallo, RetroTown!
    Bei mir ist immer wieder ein Problem wenn ich meine Radio Seite lade:

    Parse error: syntax error, unexpected end of file in /users/debbolive/www/index.php on line 63


    MEIN INDEX.PHP :

    PHP
    <?php
    // Datenbankverbindung herstellen  include( "files/mysql.php" );  $db = new dbc( "files/config.php", $prefix );  define( "THIS_SELF", "index.php?" );  // Sitzung starten  session_name( "IVSESSID" );  session_start();    if( isset( $_GET['logout'] )) {    setcookie( $prefix."id", 0, time() - 1 );     setcookie( $prefix."key", 0, time() - 1 );      $_COOKIE = array();    session_unset();  }
    // Konfiguration laden, alte optionsvariable verfügbar machen  foreach( $db->get( $prefix."base_conf" ) as $row )    $conf[$row['category']][$row['name']] = $row['value'];  $options = $conf['page'];  $exchange = array();  // Typen auslesen   foreach( $db->get( $prefix."base_type" ) as $row )     $types[$row['category']][$row['name']] = $row['id'];   // Einbinden wichtiger Dateien  $filetypes = array( "class", "function", "include", "library" );  foreach( $filetypes as $ft )    foreach( $db->get( $prefix."base_file", "`type` = '".$types['filetype'][$ft]."' AND `inc_front` = 1", -1, "`type`, `id`" ) as $file )      eval( $file['source'] );
    // Funktionsdeklarationen         // Fehlerfunktion    function page_error( $msg ) {      global $db, $prefix, $types, $conf;      $error_template  = $db->get( $prefix."content_template", "`type` = '{$types['template']['error']}'", 1 );      $template_source = $db->get( $prefix."content_template_source", "`style` = '{$conf['system']['style']}' AND `template` = '{$error_template['id']}'", 1 );             if( $template_source ) return str_replace( "{REASON}", $msg, $template_source['source'] );      else return "Error: ".$msg;    }        // Sicherheitsfunktion zu Panel includen    function parse_panel( $panel, $options, $db, $prefix, $layer, $types, $conf, $userdata  ) {          global $exchange;          if( !empty( $panel['template'] )) {        $panel_template  = $db->get( $prefix."content_template", "`id` = '{$panel['template']}' AND `type` = '{$types['template']['panel']}'", 1 );        $template_source = $db->get( $prefix."content_template_source", "`style` = '{$conf['system']['style']}' AND `template` = '{$panel_template['id']}'", 1 );        $template = str_replace( "{TITLE}", $panel['name'], $template_source['source'] );        $template = explode( "{BODY}", $template );      }                 if( $script = $db->id_get( $prefix."base_script", $panel['script'] )) {        if( $script_source = $db->get( $prefix."base_file", "`id` = '{$script['script']}' AND `type` = '{$types['filetype']['script']}'", 1 )) {          echo $template[0];          $panelvars = $db->get_assoc( $prefix."content_variable", "panel = {$panel['id']}", "value", "name" );          	      eval( $script_source['source'] );	      echo $template[1];


    ODER SO GESEHEN;

    Spoiler anzeigen

    <?php

    // Datenbankverbindung herstellen
    include( "files/mysql.php" );
    $db = new dbc( "files/config.php", $prefix );
    define( "THIS_SELF", "index.php?" );

    // Sitzung starten
    session_name( "IVSESSID" );
    session_start();

    if( isset( $_GET['logout'] )) {
    setcookie( $prefix."id", 0, time() - 1 );
    setcookie( $prefix."key", 0, time() - 1 );
    $_COOKIE = array();
    session_unset();
    }

    // Konfiguration laden, alte optionsvariable verfügbar machen
    foreach( $db->get( $prefix."base_conf" ) as $row )
    $conf[$row['category']][$row['name']] = $row['value'];
    $options = $conf['page'];
    $exchange = array();

    // Typen auslesen
    foreach( $db->get( $prefix."base_type" ) as $row )
    $types[$row['category']][$row['name']] = $row['id'];

    // Einbinden wichtiger Dateien
    $filetypes = array( "class", "function", "include", "library" );
    foreach( $filetypes as $ft )
    foreach( $db->get( $prefix."base_file", "`type` = '".$types['filetype'][$ft]."' AND `inc_front` = 1", -1, "`type`, `id`" ) as $file )
    eval( $file['source'] );

    // Funktionsdeklarationen
    // Fehlerfunktion
    function page_error( $msg ) {
    global $db, $prefix, $types, $conf;
    $error_template = $db->get( $prefix."content_template", "`type` = '{$types['template']['error']}'", 1 );
    $template_source = $db->get( $prefix."content_template_source", "`style` = '{$conf['system']['style']}' AND `template` = '{$error_template['id']}'", 1 );

    if( $template_source ) return str_replace( "{REASON}", $msg, $template_source['source'] );
    else return "Error: ".$msg;
    }

    // Sicherheitsfunktion zu Panel includen
    function parse_panel( $panel, $options, $db, $prefix, $layer, $types, $conf, $userdata ) {
    global $exchange;

    if( !empty( $panel['template'] )) {
    $panel_template = $db->get( $prefix."content_template", "`id` = '{$panel['template']}' AND `type` = '{$types['template']['panel']}'", 1 );
    $template_source = $db->get( $prefix."content_template_source", "`style` = '{$conf['system']['style']}' AND `template` = '{$panel_template['id']}'", 1 );
    $template = str_replace( "{TITLE}", $panel['name'], $template_source['source'] );
    $template = explode( "{BODY}", $template );
    }

    if( $script = $db->id_get( $prefix."base_script", $panel['script'] )) {
    if( $script_source = $db->get( $prefix."base_file", "`id` = '{$script['script']}' AND `type` = '{$types['filetype']['script']}'", 1 )) {
    echo $template[0];
    $panelvars = $db->get_assoc( $prefix."content_variable", "panel = {$panel['id']}", "value", "name" );
    eval( $script_source['source'] );
    echo $template[1];

    Du bist hier das Kind & Behauptet er hat sich das Cms erkauft haha.
    Hier gibts dies Kostenlos zum Download. :)

    Ja, habe ich auch...
    Undzwar ohne Lücken, Fehler oder sonstiges.
    Du bist nur unzufrieden mit dir weil du dir das Lückenfreie CMS nicht leisten kannst :P