4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: dosensteck on November 06, 2007, 09:33:46 PM
-
I need a quote function for Comments.
Original posted by xxxx
Text
Found no Mods :(
-
@dosensteck,
... das solltest du in v@nos MOD für den erweiterten BB-Code finden ...
... ich denke hier ... http://www.4homepages.de/forum/index.php?topic=4745.msg20105#msg20105 ...
-
Danke für den Tipp - quote funktion funktioniert bei den kommentaren schon
ich meinte eher das man auf ein kommentar klickt (Quote Button) und das dann im Textfeld innerhalb der [ quote] tags der Kommentar steht
Wie gesagt, gefunden habe ich leider nichts.
-
vielleicht so:
:arrow: finde in der details.php:
"admin_links" => $admin_links
ersetze mit:
"admin_links" => $admin_links,
"comment_quote" => "<a href=\"".$site_sess->url($self_url.""e=".$comment_row[$i]['comment_id'])."#commentform\">[Zitat]</a> "
:arrow: dann finde:
$site_template->register_vars(array(
"bbcode" => $bbcode,
füge davor dieses ein:
$comment_quote_id = (isset($HTTP_GET_VARS['quote'])) ? $HTTP_GET_VARS['quote'] : $HTTP_POST_VARS['quote'];
if (intval($comment_quote_id)) {
$sql = "SELECT c.comment_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text
FROM ".COMMENTS_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
WHERE c.comment_id = $comment_quote_id";
$result = $site_db->query_firstrow($sql);
$comment_text = (isset($HTTP_POST_VARS['message']) && $error) ? stripslashes(trim($HTTP_POST_VARS['message'])) : "";
$comment_headline = (isset($HTTP_POST_VARS['subject']) && $error) ? stripslashes(trim($HTTP_POST_VARS['subject'])) : "";
if ($result['comment_text']) {
$comment_text .= "[quote=".$result['comment_user_name']."]".$result['comment_text']."[/quote]";
}
if ($result['comment_headline']) {
$comment_headline .= "RE: ".$result['comment_headline'];
}
}
$user_name = (isset($HTTP_POST_VARS['username']) && $error) ? stripslashes(htmlspecialchars(trim($HTTP_POST_VARS['username']))) : (($user_info['user_level'] != GUEST) ? htmlspecialchars($user_info['user_name']) : "");
// $comment_headline = (isset($HTTP_POST_VARS['subject']) && $error) ? stripslashes(htmlspecialchars(trim($HTTP_POST_VARS['subject']))) : "";
:arrow: dann in deiner comment_bit.html füge irgendwo das ein:
{comment_quote}
das war alles.. sollte es so sein?
-
wahnsinn - perfekt!
Tausend dank.
Ich hab bei mir nur die [quote= funktion rausgenommen. Hab die Integration mit phpbb installiert und da schreibt er bei der user_name spalte nichts in den comment table.
Hab mich jetzt zwar ein wenig mit der abfrage gespielt und versucht irgendwie den username aus der usertabele zu bekommen... hat aber nicht funktioniert...
-
Change:
$comment_quote_id = (isset($HTTP_GET_VARS['quote'])) ? $HTTP_GET_VARS['quote'] : $HTTP_POST_VARS['quote'];
for:
$comment_quote_id = (isset($HTTP_GET_VARS['quote'])) ? intval(trim($HTTP_GET_VARS['quote'])) : intval(trim($HTTP_POST_VARS['quote']));
change:
$comment_text = (isset($HTTP_POST_VARS['message']) && $error) ? stripslashes(trim($HTTP_POST_VARS['message'])) : "";
$comment_headline = (isset($HTTP_POST_VARS['subject']) && $error) ? stripslashes(trim($HTTP_POST_VARS['subject'])) : "";
for:
$comment_text = (isset($HTTP_POST_VARS['message']) && $error) ? un_htmlspecialchars(trim((string)$HTTP_POST_VARS['message'])) : "";
$comment_headline = (isset($HTTP_POST_VARS['subject']) && $error) ? un_htmlspecialchars(trim((string)$HTTP_POST_VARS['subject'])) : "";
Change:
".$result['comment_user_name']."
for:
".format_text(trim($result['comment_user_name']), 2)."
Change:
".$result['comment_text']."
for:
".format_text(trim($result['comment_text']), 1, 0, 1)."
Change:
$comment_headline .= "RE: ".$result['comment_headline'];
for:
$comment_headline .= "RE: ".format_text(trim($result['comment_headline']), 2);
Change:
$user_name = (isset($HTTP_POST_VARS['username']) && $error) ? format_text(stripslashes(trim($HTTP_POST_VARS['username']), 2)) : (($user_info['user_level'] != GUEST) ? format_text(trim($user_info['user_name']), 2) : "");
// $comment_headline = (isset($HTTP_POST_VARS['subject']) && $error) ? stripslashes(htmlspecialchars(trim($HTTP_POST_VARS['subject']))) : "";
for:
$user_name = (isset($HTTP_POST_VARS['username']) && $error) ? un_htmlspecialchars(trim((string)$HTTP_POST_VARS['username'])) : (($user_info['user_level'] != GUEST) ? format_text(trim($user_info['user_name']), 2) : "");
$user_name = preg_replace("/[^a-z0-9_-]+/i", "", $user_name);
$user_name = (isset($HTTP_POST_VARS['username']) && !empty($HTTP_POST_VARS['username']) && isset($user_name) && !empty($user_name)) ? format_text(trim($user_name), 2) : "";
// $comment_headline = (isset($HTTP_POST_VARS['subject']) && $error) ? un_htmlspecialchars(trim((string)$HTTP_POST_VARS['subject'])) : "";
-
@thunderstrike: much <br> in quote tag and no username...
thx for try
-
<br> ? ... I no set code for BR in my post ...
If no user name, what is version of 4images use ?
-
result with your code:
[quote=]
<br>text
<br>text
<br>text
<br>text
<br>text
[/quote]
version is 1.7.3 with posted bug fixes
i have installed the integration with phpbb - in my comments_table the comment_user_name is empty. I only have usernames in phpbb_users table.
-
Ohh ok so if no need BR for this -
change:
".format_text(trim($result['comment_text']), 1, 0, 1)."
for:
".format_text($result['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments'])."