Seite 1 von 1

Wie kann ich ein Script in Thema schreiben

Verfasst: 14.06.2007 09:55
von schrainer
Wie kann ich ein Script in Thema schreiben

Will bei mir im Forum einen Dateiupload machen wo Leute Bilder und Dateien in ein bestimmtes Verzeichnis hochladen können.

Meine Frage ist ob man in ein Thema das vollende script einstellen kann damit die Daten direkt angezeigt werden ohne diese noch erneut zu verknüpfen.

Oder gibt es eine andere Möglichkeit.

Code: Alles auswählen

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Dateiliste</title>

<style type="text/css">
.farbe1{
	background-color: #F5F5F5;
}
.farbe2{
	background-color: #E5E5E5;
}
.klein{
	font-family: Tahoma;
	font-size: 11px;
	width: 90px;
	text-align: center;
	padding:0px;
}
</style>

</head>
<body>

<div align=center>

<?php
// Dateiliste-Script von Homepage-Total.de
// Hier Bitte das Passwort ändern
$pw="";

if(@$_POST["inputpw"]!=$pw){
 echo "<form action=\"?\" method=\"post\">";
 echo "<p>Passwort: <input type=\"password\" name=\"inputpw\"> (passwort) ";
 echo "<input type=\"submit\" value=\"login\"></form>";
}
else {
?>

<table width="420" cellPadding="4" cellSpacing="1" style="background-color: #D5D5D5;">
 <tr>
  <td>
   <b>Ordner - Inhalt</b> - <small>Anzeigen durch anklicken!</small>
  </td>
 </tr>
 <tr>
  <td class=farbe1>

   <table border="0" width="100%" cellPadding="2" cellSpacing="1" style="background-color: #000000;">
    <tr>
     <th width="1%" class=farbe2>#</th>
     <th class=farbe1>Dateiname</td>
     <th class=farbe2>Änderung</th>
     <th width="1%" class=farbe1>Bytes</th>
    </tr>

<?php
// Dateinamen werden eingelesen und in einer Tabelle mit Link angezeigt
$verz=opendir ("verzeichnis/");
$i = 1;
$byte = 0;

while ($file = readdir($verz)) { 
 $datei = "verzeichnis/".$file;
 $aa = filesize($datei);
 $byte = $byte + $aa;
 $zeit = filemtime($datei);

 if($file != "." && $file != "..") {
  echo "<tr><th class=farbe2>" . $i . "</th>";
  echo "<td class=farbe1> <a href=\"verzeichnis/" . $file . "\" target=\"_blank\">" . $file . "</a> </td>";
  echo "<td class=\"klein farbe2\"> " . gmdate("d.m.y H:i", $zeit) . " </td>";
  echo "<td class=farbe1> $aa </td></tr>\n";
  $i++;
 }
}
closedir($verz);
?>
   </table>

   </td>
  </tr>
  <tr>
   <td style="text-align: right;">

<?php
// Speicherplatz Info wird ausgegeben
echo "Gesamt: $byte Bytes = <b>". round($byte / 1024 ,2)."</b> KB";
?>

   </td>
 </tr>
</table>

<?php 
}
?>

</div>

</body>
</html>

Kann mir da einer Helfen??

Gruß
Schrainer

Verfasst: 14.06.2007 11:16
von Jan500
wie meinst du das jetzt genau? :-S

du kannst die viewtopic.php bzw posting.php bearbeiten und dort den php teil reinpacken und in die dazugehörigen tpls packst du den html code...

aber es gibt bereits solche scripts extra fürs phpbb
zb den attachment mod von acyd
http://www.phpbb.com/community/viewtopi ... 15&t=74505

Jan

Verfasst: 14.06.2007 13:40
von schrainer
Ja das hab ich heute mal getestet aber nicht hinbekommen. Das ist ja mal gar nicht so einfach hab mir auch schon die Deutsche Beschreibung herbeigeholt.
Bin auch nicht so der Profi in dem Bereich.

Kann mir dabei vielleicht einer bei helfen?
Oder kann das einer für mich übernehmen?

Gruß
Schrainer

Verfasst: 14.06.2007 13:46
von Jan500
du meinst den modeinbau?

kennst du KB:modsfaq?
wo kommst du denn nicht weiter?
hast du bisher schon mods installiert? wenn nein, es gibt premodded files für diesen mod

Jan

Verfasst: 14.06.2007 14:20
von schrainer
Ich hab’s hinbekommen nur eine Verzeichnis geht noch nicht richtig der verschiebt mit die Signatur nach ganz rechts

Das ist die: viewtopic.php

Da ist irgendwo noch ein Fehler drin.
Laut Beschreibung so und so hab ich das auch gemacht.

Code: Alles auswählen

# 
#-----[ ÖFFNE ]---------------------------------------------
# 

viewtopic.php

# 
#-----[ FINDE ]---------------------------------------------
# Um Zeile 146

		AND f.forum_id = t.forum_id
		$order_sql";

# 
#-----[ DANACH, FÜGE EIN ]---------------------------------------
# 

attach_setup_viewtopic_auth($order_sql, $sql);

# 
#-----[ FINDE ]---------------------------------------------
# Um Zeile 580

$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . '<br />';

# 
#-----[ DANACH, FÜGE EIN ]---------------------------------------
# 

attach_build_auth_levels($is_auth, $s_auth_can);

# 
#-----[ FINDE ]---------------------------------------------
# Um Zeile 810

//
// Update the topic view counter

# 
#-----[ VORHER, FÜGE AN ]---------------------------------------
# 

init_display_post_attachments($forum_topic_data['topic_attachment']);

# 
#-----[ FINDE ]---------------------------------------------
# Um Zeile 1205

		'U_POST_ID' => $postrow[$i]['post_id'])
	);

# 
#-----[ DANACH, FÜGE EIN ]---------------------------------------
# nach dem );

	display_post_attachments($postrow[$i]['post_id'], $postrow[$i]['post_attachment']);

Meine Änderungen sehen so aus aber nur ausschnitte daraus

Code: Alles auswählen

$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "
	FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $join_sql_table . "
	WHERE $join_sql
		AND f.forum_id = t.forum_id
		$order_sql";
		attach_setup_viewtopic_auth($order_sql, $sql);
if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, "Could not obtain topic information", '', __LINE__, __FILE__, $sql);

Code: Alles auswählen

include($phpbb_root_path . 'includes/page_header.'.$phpEx);

//
// User authorisation levels output
//
$s_auth_can = ( ( $is_auth['auth_post'] ) ? $lang['Rules_post_can'] : $lang['Rules_post_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_reply'] ) ? $lang['Rules_reply_can'] : $lang['Rules_reply_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_edit'] ) ? $lang['Rules_edit_can'] : $lang['Rules_edit_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_delete'] ) ? $lang['Rules_delete_can'] : $lang['Rules_delete_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . '<br />';attach_build_auth_levels($is_auth, $s_auth_can);

$topic_mod = '';

if ( $is_auth['auth_mod'] )

Code: Alles auswählen

);

		$template->assign_var_from_handle('POLL_DISPLAY', 'pollbox');
	}
}
init_display_post_attachments($forum_topic_data['topic_attachment']);
//
// Update the topic view counter
//
$sql = "UPDATE " . TOPICS_TABLE . "
	SET topic_views = topic_views + 1
	WHERE topic_id = $topic_id";
if ( !$db->sql_query($sql) )

Code: Alles auswählen

'L_MINI_POST_ALT' => $mini_post_alt,

		'U_MINI_POST' => $mini_post_url,
		'U_POST_ID' => $postrow[$i]['post_id'])
	);
display_post_attachments($postrow[$i]['post_id'], $postrow[$i]['post_attachment']);

// Google Ad Mod 
if (!($userdata['session_logged_in'])) 
{ 
if($i == 0) 

Gruß
Schrainer

Verfasst: 14.06.2007 14:29
von Jan500
wenn sicxh was verschiebt dann ist es i.d.R. ein fehler in der tpl datei

verlink doch mal dein forum

jan

Verfasst: 14.06.2007 15:53
von schrainer
das ist das Forum

Verfasst: 14.06.2007 16:07
von Jan500
finde in deiner viewtopic_body.tpl
<tr></span>{postrow.ATTACHMENTS}<span class="postbody">
<td colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
</tr>
den gesamten teil ersetzt du mit
<tr>
<td colspan="2"><span class="postbody">{postrow.MESSAGE}</span>{postrow.ATTACHMENTS}<span class="postbody">
{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
</tr>
Jan

Verfasst: 14.06.2007 16:13
von schrainer
Ja da hätte ich auch noch mal rein gucken sollen in die Datei

Danke erst mal

Gruß
Schrainer

Verfasst: 14.06.2007 17:25
von schrainer
So hab noch ein Problem im Admin Bereich Kann man nicht alle Funktionen aufrufen

Diese Menüpunkt im Bereich Attachments gehen nicht
  • Einstellungen
    Quota Grenzen
    "Versteckte" Attachments
    Attachments Synchronisieren
und der Menüpunkt Einstellungen Forum geht auch nicht mehr

Wo kann das dran liegen?

Gruß
Schrainer