Author Topic: Request: Quote Comments  (Read 8319 times)

0 Members and 1 Guest are viewing this topic.

Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Request: Quote Comments
« on: November 06, 2007, 09:33:46 PM »
I need a quote function for Comments.

Quote
Original posted by xxxx
Text

Found no Mods :(



Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Request: Quote Comments
« Reply #1 on: November 06, 2007, 10:01:47 PM »
@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 ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: Request: Quote Comments
« Reply #2 on: November 07, 2007, 07:38:49 PM »
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.

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: Request: Quote Comments
« Reply #3 on: November 08, 2007, 09:24:03 AM »
vielleicht so:
 :arrow: finde in der details.php:
Code: [Select]
"admin_links" => $admin_links
ersetze mit:
Code: [Select]
"admin_links" => $admin_links,
        "comment_quote" => "<a href=\"".$site_sess->url($self_url."&quote=".$comment_row[$i]['comment_id'])."#commentform\">[Zitat]</a>&nbsp;"

 :arrow: dann finde:
Code: [Select]
    $site_template->register_vars(array(
      "bbcode" => $bbcode,

füge davor dieses ein:
Code: [Select]
$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:
Code: [Select]
{comment_quote}
das war alles.. sollte es so sein?

Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: Request: Quote Comments
« Reply #4 on: November 08, 2007, 06:53:01 PM »
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...

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Request: Quote Comments
« Reply #5 on: November 08, 2007, 07:08:49 PM »
Change:

Quote
$comment_quote_id = (isset($HTTP_GET_VARS['quote'])) ? $HTTP_GET_VARS['quote'] : $HTTP_POST_VARS['quote'];

for:

Code: [Select]
$comment_quote_id = (isset($HTTP_GET_VARS['quote'])) ? intval(trim($HTTP_GET_VARS['quote'])) : intval(trim($HTTP_POST_VARS['quote']));

change:

Quote
$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:

Code: [Select]
$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:

Quote
".$result['comment_user_name']."

for:

Code: [Select]
".format_text(trim($result['comment_user_name']), 2)."

Change:

Quote
".$result['comment_text']."

for:

Code: [Select]
".format_text(trim($result['comment_text']), 1, 0, 1)."

Change:

Quote
$comment_headline .= "RE: ".$result['comment_headline'];

for:

Code: [Select]
$comment_headline .= "RE: ".format_text(trim($result['comment_headline']), 2);

Change:

Quote
$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:

Code: [Select]
$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'])) : "";
« Last Edit: August 27, 2011, 02:33:51 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: Request: Quote Comments
« Reply #6 on: November 09, 2007, 01:22:42 AM »
@thunderstrike: much <br> in quote tag and no username...

thx for try

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Request: Quote Comments
« Reply #7 on: November 09, 2007, 01:24:23 AM »
<br> ? ... I no set code for BR in my post ...
If no user name, what is version of 4images use ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: Request: Quote Comments
« Reply #8 on: November 09, 2007, 01:42:03 PM »
result with your code:
Code: [Select]
[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.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Request: Quote Comments
« Reply #9 on: November 09, 2007, 01:47:47 PM »
Ohh ok so if no need BR for this -

change:

Quote
".format_text(trim($result['comment_text']), 1, 0, 1)."

for:

Code: [Select]
".format_text($result['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments'])."
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?