Latin Phpbb2 Viewtopic Php

Latin Phpbb2 Viewtopic Php




πŸ”ž ALL INFORMATION CLICK HERE πŸ‘ˆπŸ»πŸ‘ˆπŸ»πŸ‘ˆπŸ»

































Latin Phpbb2 Viewtopic Php


By Plan



Enterprise






Teams






Compare all






By Solution



CI/CD & Automation








DevOps








DevSecOps








Case Studies



Customer Stories






Resources










In this repository


All GitHub

↡



In this repository


All GitHub

↡



In this organization


All GitHub

↡



In this repository


All GitHub

↡







phpbb

/

area51-phpbb3


Public

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?




Go to file
T



Go to line
L




Go to definition
R






Copy path






Copy permalink





This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.


2433 lines (2112 sloc)

91.3 KB












Open with Desktop




View raw






View blame















You can’t perform that action at this time.





You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.

* This file is part of the phpBB Forum Software package.
* @copyright (c) phpBB Limited
* @license GNU General Public License, version 2 (GPL-2.0)
* For full copyright and license information, please see
$ phpbb_root_path = (defined( 'PHPBB_ROOT_PATH' )) ? PHPBB_ROOT_PATH : './' ;
$ phpEx = substr(strrchr(__FILE__, '.' ), 1 );
include ( $ phpbb_root_path . 'common.' . $ phpEx );
include ( $ phpbb_root_path . 'includes/functions_display.' . $ phpEx );
include ( $ phpbb_root_path . 'includes/bbcode.' . $ phpEx );
include ( $ phpbb_root_path . 'includes/functions_user.' . $ phpEx );
$ forum_id = $ request -> variable ( 'f' , 0 );
$ topic_id = $ request -> variable ( 't' , 0 );
$ post_id = $ request -> variable ( 'p' , 0 );
$ voted_id = $ request -> variable ( 'vote_id' , array ( '' => 0 ));
$ voted_id = (count( $ voted_id ) > 1 ) ? array_unique( $ voted_id ) : $ voted_id ;
$ start = $ request -> variable ( 'start' , 0 );
$ view = $ request -> variable ( 'view' , '' );
$ default_sort_days = (!empty( $ user -> data [ 'user_post_show_days' ])) ? $ user -> data [ 'user_post_show_days' ] : 0 ;
$ default_sort_key = (!empty( $ user -> data [ 'user_post_sortby_type' ])) ? $ user -> data [ 'user_post_sortby_type' ] : 't' ;
$ default_sort_dir = (!empty( $ user -> data [ 'user_post_sortby_dir' ])) ? $ user -> data [ 'user_post_sortby_dir' ] : 'a' ;
$ sort_days = $ request -> variable ( 'st' , $ default_sort_days );
$ sort_key = $ request -> variable ( 'sk' , $ default_sort_key );
$ sort_dir = $ request -> variable ( 'sd' , $ default_sort_dir );
$ update = $ request -> variable ( 'update' , false );
/* @var $pagination \phpbb\pagination */
$ pagination = $ phpbb_container -> get ( 'pagination' );
$ hilit_words = $ request -> variable ( 'hilit' , '' , true );
/* @var $phpbb_content_visibility \phpbb\content_visibility */
$ phpbb_content_visibility = $ phpbb_container -> get ( 'content.visibility' );
// Find topic id if user requested a newer or older topic
$ result = $ db -> sql_query ( $ sql );
$ forum_id = ( int ) $ db -> sql_fetchfield ( 'forum_id' );
$ db -> sql_freeresult ( $ result );
$ topic_tracking_info = get_complete_topic_tracking( $ forum_id , $ topic_id );
$ topic_last_read = (isset( $ topic_tracking_info [ $ topic_id ])) ? $ topic_tracking_info [ $ topic_id ] : 0 ;
$ sql = 'SELECT post_id, topic_id, forum_id
AND " . $ phpbb_content_visibility -> get_visibility_sql ( 'post' , $ forum_id ) . "
ORDER BY post_time ASC, post_id ASC ";
$ result = $ db -> sql_query_limit ( $ sql , 1 );
$ row = $ db -> sql_fetchrow ( $ result );
$ db -> sql_freeresult ( $ result );
$ sql = 'SELECT topic_last_post_id as post_id, topic_id, forum_id
$ result = $ db -> sql_query ( $ sql );
$ row = $ db -> sql_fetchrow ( $ result );
$ db -> sql_freeresult ( $ result );
// Setup user environment so we can process lang string
else if ( $ view == 'next' || $ view == 'previous' )
$ sql_condition = ( $ view == 'next' ) ? '>' : '<' ;
$ sql_ordering = ( $ view == 'next' ) ? 'ASC' : 'DESC' ;
$ sql = 'SELECT forum_id, topic_last_post_time
$ result = $ db -> sql_query ( $ sql );
$ row = $ db -> sql_fetchrow ( $ result );
$ db -> sql_freeresult ( $ result );
// OK, the topic doesn't exist. This error message is not helpful, but technically correct.
trigger_error(( $ view == 'next' ) ? 'NO_NEWER_TOPICS' : 'NO_OLDER_TOPICS' );
WHERE forum_id = ' . $ row [ 'forum_id' ] . "
AND topic_last_post_time $ sql_condition { $ row [ 'topic_last_post_time' ]}
AND " . $ phpbb_content_visibility -> get_visibility_sql ( 'topic' , $ row [ 'forum_id' ]) . "
ORDER BY topic_last_post_time $ sql_ordering , topic_last_post_id $ sql_ordering ";
$ result = $ db -> sql_query_limit ( $ sql , 1 );
$ row = $ db -> sql_fetchrow ( $ result );
$ db -> sql_freeresult ( $ result );
$ result = $ db -> sql_query ( $ sql );
$ forum_style = ( int ) $ db -> sql_fetchfield ( 'forum_style' );
$ db -> sql_freeresult ( $ result );
$ user -> setup ( 'viewtopic' , $ forum_style );
trigger_error(( $ view == 'next' ) ? 'NO_NEWER_TOPICS' : 'NO_OLDER_TOPICS' );
if (isset( $ row ) && $ row [ 'forum_id' ])
// 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)
'FROM' => array ( FORUMS_TABLE => 'f' ),
// The FROM-Order is quite important here, else t.* columns can not be correctly bound.
$ sql_array [ 'SELECT' ] .= ', p.post_visibility, p.post_time, p.post_id' ;
$ sql_array [ 'FROM' ][ POSTS_TABLE ] = 'p' ;
// Topics table need to be the last in the chain
$ sql_array [ 'FROM' ][ TOPICS_TABLE ] = 't' ;
if ( $ user -> data [ 'is_registered' ])
$ sql_array [ 'SELECT' ] .= ', tw.notify_status' ;
$ sql_array [ 'LEFT_JOIN' ] = array ();
$ sql_array [ 'LEFT_JOIN' ][] = array (
'FROM' => array ( TOPICS_WATCH_TABLE => 'tw' ),
'ON' => 'tw.user_id = ' . $ user -> data [ 'user_id' ] . ' AND t.topic_id = tw.topic_id'
if ( $ config [ 'allow_bookmarks' ])
$ sql_array [ 'SELECT' ] .= ', bm.topic_id as bookmarked' ;
$ sql_array [ 'LEFT_JOIN' ][] = array (
'FROM' => array ( BOOKMARKS_TABLE => 'bm' ),
'ON' => 'bm.user_id = ' . $ user -> data [ 'user_id' ] . ' AND t.topic_id = bm.topic_id'
if ( $ config [ 'load_db_lastread' ])
$ sql_array [ 'SELECT' ] .= ', tt.mark_time, ft.mark_time as forum_mark_time' ;
$ sql_array [ 'LEFT_JOIN' ][] = array (
'FROM' => array ( TOPICS_TRACK_TABLE => 'tt' ),
'ON' => 'tt.user_id = ' . $ user -> data [ 'user_id' ] . ' AND t.topic_id = tt.topic_id'
$ sql_array [ 'LEFT_JOIN' ][] = array (
'FROM' => array ( FORUMS_TRACK_TABLE => 'ft' ),
'ON' => 'ft.user_id = ' . $ user -> data [ 'user_id' ] . ' AND t.forum_id = ft.forum_id'
$ sql_array [ 'WHERE' ] = " t.topic_id = $ topic_id ";
$ sql_array [ 'WHERE' ] = " p.post_id = $ post_id AND t.topic_id = p.topic_id ";
$ sql_array [ 'WHERE' ] .= ' AND f.forum_id = t.forum_id' ;
$ sql = $ db -> sql_build_query ( 'SELECT' , $ sql_array );
$ result = $ db -> sql_query ( $ sql );
$ topic_data = $ db -> sql_fetchrow ( $ result );
$ db -> sql_freeresult ( $ result );
// link to unapproved post or incorrect link
// If post_id was submitted, we try at least to display the topic as a last resort...
redirect(append_sid("{ $ phpbb_root_path } viewtopic. $ phpEx ", " t= $ topic_id " . (( $ forum_id ) ? " &f= $ forum_id " : '' )));
$ forum_id = ( int ) $ topic_data [ 'forum_id' ];
* Modify the forum ID to handle the correct display of viewtopic if needed
* @event core.viewtopic_modify_forum_id
* @var array topic_data array of topic's data
extract( $ phpbb_dispatcher -> trigger_event ( 'core.viewtopic_modify_forum_id' , compact( $ vars )));
// If the request is missing the f parameter, the forum id in the user session data is 0 at the moment.
// Let's fix that now so that the user can't hide from the forum's Who Is Online list.
$ user -> page [ 'forum' ] = $ forum_id ;
// Now we know the forum_id and can check the permissions
if (! $ phpbb_content_visibility -> is_visible ( 'topic' , $ forum_id , $ topic_data ))
// This is for determining where we are (page)
// are we where we are supposed to be?
if (( $ topic_data [ 'post_visibility' ] == ITEM_UNAPPROVED || $ topic_data [ 'post_visibility' ] == ITEM_REAPPROVE ) && ! $ auth -> acl_get ( 'm_approve' , $ topic_data [ 'forum_id' ]))
// If post_id was submitted, we try at least to display the topic as a last resort...
redirect(append_sid("{ $ phpbb_root_path } viewtopic. $ phpEx ", " t= $ topic_id " . (( $ forum_id ) ? " &f= $ forum_id " : '' )));
if ( $ post_id == $ topic_data [ 'topic_first_post_id' ] || $ post_id == $ topic_data [ 'topic_last_post_id' ])
$ check_sort = ( $ post_id == $ topic_data [ 'topic_first_post_id' ]) ? 'd' : 'a' ;
$ topic_data [ 'prev_posts' ] = $ phpbb_content_visibility -> get_count ( 'topic_posts' , $ topic_data , $ forum_id ) - 1 ;
$ topic_data [ 'prev_posts' ] = 0 ;
$ sql = 'SELECT COUNT(p.post_id) AS prev_posts
WHERE p.topic_id = { $ topic_data [ 'topic_id' ]}
AND " . $ phpbb_content_visibility -> get_visibility_sql ( 'post' , $ forum_id , 'p.' );
$ sql .= " AND (p.post_time > { $ topic_data [ 'post_time' ]} OR (p.post_time = { $ topic_data [ 'post_time' ]} AND p.post_id >= { $ topic_data [ 'post_id' ]} )) ";
$ sql .= " AND (p.post_time < { $ topic_data [ 'post_time' ]} OR (p.post_time = { $ topic_data [ 'post_time' ]} AND p.post_id <= { $ topic_data [ 'post_id' ]} )) ";
$ result = $ db -> sql_query ( $ sql );
$ row = $ db -> sql_fetchrow ( $ result );
$ db -> sql_freeresult ( $ result );
$ topic_data [ 'prev_posts' ] = $ row [ 'prev_posts' ] - 1 ;
$ topic_id = ( int ) $ topic_data [ 'topic_id' ];
$ topic_replies = $ phpbb_content_visibility -> get_count ( 'topic_posts' , $ topic_data , $ forum_id ) - 1 ;
// Check sticky/announcement/global time limit
if (( $ topic_data [ 'topic_type' ] != POST_NORMAL ) && $ topic_data [ 'topic_time_limit' ] && ( $ topic_data [ 'topic_time' ] + $ topic_data [ 'topic_time_limit' ]) < time())
$ sql = 'UPDATE ' . TOPICS_TABLE . '
SET topic_type = ' . POST_NORMAL . ', topic_time_limit = 0
$ topic_data [ 'topic_type' ] = POST_NORMAL ;
$ topic_data [ 'topic_time_limit' ] = 0 ;
$ user -> setup ( 'viewtopic' , $ topic_data [ 'forum_style' ]);
if ( $ view == 'print' && ! $ auth -> acl_get ( 'f_print' , $ forum_id ))
send_status_line( 403 , 'Forbidden' );
trigger_error( 'NO_AUTH_PRINT_TOPIC' );
$ overrides_forum_password_check = false ;
$ topic_tracking_info = isset( $ topic_tracking_info ) ? $ topic_tracking_info : null ;
* Event to apply extra permissions and to override original phpBB's f_read permission and forum password check
* @event core.viewtopic_before_f_read_check
* @var int forum_id The forum id from where the topic belongs
* @var int topic_id The id of the topic the user tries to access
* @var int post_id The id of the post the user tries to start viewing at.
* @var array topic_data All the information from the topic and forum tables for this topic
* It includes posts information if post_id is not 0
* @var bool overrides_f_read_check Set true to remove f_read check afterwards
* @var bool overrides_forum_password_check Set true to remove forum_password check afterwards
* @var array topic_tracking_info Information upon calling get_topic_tracking()
* Set it to NULL to allow auto-filling later.
* Set it to an array to override original data.
extract( $ phpbb_dispatcher -> trigger_event ( 'core.viewtopic_before_f_read_check' , compact( $ vars )));
if (! $ overrides_f_read_check && ! $ auth -> acl_get ( 'f_read' , $ forum_id ))
if ( $ user -> data [ 'user_id' ] != ANONYMOUS )
send_status_line( 403 , 'Forbidden' );
trigger_error( 'SORRY_AUTH_READ' );
login_box( '' , $ user -> lang [ 'LOGIN_VIEWFORUM' ]);
// Forum is passworded ... check whether access has been granted to this
// user this session, if not show login box
if (! $ overrides_forum_password_check && $ topic_data [ 'forum_password' ])
// Redirect to login upon emailed notification links if user is not logged in.
if (isset( $ _GET [ 'e' ]) && $ user -> data [ 'user_id' ] == ANONYMOUS )
login_box(build_url( 'e' ) . '#unread' , $ user -> lang [ 'LOGIN_NOTIFY_TOPIC' ]);
$ start = floor(( $ topic_data [ 'prev_posts' ]) / $ config [ 'posts_per_page' ]) * $ config [ 'posts_per_page' ];
if (!isset( $ topic_tracking_info ))
if ( $ config [ 'load_db_lastread' ] && $ user -> data [ 'is_registered' ])
$ tmp_topic_data = array ( $ topic_id => $ topic_data );
$ topic_tracking_info = get_topic_tracking( $ forum_id , $ topic_id , $ tmp_topic_data , array ( $ forum_id => $ topic_data [ 'forum_mark_time' ]));
else if ( $ config [ 'load_anon_lastread' ] || $ user -> data [ 'is_registered' ])
$ topic_tracking_info = get_complete_topic_tracking( $ forum_id , $ topic_id );
$ limit_days = array ( 0 => $ user -> lang [ 'ALL_POSTS' ], 1 => $ user -> lang [ '1_DAY' ], 7 => $ user -> lang [ '7_DAYS' ], 14 => $ user -> lang [ '2_WEEKS' ], 30 => $ user -> lang [ '1_MONTH' ], 90 => $ user -> lang [ '3_MONTHS' ], 180 => $ user -> lang [ '6_MONTHS' ], 365 => $ user -> lang [ '1_YEAR' ]);
$ sort_by_text = array ( 'a' => $ user -> lang [ 'AUTHOR' ], 't' => $ user -> lang [ 'POST_TIME' ], 's' => $ user -> lang [ 'SUBJECT' ]);
$ sort_by_sql = array ( 'a' => array ( 'u.username_clean' , 'p.post_id' ), 't' => array ( 'p.post_time' , 'p.post_id' ), 's' => array ( 'p.post_subject' , 'p.post_id' ));
$ join_user_sql = array ( 'a' => true , 't' => false , 's' => false );
$ s_limit_days = $ s_sort_key = $ s_sort_dir = $ u_sort_param = '' ;
* @event core.viewtopic_gen_sort_selects_before
* @var array limit_days Limit results by time
* @var array sort_by_text Language strings for sorting options
* @var array sort_by_sql SQL conditions for sorting options
* @var array join_user_sql SQL joins required for sorting options
* @var int sort_days User selected sort days
* @var string sort_key User selected sort key
* @var string sort_dir User selected sort direction
* @var string s_limit_days Initial value of limit days selectbox
* @var string s_sort_key Initial value of sort key selectbox
* @var string s_sort_dir Initial value of sort direction selectbox
* @var string u_sort_param Initial value of sorting form action
extract( $ phpbb_dispatcher -> trigger_event ( 'core.viewtopic_gen_sort_selects_before' , compact( $ vars )));
gen_sort_selects( $ limit_days , $ sort_by_text , $ sort_days , $ sort_key , $ sort_dir , $ s_limit_days , $ s_sort_key , $ s_sort_dir , $ u_sort_param , $ default_sort_days , $ default_sort_key , $ default_sort_dir );
// Obtain correct post count and ordering SQL if user has
$ min_post_time = time() - ( $ sort_days * 86400 );
$ sql = 'SELECT COUNT(post_id) AS num_posts
AND " . $ phpbb_content_visibility -> get_visibility_sql ( 'post' , $ forum_id );
$ result = $ db -> sql_query ( $ sql );
$ total_posts = ( int ) $ db -> sql_fetchfield ( 'num_posts' );
$ db -> sql_freeresult ( $ result );
$ limit_posts_time = " AND p.post_time >= $ min_post_time ";
$ total_posts = $ topic_replies + 1 ;
// Was a highlight request part of the URI?
$ highlight_match = $ highlight = '' ;
$ highlight_match = phpbb_clean_search_string( $ hilit_words );
$ highlight = urlencode( $ highlight_match );
$ highlight_match = str_replace( '\*' , '\w+?' , preg_quote( $ highlight_match , '#' ));
$ highlight_match = preg_replace( '#(?<=^|\s)\\\\w\*\?(?=\s|$)#' , '\w+?' , $ highlight_match );
$ highlight_match = str_replace( ' ' , '|' , $ highlight_match );
// Make sure $start is set to the last page if it exceeds the amount
$ start = $ pagination -> validate_start ( $ start , $ config [ 'posts_per_page' ], $ total_posts );
// General Viewtopic URL for return links
$ viewtopic_url = append_sid("{ $ phpbb_root_path } viewtopic. $ phpEx ", " f= $ forum_id &t= $ topic_id " . (( $ start == 0 ) ? '' : " &start= $ start ") . ((strlen( $ u_sort_param )) ? " & $ u_sort_param " : '' ) . (( $ highlight_match ) ? " &hilit= $ highlight " : '' ));
if ( $ config [ 'allow_topic_notify' ])
$ notify_status = (isset( $ topic_data [ 'notify_status' ])) ? $ topic_data [ 'notify_status' ] : null ;
watch_topic_forum( 'topic' , $ s_watching_topic , $ user -> data [ 'user_id' ], $ forum_id , $ topic_id , $ notify_status , $ start , $ topic_data [ 'topic_title' ]);
// Reset forum notification if forum notify is set
if ( $ config [ 'allow_forum_notify' ] && $ auth -> acl_get ( 'f_subscribe' , $ forum_id ))
$ s_watching_forum = $ s_watching_topic ;
watch_topic_forum( 'forum' , $ s_watching_forum , $ user -> data [ 'user_id' ], $ forum_id , 0 );
* @event core.viewtopic_highlight_modify
* @var string highlight String to be highlighted
* @var string highlight_match Highlight string to be used in preg_replace
* @var int total_posts Number of posts
* @var string viewtopic_url Current viewtopic URL
extract( $ phpbb_dispatcher -> trigger_event ( 'core.viewtopic_highlight_modify' , compact( $ vars )));
if ( $ config [ 'allow_bookmarks' ] && $ user -> data [ 'is_registered' ] && $ request -> variable ( 'bookmark' , 0 ))
if (check_link_hash( $ request -> variable ( 'hash' , '' ), " to
Porn Mira Cuckold Kinky Family Day 3
Latin Tits
Latin Formation

Report Page