wpforo)) $this->wpforo = $wpForo;
if(!is_admin()){
add_filter("mce_external_plugins", array(&$this, 'add_tinymce_buttons'), 15);
add_filter("tiny_mce_plugins", array(&$this, 'filter_tinymce_plugins'), 15);
add_filter("wp_mce_translation", array(&$this, 'add_tinymce_translations'));
}
}
function add_tinymce_buttons($plugin_array) {
$plugin_array = array();
$plugin_array['wpforo_pre_button'] = WPFORO_URL . '/wpf-assets/js/tinymce-pre.js';
$plugin_array['wpforo_link_button'] = WPFORO_URL . '/wpf-assets/js/tinymce-link.js';
$plugin_array['wpforo_source_code_button'] = WPFORO_URL . '/wpf-assets/js/tinymce-code.js';
return $plugin_array;
}
function filter_tinymce_plugins($plugins){
return array('hr','lists','textcolor');
}
function add_tinymce_translations($mce_translation){
$mce_translation['Insert link'] = __( 'Insert link' );
$mce_translation['Link Text'] = __( 'Link Text' );
$mce_translation['Open link in a new tab'] = __( 'Open link in a new tab' );
return $mce_translation;
}
function topic_form($forumid){
if(!isset($this->wpforo->post_options['max_upload_size']) || !$this->wpforo->post_options['max_upload_size']){ $server_mus = wpforo_human_size_to_bytes(ini_get('upload_max_filesize')); if( !$server_mus || $server_mus > 10485760 ) $server_mus = 10485760; $this->wpforo->post_options['max_upload_size'] = $server_mus;}
?>
$topic['closed'], // is topic closed or opened (values 1 or 0)
* "topicid" => $topic['topicid'], // the id of topic
* "forumid" => $forum_data['forumid'],
* "layout" => $cat_layout,
* "topic_title" => $topic['title'] // the title of topic
* );
*
* @return html form
*/
function reply_form($args){
extract($args, EXTR_OVERWRITE); ?>
'.wpforo_phrase('Leave a reply', false).'';
$head_html = apply_filters( 'wpforo_reply_form_head', $head_html, $args );
if(!isset($this->wpforo->post_options['max_upload_size']) || !$this->wpforo->post_options['max_upload_size']){$server_mus = wpforo_human_size_to_bytes(ini_get('upload_max_filesize')); if( !$server_mus || $server_mus > 10485760 ) $server_mus = 10485760; $this->wpforo->post_options['max_upload_size'] = $server_mus;}
?>
wpforo->post_options['posts_per_page']) return;
$pages_count = ceil($items_count/$this->wpforo->post_options['posts_per_page']);
if($permalink){
$url = trim( preg_replace('#\/paged\/[\d]+\/*.*$#is', '', wpforo_full_url()), '/' ) . '/paged/';
}else{
$url = trim( preg_replace('#[\&\?]wpfpaged=[\d]*.*$#is', '', wpforo_full_url()), '/' );
$url .= (strpos($url, '?') === FALSE ? '?' : '&') . 'wpfpaged=';
}
?>
wpforo->post->get_post_likes_count($postid) ){
$l_usernames = $this->wpforo->post->get_likers_usernames($postid);
if($l_usernames[0]['ID'] == $this->wpforo->current_userid) $l_usernames[0]['display_name'] = wpforo_phrase('You', FALSE);
if($l_count == 1){
$return = sprintf( wpforo_phrase('%s liked', FALSE), ''.esc_html($l_usernames[0]['display_name']).' ' );
}elseif($l_count == 2){
$return = sprintf( wpforo_phrase('%s and %s liked', FALSE), ''.esc_html($l_usernames[0]['display_name']).' ', ''.esc_html($l_usernames[1]['display_name']).' ' );
}elseif($l_count == 3){
$return = sprintf( wpforo_phrase('%s, %s and %s liked', FALSE), ''.esc_html($l_usernames[0]['display_name']).' ', ''.esc_html($l_usernames[1]['display_name']).' ', ''.esc_html($l_usernames[2]['display_name']).' ' );
}elseif($l_count >= 4){
$l_count = $l_count - 3;
$return = sprintf( wpforo_phrase('%s, %s, %s and %d people liked', FALSE), ''.esc_html($l_usernames[0]['display_name']).' ', ''.esc_html($l_usernames[1]['display_name']).' ', ''.esc_html($l_usernames[2]['display_name']).' ', $l_count );
}
}
return $return;
}
/**
* Get actions buttons
*
* @since 1.0.0
*
* @param array buttons names function will return buttons by this array
*
* @param int $forumid required
*
* @param int $topicid required
*
* @param int $postid required
*
* @param int $is_topic required this is a first post in the loop
*
* $buttons = array( 'reply', 'answer', 'comment', 'quote', 'like', 'report', 'sticky', 'close', 'move', 'edit', 'delete', 'link' );
*
* @return html ( buttons )
*/
function buttons( $buttons, $forumid, $topicid, $postid, $is_topic = FALSE ){
$button_html = array();
foreach($buttons as $button){
switch($button){
case 'reply':
if( $this->wpforo->perm->forum_can($forumid, 'cr') ){
$button_html[] = ' ' . wpforo_phrase('Reply', false).' ';
}else{
$button_html[] = ' ' . wpforo_phrase('Reply', false).' ';
}
break;
case 'answer':
if( $this->wpforo->perm->forum_can($forumid, 'cr') ){
$button_html[] = ' ' . wpforo_phrase('Answer', false).' ';
}else{
$button_html[] = ' ' . wpforo_phrase('Answer', false).' ';
}
break;
case 'comment':
$title = wpforo_phrase('Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.', false);
if( $this->wpforo->perm->forum_can($forumid, 'cr') ) {
$button_html[] = ' ' . wpforo_phrase('Add a comment', false).' ';
}else{
$button_html[] = ' ' . wpforo_phrase('Add a comment', false).' ';
}
break;
case 'quote':
if( $this->wpforo->perm->forum_can($forumid, 'cr') ) {
$button_html[] = ' ' . wpforo_phrase('Quote', false).' ';
}else{
$button_html[] = ' ' . wpforo_phrase('Quote', false).' ';
}
break;
case 'like':
if( $this->wpforo->perm->forum_can($forumid, 'l') ) {
$like_status = ( $this->wpforo->post->is_liked( $postid, $this->wpforo->current_userid ) === FALSE ? 'wpforo-like' : 'wpforo-unlike' );
$like_icode = ( $like_status == 'wpforo-like') ? 'up' : 'down';
$button_html[] = '' . wpforo_phrase( str_replace('wpforo-', '', $like_status), false) . ' ';
}
break;
case 'report':
if( $this->wpforo->perm->forum_can($forumid, 'r') ) {
$button_html[] = ' ' . wpforo_phrase('Report', false).' ';
}
break;
case 'sticky':
if( $this->wpforo->perm->forum_can($forumid, 's') ) {
$sticky_status = ( $this->wpforo->topic->is_sticky($topicid ) ? 'wpforo-unsticky' : 'wpforo-sticky');
$button_html[] = '' . wpforo_phrase( str_replace('wpforo-', '', $sticky_status), false).' ';
}
break;
case 'solved':
$post = $this->wpforo->post->get_post($postid);
if( $this->wpforo->perm->forum_can($forumid, 'sv') || ($this->wpforo->current_userid == $post['userid'] && $this->wpforo->perm->forum_can($forumid, 'osv')) ) {
$solved_status = ( $this->wpforo->topic->is_solved($topicid) ? 'wpforo-unsolved' : 'wpforo-solved');
$button_html[] = '' . wpforo_phrase( str_replace('wpforo-', '', $solved_status), false).' ';
}
break;
case 'close':
if( $this->wpforo->perm->forum_can($forumid, 'cot') ) {
$open_status = ( $this->wpforo->topic->is_closed($topicid) ? 'wpforo-open' : 'wpforo-close' );
$open_icon = ($open_status == 'wpforo-open') ? 'unlock' : 'lock';
$button_html[] = '' . wpforo_phrase( str_replace('wpforo-', '', $open_status), false).' ';
}
break;
case 'move':
if( $this->wpforo->perm->forum_can($forumid, 'mt') ) {
$button_html[] = ' ' . wpforo_phrase('Move', false).' ';
}
break;
case 'edit':
$post = $this->wpforo->post->get_post($postid);
$diff = current_time( 'timestamp', 1 ) - strtotime($post['created']);
if( $this->wpforo->perm->forum_can($forumid, ($is_topic ? 'et' : 'er') ) || ($this->wpforo->current_userid == $post['userid'] && $this->wpforo->perm->forum_can($forumid, ($is_topic ? 'eot' : 'eor' )) && $diff < $this->wpforo->post_options[($is_topic ? 'eot' : 'eor' ).'_durr'] ) ) {
$a = ( $is_topic ) ? 'wpfedittopicpid' : '';
$b = ( $is_topic ) ? $postid : $postid;
$button_html[] = ' ' . wpforo_phrase('Edit', false).' ';
}
break;
case 'delete':
$post = $this->wpforo->post->get_post($postid);
$diff = current_time( 'timestamp', 1 ) - strtotime($post['created']);
if( $this->wpforo->perm->forum_can($forumid, ($is_topic ? 'dt' : 'dr' )) || ($this->wpforo->current_userid == $post['userid'] && $this->wpforo->perm->forum_can($forumid, ($is_topic ? 'dot' : 'dor' )) && $diff < $this->wpforo->post_options[($is_topic ? 'dot' : 'dor' ).'_durr']) ){
$a = ( $is_topic ) ? 'wpftopicdelete' : 'wpfreplydelete';
$b = ( $is_topic ) ? $topicid : $postid;
$button_html[] = ' ' . wpforo_phrase('Delete', false).' ';
}
break;
case 'link':
$url = ( $is_topic ) ? $this->wpforo->topic->get_topic_url( $topicid ) : $this->wpforo->post->get_post_url( $postid );
$button_html[] = ' ';
break;
case 'positivevote':
if( $this->wpforo->perm->forum_can($forumid, 'v') ) {
$button_html[] = ' ';
}else{
$button_html[] = ' ';
}
break;
case 'negativevote':
if( $this->wpforo->perm->forum_can($forumid, 'v') ) {
$button_html[] = ' ';
}else{
$button_html[] = ' ';
}
break;
case 'isanswer':
$is_answer = $this->wpforo->post->is_answered( $postid );
$is_answer = ( $is_answer == 0 ) ? '-not' : '';
if( is_user_logged_in() ){
$button_html[] = '
';
}else{
$button_html[] = '
';
}
break;
} //switch
} //foreach
echo implode('', $button_html);
}
function breadcrumb($url_data){
extract($url_data, EXTR_OVERWRITE);
switch($template) :
case 'search': ?>
wpforo->forum->get_all_relative_ids($forumid, $relative_ids);
foreach( $relative_ids as $key => $rel_forumid ) : ?>
wpforo->forum->get_forum($rel_forumid) ?>
wpforo->forum->get_all_relative_ids($forumid, $relative_ids);
foreach( $relative_ids as $key => $rel_forumid ) : ?>
wpforo->forum->get_forum($rel_forumid) ?>
wpforo->topic->get_topic($topicid) ?>
wpforo->topic->is_solved($item['topicid'])){
$icon['class'] = 'fa-check-circle';
$icon['color'] = 'wpfcl-8';
$icon['title'] = wpforo_phrase('Solved', false);
if($echo) {
$status = true; echo ($data == 'icon') ? implode(' ', $icon) : $icon['title'];
}
else{
return ($data == 'icon') ? implode(' ', $icon) : $icon['title'];
}
}
}
if( $item['closed'] && $item['type'] == 1 ){
$icon['class'] = 'fa-lock';
$icon['color'] = 'wpfcl-1';
$icon['title'] = wpforo_phrase('Closed', false);
if($echo) { $status = true; echo ($data == 'icon') ? implode(' ', $icon) : $icon['title']; } else{ return ($data == 'icon') ? implode(' ', $icon) : $icon['title']; }
}
elseif( $item['closed'] && $item['type'] != 1 ){
$icon['class'] = 'fa-lock';
$icon['color'] = 'wpfcl-1';
$icon['title'] = wpforo_phrase('Closed', false);
if($echo) { $status = true; echo ($data == 'icon') ? implode(' ', $icon) : $icon['title']; } else{ return ($data == 'icon') ? implode(' ', $icon) : $icon['title']; }
}
elseif( !$item['closed'] && $item['type'] == 1 ){
$icon['class'] = 'fa-thumb-tack';
$icon['color'] = 'wpfcl-5';
$icon['title'] = wpforo_phrase('Sticky', false);
if($echo) { $status = true; echo ($data == 'icon') ? implode(' ', $icon) : $icon['title']; } else{ return ($data == 'icon') ? implode(' ', $icon) : $icon['title']; }
}
if( $status ){
//do nothing
}
else{
if( $type == 'forum' ){
$icon['class'] = 'fa-comments';
$icon['color'] = 'wpfcl-2';
}
elseif( $type == 'topic' ){
if( $item['posts'] == 1 ){
$icon['class'] = 'fa-file-o';
$icon['color'] = 'wpfcl-2';
$icon['title'] = '';
}
elseif( $item['posts'] > 1 && $item['posts'] <= 5 ){
$icon['class'] = 'fa-file-text-o';
$icon['color'] = 'wpfcl-2';
$icon['title'] = '';
}
elseif( $item['posts'] > 5 && $item['posts'] <= 20 ){
$icon['class'] = 'fa-file-text';
$icon['color'] = 'wpfcl-2';
$icon['title'] = '';
}
elseif( $item['posts'] > 20 ){
$icon['class'] = 'fa-file-text';
$icon['color'] = 'wpfcl-5';
$icon['title'] = '';
}
else{
$icon['class'] = 'fa-file-o';
$icon['color'] = 'wpfcl-2';
$icon['title'] = '';
}
}
if($echo) { echo ($data == 'icon') ? implode(' ', $icon) : $icon['title']; } else{ return ($data == 'icon') ? implode(' ', $icon) : $icon['title']; }
}
}
else{
return false;
}
}
public function init_member_templates(){
$this->wpforo->member_tpls = array(
'account' => wpftpl('profile-account.php'),
'activity' => wpftpl('profile-activity.php'),
'subscriptions' => wpftpl('profile-subscriptions.php')
);
$this->wpforo->member_tpls = apply_filters('wpforo_member_templates_filter', $this->wpforo->member_tpls);
$this->wpforo->member_tpls['profile'] = wpftpl('profile-home.php');
}
function has_menu(){
return has_nav_menu( 'wpforo-menu' );
}
function nav_menu(){
if ( has_nav_menu( 'wpforo-menu' ) ){
$defaults = array(
'theme_location' => 'wpforo-menu',
'menu' => '',
'container' => '',
'container_class' => '',
'container_id' => '',
'menu_class' => 'wpf-menu',
'menu_id' => 'wpf-menu',
'echo' => true,
'fallback_cb' => 'wp_page_menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '',
'depth' => 0,
'walker' => ''
);
wp_nav_menu( $defaults );
}
}
function init_nav_menu(){
if(isset($this->wpforo->current_object) && !empty($this->wpforo->current_object)){
extract($this->wpforo->current_object, EXTR_OVERWRITE);
$this->wpforo->menu['wpforo-home'] = array(
'href' => WPFORO_BASE_URL,
'label' => wpforo_phrase('forums', FALSE),
'attr' => ((($template == 'forum' || $template == 'topic' || $template == 'post') && !isset($_GET['wpforo'])) ? ' class="wpforo-active"' : '' ),
'submenues' => array()
);
$this->wpforo->menu['wpforo-members'] = array(
'href' => WPFORO_BASE_URL . 'members/',
'label' => wpforo_phrase('members', FALSE),
'attr' => ( $template == 'members' ? ' class="wpforo-active"' : '' ),
'submenues' => array()
);
if( is_user_logged_in() ){
$this->wpforo->menu['wpforo-profile-home'] = array(
'href' => $this->wpforo->member->get_profile_url($this->wpforo->current_userid),
'label' => wpforo_phrase('my profile', FALSE),
'attr' => ( isset($this->wpforo->member_tpls[$template]) && $this->wpforo->member_tpls[$template] ? ' class="wpforo-active"' : '' ),
'submenues' => array()
);
$this->wpforo->menu['wpforo-profile-account'] = array(
'href' => $this->wpforo->member->get_profile_url($this->wpforo->current_userid, 'account'),
'label' => wpforo_phrase('account', FALSE),
'attr' => ( $template == 'account' ? ' class="wpforo-active"' : '' ),
'submenues' => array()
);
$this->wpforo->menu['wpforo-profile-activity'] = array(
'href' => $this->wpforo->member->get_profile_url($this->wpforo->current_userid, 'activity'),
'label' => wpforo_phrase('activity', FALSE),
'attr' => ( $template == 'activity' ? ' class="wpforo-active"' : '' ),
'submenues' => array()
);
$this->wpforo->menu['wpforo-profile-subscriptions'] = array(
'href' => $this->wpforo->member->get_profile_url($this->wpforo->current_userid, 'subscriptions'),
'label' => wpforo_phrase('subscriptions', FALSE),
'attr' => ( $template == 'subscriptions' ? ' class="wpforo-active"' : '' ),
'submenues' => array()
);
$this->wpforo->menu['wpforo-logout'] = array(
'href' => WPFORO_BASE_URL . '?wpforo=logout',
'label' => wpforo_phrase('logout', FALSE),
'attr' => '',
'submenues' => array()
);
}else{
if( wpforo_feature('user-register', $this->wpforo) ){
$this->wpforo->menu['wpforo-register'] = array(
'href' => wpforo_register_url(),
'label' => wpforo_phrase('register', FALSE),
'attr' => ( isset($_GET['wpforo']) && $_GET['wpforo'] == 'signup' ? ' class="wpforo-active"' : '' ),
'submenues' => array()
);
}
$this->wpforo->menu['wpforo-login'] = array(
'href' => wpforo_login_url(),
'label' => wpforo_phrase('login', FALSE),
'attr' => ( isset($_GET['wpforo']) && $_GET['wpforo'] == 'signin' ? ' class="wpforo-active"' : '' ),
'submenues' => array()
);
}
$this->wpforo->menu = apply_filters('wpforo_menu_array_filter', $this->wpforo->menu);
}
}
/**
*
* Checks in current active theme options if certain layout exists.
*
* @since 1.0.0
*
* @param mixed $identifier Layout id (folder name) OR @layout variable in header ( 1 or Extended )
* @param string $identifier_type The type of first parameter 'id' OR 'name' (@layout)
*
* @return boolean true/false
*
**/
function layout_exists( $identifier, $identifier_type = 'id' ){
$layouts = $this->wpforo->theme_options['layouts'];
if( $identifier_type == 'id' ){
if( isset($layouts[$identifier]) && !empty($layouts[$identifier])){
return true;
}
else{
return false;
}
}
elseif( $identifier_type = 'name' ){
foreach( $layouts as $id => $layout ){
if( !isset($layout['name']) && $layout['name'] == $identifier ){
return true;
}
}
return false;
}
}
/**
*
* Finds and returns all layouts information in array from theme's /layouts/ folder
*
* @since 1.0.0
*
* @param string $theme Theme id ( folder name ) e.g. 'classic'
*
* @return array
*
**/
function find_layouts( $theme ){
$layout_data = array();
$layouts = $this->find_themes('/'.$theme.'/layouts', 'php', 'layout');
if(!empty($layouts)){
foreach( $layouts as $layout ){
$lid = trim(basename(dirname( $layout['file']['value'] )), '/');
$layout_data[$lid]['id'] = $lid;
$layout_data[$lid]['name'] = $layout['name']['value'];
$layout_data[$lid]['version'] = $layout['version']['value'];
$layout_data[$lid]['description'] = $layout['description']['value'];
$layout_data[$lid]['author'] = $layout['author']['value'];
$layout_data[$lid]['url'] = $layout['layout_url']['value'];
$layout_data[$lid]['file'] = $layout['file']['value'];
}
}
return $layout_data;
}
function show_layout_selectbox($layoutid = 0){
$layouts = $this->find_layouts( WPFORO_THEME );
if( !empty($layouts) ){
foreach( $layouts as $layout ) : ?>
>
find_theme_headers( WPFORO_THEME_DIR . '/' . $theme_file );
$theme['id'] = $theme_folder;
$theme['name'] = $theme_data['name']['value'];
$theme['version'] = $theme_data['version']['value'];
$theme['description'] = $theme_data['description']['value'];
$theme['author'] = $theme_data['author']['value'];
$theme['url'] = $theme_data['theme_url']['value'];
$theme['file'] = $theme_file;
$theme['folder'] = $theme_folder;
$theme['layouts'] = $this->find_layouts( $theme_folder );
$styles = $this->find_styles( $theme_folder );
if(!empty($styles)){
reset($styles);
$theme['style'] = key($styles);
$theme['styles'] = $styles;
}
return $theme;
}
}
/**
*
* Scans wpForo themes (wpf-themes) folder, reads main files' headers and returns information about all themes in array.
* This function can also be used to scan and get information about layouts in each theme /layouts/ folder.
*
* @since 1.0.0
*
* @param string $base_dir Absolute path to scan directory (e.g. /home/public_html/wp-content/plugins/wpforo/wpf-themes/)
* @param string $ext File extension which may contain header information
* @param string $mode 'theme' or 'layout'
*
* @return array
*
**/
function find_themes( $base_dir = '', $ext = 'css', $mode = 'theme' ){
$themes = array ();
$themes_dir = @opendir( WPFORO_THEME_DIR . $base_dir );
$theme_files = array();
if( $themes_dir ){
while( ($file = readdir( $themes_dir )) !== false ){
if( substr($file, 0, 1) == '.' ) continue;
if( is_dir( WPFORO_THEME_DIR . $base_dir .'/'.$file ) ){
$themes_subdir = @opendir( WPFORO_THEME_DIR . $base_dir .'/'.$file );
if( $themes_subdir ){
while(($subfile = readdir( $themes_subdir ) ) !== false ){
if( substr($subfile, 0, 1) == '.' ) continue;
if( substr($subfile, -4) == '.' . $ext ) $theme_files[] = "$file/$subfile";
}
closedir( $themes_subdir );
}
}
else{
if( substr($file, -4) == '.' . $ext ) $theme_files[] = $file;
}
}
closedir( $themes_dir );
}
if( empty($theme_files) ) return $themes;
foreach( $theme_files as $theme_file ){
if( !is_readable( WPFORO_THEME_DIR . $base_dir . '/' . $theme_file ) ) continue;
if( $mode == 'theme' ){
$theme_data = $this->find_theme_headers( WPFORO_THEME_DIR . $base_dir . '/' . $theme_file );
}
elseif( $mode == 'layout' ){
$theme_data = $this->find_layout_headers( WPFORO_THEME_DIR . $base_dir . '/' . $theme_file );
}
if( empty($theme_data['name']['value']) ) continue;
$themes[wpforo_clear_basename($theme_file)] = $theme_data;
}
return $themes;
}
/**
*
* Reads theme main file's header variables and returns information in array.
*
* @since 1.0.0
*
* @param string $file Absolute path to file (e.g. /home/public_html/wp-content/plugins/wpforo/wpf-themes/style.css)
*
* @return array
*
**/
function find_theme_headers( $file ){
$theme_headers = array();
$headers = array(
'name' => 'Theme Name',
'version' => 'Version',
'description' => 'Description',
'author' => 'Author',
'theme_url' => 'Theme URI',
);
$fp = fopen( $file, 'r' );
$data = fread( $fp, 8192 );
fclose( $fp );
$data = str_replace( "\r", "\n", $data );
foreach ( $headers as $header_key => $header_name ){
if ( preg_match( '|^[\s\t\/*#@]*' . preg_quote( $header_name, '|' ) . ':(.*)$|mi', $data, $match ) && $match[1] ){
$theme_headers[$header_key]['name'] = $header_name;
$theme_headers[$header_key]['value'] = trim(preg_replace("/\s*(?:\*\/|\?>).*/", '', $match[1]));
}
else{
$theme_headers[$header_key]['name'] = $header_name;
$theme_headers[$header_key]['value'] = '';
}
}
$theme_headers['file']['name'] = 'file';
$theme_headers['file']['value'] = $file;
return $theme_headers;
}
/**
*
* Reads layout main file's header variables and returns information in array.
*
* @since 1.0.0
*
* @param string $file Absolute path to file (e.g. /home/public_html/wp-content/plugins/wpforo/wpf-themes/layouts/1/forum.php)
*
* @return array
*
**/
function find_layout_headers( $file ){
$theme_headers = array();
$headers = array(
'name' => 'layout',
'version' => 'version',
'description' => 'description',
'author' => 'author',
'layout_url' => 'url',
);
$fp = fopen( $file, 'r' );
$data = fread( $fp, 8192 );
fclose( $fp );
$data = str_replace( "\r", "\n", $data );
foreach ( $headers as $header_key => $header_name ){
if ( preg_match( '|^[\s\t\/*#@]*' . preg_quote( $header_name, '|' ) . ':(.*)$|mi', $data, $match ) && $match[1] ){
$theme_headers[$header_key]['name'] = $header_name;
$theme_headers[$header_key]['value'] = trim(preg_replace("/\s*(?:\*\/|\?>).*/", '', $match[1]));
}
else{
$theme_headers[$header_key]['name'] = $header_name;
$theme_headers[$header_key]['value'] = '';
}
}
$theme_headers['file']['name'] = 'file';
$theme_headers['file']['value'] = trim(str_replace( WPFORO_THEME_DIR, '', $file), '/');
return $theme_headers;
}
public function copyright(){ ?>
wpForo version
'fa-user', 'account' => 'fa-cog', 'activity' => 'fa-comments-o', 'subscriptions' => 'fa-rss');
$menu = apply_filters('wpforo_member_menu_filter', $menu);
if( !($userid == $this->wpforo->current_userid || $this->wpforo->perm->usergroup_can( $this->wpforo->current_user_groupid, 'em' )) ) unset($menu['account']);
foreach( $menu as $key => $value ) : ?>
wpforo->current_object, EXTR_OVERWRITE);
extract($user, EXTR_OVERWRITE);
include( (isset($this->wpforo->member_tpls[$template]) && $this->wpforo->member_tpls[$template] ? $this->wpforo->member_tpls[$template] : $this->wpforo->member_tpls['profile']) );
}
public function member_error(){
echo apply_filters('wpforo_member_error_filter', wpforo_phrase('Members not found', FALSE));
}
}
?>