| Zobrazit předchozí téma :: Zobrazit následující téma |
| Autor |
Zpráva |
Sandal Účastník

Založen: 7.7.2002 Příspěvky: 17
|
Zaslal: 01 únor 2003 15:08 Předmět: Save obsahu topicu |
|
|
Někde jsem to zahlídl na nějakém foru, ale už nevím kde. Jde o to, že by se mi hodil hack na uložení všech zpráv v daném topicu (Save to HDD) do txt souboru. Hledal jsem ale nenašel.
Nevíte někdo kde by se to dalo sehnat? Díky |
|
| Návrat nahoru |
|
 |
Bubli Nováček

Založen: 19.7.2003 Příspěvky: 5
|
Zaslal: 25 červenec 2003 00:41 Předmět: Re: Save obsahu topicu |
|
|
| by mě taky zajmalo... |
|
| Návrat nahoru |
|
 |
salik Člen týmu

Založen: 14.7.2002 Příspěvky: 171
|
|
| Návrat nahoru |
|
 |
nikilauda Účastník


Založen: 1.2.2003 Příspěvky: 21 Bydliště: non-Prague
|
Zaslal: 26 červenec 2003 09:55 Předmět: Re: Save obsahu topicu |
|
|
Nejsem autorem a PHP prakticky neumím.
Soubor ./export.php :
[php:1:224e692163]
<?php
/***************************************************************************
* export.php
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
//
// Start initial var setup
//
if ( isset($HTTP_GET_VARS[POST_TOPIC_URL]) )
{
$topic_id = intval($HTTP_GET_VARS[POST_TOPIC_URL]);
}
else if ( isset($HTTP_GET_VARS['topic']) )
{
$topic_id = intval($HTTP_GET_VARS['topic']);
}
if ( isset($HTTP_GET_VARS[POST_POST_URL]))
{
$post_id = intval($HTTP_GET_VARS[POST_POST_URL]);
}
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
if ( !isset($topic_id) && !isset($post_id) )
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
//
// This rather complex gaggle of code handles querying for topics but
// also allows for direct linking to a post (and the calculation of which
// page the post is on and the correct display of viewtopic)
//
$join_sql_table = ( !isset($post_id) ) ? '' : ", " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2 ";
$join_sql = ( !isset($post_id) ) ? "t.topic_id = $topic_id" : "p.post_id = $post_id AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_id <= $post_id";
$count_sql = ( !isset($post_id) ) ? '' : ", COUNT(p2.post_id) AS prev_posts";
$order_sql = ( !isset($post_id) ) ? '' : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, f.forum_name, f.f
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_re
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $join_sql_table . "
WHERE $join_sql
AND f.forum_id = t.forum_id
$order_sql";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain topic information", '', __LINE__, __FILE__, $sql);
}
if ( !($forum_row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
$forum_id = $forum_row['forum_id'];
//
// Start session management
//
$userdata = session_pagestart($user_ip, $forum_id);
init_userprefs($userdata);
//
// End session management
//
//
// Start auth check
//
$is_auth = array();
$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_row);
if( !$is_auth['auth_view'] || !$is_auth['auth_read'] )
{
if ( !$userdata['session_logged_in'] )
{
$redirect = ( isset($post_id) ) ? POST_POST_URL . "=$post_id" : POST_TOPIC_URL . "=$topic_id";
$redirect .= ( isset($start) ) ? "&start=$start" : '';
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=viewtopic.$phpEx&$redirect", true));
}
$message = ( !$is_auth['auth_view'] ) ? $lang['Topic_post_not_exist'] : sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']);
message_die(GENERAL_MESSAGE, $message);
}
//
// End auth check
//
[/php:1:224e692163]
Upravit ./templates/SubSilver/viewtopic_body.tpl, tzn. za :
[php:1:224e692163]
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><br />
<span class="gensmall"><b>{PAGINATION}</b><br />
</span></td>
</tr>
</table>
[/php:1:224e692163]
Vložit :
[php:1:224e692163]
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td align="left" valign="bottom" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a> <a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a> <a href="{U_POST_EXPORT_TOPIC}"><img src="templates/subSilver/images/lang_czech/icon_export.gif" border="0" alt="Exportovat toto tima do TXT souboru" align="middle" /></a></span></td>
<td align="left" valign="middle" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a>
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
</tr>
</table>
[/php:1:224e692163]
A za :
[php:1:224e692163]
<tr align="center">
<td class="catBottom" colspan="2" height="28"><table cellspacing="0" cellpadding="0" border="0">
<tr><form method="post" action="{S_POST_DAYS_ACTION}">
<td align="center"><span class="gensmall">{L_DISPLAY_POSTS}: {S_SELECT_POST_DAYS} {S_SELECT_POST_ORDER} <input type="submit" value="{L_GO}" class="lit
</form></tr>M
</table></td>
</tr>
</table>
[/php:1:224e692163]
Vložit :
[php:1:224e692163]
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a> <a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a> <a href="{U_POST_EXPORT_TOPIC}"><img src="templates/subSilver/images/lang_czech/icon_export.gif" border="0" alt="Exportovat toto tima do TXT souboru" align="middle" /></span></td>
<td align="left" valign="middle" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a>
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
<td align="right" valign="top" nowrap="nowrap"><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span>
</td>
</tr>
</table>
[/php:1:224e692163]
V souboru ./viewtopic.php Za :
[php:1:224e692163]
$new_topic_url = append_sid("posting.$phpEx?mode=newtopic&" . POST_FORUM_URL . "=$forum_id");
$reply_topic_url = append_sid("posting.$phpEx?mode=reply&" . POST_TOPIC_URL . "=$topic_id");
[/php:1:224e692163]
Vložit :
[php:1:224e692163]
$export_topic_url = append_sid("export.$phpEx?mode=txt&" . POST_TOPIC_URL . "=$topic_id");
[/php:1:224e692163]
Za
[php:1:224e692163]
'S_TOPIC_LINK' => POST_TOPIC_URL,
'S_SELECT_POST_DAYS' => $select_post_days,
'S_SELECT_POST_ORDER' => $select_post_order,
'S_POST_DAYS_ACTION' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $topic_id . "&start=$start"),
'S_AUTH_LIST' => $s_auth_can,
'S_TOPIC_ADMIN' => $topic_mod,
'S_WATCH_TOPIC' => $s_watching_topic,
'S_WATCH_TOPIC_IMG' => $s_watching_topic_img
[/php:1:224e692163]
Vložit :
[php:1:224e692163]
'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&highlight=$highlight"),
'U_VIEW_FORUM' => $view_forum_url,
'U_VIEW_OLDER_TOPIC' => $view_prev_topic_url,
'U_VIEW_NEWER_TOPIC' => $view_next_topic_url,
'U_POST_NEW_TOPIC' => $new_topic_url,
'U_POST_EXPORT_TOPIC' => $export_topic_url,
'U_POST_REPLY_TOPIC' => $reply_topic_url)
[/php:1:224e692163]
Obrázek si můžete stáhnout zde : http://dp2forum.k2.cz/templates/subSilver/images/lang_czech/icon_export.gif
Mno a to by mělo být vše. Děkuji autoru za poskytnutí úpravy  |
|
| Návrat nahoru |
|
 |
Juliooo Účastník


Založen: 5.7.2003 Příspěvky: 25 Bydliště: KE, Slovensko
|
Zaslal: 27 červenec 2003 17:21 Předmět: Re: Save obsahu topicu |
|
|
Funguje to??? _________________ http://board.acorn.sk |
|
| Návrat nahoru |
|
 |
salik Člen týmu

Založen: 14.7.2002 Příspěvky: 171
|
Zaslal: 29 červenec 2003 21:53 Předmět: Re: Save obsahu topicu |
|
|
hm, u autora to funguje dobre (http://dp2forum.k2.cz/index.php), ale na locale som to nerozbehol, bud som spravil chybu, alebo to nie je komplet 
Naposledy upravil salik dne 23 říjen 2003 22:15, celkově upraveno 1 krát. |
|
| Návrat nahoru |
|
 |
Juliooo Účastník


Založen: 5.7.2003 Příspěvky: 25 Bydliště: KE, Slovensko
|
Zaslal: 30 červenec 2003 13:40 Předmět: Re: Save obsahu topicu |
|
|
Tak sa jednoducho skús opýtať tvorcu... Nie? Alebo odkiaľ to on zohnal... _________________ http://board.acorn.sk |
|
| Návrat nahoru |
|
 |
qik-qak Přispěvatel

Založen: 9.2.2003 Příspěvky: 58
|
Zaslal: 31 červenec 2003 09:46 Předmět: Re: Save obsahu topicu |
|
|
nefunguje to.
Je to přesný postup úprav? zdá se mi že ne.
V horním začíná
<?php
ale dole není uzavřeno...
pak tohle
'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=$start&amp;postdays=$post_days&amp;postorder=$post_order&amp;highlight=$highlight"),
'U_VIEW_FORUM' => $view_forum_url,
'U_VIEW_OLDER_TOPIC' => $view_prev_topic_url,
'U_VIEW_NEWER_TOPIC' => $view_next_topic_url,
'U_POST_NEW_TOPIC' => $new_topic_url,
'U_POST_EXPORT_TOPIC' => $export_topic_url,
'U_POST_REPLY_TOPIC' => $reply_topic_url)
nemělo by být jen ?
'U_POST_EXPORT_TOPIC' => $export_topic_url, |
|
| Návrat nahoru |
|
 |
nikilauda Účastník


Založen: 1.2.2003 Příspěvky: 21 Bydliště: non-Prague
|
Zaslal: 31 červenec 2003 11:16 Předmět: Re: Save obsahu topicu |
|
|
Podivam se na to jeste jednou. a dam sem opravu. Nejdrive to ale bude mozne az v sobotu.
Jak jsem uz psal, v php neprogramuji, takze chyby byly a budou mozne. |
|
| Návrat nahoru |
|
 |
salik Člen týmu

Založen: 14.7.2002 Příspěvky: 171
|
Zaslal: 31 červenec 2003 20:34 Předmět: Re: Save obsahu topicu |
|
|
....co sa tyka uprav v viewtopic_body.tpl a viewtopic.php - tam je navod uplne zly, vznika tam duplicita, ale tam sa to "uprace" jednoducho, v subore export.php dava chybu uz v riadku 41, tam je to "horsie"
Naposledy upravil salik dne 23 říjen 2003 22:15, celkově upraveno 1 krát. |
|
| Návrat nahoru |
|
 |
nikilauda Účastník


Založen: 1.2.2003 Příspěvky: 21 Bydliště: non-Prague
|
Zaslal: 01 srpen 2003 18:43 Předmět: Re: Save obsahu topicu |
|
|
Takže znovu, lépe a radostněji.
[ php ] [ /php ] Kazi kod, resp. nezobrazuje presne to co je mezi tim.
Napr.
[php:1:dd35f072a0] $export_topic_url = append_sid("export.$phpEx?mode=txt&" . POST_TOPIC_URL . "=$topic_id"); [/php:1:dd35f072a0]
Spravne :
| kód: | | $export_topic_url = append_sid("export.$phpEx?mode=txt&" . POST_TOPIC_URL . "=$topic_id"); |
Pro ty, kteří jsou php pozitivní :
*****
export.php soubor nahrajte do root PHPBB.
Aby to zacalo fungovat, musi se upravit templaty - pridat tam jedno tlacitko, ktere bude volat export.php s pametrem t=cislo_topicu, napr. export.php?t=505. Dale je tam jeste rozlisovani vystupniho formatu (txt,html,xml ...), ale to ponekud nehotove.
Takze ted se vola export i s promennou mode, ale ta se nevyuziva (export.php?mode=txt&t=505)
******
Vložíme soubor ./export.php
| kód: |
<?php
/***************************************************************************
* export.php
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
//
// Start initial var setup
//
if ( isset($HTTP_GET_VARS[POST_TOPIC_URL]) )
{
$topic_id = intval($HTTP_GET_VARS[POST_TOPIC_URL]);
}
else if ( isset($HTTP_GET_VARS['topic']) )
{
$topic_id = intval($HTTP_GET_VARS['topic']);
}
if ( isset($HTTP_GET_VARS[POST_POST_URL]))
{
$post_id = intval($HTTP_GET_VARS[POST_POST_URL]);
}
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
if ( !isset($topic_id) && !isset($post_id) )
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
//
// This rather complex gaggle of code handles querying for topics but
// also allows for direct linking to a post (and the calculation of which
// page the post is on and the correct display of viewtopic)
//
$join_sql_table = ( !isset($post_id) ) ? '' : ", " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2 ";
$join_sql = ( !isset($post_id) ) ? "t.topic_id = $topic_id" : "p.post_id = $post_id AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_id <= $post_id";
$count_sql = ( !isset($post_id) ) ? '' : ", COUNT(p2.post_id) AS prev_posts";
$order_sql = ( !isset($post_id) ) ? '' : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, 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 ORDER BY p.post_id ASC";
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, 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";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain topic information", '', __LINE__, __FILE__, $sql);
}
if ( !($forum_row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
$forum_id = $forum_row['forum_id'];
//
// Start session management
//
$userdata = session_pagestart($user_ip, $forum_id);
init_userprefs($userdata);
//
// End session management
//
//
// Start auth check
//
$is_auth = array();
$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_row);
if( !$is_auth['auth_view'] || !$is_auth['auth_read'] )
{
if ( !$userdata['session_logged_in'] )
{
$redirect = ( isset($post_id) ) ? POST_POST_URL . "=$post_id" : POST_TOPIC_URL . "=$topic_id";
$redirect .= ( isset($start) ) ? "&start=$start" : '';
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=viewtopic.$phpEx&$redirect", true));
}
$message = ( !$is_auth['auth_view'] ) ? $lang['Topic_post_not_exist'] : sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']);
message_die(GENERAL_MESSAGE, $message);
}
//
// End auth check
//
$forum_name = $forum_row['forum_name'];
$topic_title = $forum_row['topic_title'];
$topic_id = $forum_row['topic_id'];
$topic_time = $forum_row['topic_time'];
if ( !empty($post_id) )
{
$start = floor(($forum_row['prev_posts'] - 1) / $board_config['posts_per_page']) * $board_config['posts_per_page'];
}
// Decide how to order the post display
//
if ( !empty($HTTP_POST_VARS['postorder']) || !empty($HTTP_GET_VARS['postorder']) )
{
$post_order = (!empty($HTTP_POST_VARS['postorder'])) ? $HTTP_POST_VARS['postorder'] : $HTTP_GET_VARS['postorder'];
$post_time_order = ($post_order == "asc") ? "ASC" : "DESC";
}
else
{
$post_order = 'asc';
$post_time_order = 'ASC';
}
$select_post_order = '<select name="postorder">';
if ( $post_time_order == 'ASC' )
{
$select_post_order .= '<option value="asc" selected="selected">' . $lang['Oldest_First'] . '</option><option value="desc">' . $lang['Newest_First'] . '</option>';
}
else
{
$select_post_order .= '<option value="asc">' . $lang['Oldest_First'] . '</option><option value="desc" selected="selected">' . $lang['Newest_First'] . '</option>';
}
$select_post_order .= '</select>';
//
// Hlavicka
//
$soubor = "Forum:\t$forum_name\r\n";
$soubor .= "Téma:\t$topic_title\r\n";
for ($c=0; $c < strlen ($topic_title);$c++) $soubor .= "-";
$soubor .= "--------\r\n";
//
// END
//
//
// Go ahead and pull all data for this topic
//
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
WHERE p.topic_id = $topic_id
$limit_posts_time
AND pt.post_id = p.post_id
AND u.user_id = p.poster_id
ORDER BY p.post_time $post_time_order";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain post/user information.", '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$postrow = array();
do
{
$postrow[] = $row;
}
while ( $row = $db->sql_fetchrow($result) );
$db->sql_freeresult($result);
$total_posts = count($postrow);
}
else
{
message_die(GENERAL_MESSAGE, $lang['No_posts_topic']);
}
$sql = "SELECT *
FROM " . RANKS_TABLE . "
ORDER BY rank_special, rank_min";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain ranks information.", '', __LINE__, __FILE__, $sql);
}
$ranksrow = array();
while ( $row = $db->sql_fetchrow($result) )
{
$ranksrow[] = $row;
}
$db->sql_freeresult($result);
for($i = 0; $i < $total_posts; $i++) {
$poster_id = $postrow[$i]['user_id'];
$poster = ( $poster_id == ANONYMOUS ) ? $lang['Guest'] : $postrow[$i]['username'];
$post_date = create_date($board_config['default_dateformat'], $postrow[$i]['post_time'], $board_config['board_timezone']);
$poster_posts = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Posts'] . ': ' . $postrow[$i]['user_posts'] : '';
$poster_from = ( $postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Location'] . ': ' . $postrow[$i]['user_from'] : '';
$poster_joined = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Joined'] . ': ' . create_date($lang['DATE_FORMAT'], $postrow[$i]['user_regdate'], $board_config['board_timezone']) : '';
//
// Handle anon users posting with usernames
//
if ( $poster_id == ANONYMOUS && $postrow[$i]['post_username'] != '' )
{
$poster = $postrow[$i]['post_username'];
$poster_rank = $lang['Guest'];
}
$temp_url = '';
$post_subject = ( $postrow[$i]['post_subject'] != '' ) ? $postrow[$i]['post_subject'] : '';
$message = $postrow[$i]['post_text'];
$bbcode_uid = $postrow[$i]['bbcode_uid'];
$user_sig = ( $postrow[$i]['enable_sig'] && $postrow[$i]['user_sig'] != '' && $board_config['allow_sig'] ) ? $postrow[$i]['user_sig'] : '';
$user_sig_bbcode_uid = $postrow[$i]['user_sig_bbcode_uid'];
//
// Parse message and/or sig for BBCode if reqd
//
if ( $board_config['allow_bbcode'] )
{
if ( $user_sig != '' && $user_sig_bbcode_uid != '' )
{
$user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $user_sig);
}
if ( $bbcode_uid != '' )
{
$message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
}
}
if ( $user_sig != '' && $board_config['allow_sig'] )
{
$user_sig = make_clickable($user_sig);
}
$message = make_clickable($message);
$message = strip_tags($message);
$message = str_replace(" ", "", $message);
$message = str_replace("\t", "", $message);
$message = str_replace("\r\n\r\n", "\r\n", $message);
$message = str_replace("\r\r \r", "", $message);
$message = str_replace("\r\r", "", $message);
$soubor .= "\r\n$poster:\r\n";
$soubor .= "$message\r\n";
}
$attachment = (strstr($HTTP_USER_AGENT, "MSIE")) ? "" : " attachment"; // IE 5.5 fix.
header("Cache-control: private"); // another fix for IE
header("Content-Type: application/octet-stream");
header("Content-Length: ".strlen($soubor));
header("Content-Disposition: attachment; filename=$topic_title."."txt");
echo $soubor;
|
Úprava ./viewtopic.php
Za
| kód: |
//
// Post, reply and other URL generation for
// templating vars
//
$new_topic_url = append_sid("posting.$phpEx?mode=newtopic&" . POST_FORUM_URL . "=$forum_id");
$reply_topic_url = append_sid("posting.$phpEx?mode=reply&" . POST_TOPIC_URL . "=$topic_id");
|
Vložit :
| kód: |
$export_topic_url = append_sid("export.$phpEx?mode=txt&" . POST_TOPIC_URL . "=$topic_id");
|
Za :
| kód: |
'S_TOPIC_LINK' => POST_TOPIC_URL,
'S_SELECT_POST_DAYS' => $select_post_days,
'S_SELECT_POST_ORDER' => $select_post_order,
'S_POST_DAYS_ACTION' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $topic_id . "&start=$start"),
'S_AUTH_LIST' => $s_auth_can,
'S_TOPIC_ADMIN' => $topic_mod,
'S_WATCH_TOPIC' => $s_watching_topic,
'S_WATCH_TOPIC_IMG' => $s_watching_topic_img,
'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&highlight=$highlight"),
'U_VIEW_FORUM' => $view_forum_url,
'U_VIEW_OLDER_TOPIC' => $view_prev_topic_url,
'U_VIEW_NEWER_TOPIC' => $view_next_topic_url,
'U_POST_NEW_TOPIC' => $new_topic_url,
|
Vložit :
| kód: |
'U_POST_EXPORT_TOPIC' => $export_topic_url,
|
Soubor ./templates/subSilver/viewtopic_body.tpl
Za
| kód: |
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><br />
<span class="gensmall"><b>{PAGINATION}</b><br />
</span></td>
</tr>
</table>
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr>
|
Nahradíme řádek
| kód: |
<td align="left" valign="bottom" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a> <a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td>
|
Tímto řádkem :
| kód: |
<td align="left" valign="bottom" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a> <a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a> <a href="{U_POST_EXPORT_TOPIC}"><img src="templates/subSilver/images/lang_czech/icon_export.gif" border="0" alt="Exportovat toto téma do TXT souboru" align="middle" /></a></span></td>
|
Za :
| kód: | <tr align="center">
<td class="catBottom" colspan="2" height="28"><table cellspacing="0" cellpadding="0" border="0">
<tr><form method="post" action="{S_POST_DAYS_ACTION}">
<td align="center"><span class="gensmall">{L_DISPLAY_POSTS}: {S_SELECT_POST_DAYS} {S_SELECT_POST_ORDER} <input type="submit" value="{L_GO}" class="liteoption" name="submit" /></span></td>
</form></tr>
</table></td>
</tr>
</table>
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
|
Nahradíme řádek :
| kód: | <td align="left" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a> <a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td>
|
Řádkem :
| kód: |
<td align="left" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a> <a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a> <a href="{U_POST_EXPORT_TOPIC}"><img src="templates/subSilver/images/lang_czech/icon_export.gif" border="0" alt="Exportovat toto téma do TXT souboru" align="middle" /></span></td>
|
Úpravy jsem zkoušel na 2.0.5 a jsou funkční. Proč není uzavřen tag <?php> v export.php nevím.
Obrázek si můžete stáhnout zde : http://dp2forum.k2.cz/templates/subSilver/images/lang_czech/icon_export.gif
Naposledy upravil nikilauda dne 12 srpen 2003 10:46, celkově upraveno 3 krát. |
|
| Návrat nahoru |
|
 |
Anonymní
|
Zaslal: 04 srpen 2003 21:57 Předmět: Re: Save obsahu topicu |
|
|
to uz funguje vyborne, dakujem nikilauda  |
|
| Návrat nahoru |
|
 |
qik-qak Přispěvatel

Založen: 9.2.2003 Příspěvky: 58
|
Zaslal: 08 srpen 2003 18:49 Předmět: Re: Save obsahu topicu |
|
|
chyby:
Warning: Cannot modify header information - headers already sent by (output started at /home/metro/www/diskuze/export.php:2) in /home/metro/www/diskuze/export.php on line 268
Warning: Cannot modify header information - headers already sent by (output started at /home/metro/www/diskuze/export.php:2) in /home/metro/www/diskuze/export.php on line 269
Warning: Cannot modify header information - headers already sent by (output started at /home/metro/www/diskuze/export.php:2) in /home/metro/www/diskuze/export.php on line 270
Warning: Cannot modify header information - headers already sent by (output started at /home/metro/www/diskuze/export.php:2) |
|
| Návrat nahoru |
|
 |
salik Člen týmu

Založen: 14.7.2002 Příspěvky: 171
|
Zaslal: 08 srpen 2003 23:04 Předmět: Re: Save obsahu topicu |
|
|
funguje to dobre, este odporucam pridat ficurku na tlac , "hodi" sa tam

Naposledy upravil salik dne 23 říjen 2003 22:15, celkově upraveno 1 krát. |
|
| Návrat nahoru |
|
 |
Webhosting C4 - 2 GB, PHP, MySQL, administrační systém, 1.200 Kč na rok s doménou v ceně. Srubové domy, dřevostavby a víkendové sruby.
Bezproblémová instalace phpBB, Joomla, Drupal. Návody pro C4 - užitečné rady pro zákazníky. Nafukovací balonky s potiskem.
Výhodné sázkové kanceláře. značkové oblečení z USA, luxusní kabelky a také peněženky nabízí eshop usaboutique.cz.
Apartment in Prague - accommodation in Prag, prague apartments, luxusní anglické dýmky a kvalitní doutníky, značkové spodní prádlo a podprsenky
|  |
nikilauda Účastník


Založen: 1.2.2003 Příspěvky: 21 Bydliště: non-Prague
|
Zaslal: 12 srpen 2003 11:53 Předmět: Re: Save obsahu topicu |
|
|
Stejný postup je i u phpBB 2.0.6
V Zaslal: pá 01 srpen, 2003 jsem opravil chyby v postupu a přidal odkaz na ikonku. |
|
| Návrat nahoru |
|
 |
Anonymní
|
Zaslal: 25 červenec 2004 23:46 Předmět: Re: Save obsahu topicu |
|
|
| Jen tak mimochodem zrovna tenhle mod by se tady na foru podle me hodil.. |
|
| Návrat nahoru |
|
 |
Frost Nováček


Založen: 24.7.2004 Příspěvky: 14
|
Zaslal: 26 červenec 2004 00:10 Předmět: Re: Save obsahu topicu |
|
|
| Anonymous napsal: | | Jen tak mimochodem zrovna tenhle mod by se tady na foru podle me hodil.. | Hups ja nebyl prihlasenej.. ten anonym sem byl ja.. |
|
| Návrat nahoru |
|
 |
|
|
|
|
Nemůžete odesílat nové téma do tohoto fóra. Nemůžete odpovídat na témata v tomto fóru. Nemůžete upravovat své příspěvky v tomto fóru. Nemůžete mazat své příspěvky v tomto fóru. Nemůžete hlasovat v tomto fóru. Nemůžete připojovat soubory k příspěvkům Nemůžete stahovat ani prohlížet přiložené soubory
|
Powered by phpBB & phpBB SEO © 2001, 2005 phpBB Group Český překlad phpBB Czech - www.phpbbcz.com Optimalizoval JanoF - PCforum.sk
|