ilch Forum » Ilch Clan 1.1 » Fehlersuche und Probleme » gästebuch-.-

Geschlossen
  1. #1
    User Pic
    Bisa Mitglied
    Registriert seit
    23.12.2008
    Beiträge
    11
    Beitragswertungen
    0 Beitragspunkte
    moin all habe schin die such funktion genutzt und nichts wirklich hilfreiches gefunden

    also ich möchte im meinem gb das feld e-mail adresse pflicht ist wie mach ich das mein gbook.php sieht so aus

    <style type="text/css">
    <!--
    body,td,th {
    	color: #FF6600;
    }
    body {
    	background-color: #666666;
    }
    -->
    </style><?php 
    #   Copyright by: Manuel Staechele
    #   Support: www.ilch.de
    
    
    defined ('main') or die ( 'no direct access' );
    
    $title = $allgAr['title'].' :: G&auml;stebuch';
    $hmenu = 'G&auml;stebuch';
    $design = new design ( $title , $hmenu );
    $design->header();
    
    # time sperre in sekunden
    $timeSperre = $allgAr['Gsperre'];
    
    /*
    
      gbook
    	
    	id , name , mail , page , ip , time , txt
    
    */
      if (is_siteadmin() AND $menu->getA(1) == 'b' AND is_numeric($menu->getE(1)) AND $allgAr['bs_act']=='1'){
      $ips = db_query('SELECT * FROM prefix_gbook WHERE id = '.$menu->getE(1));
      $ips_ = db_fetch_assoc($ips);
      $ips = db_query('INSERT INTO `prefix_banscript` VALUES ( "" , "'.time().'" , "'.$ips_['ip'].'" ,"'.$ips_['cookie'].'" , "'.$ips_['name'].'" ) ' );
      if($ips >= 1)
      echo'Die Ip: '.$ips_['ip'].' wurde erfolgreich gebannt!';
      else
      echo'Die Ip: '.$ips_['ip'].'konnte nicht gebannt werden!';
      }
      if (is_siteadmin() AND $menu->getA(1) == 'd' AND is_numeric($menu->getE(1)) ) {
        db_query("DELETE FROM prefix_gbook WHERE id = ".$menu->getE(1));
        }
      // Gibt $show_info aus \\
      if ($menu->getA(1) == 'i' AND is_siteadmin() AND $allgAr['bs_act']=='1') {
      $show_info = 1;
      }
    switch($menu->get(1)) {
    case 1 :
    
    	$tpl = new tpl ( 'gbook.htm' );
    	$ar = array (
        'uname' => $_SESSION['authname'],
        'SMILIES' => getsmilies(),
    		'ANTISPAM' => get_antispam ('gbook', 1),
        'TXTL' => $allgAr['Gtxtl']
      );
    	$tpl->set_ar_out($ar,3);
      
      if (!isset($_SESSION['klicktime_gbook'])) { $_SESSION['klicktime_gbook'] = 0; }
      
    break;
    case 2 :
    
      $dppk_time = time();
      if (($_SESSION['klicktime_gbook'] + $timeSperre) < $dppk_time
      AND isset($_POST['name'])
      AND isset($_POST['txt'])
      AND trim($_POST['name']) != ""
      AND trim($_POST['txt']) != ""
      AND chk_antispam ('gbook' )
      AND strlen ($_POST['txt']) <= $allgAr['Gtxtl'] ) {
    
        $txt = escape($_POST['txt'], 'textarea');
    	  $name = escape($_POST['name'], 'string');
    	  $mail = escape($_POST['mail'], 'string');
    	  $page = escape($_POST['page'], 'string');
    	if($allgAr['gb_ban_nick'] == '1' AND $allgAr['bs_act'] == '1') {
    	$erg = db_query('SELECT name FROM `prefix_banscript`');
    		$row = mysql_fetch_array($erg);
    		if(@in_array($_POST['name'],$row) ) {
    		echo'Der Name '.$_POST['name'].' ist gesperrt!';}
    		else {db_query("INSERT INTO prefix_gbook VALUES (
          null,
    	    '".$name."',
          '".$mail."',
          '".$page."',
          '".time()."',
          '".getip()."',
          '".$txt."',
          '".$_COOKIE['id']."',
          '".$_SESSION['authid']."'
    		)
        ");} 
    		}
    		elseif($allgAr['gb_ban_nick'] == '0'){
      	db_query("INSERT INTO prefix_gbook VALUES (
          null,
    	    '".$name."',
          '".$mail."',
          '".$page."',
          '".time()."',
          '".getip()."',
          '".$txt."',
          '".$_COOKIE['id']."',
          '".$_SESSION['authid']."'
    		)
        ");
        }			
        
        $_SESSION['klicktime_gbook'] = $dppk_time;
        wd('index.php?gbook',$lang['insertsuccessful']);
    	} else {
    	  echo '- '.$lang['donotpostsofast'];
    	  echo '<br />- '.sprintf($lang['gbooktexttolong'], $allgAr['Gtxtl']);
    	  echo '<br />- '.$lang['plsfilloutallfields'];
    	}	
      break;
    case 'show' :
      if ($allgAr['gbook_koms_for_inserts'] == 1) {
        $id = escape($menu->get(2), 'integer');
        if (chk_antispam('gbookkom') AND isset($_POST['name']) AND isset($_POST['text'])) {
          $name = escape($_POST['name'], 'string');
          $text = escape($_POST['text'], 'string');
          db_query("INSERT INTO prefix_koms (name,text,uid,cat) VALUES ('".$name."', '".$text."', ".$id.", 'GBOOK')");
        }
        if ($menu->getA(3) == 'd' AND is_numeric($menu->getE(3)) AND has_right(-7, 'gbook')) {
          $did = escape($menu->getE(3), 'integer');
          db_query("DELETE FROM prefix_koms WHERE uid = ".$id." AND cat = 'GBOOK' AND id = ".$did);
        }
        
    
        $r  = db_fetch_assoc(db_query("SELECT time, name, mail, page, txt as text, id FROM prefix_gbook WHERE id = ".$id));
        $r['datum'] = date('d.m.Y', $r['time']);
        if ($r['page'] != '') {
          $r['page'] = get_homepage($r['page']);
          $r['page'] = ' &nbsp; <a href="'.$r['page'].'" target="_blank"><img src="include/images/icons/page.gif" border="0" alt="Homepage '.$lang['from'].' '.$r['name'].'"></a>'; 
    		}
    		if ($r['mail'] != '') { 
    	    $r['mail'] = ' &nbsp; <a href="mailto:'.escape_email_to_show($r['mail']).'"><img src="include/images/icons/mail.gif" border="0" alt="E-Mail '.$lang['from'].' '.$r['name'].'"></a>'; 
    		}
        
        $tpl = new tpl ( 'gbook.htm' );
    		$r['ANTISPAM'] = get_antispam('gbookkom', 0);
        $r['uname'] = $_SESSION['authname'];
        $r['text'] = bbcode($r['text']);
        $tpl->set_ar_out($r, 4);
        $i = 1;
        $erg = db_query("SELECT id, name, text FROM prefix_koms WHERE uid = ".$id." AND cat = 'GBOOK' ORDER BY id DESC");
        $anz = db_num_rows($erg)+1;
        while ($r1 = db_fetch_assoc($erg)) {
          $r1['zahl'] = $anz - $i;
          $r1['text'] = bbcode($r1['text']);
          if (has_right(-7, 'gbook')) { $r1['text'] .= '<a href="index.php?gbook-show-'.$id.'-d'.$r1['id'].'"><img src="include/images/icons/del.gif" alt="'.$lang['delete'].'" border="0" title="'.$lang['delete'].'" /></a>'; }
          $tpl->set_ar_out($r1, 5);
          $i++;
        }
        $tpl->out(6);
      }
      break;
    default :
    
      $limit = $allgAr['gbook_posts_per_site'];  // Limit 
      $page = ( $menu->getA(1) == 'p' ? escape($menu->getE(1), 'integer') : 1 );
      $MPL = db_make_sites ($page , "" , $limit , "?gbook" , 'gbook' );
      $anfang = ($page - 1) * $limit;
      
    	$tpl = new tpl ( 'gbook.htm' );
    	
      $ei1 = @db_query("SELECT COUNT(ID) FROM prefix_gbook"); 
      $ein    = @db_result($ei1,0);
    	
    	$ar = array ('EINTRAGE' => $ein );
    	$tpl->set_ar_out($ar,0);
    	
    	$erg = db_query("SELECT * FROM prefix_gbook ORDER BY time DESC LIMIT ".$anfang.",".$limit) or die (db_error());
    	while ($row = db_fetch_object($erg)) {
    	  
        $page = '';
        $mail = '';
    		if ($row->page) {
          $row->page = get_homepage($row->page);
          $page = ' &nbsp; <a href="'.$row->page.'" target="_blank"><img src="include/images/icons/page.gif" border="0" alt="Homepage '.$lang['from'].' '.$row->name.'"></a>'; 
    		}
    		if ($row->mail) { 
    	    $mail = ' &nbsp; <a href="mailto:'.escape_email_to_show($row->mail).'"><img src="include/images/icons/mail.gif" border="0" alt="E-Mail '.$lang['from'].' '.$row->name.'"></a>'; 
    		}
    	if(is_siteadmin() AND $allgAr['bs_act']=='1') {
    	$info_icon = '<a href="index.php?gbook-i"><img src="include/images/icons/info.gif" border="0" alt="Info" title="Info"></a>'; 
    	$ban = '<a href="index.php?gbook-b'.$row->id.'"><img src="include/images/icons/ban.gif" border="0" alt="Bannen" title="Bannen"></a>'; 
    	$row_del = '<a href="index.php?gbook-d'.$row->id.'"><img src="include/images/icons/del.gif" border="0" alt="'.$lang['delete'].'" title="'.$lang['delete'].'"></a>';
    	}
    	if($show_info == '1' AND is_siteadmin() ) {
    	if(!empty($row->ip) )
    	$row_ip = 'Ip: '.$row->ip;
    	if(!empty($row->time) )
    	$row_time = 'Datum: '.date("d-m-Y H:i:s",$row->time);
    	if(!empty($row->cookie) )
    	$row_cookie = 'Cookie: '.$row->cookie;
    	if(!empty($row->user) )
    	$row_user = 'User: '.$row->user;
          $info = '<tr class="Cmite"><td colspan="3">'.$row_ip.' '.$row_time.' '.$row_cookie.' '.$row_user.'
          </td></tr>';
          unset($row_ip,$row_time,$row_cookie,$row_user);
          }
        $koms = '';
        if ($allgAr['gbook_koms_for_inserts'] == 1) {
          $koms = db_result(db_query("SELECT COUNT(*) FROM prefix_koms WHERE uid = ".$row->id." AND cat = 'GBOOK'"),0,0);
          $koms = '<a href="index.php?gbook-show-'.$row->id.'">'.$koms.' '.$lang['comments'].'</a>';
        }
      	if(!empty($row->user) AND $allgAr['gb_nick_link']=='1' AND $allgAr['bs_act']=='1')
      	$name = '<a href="index.php?user-details-'.$row->user.'">'.$row->name.'</a>';
      	else $name = $row->name;
        echo'
        <table width="100%" cellpadding="4" cellspacing="0" border="0" class="rand">
    	<tr class="Cmite">
    	<td width="40%"><b>'.$name.'</b></td>
     	<td width="20%">'.$ban.' '.$info_icon.' '.$row_del.' '.$mail.' '.$page.'</td>
        <td width="30%" align="right">'.date("d.m.Y",$row->time).'</td>
     	</tr>
     	'.$info.'
    	<tr class="Cnorm">
        <td colspan="3">'.BBCode($row->txt).'</td>
    	</tr>
        </table>'.$koms.'<br /><br />';
    	}
    	$tpl->set_out('SITELINK', $MPL, 2 );
    break;
    }
    
    //-----------------------------------------------------------|
    
    $design->footer();
    
    ?>

    wo muss ich da was einfügen und raus nehmen schon mal danke mfg Bisa


    verwendete ilchClan Version: 1.1

    betroffene Homepage: jubel-trubel.com
    0 Mitglieder finden den Beitrag gut.
Geschlossen

Zurück zu Fehlersuche und Probleme

Optionen: Bei einer Antwort zu diesem Thema eine eMail erhalten