ThWboard Support-Forum (Archiv)

Ort: / Boardübersicht / Code Hack Requests / Zusatz vor die Thread Topics


<< vorherige Seite – Seite 2 von 2

PhoenixDH schrieb am 25.03.2005 um 14:29 Uhr

Um was gehts ?
Steht doch alles oben was man braucht !

Raiden schrieb am 28.03.2005 um 11:01 Uhr

Es steht nicht da, wo man einige Sachen einfügen muss, wenn es bei dir geklappt hat, würdest du mir/uns vlt. sagen wo was eingefügt werden muss?

PhoenixDH schrieb am 28.03.2005 um 17:58 Uhr

Ja, Morgen, bin grad aus dem Urlaub gekommen !

Zweeper schrieb am 28.03.2005 um 23:04 Uhr

cool, thx :)

PhoenixDH schrieb am 29.03.2005 um 15:28 Uhr

Hier ist meine newtopic:

<?php
/* $Id: newtopic.php,v 1.18 2004/01/05 17:44:32 thed_o_n Exp $ */
/*
          ThWboard - PHP/MySQL Bulletin Board System
        ==============================================
            (c) 2000, 2001 by
               Paul Baecher         <paul@thewall.de>
               Felix Gonschorek   <funner@thewall.de>

          download the latest version:
            http://www.thwboard.de

          This  program is  free  software;  you can
          redistribute it and/or modify it under the
          terms of the GNU General Public License as
          published by the Free Software Foundation;
          either  version 2 of  the License,  or (at
          your option) any later version.

        ==============================================

*/

include "./inc/header.inc.php";
include "./inc/tagbar.inc.php";

// http://www.securiteam.com/securitynews/5FP0C204KE.html
$post['posttext'] = ((isset($HTTP_POST_VARS['post'])) ? $HTTP_POST_VARS['post']['posttext'] : '');

if(!isset($post['postcode']))
{
  $post['postcode'] = 0;
}

if(!isset($post['postsmilies']))
{
  $post['postsmilies'] = 0;
}

if(!isset($post['postemailnotify']))
{
  $post['postemailnotify'] = 0;
}

if( $g_user['userid'] == 0 && !$P->has_permission( P_POSTNEW ) )
{
    message("Hinweis", "Sie m&uuml;ssen registriert sein, um Beitr&auml;ge erstellen zu k&ouml;nnen");
}

requires_permission( P_POSTNEW );

if( !isset($Submit) )
{
    $newtopicicons = '';
    $j = 1;
    while( list($iconid, $img) = each($topicicon) )
    {
        $newtopicicons .= "<INPUT type=\"radio\" name=\"thread[threadiconid]\" value=\"$iconid\" >
            <img src=\"templates/".$style['styletemplate']."/images/icon/".$img."_new.png\">&nbsp;&nbsp;&nbsp;";
        if( $j % 6 == 0 )
        {
            $newtopicicons .= "<br>";
        }
    
        $j++;
    }
    
    if( $config['smilies'] )
    {
        $smilies_on_off = "AN";
    }
    else
    {
        $smilies_on_off = "AUS";
    }

    if( $config['use_email'] )
    {
        $notifyavailable = '';
    }
    else
    {
        $notifyavailable = ' (Derzeit nicht verfügbar)';
    }
//               <input class="tbinput" type="text" name="thread[postguestname]">
    if( $g_user['userid'] )
    {
        $replyusername = "$style[stdfont]$g_user[userhtmlname]$style[stdfontend]$style[smallfont] [ <a href=\"".build_link('logout.php')."\">Logout</a> ]$style[smallfontend]";
    }
    else
    {
        if( $g_user['userid'] == 0 && $P->has_permission( P_POSTNEW ) )
        {
            $replyusername = '<input class="tbinput" name="post[postguestname]" type="text">' . $style['smallfont'] .
            ' (Minimal ' . $config['min_usernamelength'] . ', maximal ' . $config['max_usernamelength'] .
            ' Zeichen, keine Sonderzeichen) <b>Das Forum speichert ihre IP-Addresse!</b>' . $style['smallfontend'];
        }
        else
        {
            $replyusername = '';
        }
    }
    
    include("./inc/smiliepicker.inc.php");  
    $Tframe= new Template("templates/" . $style['styletemplate'] . "/frame.html");
    $Tform= new Template("templates/" . $style['styletemplate'] . "/newtopic.html");

    $navpath .= 'Neues Thema erstellen';
    
    eval($Tform->GetTemplate("CONTENT"));
    eval($Tframe->GetTemplate());
}
else
{
  $msg = '';

  // strip session id & time
  $board_url = str_replace('/', '\/', (($config['board_baseurl'][(strlen($config['board_baseurl']) - 1)] == '/') ? $config['board_baseurl'] : $config['board_baseurl'].'/'));
  $post['posttext'] = preg_replace("/(".$board_url."[^ ]+\.php[^ ]*)([?&]s=[^?&]+)/", '$1', $post['posttext']);
  $post['posttext'] = preg_replace("/(".$board_url."[^ ]+\.php[^ ]*)([?&]time=[^?&]+)/", '$1', $post['posttext']);
  CheckFormat($post['posttext']);

  
  // Bannedwords-Protection
  if( $config["usebwordprot"] == BWORD_TOPIC || $config["usebwordprot"] == BWORD_ALL )
    {
      $thread["threadtopic"] = check_banned($thread["threadtopic"]);
    }
  if( $config["usebwordprot"] >= BWORD_POST )
    {
        $post["posttext"] = check_banned($post["posttext"]);
    }
  if( strlen($thread['threadtopic']) > $config['subject_maxlength'] )
    {
      $msg .= "Das Subject ist zu lang!<br>";
    }
  if( strlen(preparse_code($thread['threadtopic'])) < $config['subject_minlength'] )
    {
      $msg .= "Das Subject ist zu kurz!<br>";
    }
  $testlen = strlen(preg_replace("/(\s+|(&#032;)+)/", '', strip_tags(parse_code(preparse_code($post['posttext']), 1, ($config['imageslevel'] ? 0 : 1), $post['postcode'], $post['postsmilies']))));
  if( $testlen < $config['message_minlength'] )
    {
      $msg .= "Der Text ist zu kurz<br>";
    }
  if( $testlen > $config['message_maxlength'] )
    {
      $msg .= "Der Text ist zu lang<br>";
    }
  
  if( strlen($msg) > 0 )
    {
      $navpath .= 'Neuer Thread';
      message("Fehler","Es sind leider folgende Fehler aufgetreten:<br><br><font color='$style[color_err]'>$msg</font>");
    }
  
  if( !$P->has_permission( P_NOFLOODPROT ) && time() - $config['postdelay'] < $g_user['userlastpost'] )
    {
      $navpath .= 'Neuer Thread';
      message("Fehler", "Sie können nur alle $config[postdelay] Sekunden einen neuen Thread erstellen.");
    }
  
  $time = time();
  
  (isset($post['postemailnotify']) && $post['postemailnotify']) ? $post['postemailnotify'] = 1 : $post['postemailnotify'] = 0;
  
  if( !isset($thread['topiciconid']) || !$topicicon[($thread['topiciconid'])] )
    {
      $thread['topiciconid'] = 0;
    }
  
  if( $P->has_permission( P_POSTNEW ) && ($g_user['userid'] == 0) )
    {
      // check username
      check_username($post['postguestname']);

      // override notify
      $post['postemailnotify'] = 0;
      
      $g_user['username'] = $config['guestprefix'] . $post['postguestname'];
      $post['postguestname'] = $config['guestprefix'] . addslashes($post['postguestname']);
    }
  else
    {
      $post['postguestname'] = '';
    }
  
  if( $config['uppercase_prot'] )
    {
      $thread['threadtopic'] = killshout( $thread['threadtopic'] );
    }
  
  // Autoclose & delete
  if ( isset($config['auto_close']) && $config['auto_close'] > 0 )
    {
      thwb_query("UPDATE  " . $pref . "thread SET threadclosed = '1' WHERE threadtime < '" . ( time() - ( ( $config['auto_close'] + 1 ) * 86400 ) ) . "'");
    }
  if ( isset($config['auto_delete']) && $config['auto_delete'] > 0 )
    {
      thwb_query("DELETE FROM " . $pref . "thread WHERE threadtime < " . ( time() - ( $config['auto_delete'] * 86400 ) ) . "");
    }
  // die neue nachricht abspeichern in dem topics table
  $thread['threadspacer'] = " ";
  $thread['threadtopic'] = $thread['threadprefix'] . $thread['threadspacer'] . $thread['threadtopic'];
  thwb_query("INSERT INTO ".$pref."thread (threadtime, threadtopic, threadauthor, boardid,
        threadlastreplyby, threadiconid, threadcreationtime)
        VALUES('$time',
        '".addslashes(preparse_code($thread['threadtopic']))."',
        '".addslashes($g_user['username'])."',
        '$board[boardid]', 
        '".addslashes($g_user['username'])."',
        '".intval($thread['threadiconid'])."',
        '$time')");
  
  $thread['threadid'] = mysql_insert_id();
  
  // die neue nachricht abspeichern in dem messages table
  thwb_query("INSERT INTO ".$pref."post (posttime, posttext, userid, threadid, postemailnotify, postip, postsmilies,
        postcode, postguestname)
        VALUES('$time',
        '" . addslashes(preparse_code($post['posttext'])) . "',
        '$g_user[userid]',
        '$thread[threadid]',
        '$post[postemailnotify]',
        '".addslashes($REMOTE_ADDR)."',
        '" . ($post['postsmilies'] ? 1 : 0) . "',
        '" . ($post['postcode'] ? 1 : 0) . "',
        '" . addslashes($post['postguestname']) . "')");

  // Den topics-count-wert des board erh&ouml;hen
  thwb_query("UPDATE ".$pref."board SET
    boardthreads=boardthreads+1,
    boardlastpost='$time',
    boardposts=boardposts+1,
    boardlastpostby='" . addslashes($g_user['username']) . "',
    boardthreadtopic='" . addslashes(preparse_code($thread['threadtopic'])) . "',
    boardthreadid=$thread[threadid]
        WHERE boardid='$board[boardid]'");

  // Unterforenhack
  thwb_query("UPDATE ".$pref."board SET
    boardthreads=boardthreads+1,
    boardlastpost='$time',
    boardposts=boardposts+1,
    boardlastpostby='" . addslashes($g_user['username']) . "',
    boardthreadtopic='" . addslashes(preparse_code($thread['threadtopic'])) . "',
    boardthreadid=$thread[threadid]
        WHERE boardid='$board[uberid]'");
  
  if( $g_user['userid'] )
    {
      // Den postings wert des postenden users erh&ouml;hen
      thwb_query("UPDATE ".$pref."user SET userlastpost=$time, userposts=userposts+1 WHERE userid='$g_user[userid]'");
    }
  
  header("Location: ".build_link("showtopic.php?threadid=$thread[threadid]", true));
}

?>

Raiden schrieb am 03.04.2005 um 21:56 Uhr

Und wie hast du das mit der newtopic.html gemacht?
Ich hab dort einfach mal folgendes eingefügt:

<form name="thread[threadprefix]">
  <select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
    <option>unnamed1</option>
  </select>
</form>

aber wenn ich dann absenden will, dann reagiert das ganze nicht...
Was muss ich denn nun wo machen? >_<

-Edit-
Soo... ich hab das nun noch einmal probiert und nun kommt der Fehler:

Parse error: parse error, unexpected T_STRING in /var/www/web419/html/raiden/thwboard/newtopic.php on line 58

Gebt mir bitte eine genaue Anleitung :)

PhoenixDH schrieb am 04.04.2005 um 09:28 Uhr

Sieht so aus:

<select class="tbselect" name="thread[threadprefix]">
                  <option value=""></option>
                  <option value="[VID]">[VID]</option>
                  <option value="[PIC]">[PIC]</option>
                  <option value="[GAME]">[GAME]</option>
                  <option value="[LINK]">[LINK]</option>                  
                  <option value="[EBAY]">[EBAY]</option> 
        <option value="[VK]">[VK]</option>
                <option value="[SUCHE]">[SUCHE]</option> 
              </select>   

Raiden schrieb am 05.04.2005 um 18:47 Uhr

alles klar so weit so gut..
nur.. ich habe deine newtopic.php übernommen, und auch deine Version in die newtopic.html übernommen, jedoch kommt immernoch der Fehler:

Parse error: parse error, unexpected T_STRING in /var/www/web419/html/raiden/thwboard/newtopic.php on line 58

Worann kann das liegen?

folgendes steht in linie 58 in der newtopic.php:

$newtopicicons .= "<INPUT type="radio" name="thread[threadiconid]" value="$iconid" >

PhoenixDH schrieb am 05.04.2005 um 18:53 Uhr

Wenn du das 1 zu 1 übernommen hast dürfte da keine Fehlermeldung kommen, sonst würde es bei mir auch nicht gehen !

bdominik schrieb am 05.04.2005 um 18:58 Uhr

hm, ich will mich ja nur ungerne einmischen, aber in deinem code phoenix ist ein Fehler drin, die anführungszeichen sind nicht richtig escaped. Das ist nicht der Fehler von Raiden sondern ein Fehler im Code.

PhoenixDH schrieb am 05.04.2005 um 22:40 Uhr

Äh, wird bei mir aber net bemängelt !
Wie gesagt es geht, daran hatte ich auch gedacht, aber wie gesagt, nachdem es ja bei mir geht ...

Raiden schrieb am 08.04.2005 um 18:02 Uhr

Aber bei mir nicht >_<
Ich will doch nur das diese Präfixe vor den Threadtopics angezeigt werden T-T
bdominik, kannst du das dann so umschreiben, dass es funktioniert?

PhoenixDH schrieb am 08.04.2005 um 19:48 Uhr

Wenn ich Zeit habe versuche ich es mal einzubauen, schick mir einfach mal die 2 Dateien per E-Mail !

Raiden schrieb am 19.06.2005 um 23:44 Uhr

Ich will mal wieder den alten Thread in die Erinnerung rufen ;p
Das Problem hat sich immernoch nicht gelöst bitte bitte helft doch mal.

Narodnaja schrieb am 09.07.2005 um 01:44 Uhr

*malkurzhierwiedermeld*

Der ganze Ansatz ist eigentlich doof, weil er nur einen Präfix VOR den eigentlichen Topictitel schreibt. Wenn man den nun editiert, editierts den mit.

Aber @ raiden: wenns noch aktuell is, is ja schon wieder länger her:
wenn bei dir steht:

$newtopicicons .= "<INPUT type="radio" name="thread[threadiconid]" value="$iconid" >

dann kann da ja was nicht gehen. Probier doch mal

$newtopicicons .= "<INPUT type=\"radio\" name=\"thread[threadiconid]\" value=\"" . $iconid . "\" >

/edit: kann ich hier keine escapeden \" mehr posten ?? so macht die Erklärung natürlich keinen Sinn :(

<< vorherige Seite – Seite 2 von 2