[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/phpbb/ -> content_visibility.php (summary)

This file is part of the phpBB Forum Software package.

Copyright: (c) phpBB Limited
License: GNU General Public License, version 2 (GPL-2.0)
File Size: 885 lines (31 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

content_visibility:: (12 methods):
  __construct()
  can_soft_delete()
  get_count()
  is_visible()
  get_visibility_sql()
  get_forums_visibility_sql()
  get_global_visibility_sql()
  set_post_visibility()
  set_topic_visibility()
  add_post_to_statistic()
  remove_post_from_statistic()
  remove_topic_from_statistic()


Class: content_visibility  - X-Ref

phpbb_visibility
Handle fetching and setting the visibility for topics and posts

__construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $php_ext, $forums_table, $posts_table, $topics_table, $users_table)   X-Ref
Constructor

param: \phpbb\auth\auth        $auth    Auth object
param: \phpbb\config\config    $config    Config object
param: \phpbb\event\dispatcher_interface    $phpbb_dispatcher    Event dispatcher object
param: \phpbb\db\driver\driver_interface    $db        Database object
param: \phpbb\user        $user            User object
param: string        $phpbb_root_path    Root path
param: string        $php_ext            PHP Extension
param: string        $forums_table        Forums table name
param: string        $posts_table        Posts table name
param: string        $topics_table        Topics table name
param: string        $users_table        Users table name

can_soft_delete($forum_id, $poster_id, $post_locked)   X-Ref
Can the current logged-in user soft-delete posts?

param: $forum_id        int        Forum ID whose permissions to check
param: $poster_id        int        Poster ID of the post in question
param: $post_locked    bool    Is the post locked?
return: bool

get_count($mode, $data, $forum_id)   X-Ref
Get the topics post count or the forums post/topic count based on permissions

param: $mode            string    One of topic_posts, forum_posts or forum_topics
param: $data            array    Array with the topic/forum data to calculate from
param: $forum_id        int        The forum id is used for permission checks
return: int    Number of posts/topics the user can see in the topic/forum

is_visible($mode, $forum_id, $data)   X-Ref
Check topic/post visibility for a given forum ID

Note: Read permissions are not checked.

param: $mode        string    Either "topic" or "post"
param: $forum_id    int        The forum id is used for permission checks
param: $data        array    Array with item information to check visibility
return: bool        True if the item is visible, false if not

get_visibility_sql($mode, $forum_id, $table_alias = '')   X-Ref
Create topic/post visibility SQL for a given forum ID

Note: Read permissions are not checked.

param: $mode            string    Either "topic" or "post"
param: $forum_id        int        The forum id is used for permission checks
param: $table_alias    string    Table alias to prefix in SQL queries
return: string    The appropriate combination SQL logic for topic/post_visibility

get_forums_visibility_sql($mode, $forum_ids = array()   X-Ref
Create topic/post visibility SQL for a set of forums

Note: Read permissions are not checked. Forums without read permissions
should not be in $forum_ids

param: $mode            string    Either "topic" or "post"
param: $forum_ids        array    Array of forum ids which the posts/topics are limited to
param: $table_alias    string    Table alias to prefix in SQL queries
return: string    The appropriate combination SQL logic for topic/post_visibility

get_global_visibility_sql($mode, $exclude_forum_ids = array()   X-Ref
Create topic/post visibility SQL for all forums on the board

Note: Read permissions are not checked. Forums without read permissions
should be in $exclude_forum_ids

param: $mode                string    Either "topic" or "post"
param: $exclude_forum_ids    array    Array of forum ids which are excluded
param: $table_alias        string    Table alias to prefix in SQL queries
return: string    The appropriate combination SQL logic for topic/post_visibility

set_post_visibility($visibility, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest, $limit_visibility = false, $limit_delete_time = false)   X-Ref
Change visibility status of one post or all posts of a topic

param: $visibility    int        Element of {ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE}
param: $post_id        mixed    Post ID or array of post IDs to act on,
param: $topic_id        int        Topic where $post_id is found
param: $forum_id        int        Forum where $topic_id is found
param: $user_id        int        User performing the action
param: $time            int        Timestamp when the action is performed
param: $reason        string    Reason why the visibility was changed.
param: $is_starter    bool    Is this the first post of the topic changed?
param: $is_latest        bool    Is this the last post of the topic changed?
param: $limit_visibility    mixed    Limit updating per topic_id to a certain visibility
param: $limit_delete_time    mixed    Limit updating per topic_id to a certain deletion time
return: array        Changed post data, empty array if an error occurred.

set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all = false)   X-Ref
Set topic visibility

Allows approving (which is akin to undeleting/restore) or soft deleting an entire topic.
Calls set_post_visibility as needed.

Note: By default, when a soft deleted topic is restored. Only posts that
were approved at the time of soft deleting, are being restored.
Same applies to soft deleting. Only approved posts will be marked
as soft deleted.
If you want to update all posts, use the force option.

param: $visibility    int        Element of {ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE}
param: $topic_id        mixed    Topic ID to act on
param: $forum_id        int        Forum where $topic_id is found
param: $user_id        int        User performing the action
param: $time            int        Timestamp when the action is performed
param: $reason        string    Reason why the visibilty was changed.
param: $force_update_all    bool    Force to update all posts within the topic
return: array        Changed topic data, empty array if an error occured.

add_post_to_statistic($data, &$sql_data)   X-Ref
Add post to topic and forum statistics

param: $data            array    Contains information from the topics table about given topic
param: &$sql_data        array    Populated with the SQL changes, may be empty at call time
return: null

remove_post_from_statistic($data, &$sql_data)   X-Ref
Remove post from topic and forum statistics

param: $data            array    Contains information from the topics table about given topic
param: &$sql_data        array    Populated with the SQL changes, may be empty at call time
return: null

remove_topic_from_statistic($data, &$sql_data)   X-Ref
Remove topic from forum statistics

param: $data            array    Post and topic data
param: &$sql_data        array    Populated with the SQL changes, may be empty at call time
return: null



Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1