Skip to content

class Comment

Oliver edited this page Apr 26, 2020 · 3 revisions

www/includes/forum.inc.php


Comment

In dieser Klasse befinden sich alle Funktionen zum Commenting-System

Package

zorg\Forum

author

  • [z]biko

version

  • 1.0

Overview

Public Properties

No public properties found

Constants

No constants found

Public Methods

compile_template() | formatPost() | getBoardlink() | getChildPostsFormFields() | getHTMLadditional() deprecated | getLink() | getLinkComment() | getLinkThread() | getNumChildposts() | getParentid() | getRecordset() | getSummary() | getThreadid() | getTitle() | highliteKeyword() | isThread() | markasread() | markasunread() | post() | update() |

Methods

compile_template()

Kompiliert ein Comment als Smarty-Template Resource

public compile_template(int $thread_id, int $comment_id, string $board = 'f') : bool static

See also

Tags
  • author: [z]biko
  • version: 2.0
  • since: 1.0 method added
  • since: 2.0 05.11.2018 method ehnaced with code & query optimizations
  • global: object $db Globales Class-Object mit allen MySQL-Methoden
  • global: object $smarty Globales Class-Object mit allen Smarty-Methoden

formatPost()

Macht Textformatierungen fürs Forum

public formatPost(string $text) : string static

Tags
  • author: [z]biko
  • version: 1.0
  • since: 1.0 method added
  • global: object $user Globales Class-Object mit den User-Methoden & Variablen

getBoardlink()

Get link for a Board

public getBoardlink(string $board) : object static

Tags
  • author: [z]biko
  • version: 1.0
  • since: 1.0 method added

getChildPostsFormFields()

public getChildPostsFormFields(mixed $id, mixed $parent_id, mixed $comment_id, mixed $depth) : mixed static

getHTMLadditional()

HTML der "Additional Posts" Teile

public getHTMLadditional(object $rs, array $himages) : string deprecated see smartyresource_comments_get_childposts()??? (26.10.2018)static

Tags
  • author: [z]biko
  • version: 1.0
  • since: 1.0 method added

getLink()

Link to a Comment

public getLink(string $board, int $parent_id, int $comment_id, int $thread_id) : string static

See also

Tags
  • author: [z]biko
  • author: IneX
  • version: 2.0
  • since: 1.0 method added
  • since: 2.0 26.10.2018 added $addUrlParameters to make Link work with routes (e.g. /thread/23/?parent_id=5 vs. /gallery.php?show=pic&picID=23)

getLinkComment()

Get link for a Comment

public getLinkComment(int $comment_id) : string static

Tags
  • author: [z]biko
  • version: 1.0
  • since: 1.0 method added

getLinkThread()

Link to a Thread

public getLinkThread(mixed $board, mixed $thread_id, string $output_html = true) : string static

Tags
  • author: [z]biko
  • author: IneX
  • version: 2.0
  • since: 1.0 method added
  • since: 2.0 26.10.2018 added $output_html-Parameter & return only for Thread-URL

getNumChildposts()

Anzahl Kinder-Objekte zu beliebigem Post ermitteln

public getNumChildposts(string $board, int $comment_id) : int static

Tags
  • author: [z]biko
  • version: 1.0
  • since: 1.0 method added
  • FIXME: switch Reihenfolge der params (so wie sonst auch überall): $board <--> $comment_id
  • global: object $db Globales Class-Object mit allen MySQL-Methoden
  • global: object $user Globales Class-Object mit den User-Methoden & Variablen

getParentid()

Get a Comment's Parent-Comment-ID

public getParentid(int $comment_id, int $height = null) : int static

Tags
  • author: [z]biko
  • version: 2.0
  • since: 1.0 method added
  • since: 2.0 27.11.2018 Fixed passing any $height integer to this method caused an eternal loop

getRecordset()

Fetches a Post and returns its Recordset

public getRecordset(int $id) : \arr|bool static

Tags
  • author: [z]biko
  • version: 2.0
  • since: 1.0 method added
  • since: 2.0 06.11.2018 added parameter validation
  • global: object $db Globales Class-Object mit allen MySQL-Methoden

getSummary()

Schnipsel/Auszug eines Kommentars holen.

public getSummary(string $text, int $length = 20) : string static

Uses \remove_html() \text_width() \t()

Tags
  • version: 1.1
  • since: 1.0 19.08.2019 IneX method added
  • since: 1.1 15.01.2019 IneX enhanced to also remove Smarty curly brackets { and }

getThreadid()

Holt den Thread-Id eines Posts oder Threads.

WICHTIG! UNBEDINGT SO LASSEN!

public getThreadid(mixed $board, int $id) : int static

getTitle()

Den Titel eines Kommentars holen.

public getTitle(string $text, int $length = 20, string $if_empty_use_this = null) : string static

Uses \remove_html() \text_width()

Tags
  • author: [z]biko
  • author: IneX
  • version: 2.1
  • since: 1.0 [z]biko method added
  • since: 2.0 24.09.2018 IneX method uses now text_width() util-function
  • since: 2.1 15.01.2019 IneX enhanced to also remove Smarty curly brackets { and }

highliteKeyword()

public highliteKeyword(mixed $keyword, mixed $text) : mixed static

isThread()

Prüft ob der Comment ein Thread ist

Prüft, ob der Comment im therads-table eingetragen ist (= thread start)

public isThread(string $board, int $id) : bool static

Tags
  • author: IneX
  • date: 16.03.2008

markasread()

Mark Comment as 'read'

public markasread(mixed $comment_id, mixed $user_id) : mixed static

markasunread()

public markasunread(mixed $comment_id) : mixed static

post()

Post Comment to Board

public post(mixed $parent_id, mixed $board, mixed $user_id, mixed $text, mixed $msg_users = NULL) : mixed static

Tags
  • version: 3.2
  • since: 1.0 [z]biko method added
  • since: 2.0 IneX added Activities
  • since: 3.0 IneX various code optimizations, new notification class used
  • since: 3.1 IneX minor code optimizations, changed Forum Activity-Notification only if new Forum-Thread
  • since: 3.2 27.09.2019 IneX changed INSERT to use $db->insert()
  • global: object $db Globales Class-Object mit allen MySQL-Methoden
  • global: object $user Globales Class-Object mit den User-Methoden & Variablen
  • global: object $notification Globales Class-Object mit allen Notification-Methoden

update()

Comment update

Update contents of an existing Comment (e.g. via Comment Edit Form)

public update(int $comment_id, array $comment_data_updated) : mixed static

See also

Tags
  • author: IneX
  • version: 2.0
  • since: 1.0 26.11.2018 method moved to Comment-Class from /actions/comment_edit.php
  • since: 2.0 27.11.2018 updated to use new $notifcation Class & some code and query optimizations
  • global: object $db Globales Class-Object mit allen MySQL-Methoden
  • global: object $user Globales Class-Object mit den User-Methoden & Variablen
  • global: object $notification Globales Class-Object mit allen Notification-Methoden

\ » Classes » Comment

Clone this wiki locally