So grosses Problem:
Ich habe es geschafft, die Notizen als Post-It zu erfassen/ändern, so das diese auf dem Index oder auch auf allen Seiten angezeigt werden können.
Jetzt bin ich aber an dem Punkt, an dem ich echt festhänge. Vielleicht kann da jemand helfen.
Hier erstmal der Code des unfertigen(!!!!!) Add-On:
Code: Alles auswählen
#####################################################################################
## MOD Title: Post-It Add-On for Personal Notes
## MOD Version: 1.0.0
## MOD Author: OXPUS - http://www.oxpus.de
## AWSW - http://www.awsw.de
##
## MOD Description: This add-on displays the personal notes as post-its over the board.
## Users can chooce which notes will be displayed on index or all pages.
##
## MOD Requires: Personal Notes (http://www.oxpus.de)
## Board Note (http://www.awsw.de)
##
## MOD Tested On: phpBB 2.0.4
##
## Installation Level: (easy)
## Installation Time: 10-15 minutes
##
## Files To Edit: (8+x)
## - notes.php
## - posting_notes.php
## - includes/page_header.php
## - language/lang_english/lang_main.php
## - language/lang_german/lang_main.php
## - templates/subSilver/notes_body.tpl
## - templates/subSilver/overall_header.tpl
## - templates/subSilver/posting_notes_body.tpl
##
## Included Files: (None)
##
##############################################################
##############################################################
## Author Note: 1.0.0 First release (not finished yet!!!)
##
##############################################################
###############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
# ----- QUERY DATABASE ----------------------------------------
# // Change the table-prefix 'phpbb_' if your tables haves another one!!!
#
ALTER TABLE `phpbb_notes` ADD `postit` MEDIUMINT( 8 ) DEFAULT '0' NOT NULL ;
#
# ----- OPEN ----------------------------------------
#
notes.php
#
# ----- FIND ----------------------------------------
#
'L_DELETE_TOPIC' => $lang['Delete_topic'])
#
# ----- REPLACE WITH ----------------------------------------
#
'L_DELETE_TOPIC' => $lang['Delete_topic'],
'L_POSTIT' => 'Post-It')
#
# ----- FIND ----------------------------------------
#
$delpost = '<a href="' . $temp_url . '">' . $lang['Delete_post'] . '</a>';
#
# ----- AFTER ADD ----------------------------------------
#
if ( $postrow[$i]['postit'] == 1 )
{
$postit = $lang['board_note_index'];
}
else if ( $postrow[$i]['postit'] == 2 )
{
$postit = $lang['board_note_all'];
}
else
{
$postit = $lang['board_note_none'];
}
#
# ----- FIND ----------------------------------------
#
'MESSAGE' => $message,
'POSTIT' => $postit,
#
# ----- AFTER ADD ----------------------------------------
#
'POSTIT' => $postit,
#
# ----- OPEN ----------------------------------------
#
templates/subSilver/notes_body.tpl
#
# ----- FIND ----------------------------------------
#
<td valign="top" nowrap="nowrap">{postrow.EDIT_IMG} {postrow.DELETE_IMG}</td>
#
# ----- REPLACE WITH ----------------------------------------
#
<td valign="top" nowrap="nowrap" class="postdetails" align="right">{postrow.EDIT_IMG} {postrow.DELETE_IMG}<br />{L_POSTIT}: {postrow.POSTIT}</td>
#
# ----- OPEN ----------------------------------------
#
language/lang_english/lang_main.php
#
# ----- FIND ----------------------------------------
#
$lang['board_note_close'] = "Close Note";
#
# ----- AFTER ADD ----------------------------------------
#
$lang['board_note_none'] = "No";
$lang['board_note_index'] = "Index";
$lang['board_note_all'] = "All";
#
# ----- OPEN ----------------------------------------
#
language/lang_german/lang_main.php
#
# ----- FIND ----------------------------------------
#
$lang['board_note_close'] = "Notiz schließen";
#
# ----- AFTER ADD ----------------------------------------
#
$lang['board_note_none'] = "Nein";
$lang['board_note_index'] = "Index";
$lang['board_note_all'] = "Überall";
#
# ----- OPEN ----------------------------------------
#
posting_notes.php
#
# ----- FIND ----------------------------------------
#
$sql = "INSERT INTO " . NOTES_TABLE . "
(post_subject, poster_id, post_time, post_text) VALUES ('$subject', " . $userdata['user_id'] . ", $current_time, '$message')";
#
# ----- REPLACE WITH ----------------------------------------
#
if ( !$postit ) { $postit = 0; }
$sql = "INSERT INTO " . NOTES_TABLE . "
(post_subject, poster_id, post_time, post_text, postit) VALUES ('$subject', " . $userdata['user_id'] . ", $current_time, '$message', $postit)";
#
# ----- FIND ----------------------------------------
#
$sql = "UPDATE " . NOTES_TABLE . "
SET post_subject = '$subject', post_text = '$message'
#
# ----- REPLACE WITH ----------------------------------------
#
$sql = "UPDATE " . NOTES_TABLE . "
SET post_subject = '$subject', post_text = '$message', postit = $postit
#
# ----- FIND ----------------------------------------
#
if ( $mode == 'newtopic' )
{
$subject = '';
$message = '';
#
# ----- AFTER ADD ----------------------------------------
#
$postit = 0;
#
# ----- FIND ----------------------------------------
#
$message = $row['post_text'];
#
# ----- AFTER ADD ----------------------------------------
#
$postit = $row['postit'];
#
# ----- FIND ----------------------------------------
#
'L_POST_SUBJECT' => $lang['Post_subject'])
);
#
# ----- REPLACE WITH ----------------------------------------
#
'L_POST_SUBJECT' => $lang['Post_subject'],
'L_POSTIT' => 'Post-It')
);
$board_note_none = ( $postit == '0' ) ? "checked=\"checked\"" : "";
$board_note_index = ( $postit == '1') ? "checked=\"checked\"" : "";
$board_note_all = ( $postit == '2') ? "checked=\"checked\"" : "";
#
# ----- FIND ----------------------------------------
#
'SUBJECT' => $subject,
'MESSAGE' => $message,
#
# ----- AFTER ADD ----------------------------------------
#
"L_board_note_NONE" => $lang['board_note_none'],
"L_board_note_INDEX" => $lang['board_note_index'],
"L_board_note_ALL" => $lang['board_note_all'],
"board_note_NONE" => $board_note_none,
"board_note_INDEX" => $board_note_index,
"board_note_ALL" => $board_note_all,
#
# ----- OPEN ----------------------------------------
#
/templates/subSilver/posting_notes.tpl
#
# ----- FIND ----------------------------------------
#
<th class="thHead" colspan="2" height="25"><b>{L_POST_A}</b></th>
#
# ----- REPLACE WITH ----------------------------------------
#
<th class="thHead" colspan="3" height="25"><b>{L_POST_A}</b></th>
#
# ----- FIND ----------------------------------------
#
<td class="row2" width="80%"> <span class="gen">
<input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{SUBJECT}" />
</span> </td>
#
# ----- REPLACE WITH ----------------------------------------
#
<td class="row2"><span class="gen">
<input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{SUBJECT}" />
</span></td>
<td class="row2" align="center"><span class="gen"><b>{L_POSTIT}: </b>
<input type="radio" name="postit" value="0" {board_note_NONE} />{L_board_note_NONE} <input type="radio" name="postit" value="1" {board_note_INDEX} />{L_board_note_INDEX} <input type="radio" name="postit" value="2" {board_note_ALL} />{L_board_note_ALL}</td>
#
# ----- FIND ----------------------------------------
#
</td>
<td class="row2" valign="top"><span class="gen"> <span class="genmed"> </span>
<table width="80%" border="0" cellspacing="0" cellpadding="2">
#
# ----- REPLACE WITH ----------------------------------------
#
</td>
<td class="row2" valign="top" colspan="2"><span class="gen"> <span class="genmed"> </span>
<table width="80%" border="0" cellspacing="0" cellpadding="2">
#
# ----- FIND ----------------------------------------
#
<td class="catBottom" colspan="2" align="center" height="28"> {S_HIDDEN_FORM_FIELDS}<input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="{L_SUBMIT}" /></td>
#
# ----- REPLACE WITH ----------------------------------------
#
<td class="catBottom" colspan="3" align="center" height="28"> {S_HIDDEN_FORM_FIELDS}<input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="{L_SUBMIT}" /></td>
#
# ----- OPEN ----------------------------------------
#
includes/page_header.php
#
# ----- FIND ----------------------------------------
#
if ( $board_config['board_note_enable'] <> 0 )
#
# ----- BEFORE ADD ----------------------------------------
#
$x = 250;
$y = 150;
$i = 0;
#
# ----- FIND ----------------------------------------
#
else
{
$board_note ='';
}
#
# ----- AFTER ADD ----------------------------------------
#
if ($i <> 1)
{
$sql = "SELECT * FROM " . NOTES_TABLE . "
WHERE poster_id = " . $userdata['user_id'] . "
AND postit = 2
ORDER BY post_time";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain notes/user information.", '', __LINE__, __FILE__, $sql);
}
while ($row = $db->sql_fetchrow($result))
{
$x = $x + 20;
$y = $y + 10;
$subject = $row['post_subject'];
$message = $row['post_text'];
$message = str_replace("\n", "\n<br />\n", $message);
$board_note = '<b>'.$subject.'</b><br />'.$message;
$template->assign_vars(array(
'board_note' => $board_note,
'x' => $x,
'y' => $y)
);
$template->assign_block_vars('switch_enable_board_note', array());
$i = 1;
}
}
#
# ----- FIND ----------------------------------------
#
$template->assign_vars(array(
'SITENAME' => $board_config['sitename'],
'board_note' => $board_note,
#
# ----- REPLACE WITH ----------------------------------------
#
$template->assign_vars(array(
'SITENAME' => $board_config['sitename'],
#
# ----- OPEN ----------------------------------------
#
templates/subSilver/overall_header.tpl
#
# ----- FIND ----------------------------------------
#
<div id="hano" style="left:600px;top:150px; background-color: #FFFF99;">
#
# ----- REPLACE WITH ----------------------------------------
#
<div id="hano" style="left:{x}px;top:{x}150px; background-color: #FFFF99;">
#
# That's all!!!
#
# No that's not all! The Mod isn't finish! On this point the last note ist displayed and can not closed. HELP!!!
#
# ----- EoM ----------------------------------------
Es kann mit diesem (unfertigen!) Mod halt jetzt eine persönliche Notiz als Post-It markiert werden. Fertig ist das für alle Seiten, so dachte ich. Und hier das Problem: Es erscheint die LETZTE Notiz und das auch auf dem Index. Und gerade da lässt sie sich nicht schliessen.
Jetzt bräuchte ich Eure Hilfe, denn hier geht es über meinen Wissenstand (gerade was Java anbelangt) hinaus.
Wäre Euch echt Dankbar.
OXPUS
PS @AWSW: Über den Titel des Add-Ons und die Beschreibung kann gerne noch verhandelt werden

Und sofern das jetzt nicht mehr hier reinpasst: Einfach verschieben...