Please or Register to create posts and topics.

Asgaros Forum v1.10.1: Roles & Performance Improvements

PreviousPage 2 of 5Next

Hallo @asgaros,

vielen Dank für die Verbesserungen. Ich warte immer noch dringend auf die Anzeige der Forums-Nutzergruppen in der Mitgliederliste und in der Aktivitätenliste. Wäre schön, wenn das mit dem nächsten Update kommt.

Sylvia

Hallo @springer

Die Änderungen am Rollensystem waren einige der nötigen Vorarbeiten, welche für die geplanten Filtermechanismen benötigt werden. Einer Veröffentlichung im Laufe dieses Jahres sollte also nichts mehr im Wege stehen. 🙂

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Hallo @asgaros,

seit dem Update kommen auch meine Forenmitglieder.

Wenn Mann auf einen Beitrag klickt, der Benutzer hat den Hut verfasst.
Den eigenen Beitrag kann man nicht mehr lesen.
Dies ist bei eingeloggten Benutzer oder auch bei Gästen der Fall.

Das Forum ist bei http://www.myhakotrac.de zu finden.

Soeben habe ich ein Backup auf die Version 1.10.0 geladen und alles funktioniert wieder.

Gruß Robert

Hallo @v490

Auch bei dir gehe ich davon aus, dass es an deinen Custom-Code-Anpassungen liegt. Ich musste leider einige Änderungen an vorhandenen Funktionen vornehmen, wodurch dieser Code eine Überarbeitung benötigt.

Bitte poste hier mal deine Modifikationen aus deiner functions.php Datei, so dass ich dir die entsprechenden Anpassungen vornehmen kann. 🙂

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Erstmal danke für die Unterstützung,

hier der gesamte Code von der functions.php vom Theme.

Solltest du nicht alles benötigen, kannst du es gerne löschen…

Gruß Robert

<?php
/**
* Vega WP functions and definitions
*
* @package vega
*/
?>
<?php

### THEME DEFAULTS ###
require get_template_directory() . '/customize/theme-defaults.php';

### SETUP ###

/* Über Username zu Ultimate Member */

function my_prof_link($link, $user) {
return '/user/'.$user->user_login;
}
add_filter('asgarosforum_filter_profile_link', 'my_prof_link', 10, 2);

/* Ende Link zu Ultimate Member */

/* Kleine Hakotracs unter User Name */

add_action('asgarosforum_after_post_author', 'my_asgarosforum_after_post_administration', 10, 2);
function getUserRoles($id) {
$user = new WP_User((int)$id);
return implode(' and ', $user->roles);
}
function my_asgarosforum_after_post_administration($author_id, $author_posts) {
if (getUserRoles($author_id)=='administrator') {
echo '
<br /><img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumgold0001.png" id="logo" width="60" height="50" />
<br /><div class="icon-status-admin">'.__('Admin','rcl-asgaros').' <i class=""></i></div>';
} else {
if (AsgarosForumPermissions::isModerator($author_id)) {
echo '
<br /><img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="60" height="50" />
<br /><div class="icon-status-moderator">'.__('Moderator','rcl-asgaros').' <i class=""></i></div>';
} else {
if(getUserRoles($author_id)=='contributor') {
echo '<div class="icon-status-contributor">'.__('Oldie','rcl-asgaros').' <i class=""></i></div>';
} else {
if(getUserRoles($author_id)=='author') {
echo '<div class="icon-status-author">'.__('Author','rcl-asgaros').' <i class=""></i></div>';
} else {
if ($author_posts > 300) {
echo '
<br />

<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />
<br />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />

<span id="rating"><p><span class="after"> </span></p>Ist fast schon zuhause hier</span>
</div>';
} else if ($author_posts >= 150 && $author_posts < 299) {
echo '
<br />

<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />
<br />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />

<div class="star-wrapper">

<span id="rating"><p><span class="after"> </span></p>Kann einfach nicht weg bleiben</span>
</div>';
} else if ($author_posts >= 100 && $author_posts < 149) {
echo '
<br />

<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />
<br />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />

<div class="star-wrapper">

<span id="rating"><p><span class="after"> </span></p>Ist gerne hier</span>
</div>';
} else if ($author_posts >= 50 && $author_posts < 99) {
echo '
<br />

<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />
<br />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />

<div class="star-wrapper">

<span id="rating"><p><span class="after"> </span></p>Nicht zu schüchtern zum Reden</span>
</div>';
} else if ($author_posts >= 10 && $author_posts < 49) {
echo '
<br />

<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forum0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />
<br />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />

<div class="star-wrapper">

<span id="rating"><p><span class="after"> </span></p>Schaut nur mal vorbei</span>
</div>';
} else if ($author_posts >= 1 && $author_posts < 9){
echo '
<br />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />
<br />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />
<img src="http://myhakotrac.de/wp-includes/images/asgaros-images/forumblack0001.png" id="logo" width="30" height="25" />
<br>
<span id="rating"><p><span class="after"> </span></p>Bin neu hier</span>';
}

if(getUserRoles($author_id)=='subscriber') {
echo '
<br />
<div class="icon-status-editor">'.__('','rcl-asgaros').' <i class=""></i></div>';};
}
}
}
}
}

/* Ende Hakos einfügen */

if ( ! function_exists( 'vega_wp_setup' ) ) :
function vega_wp_setup() {

global $vega_wp_defaults;

#make theme available for translation. Translations can be filed in the /languages/ directory
load_theme_textdomain( 'vega', get_template_directory() . '/languages' );

#add default posts and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );

#let WordPress manage the document title
add_theme_support( 'title-tag' );

#support for post thumbnails on posts and pages
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 300, 250, true );
add_image_size( 'vega-post-thumbnail-recent', 350, 220, true );

#navigation menus
register_nav_menus( array(
'header' => __( 'Header Menu', 'vega' ),
'footer' => __( 'Footer Menu', 'vega' ),
'top_left' => __( 'Top Left', 'vega'),
'top_right' => __( 'Top Right - Social', 'vega'),
) );

#custom header support
$args = array(
'flex-width' => true,
'width' => 1920,
'flex-height' => true,
'height' => 600,
'default-image' => $vega_wp_defaults['vega_wp_custom_header'],
);
add_theme_support( 'custom-header', $args );

#custom logo support
add_theme_support( 'custom-logo', array('height' => 45, 'width' => 165,'flex-height' => true,'flex-width' => true ) );

#page excerpts
add_post_type_support('page', 'excerpt');

#https://make.wordpress.org/core/2016/11/26/extending-the-custom-css-editor/
if ( function_exists( 'wp_update_custom_css_post' ) ) {
$css = vega_wp_get_option('vega_wp_custom_css');
if ( $css ) {
$core_css = wp_get_custom_css();
$return = wp_update_custom_css_post( $core_css . $css );
if ( ! is_wp_error( $return ) ) {
remove_theme_mod( 'vega_wp_custom_css' );
}
}
}

if ( class_exists( 'WooCommerce' ) ) {
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
}

}
endif;
add_action( 'after_setup_theme', 'vega_wp_setup' );

### AFTER SETUP ###

function vega_wp_content_width() {
$GLOBALS['content_width'] = apply_filters( 'vega_wp_content_width', 1200 );
}
add_action( 'after_setup_theme', 'vega_wp_content_width', 0 );

### FILTERS ###

function vega_wp_move_comment_field_to_bottom( $fields ) {
$comment_field = $fields['comment'];
unset( $fields['comment'] );
$fields['comment'] = $comment_field;
return $fields;
}
add_filter( 'comment_form_fields', 'vega_wp_move_comment_field_to_bottom' );

function vega_wp_excerpt_length( $length ) {
return 65;
}
add_filter( 'excerpt_length', 'vega_wp_excerpt_length', 999 );

//http://wordpress.stackexchange.com/questions/50779/how-to-wrap-oembed-embedded-video-in-div-tags-inside-the-content
add_filter('embed_oembed_html', 'vega_embed_oembed_html', 99, 4);
function vega_embed_oembed_html($html, $url, $attr, $post_id) {
return '<div class="iframe-video">' . $html . '</div>';
}

### STYLES AND SCRIPTS ###

function vega_wp_scripts() {

/** CSS **/

#bootstrap, fontawesome, bootstrapsocial
wp_register_style('bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css' );
wp_register_style('font-awesome', get_template_directory_uri().'/assets/css/font-awesome.min.css' );
wp_register_style('bootstrap-social', get_template_directory_uri().'/assets/css/bootstrap-social.css' );

#animate.css
wp_enqueue_style('animate-css', get_template_directory_uri().'/assets/css/animate.css');

#fonts
wp_enqueue_style('vega-wp-googlefont1',
'//fonts.googleapis.com/css?family=Lato:400,400i,700,700i,900,900i&amp;subset=latin-ext');

#default stylesheet
$vega_wp_theme = wp_get_theme();
$deps = array('bootstrap', 'font-awesome', 'bootstrap-social');
wp_enqueue_style('vega-wp-style', get_stylesheet_uri(), $deps, $vega_wp_theme->get( 'Version' ));

#color scheme
$vega_wp_color_stylesheet = vega_wp_get_option('vega_wp_color_stylesheet');
wp_enqueue_style('vega-wp-color', get_template_directory_uri() . '/color-schemes/' . strtolower($vega_wp_color_stylesheet) . '.css', array() );

// Load html5shiv.js
wp_enqueue_script( 'vega-html5', get_template_directory_uri() . '/assets/js/html5shiv.js', array('vega-wp-style'), '3.7.0' );
wp_script_add_data( 'vega-html5', 'conditional', 'lt IE 9' );

// Load respond.min.js
wp_enqueue_script( 'vega-respond', get_template_directory_uri() . '/assets/js/respond.min.js', array('vega-wp-style'), '1.3.0' );
wp_script_add_data( 'vega-html5', 'conditional', 'lt IE 9' );

/** Javascript **/

#bootstrap
wp_enqueue_script('bootstrap', get_template_directory_uri().'/assets/js/bootstrap.min.js', array('jquery'), '', true );
wp_enqueue_script('jquery-smartmenus', get_template_directory_uri() . '/assets/js/jquery.smartmenus.min.js', array('jquery'), '', true );
wp_enqueue_script('jquery-smartmenus-bootstrap', get_template_directory_uri() . '/assets/js/jquery.smartmenus.bootstrap.min.js', array('jquery'), '', true );

#animation
$vega_wp_animations = vega_wp_get_option('vega_wp_animations');
if($vega_wp_animations == 'Y') {
wp_enqueue_script('wow', get_template_directory_uri() . '/assets/js/wow.min.js', array('jquery'), '', true );
wp_enqueue_script('vega-wp-themejs-anim', get_template_directory_uri() . '/assets/js/vega-wp-anim.js', array('jquery'), '', true );
}

#parallax
wp_enqueue_script('parallax', get_template_directory_uri() . '/assets/js/parallax.min.js', array('jquery'), '', true );

#theme javascript
$vega_this_theme = wp_get_theme();
wp_enqueue_script('vega-wp-themejs', get_template_directory_uri() . '/assets/js/vega-wp.js', array('jquery'), $vega_this_theme->get( 'Version' ), true );

#comments
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}

}
add_action( 'wp_enqueue_scripts', 'vega_wp_scripts' );

### CUSTOM CSS ###

function vega_wp_custom_css() {
$vega_wp_custom_css = vega_wp_get_option('vega_wp_custom_css');
if($vega_wp_custom_css != '') {
echo '<!-- Custom CSS -->';
$output="<style>" . stripslashes($vega_wp_custom_css) . "</style>";
echo $output;
echo '<!-- /Custom CSS -->';
}
}
add_action('wp_head','vega_wp_custom_css');

if ( ! function_exists( 'vega_show_custom_css_field' ) ) :
function vega_show_custom_css_field(){
if(get_bloginfo('version') >= 4.7){
$vega_wp_custom_css = vega_wp_get_option('vega_wp_custom_css');
if($vega_wp_custom_css == '') return false;
else return true;
}
return true;
}
endif;

function vega_custom_css_banner(){
$vega_wp_frontpage_banner_bg_color = vega_wp_get_option('vega_wp_frontpage_banner_bg_color');
if($vega_wp_frontpage_banner_bg_color != '') {
echo "
<style>";
echo ' .frontpage-banner.frontpage-banner-parallax-bg:before { width: 100%; height: 100%; background-color: ' . esc_attr($vega_wp_frontpage_banner_bg_color) . '; opacity: 0.35; content: ""; position: absolute; left: 0; top: 0; z-index: 2; }';
echo ' .frontpage-simple-banner:before { width: 100%; height: 100%; background-color: ' . esc_attr($vega_wp_frontpage_banner_bg_color) . '; opacity: 0.35; content: ""; position: absolute; left: 0; top: 0; z-index: 2; } ';
echo "</style>
";
}
}
add_action('wp_head','vega_custom_css_banner', 95);

function vega_custom_css_cta1(){
$vega_wp_frontpage_cta_dark_parallax = vega_wp_get_option('vega_wp_frontpage_cta_dark_parallax');
$vega_wp_frontpage_cta_dark_bg_color = vega_wp_get_option('vega_wp_frontpage_cta_dark_bg_color');
$vega_wp_frontpage_cta_dark_bg_image = vega_wp_get_option('vega_wp_frontpage_cta_dark_bg_image');
echo "
<style>";
if($vega_wp_frontpage_cta_dark_bg_image != '' && $vega_wp_frontpage_cta_dark_parallax != 'Y'){
echo ".frontpage-cta1.image-bg {background-image:url(". esc_url($vega_wp_frontpage_cta_dark_bg_image) . "); -webkit-background-size:cover; -moz-background-size:cover; -o-background-size:cover; background-size:cover; background-repeat:no-repeat; z-index:0; background-position: center center;} ";
}
if ($vega_wp_frontpage_cta_dark_bg_color != '') {
echo ".frontpage-cta1.parallax-bg:before, .frontpage-cta1.image-bg:before {background-color:" . esc_attr($vega_wp_frontpage_cta_dark_bg_color) . "} ";
echo ".frontpage-cta1.color-bg{background-color:" . esc_attr($vega_wp_frontpage_cta_dark_bg_color) . "} ";
}
echo "</style>
";
}
add_action('wp_head','vega_custom_css_cta1', 96);

function vega_custom_css_cta2(){
$vega_wp_frontpage_cta_dark2_parallax = vega_wp_get_option('vega_wp_frontpage_cta_dark2_parallax');
$vega_wp_frontpage_cta_dark2_bg_color = vega_wp_get_option('vega_wp_frontpage_cta_dark2_bg_color');
$vega_wp_frontpage_cta_dark2_bg_image = vega_wp_get_option('vega_wp_frontpage_cta_dark2_bg_image');
echo "
<style>";
if($vega_wp_frontpage_cta_dark2_bg_image != '' && $vega_wp_frontpage_cta_dark2_parallax != 'Y'){
echo ".frontpage-cta2.image-bg {background-image:url(". esc_url($vega_wp_frontpage_cta_dark2_bg_image) . "); -webkit-background-size:cover; -moz-background-size:cover; -o-background-size:cover; background-size:cover; background-repeat:no-repeat; z-index:0; background-position: center center;} ";
}
if ($vega_wp_frontpage_cta_dark2_bg_color != '') {
echo ".frontpage-cta2.parallax-bg:before, .frontpage-cta2.image-bg:before {background-color:" . esc_attr($vega_wp_frontpage_cta_dark2_bg_color) . "} ";
echo ".frontpage-cta2.color-bg{background-color:" . esc_attr($vega_wp_frontpage_cta_dark2_bg_color) . "} ";
}
echo "</style>
";
}
add_action('wp_head','vega_custom_css_cta2', 97);

### CUSTOMIZER STYLES ("Upgrade to Pro") ###

function vega_wp_custom_customize_enqueue() {
wp_enqueue_style( 'customizer-css', get_template_directory_uri() . '/customize/style.css' );
}
add_action( 'customize_controls_enqueue_scripts', 'vega_wp_custom_customize_enqueue' );

### WIDGETS ###

function vega_wp_widgets_init() {
register_sidebar( array(
'name' => __( 'Default Sidebar', 'vega' ),
'id' => 'sidebar',
'description' => __( 'Add widgets here to appear in your sidebar.', 'vega' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Pages Sidebar', 'vega' ),
'id' => 'page-sidebar',
'description' => __( 'Add widgets here to appear in the sidebar on pages.', 'vega' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Posts Sidebar', 'vega' ),
'id' => 'post-sidebar',
'description' => __( 'Add widgets here to appear in the sidebar on posts.', 'vega' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Footer Col 1', 'vega' ),
'id' => 'footer_1',
'description' => __( 'Add widgets here to appear in the first column of the footer.', 'vega' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Footer Col 2', 'vega' ),
'id' => 'footer_2',
'description' => __( 'Add widgets here to appear in the second column of the footer.', 'vega' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Footer Col 3', 'vega' ),
'id' => 'footer_3',
'description' => __( 'Add widgets here to appear in the third column of the footer.', 'vega' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Footer Col 4', 'vega' ),
'id' => 'footer_4',
'description' => __( 'Add widgets here to appear in the fourth column of the footer.', 'vega' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'vega_wp_widgets_init' );

### INCLUDES ###

#bootstrap nav walker
require get_template_directory() . '/includes/wp_bootstrap_navwalker.php';
#customizer
require get_template_directory() . '/customize/customizer.php';

### FUNCTIONS ###

#vega_has_top_bar
if ( ! function_exists( 'vega_has_top_bar' ) ) :
function vega_has_top_bar(){
if ( has_nav_menu( 'top_left' ) || has_nav_menu('top_right') ) {return true;}
return false;
}
endif;

#vega_wp_title
if ( ! function_exists( 'vega_wp_title' ) ) :
function vega_wp_title() {
$title = '';
if( is_home() && get_option('page_for_posts') ) {
$title = get_page( get_option('page_for_posts') )->post_title;
}
else if ( is_page() ) {
$title = get_the_title(); if($title == '') $title = __("Page ID: ", 'vega') . get_the_ID();
}
else if ( is_single() ){
$title = get_the_title(); if($title == '') $title = __("Post ID: ", 'vega') . get_the_ID();
}
else if ( is_category() ) {
$title = single_cat_title('', false);
}
else if ( is_tag() ) {
$title = single_tag_title(__('Tag: ', 'vega'), false);
}
else if ( is_author() ) {
$title = __('Author: ', 'vega') . get_the_author();
}
else if ( is_day() ) {
$title = __('Day: ', 'vega') . get_the_date() ;
}
else if ( is_month() ) {
$title = __('Month: ', 'vega') . get_the_date( _x( 'F Y', 'monthly archives date format', 'vega' ) );
}
else if ( is_year() ) {
$title = __('Year: ', 'vega') . get_the_date( _x( 'Y', 'yearly archives date format', 'vega' ) );
}
else if ( is_404() ) {
$title = __('Not Found!', 'vega');
}
else if ( is_search() ) {
$title = __('Search Results: ', 'vega') . get_search_query();
} else if(function_exists('is_shop')) {
if(is_shop()) $title = __('Shop', 'vega');
if(is_product_category()) $title = single_term_title('', false);
} else {
$title = __( 'Archives', 'vega' );
}

return $title;
}
endif;

#vega_wp_get_col_class
if ( ! function_exists( 'vega_wp_get_col_class' ) ) :
function vega_wp_get_col_class($n){
switch($n){
case 1: return 'col-xs-4 col-xs-offset-4'; break;
case 2: return 'col-sm-3 col-sm-offset-3' . '|' . 'col-sm-3'; break;
case 3: return 'col-sm-4|col-sm-4|col-sm-4'; break;
case 4: return 'col-md-3 col-sm-6|col-md-3 col-sm-6|col-md-3 col-sm-6|col-md-3 col-sm-6'; break;
case 5: return 'col-sm-2 col-sm-offset-1|col-sm-2|col-sm-2|col-sm-2|col-sm-2'; break;
case 6: return 'col-sm-2 col-xs-6|col-sm-2 col-xs-6|col-sm-2 col-xs-6|col-sm-2 col-xs-6|col-sm-2 col-xs-6|col-sm-2 col-xs-6'; break;
}
}
endif;

#vega_wp_get_equal_col_class
if ( ! function_exists( 'vega_wp_get_equal_col_class' ) ) :
function vega_wp_get_equal_col_class($n){
switch($n){
case 1: return 'col-md-12'; break;
case 2: return 'col-lg-6 col-md-6 col-sm-6 col-xs-12'; break;
case 3: return 'col-lg-4 col-md-4 col-sm-4 col-xs-12'; break;
case 4: return 'col-lg-3 col-md-3 col-sm-6 col-xs-12'; break;
}
}
endif;

#vega_wp_get_option
if ( ! function_exists( 'vega_wp_get_option' ) ) :
function vega_wp_get_option($key){
global $vega_wp_defaults;
if (array_key_exists($key, $vega_wp_defaults))
$value = get_theme_mod($key, $vega_wp_defaults[$key]);
else
$value = get_theme_mod($key);
return $value;
}
endif;

function vega_wp_show_banner_title(){
$vega_show_banner_title = true;
$vega_wp_post_title = vega_wp_get_option('vega_wp_post_title');
$vega_wp_page_title = vega_wp_get_option('vega_wp_page_title');
if(is_page()){
if($vega_wp_page_title == 'Both' || $vega_wp_page_title == 'Banner') $vega_show_banner_title = true;
else $vega_show_banner_title = false;
}
if(is_single()){
if($vega_wp_post_title == 'Both' || $vega_wp_post_title == 'Banner') $vega_show_banner_title = true;
else $vega_show_banner_title = false;
}
return $vega_show_banner_title;
}

function vega_wp_show_content_title(){
$vega_show_content_title = true;
$vega_wp_post_title = vega_wp_get_option('vega_wp_post_title');
$vega_wp_page_title = vega_wp_get_option('vega_wp_page_title');
if(is_page()){
if($vega_wp_page_title == 'Both' || $vega_wp_page_title == 'Content') $vega_show_content_title = true;
else $vega_show_content_title = false;
}
if(is_single()){
if($vega_wp_post_title == 'Both' || $vega_wp_post_title == 'Content') $vega_show_content_title = true;
else $vega_show_content_title = false;
}
return $vega_show_content_title;
}

function vega_wp_section_bg_color($key){
$bg_color = vega_wp_get_option($key);
if($bg_color == '') return;

echo ' style="background-color:' . esc_attr($bg_color) . '" ';
}

### EXAMPLE/DEFAULT CONTENT ###

#vega_wp_random_thumbnail
function vega_wp_random_thumbnail($size='default'){
global $vega_wp_defaults;
if($size == 'vega-post-thumbnail-recent')
$images = $vega_wp_defaults['vega_wp_recent_post_image'];
else if($size == 'full')
$images = $vega_wp_defaults['vega_wp_full_image'];
else
$images = $vega_wp_defaults['vega_wp_featured_image'];
$rand_key = array_rand($images, 1);
echo esc_url($images[$rand_key]);
}

#vega_wp_sequential_thumbnail
function vega_wp_sequential_thumbnail($size, $n){
global $vega_wp_defaults;
if($size == 'vega-post-thumbnail-recent')
$images = $vega_wp_defaults['vega_wp_recent_post_image'];
else
$images = $vega_wp_defaults['vega_wp_featured_image'];
echo esc_url($images[$n]);
}

#vega_wp_example_nav_header
function vega_wp_example_nav_header(){
$args = array('parent'=>0);
$pages = get_pages($args);

echo '<div class="navbar-collapse collapse"><ul class="nav navbar-nav navbar-right menu-header">';

$vega_wp_enable_demo = vega_wp_get_option('vega_wp_enable_demo');
if(get_option('show_on_front') == 'page' || $vega_wp_enable_demo == 'Y') {

#one page items
$vega_wp_frontpage_position_content = vega_wp_get_option('vega_wp_frontpage_position_content');
$vega_wp_frontpage_position_4cols = vega_wp_get_option('vega_wp_frontpage_position_4cols');
$vega_wp_frontpage_position_cta_dark = vega_wp_get_option('vega_wp_frontpage_position_cta_dark');
$vega_wp_frontpage_position_cta_dark2 = vega_wp_get_option('vega_wp_frontpage_position_cta_dark2');
$vega_wp_frontpage_position_open1 = vega_wp_get_option('vega_wp_frontpage_position_open1');
$vega_wp_frontpage_position_latest_posts = vega_wp_get_option('vega_wp_frontpage_position_latest_posts');
$arr[$vega_wp_frontpage_position_content] = 'content';
$arr[$vega_wp_frontpage_position_4cols] = '4cols';
$arr[$vega_wp_frontpage_position_cta_dark] = 'cta_dark';
$arr[$vega_wp_frontpage_position_cta_dark2] = 'cta_dark2';
$arr[$vega_wp_frontpage_position_open1] = 'open1';
$arr[$vega_wp_frontpage_position_latest_posts] = 'latest_posts';

ksort($arr);
foreach($arr as $k=>$v){

if($v == 'content') { echo '<li class="page-scroll"><a href="#welcome">' . __('Welcome', 'vega') . '</a></li>'; }

if($v == '4cols') { $vega_wp_frontpage_4_cols_section_id = vega_wp_get_option('vega_wp_frontpage_4_cols_section_id');
$vega_wp_frontpage_4_cols_heading = vega_wp_get_option('vega_wp_frontpage_4_cols_heading');
echo '<li class="page-scroll"><a href="#'.esc_attr($vega_wp_frontpage_4_cols_section_id).'">' . esc_html($vega_wp_frontpage_4_cols_heading) . '</a></li>'; }

if($v == 'cta_dark'){ $vega_wp_frontpage_cta_dark_section_id = vega_wp_get_option('vega_wp_frontpage_cta_dark_section_id');
echo '<li class="page-scroll"><a href="#'.esc_attr($vega_wp_frontpage_cta_dark_section_id).'">' . esc_html($vega_wp_frontpage_cta_dark_section_id) . '</a></li>'; }

if($v == 'cta_dark2'){ $vega_wp_frontpage_cta_dark2_section_id = vega_wp_get_option('vega_wp_frontpage_cta_dark2_section_id');
echo '<li class="page-scroll"><a href="#'.esc_attr($vega_wp_frontpage_cta_dark2_section_id).'">' . esc_html($vega_wp_frontpage_cta_dark2_section_id) . '</a></li>'; }

if($v == 'latest_posts') { $vega_wp_frontpage_latest_posts_section_id = vega_wp_get_option('vega_wp_frontpage_latest_posts_section_id');
$vega_wp_frontpage_latest_posts_heading = vega_wp_get_option('vega_wp_frontpage_latest_posts_heading');
echo '<li class="page-scroll"><a href="#'.esc_attr($vega_wp_frontpage_latest_posts_section_id).'">' . esc_html($vega_wp_frontpage_latest_posts_heading) . '</a></li>'; }

if($v == 'open1') { $vega_wp_frontpage_open1_section_id = vega_wp_get_option('vega_wp_frontpage_open1_section_id');
$vega_wp_frontpage_open1_heading = vega_wp_get_option('vega_wp_frontpage_open1_heading');
echo '<li class="page-scroll"><a href="#'.esc_attr($vega_wp_frontpage_open1_section_id).'">' . esc_html($vega_wp_frontpage_open1_heading) . '</a></li>'; }
}
}

#all top level pages
foreach($pages as $page)
echo '<li><a href="'.get_permalink($page->ID).'">'.esc_html($page->post_title).'</a></li>';
echo '</ul>';
echo '</div>';
}

#vega_wp_example_nav_footer
function vega_wp_example_nav_footer(){
$args = array('parent'=>0);
$pages = get_pages($args);
echo '<ul id="menu-footer" class="nav-foot">';
foreach($pages as $page)
echo '<li><a href="'.get_permalink($page->ID).'">'.esc_html($page->post_title).'</a></li>';
echo '</ul>';
}

#vega_wp_example_frontpage_content
function vega_wp_example_frontpage_content(){
$random_page_id = 1;
$random_page = get_post( $random_page_id );
echo '<h2 class="block-title wow zoomIn">' . esc_html($random_page->post_title) . '</h2>';
echo '<div class="wow fadeInUp">'. $random_page->post_content .'</div>';
}

#vega_wp_example_sidebar_footer
function vega_wp_example_sidebar_footer(){
echo '<div class="footer-widgets bg-grey-light-3">';
echo '<div class="container">';
echo '<div class="row">';
echo '<div class="col-md-3 footer-widget footer-widget-col-1">';
the_widget('WP_Widget_Pages', 'title=' . __('Pages', 'vega') , 'before_title=<h3 class="widget-title">&after_title=</h3>&before_widget=<div class="widget">&after_widget=</div>');
echo '</div>';
echo '<div class="col-md-3 footer-widget footer-widget-col-2">';
the_widget('WP_Widget_Recent_Posts', 'title=' . __('Recent Posts', 'vega') , 'before_title=<h3 class="widget-title">&after_title=</h3>&before_widget=<div class="widget">&after_widget=</div>');
echo '</div>';
echo '<div class="col-md-3 footer-widget footer-widget-col-3">';
the_widget('WP_Widget_Categories', 'title=' . __('Categories', 'vega') , 'before_title=<h3 class="widget-title">&after_title=</h3>&before_widget=<div class="widget">&after_widget=</div>');
echo '</div>';
echo '<div class="col-md-3 footer-widget footer-widget-col-3">';
the_widget( 'WP_Widget_Meta', 'title=' . __('Meta', 'vega') , 'before_title=<h3 class="widget-title">&after_title=</h3>&before_widget=<div class="widget">&after_widget=</div>');
echo '</div>';
echo '</div></div></div>';
}

#vega_wp_example_sidebar
function vega_wp_example_sidebar(){
echo '<div class="sidebar-widgets" >';
the_widget('WP_Widget_Search');
the_widget('WP_Widget_Pages', 'title=' . __('Pages', 'vega') , 'before_title=<h3 class="widget-title">&after_title=</h3>&before_widget=<div class="widget">&after_widget=</div>');
the_widget('WP_Widget_Recent_Posts', 'title=' . __('Recent Posts', 'vega') , 'before_title=<h3 class="widget-title">&after_title=</h3>&before_widget=<div class="widget">&after_widget=</div>');
the_widget( 'WP_Widget_Archives', 'title=' . __('Archives', 'vega'), 'before_title=<h3 class="widget-title">&after_title=</h3>&before_widget=<div class="widget">&after_widget=</div>');
the_widget( 'WP_Widget_Categories', 'title=' . __('Categories', 'vega'), 'before_title=<h3 class="widget-title">&after_title=</h3>&before_widget=<div class="widget">&after_widget=</div>');
echo '</div>';
}

?>

 

 

@asgaros

With the last update some of users have problem to get in the forum

They have this message :

Fatal error: Uncaught Error: Using $this when not in object context in /homepages/23/d212578720/htdocs/LOHAD/wp-content/plugins/asgaros-forum/includes/forum-permissions.php:94 Stack trace: #0 /homepages/23/d212578720/htdocs/LOHAD/wp-content/themes/screenr/functions.php(388): AsgarosForumPermissions::getForumRole(‘1’) #1 /homepages/23/d212578720/htdocs/LOHAD/wp-includes/class-wp-hook.php(286): show_forum_role(‘1’, ‘127’) #2 /homepages/23/d212578720/htdocs/LOHAD/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array) #3 /homepages/23/d212578720/htdocs/LOHAD/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #4 /homepages/23/d212578720/htdocs/LOHAD/wp-content/plugins/asgaros-forum/includes/views/post-element.php(55): do_action(‘asgarosforum_af…’, ‘1’, ‘127’) #5 /homepages/23/d212578720/htdocs/LOHAD/wp-content/plugins/asgaros-forum/includes/views/topic.php(21): require(‘/homepages/23/d…’) #6 /homepages/23/d212578720/htdocs/LOHAD/wp-content/plugins/asgaros-forum/includes/forum.php(655): require(‘/homepage in /homepages/23/d212578720/htdocs/LOHAD/wp-content/plugins/asgaros-forum/includes/forum-permissions.php on line 94

For myself everything is OK (I’m on Google Chrome) but somme users have this error.

The first one is on Internet Explorer … I’m trying to ask to the others.

Do you have an idea ?

@v490

Ersetze bitte die folgende Zeile:

if (AsgarosForumPermissions::isModerator($author_id)) {

Hiermit:

global $asgarosforum;
if ($asgarosforum->permissions->isModerator($author_id)) {

 

v490 has reacted to this post.
v490
If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Hello @tof

Unfortunately this is caused by some changes which I had to make to a couple of functions. This means that some of your custom code implement via your themes functions.php file is not working anymore.

If you have some knowledge with coding you can have a look at the code example in the post above (the second code-snippet contains the correct function-call). Otherwise just post your current functions.php file code here so I can tell you the exact changes you have to make.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

OK … thanks for the help @asgaros

Here is the code of my functions.php file

<?php
/**
* Screenr functions and definitions.
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Screenr
*/

if ( ! function_exists( 'screenr_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function screenr_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Screenr, use a find and replace
* to change 'screenr' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'screenr', get_template_directory() . '/languages' );

// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );

/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );

/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
add_post_type_support( 'page', 'excerpt' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'screenr-blog-grid-small', 350, 200, true );
add_image_size( 'screenr-blog-grid', 540, 300, true );
add_image_size( 'screenr-blog-list', 790, 400, true );
add_image_size( 'screenr-service-small', 538, 280, true );

add_theme_support( 'custom-logo', array(
'height' => 60,
'width' => 240,
'flex-height' => true,
'flex-width' => true,
//'header-text' => array( 'site-title', 'site-description' ),
) );

// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary', 'screenr' ),
) );

/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
) );

// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'screenr_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );

add_theme_support( 'custom-header', array(
'default-image' => get_template_directory_uri() . '/assets/images/header-default.jpg',
'width' => 1600,
'height' => 800,
'flex-height' => false,
'flex-width' => false,
'uploads' => true,
'random-default' => false,
'header-text' => false,
'default-text-color' => '',
'wp-head-callback' => '',
'admin-head-callback' => '',
'admin-preview-callback' => '',
) );

// Recommend plugins
add_theme_support( 'recommend-plugins', array(
'contact-form-7' => array(
'name' => esc_html__( 'Contact Form 7', 'screenr' ),
'active_filename' => 'contact-form-7/wp-contact-form-7.php',
),
'easymega' => array(
'name' => esc_html__( 'Mega Menu Plugin for WordPress', 'screenr' ),
'active_filename' => 'easymega/easymega.php',
),
) );

// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );

/*
* WooCommerce support.
*/
add_theme_support( 'woocommerce' );

}
endif;
add_action( 'after_setup_theme', 'screenr_setup' );

/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function screenr_content_width() {
$GLOBALS['content_width'] = apply_filters( 'screenr_content_width', 790 );
}
add_action( 'after_setup_theme', 'screenr_content_width', 0 );

/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function screenr_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'screenr' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );

if ( class_exists( 'WooCommerce' ) ) {
register_sidebar( array(
'name' => esc_html__( 'Shop', 'screenr' ),
'id' => 'sidebar-shop',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
}

register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'screenr' ),
'id' => 'footer-1',
'description' => screenr_sidebar_desc( 'footer-1' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'screenr' ),
'id' => 'footer-2',
'description' => screenr_sidebar_desc( 'footer-2' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'screenr' ),
'id' => 'footer-3',
'description' => screenr_sidebar_desc( 'footer-3' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 4', 'screenr' ),
'id' => 'footer-4',
'description' => screenr_sidebar_desc( 'footer-4' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );

}
add_action( 'widgets_init', 'screenr_widgets_init' );

/**
* Add Google Fonts, editor styles to WYSIWYG editor
*/
function screenr_editor_styles() {
add_editor_style( array( 'assets/css/editor-style.css', screenr_fonts_url() ) );
}
add_action( 'after_setup_theme', 'screenr_editor_styles' );

/**
* Enqueue scripts and styles.
*/
function screenr_scripts() {
$theme = wp_get_theme();
$version = $theme->get( 'Version' );

wp_enqueue_style( 'screenr-fonts', screenr_fonts_url(), array(), null );
wp_enqueue_style( 'font-awesome', get_template_directory_uri() .'/assets/css/font-awesome.min.css', false, '4.0.0' );
wp_enqueue_style( 'bootstrap', get_template_directory_uri() .'/assets/css/bootstrap.min.css', false, '4.0.0' );
wp_enqueue_style( 'screenr-style', get_template_directory_uri().'/style.css' );

wp_enqueue_script( 'screenr-plugin', get_template_directory_uri() . '/assets/js/plugins.js', array( 'jquery' ), '4.0.0', true );
wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array(), '4.0.0', true );

$screenr_js = array(
'ajax_url' => admin_url( 'admin-ajax.php' ),
'full_screen_slider' => ( get_theme_mod( 'slider_fullscreen' ) ) ? true : false,
'header_layout' => get_theme_mod( 'header_layout' ),
'slider_parallax' => ( get_theme_mod( 'slider_parallax', 1 ) == 1 ) ? 1 : 0,
'is_home_front_page' => ( is_page_template( 'template-frontpage.php' ) && is_front_page() ) ? 1 : 0,
'autoplay' => 7000,
'speed' => 700,
'effect' => 'slide',
'gallery_enable' => '',
);

// Load gallery scripts
$galley_disable = get_theme_mod( 'gallery_disable' ) == 1 ? true : false;
if ( ! $galley_disable || is_customize_preview() ) {
$screenr_js['gallery_enable'] = 1;
$display = get_theme_mod( 'gallery_display', 'grid' );
if ( ! is_customize_preview() ) {
switch ( $display ) {
case 'masonry':
wp_enqueue_script('screenr-gallery-masonry', get_template_directory_uri() . '/assets/js/isotope.pkgd.min.js', array(), $version, true);
break;
case 'justified':
wp_enqueue_script('screenr-gallery-justified', get_template_directory_uri() . '/assets/js/jquery.justifiedGallery.min.js', array(), $version, true);
break;
case 'slider':
case 'carousel':
wp_enqueue_script('screenr-gallery-carousel', get_template_directory_uri() . '/assets/js/owl.carousel.min.js', array(), $version, true);
break;
default:
break;
}
} else {
wp_enqueue_script('screenr-gallery-masonry', get_template_directory_uri() . '/assets/js/isotope.pkgd.min.js', array(), $version, true);
wp_enqueue_script('screenr-gallery-justified', get_template_directory_uri() . '/assets/js/jquery.justifiedGallery.min.js', array(), $version, true);
wp_enqueue_script('screenr-gallery-carousel', get_template_directory_uri() . '/assets/js/owl.carousel.min.js', array(), $version, true);
}
}

wp_enqueue_style( 'screenr-gallery-lightgallery', get_template_directory_uri().'/assets/css/lightgallery.css' );

wp_enqueue_script( 'screenr-theme', get_template_directory_uri() . '/assets/js/theme.js', array( 'jquery' ), '20120206', true );

if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}

wp_localize_script( 'screenr-theme', 'Screenr', apply_filters( 'screenr_localize_script', $screenr_js ) );

if ( class_exists( 'WooCommerce' ) ) {
wp_enqueue_style( 'screenr-woocommerce', get_template_directory_uri().'/woocommerce.css' );
}

}
add_action( 'wp_enqueue_scripts', 'screenr_scripts' );

if ( ! function_exists( 'screenr_fonts_url' ) ) :
/**
* Register default Google fonts
*/
function screenr_fonts_url() {
$fonts_url = '';

/* Translators: If there are characters in your language that are not
* supported by Open Sans, translate this to 'off'. Do not translate
* into your own language.
*/
$open_sans = _x( 'on', 'Open Sans font: on or off', 'screenr' );

/* Translators: If there are characters in your language that are not
* supported by Montserrat, translate this to 'off'. Do not translate
* into your own language.
*/
$montserrat = _x( 'on', 'Montserrat font: on or off', 'screenr' );

if ( 'off' !== $montserrat || 'off' !== $open_sans ) {
$font_families = array();

if ( 'off' !== $open_sans ) {
$font_families[] = 'Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic';
}

if ( 'off' !== $montserrat ) {
$font_families[] = 'Montserrat:400,700';
}

$query_args = array(
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
);

$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}

return esc_url_raw( $fonts_url );
}
endif;

/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';

/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/extras.php';

/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';

/**
* Slider
*/
require get_template_directory() . '/inc/class-slider.php';

if ( class_exists( 'WooCommerce' ) ) {
/**
* Woocommerce
*/
require get_template_directory() . '/inc/wc.php';

}

/**
* Add theme info page
*/
require get_template_directory() . '/inc/dashboard.php';

//require_once( trailingslashit( get_template_directory() ) . 'trt-customizer-pro/example-1/class-customize.php' );

//////////////////////
// ASGAROS
//////////////////////

add_action('asgarosforum_custom_profile_content', 'my_function_asgaros_cabinet2', 30, 1);
function my_function_asgaros_cabinet2($data) {
echo '<a href="http://lohad.fr/messages/?fepaction=newmessage&fep_to='.$data->ID.'" title="'.__('Message Privé','rcl-asgaros').'"><i style="color:'.$rcl_options['color_font_icon'].';" class="fa fa-comment"></i> Message Privé</a>';

}

add_action('asgarosforum_after_post_author', 'my_function_asgaros_cabinet', 30, 1);
function my_function_asgaros_cabinet($author_id) {
echo '<a href="http://lohad.fr/messages/?fepaction=newmessage&fep_to='.$author_id.'" title="'.__('Message Privé','rcl-asgaros').'"><i style="color:'.$rcl_options['color_font_icon'].';" class="fa fa-comment"></i></a>';
}

function show_forum_role($user_id, $post_counter) {
echo '<br>'.AsgarosForumPermissions::getForumRole($user_id).'<br>';
}
add_action('asgarosforum_after_post_author', 'show_forum_role', 10, 2);

 

@tof

Replace the following line:

echo '<br>'.AsgarosForumPermissions::getForumRole($user_id).'<br>';

With:

global $asgarosforum;
echo '<br>'.$asgarosforum->permissions->getForumRole($user_id).'<br>';

This should fix the error. 🙂

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!
PreviousPage 2 of 5Next