Forum Replies Created

Viewing 28 posts - 41 through 68 (of 68 total)
  • Author
  • in reply to: How can i force the translation? #150059
     Roader
    Participant

    Hola Laura. AYUDA!!

    He tratado de hacer que WordPress reconozca los .mo y .po del Theme /sweetdate / languages

    Instalé un switcher de idiomas, funciona con BuddyPress, o sea, este reconoce los .mo y .po de BP puestos en wp-content /languages / plugins y cambia de inglés a español sin problemas.

    Pero con el lang del theme no funciona así wp-content /languages / themes.
    Ni así wp-content / themes / sweetdate (o sweetdate-child) / languages.

    Prueba y me avisas por favor.

    Código para intentar hacer funcionar el reconocimiento o carga del idioma del Theme:

    COPY CODE
    
    // Load translation files from your child theme instead of the parent theme
    function child_theme_slug_setup() {
        load_child_theme_textdomain( 'sweetdate', get_stylesheet_directory() . '/languages' );
    }
    add_action( 'after_setup_theme', 'sweetdate_theme_slug_setup' );

    Fuente: http://docs.easydigitaldownloads.com

    Otra fuente (Link).

    in reply to: SweeDate: Security Tips #149138
     Roader
    Participant

    SPEED (HOSTGATOR)

    COPY CODE
    # Enable Gzip
    <ifModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </ifModule>
    
    # Enable Deflate
    <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/atom_xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/x-shockwave-flash
    AddOutputFilterByType DEFLATE image/svg+xml .svg .svgz
    </IfModule>
    
    # Enable mod_headers 
    <ifModule mod_headers.c>
    # 6 MONTH
    <FilesMatch ".(ico|gif|jpg|jpeg|png|flv|pdf|mp3|mp4)$">
    Header set Cache-Control "max-age=15552000"
    </FilesMatch>
    # 1 WEEK
    <FilesMatch ".(js|css|swf)$">
    Header set Cache-Control "max-age=604800"
    </FilesMatch>
    # 60 MIN
    <FilesMatch ".(html|htm|txt)$">
    Header set Cache-Control "max-age=2700"
    </FilesMatch>
    </ifModule>
    
    # Expires
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 60 days"
    ExpiresByType image/jpeg "access plus 60 days"
    ExpiresByType image/gif "access plus 60 days"
    ExpiresByType image/png "access plus 60 days"
    ExpiresByType audio/x-wav "access plus 1 month"
    ExpiresByType audio/mpeg "access plus 1 month"
    ExpiresByType video/mpeg "access plus 1 month"
    ExpiresByType video/mp4 "access plus 1 month"
    ExpiresByType video/quicktime "access plus 1 month"
    ExpiresByType video/x-ms-wmv "access plus 1 month"
    ExpiresByType text/css "access 5 days"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType text/x-javascript "access plus 1 week"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType application/x-javascript "access plus 1 week"
    ExpiresByType application/javascript "access plus 1 week"
    ExpiresByType image/x-icon "access plus 1 month"
    ExpiresDefault "access plus 2 days"
    </IfModule>

    If you use All In One WordPress Security And FireWall, DONT Active Captcha with this plugin.

    Here I sharing my Htaccess. Good Luck!

    Attachments:
    You must be logged in to view attached files.
    in reply to: SweeDate: Security Tips #149017
     Roader
    Participant

    Other for wp-admin:

    COPY CODE
    # Protect htaccess
    <files .htaccess>
    order allow,deny
    deny from all
    </files>
    
    # Protect wp-admin by my IP
    order deny,allow
    allow from 000.0.00.00
    deny from all
    
    <FilesMatch "\.(css|js|jpg|jpeg|gif|png)$">
      Order Allow,Deny
      Allow from All
      Satisfy Any
    </FilesMatch>
     
    <Files admin-ajax.php>
      Order Allow,Deny
      Allow from All
      Satisfy Any
    </Files>

    Allow Ajax is important for some Plugins and Themes.
    Remember change allow from 000.0.00.00 IP Address.

    in reply to: SweeDate: Security Tips #148998
     Roader
    Participant

    PART III

    Now, go to: public_html / wp-content / themes / sweetdate-child and open functions.php for Edit. ADD:

    COPY CODE
    
    // Enable shortcodes in text widgets
    add_filter('widget_text','do_shortcode');
    
    // Protect commentary box 
    add_filter('pre_comment_content', 'wp_specialchars');
    
    // Disable Login's errors
    function login_errors_message() {
    	return 'Ooooops! Something is wrong, try again, please!';
    }
    add_filter('login_errors', 'login_errors_message');
    
    // Remove WP Header Junk 
    remove_action('wp_head', 'rsd_link'); // remove really simple discovery link
        remove_action('wp_head', 'wp_generator'); // remove wordpress version
    
        remove_action('wp_head', 'feed_links', 2); // remove rss feed links (make sure you add them in yourself if youre using feedblitz or an rss service)
        remove_action('wp_head', 'feed_links_extra', 3); // removes all extra rss feed links
    
        remove_action('wp_head', 'index_rel_link'); // remove link to index page
        remove_action('wp_head', 'wlwmanifest_link'); // remove wlwmanifest.xml (needed to support windows live writer)
    
        remove_action('wp_head', 'start_post_rel_link', 10, 0); // remove random post link
        remove_action('wp_head', 'parent_post_rel_link', 10, 0); // remove parent post link
        remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); // remove the next and previous post links
        remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
    
        remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0 );

    NOTE: The next code if to Protect BuddyPress Admin.

    COPY CODE
    // Exclude Admins from Directories and BP Widgets 
    add_filter( 'bp_after_has_members_parse_args', 'buddydev_exclude_users' );
     
    function buddydev_exclude_users( $args ) {
        //do not exclude in admin
        if( is_admin() && ! defined( 'DOING_AJAX' ) ) {
            return $args;
        }
        
        $excluded = isset( $args['exclude'] )? $args['exclude'] : array();
     
        if( !is_array( $excluded ) ) {
            $excluded = explode(',', $excluded );
        }
        
        $user_ids = array( 1, ); // enter user ids here
        
        
        $excluded = array_merge( $excluded, $user_ids );
        
        $args['exclude'] = $excluded;
        
        return $args;
    }
    
    // Deny access to admins profile. User is redirected to the homepage
    function bpfr_hide_admins_profile() {
    	global $bp; 
    	if(bp_is_profile && $bp->displayed_user->id == 1 && $bp->loggedin_user->id != 1) :
    		wp_redirect( home_url() );
    	exit;
    	endif;
    }
    add_action( 'wp', 'bpfr_hide_admins_profile', 1 );
    
    // Hide admin's activities from all activity feeds
    function bpfr_hide_admin_activity( $a, $activities ) {	
    	
    	// ... but allow admin to see his activities!
    	if ( is_site_admin() )	
    		return $activities;	
    	
    	foreach ( $activities->activities as $key => $activity ) {	
    		// ID's to exclude, separated by commas. ID 1 is always the superadmin
    		if ( $activity->user_id == 1  ) {			
    			
    			unset( $activities->activities[$key] );			
    			
    			$activities->activity_count = $activities->activity_count-1;			
    			$activities->total_activity_count = $activities->total_activity_count-1;			
    					$activities->pag_num = $activities->pag_num -1;				
    		}		
    	}
    	
    					
    	// Renumber the array keys to account for missing items 	
    	$activities_new = array_values( $activities->activities );		
    	$activities->activities = $activities_new;	
    	
    	return $activities;
    	
    }
    add_action( 'bp_has_activities', 'bpfr_hide_admin_activity', 10, 2 );
    
    

    If you use these codes… your BuddyPress KeyMaster or Admin will be Invisible for all members (except yourself). This Admin will be only to Administrate the Site (update plugins, create Pages only, etc.). Keymaster or Admin is Not for Post Activities, Blog Posts, Messaging, etc.
    So, you can create a new User for post, etc. a secure Contributor or SubAdmin. Remember if a Hacker know your Super Admin, you could have problems.

    What more can I improve? To know that, go to WPDOCTOR (LINK). Write your Url or Domain. Here you can obtain a good analysis of your Security, Speed, etc.

    RECOMMENDE PLUGINS:

    – SEO by Yoast

    – Wp Super Cache

    – BackUpWordPress

    Please, do not install a lot of plugins, or outdate plugins.
    Only use that you need.

    GOOD LUCK!

    in reply to: SweeDate: Security Tips #148991
     Roader
    Participant

    <h1>CONTINUE:</h1>

    Disable XML-RPC (Please Read LINK)

    <h4>Well, If you decides to user All In One WordPress Security, use this Custom directives:</h4>

    COPY CODE
    
    
    # Prevent  SQL Injections
    
    Options +FollowSymLinks
    
    RewriteEngine On
    
    RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
    
    RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    
    RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
    
    RewriteRule ^(.*)$ index.php [F,L]
    
    # Protect  Headers
    
    Header set X-XSS-Protection "1; mode=block"
    
    Header set X-Content-Type-Options nosniff
    
    Header always append X-Frame-Options SAMEORIGIN
    
    # Active Gzip
    
    <ifModule mod_gzip.c>
    
    mod_gzip_on Yes
    
    mod_gzip_dechunk Yes
    
    mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
    
    mod_gzip_item_include handler ^cgi-script$
    
    mod_gzip_item_include mime ^text/.*
    
    mod_gzip_item_include mime ^application/x-javascript.*
    
    mod_gzip_item_exclude mime ^image/.*
    
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    
    </ifModule>

    <h2>MORE SECURITY </h2>

    If you are using HostGator and Php 5 or 7, go to your: public_html , search the file: .user.ini and put this:

    display_errors = Off

    This prevent the bug WordPress – Full Path Disclosure.

    <h4>Protect Wp Admin </h4>

    There are many forms to protect Wp Admin, but here I give you one:

    In public_html / wp-admin Create a .htaccess file, and add this:

    # Protect htaccess
    <files .htaccess>
    order allow,deny
    deny from all
    </files>

    # Protect wp-admin by my IP
    order deny,allow
    allow from 000.0.00.00
    deny from all

    Change 000.0.00.00 for your IP. What is your IP Address? (LINK TO KNOW)

    Nobody except the Administrator and Contributors could in to your WP Admin DashBoard.

    If you want to add other secure IP, add other: allow from 000….

    <h4>Protect Uploads folder </h4>

    Go to: public_html / wp-content / uploads, Create a .htaccess files and add this:

    # Protect htaccess
    <files .htaccess>
    order allow,deny
    deny from all
    </files>

    # Secure uploads directory
    <Files ~ “.*\..*”>
    Order Allow,Deny
    Deny from all
    </Files>
    <FilesMatch “\.(jpg|jpeg|jpe|gif|png|pdf|mp4|mpeg|mp3)$”>
    Order Deny,Allow
    Allow from all
    </FilesMatch>

    in reply to: Remove header logo #148414
     Roader
    Participant

    Well, well,

    Now, inside your functions.php (child theme) use:

    COPY CODE
    // Desactiva los errores de la pagina Login
    function login_errors_message() {
    	return 'Ooooops! Something is wrong, try again, please!';
    }
    add_filter('login_errors', 'login_errors_message');
    
    // Remove WP Header Junk 
    remove_action('wp_head', 'rsd_link'); // remove really simple discovery link
        remove_action('wp_head', 'wp_generator'); // remove wordpress version
    
        remove_action('wp_head', 'feed_links', 2); // remove rss feed links (make sure you add them in yourself if youre using feedblitz or an rss service)
        remove_action('wp_head', 'feed_links_extra', 3); // removes all extra rss feed links
    
        remove_action('wp_head', 'index_rel_link'); // remove link to index page
        remove_action('wp_head', 'wlwmanifest_link'); // remove wlwmanifest.xml (needed to support windows live writer)
    
        remove_action('wp_head', 'start_post_rel_link', 10, 0); // remove random post link
        remove_action('wp_head', 'parent_post_rel_link', 10, 0); // remove parent post link
        remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); // remove the next and previous post links
        remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
    
        remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0 );
    
    // Proteger caja comentarios
    add_filter('pre_comment_content', 'wp_specialchars');
    
    // Wp DashBoard Only for Admins
    add_action( 'init', 'blockusers_init' );
    function blockusers_init() {
     if ( is_admin() && !current_user_can( 'administrator' ) && !( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
     wp_redirect( home_url() );exit;
     }
    }
    
    // Enable shortcodes in text widgets
    add_filter('widget_text','do_shortcode');
    
    /* Filter the redirect url for login */
    add_filter("login_redirect","kleo_redirect_to_profile",100,3);
     
    function kleo_redirect_to_profile($redirect_to_calculated,$redirect_url_specified,$user){
    /*if no redirect was specified,let us think ,user wants to be in wp-dashboard*/
        if(!is_super_admin($user->ID))
            return bp_core_get_user_domain($user->ID );
        else
            return $redirect_to_calculated; /*if site admin*/
    }
    
    // Exclude Admins from Directories and BP Widgets 
    add_filter( 'bp_after_has_members_parse_args', 'buddydev_exclude_users' );
     
    function buddydev_exclude_users( $args ) {
        //do not exclude in admin
        if( is_admin() && ! defined( 'DOING_AJAX' ) ) {
            return $args;
        }
        
        $excluded = isset( $args['exclude'] )? $args['exclude'] : array();
     
        if( !is_array( $excluded ) ) {
            $excluded = explode(',', $excluded );
        }
        
        $user_ids = array( 1, ); // enter user ids here
        
        
        $excluded = array_merge( $excluded, $user_ids );
        
        $args['exclude'] = $excluded;
        
        return $args;
    }
    
    // Deny access to admins profile. User is redirected to the homepage
    function bpfr_hide_admins_profile() {
    	global $bp; 
    	if(bp_is_profile && $bp->displayed_user->id == 1 && $bp->loggedin_user->id != 1) :
    		wp_redirect( home_url() );
    	exit;
    	endif;
    }
    add_action( 'wp', 'bpfr_hide_admins_profile', 1 );
    
    // Hide admin's activities from all activity feeds
    function bpfr_hide_admin_activity( $a, $activities ) {	
    	
    	// ... but allow admin to see his activities!
    	if ( is_site_admin() )	
    		return $activities;	
    	
    	foreach ( $activities->activities as $key => $activity ) {	
    		// ID's to exclude, separated by commas. ID 1 is always the superadmin
    		if ( $activity->user_id == 1  ) {			
    			
    			unset( $activities->activities[$key] );			
    			
    			$activities->activity_count = $activities->activity_count-1;			
    			$activities->total_activity_count = $activities->total_activity_count-1;			
    					$activities->pag_num = $activities->pag_num -1;				
    		}		
    	}
    	
    					
    	// Renumber the array keys to account for missing items 	
    	$activities_new = array_values( $activities->activities );		
    	$activities->activities = $activities_new;	
    	
    	return $activities;
    	
    }
    add_action( 'bp_has_activities', 'bpfr_hide_admin_activity', 10, 2 );
    in reply to: Remove header logo #148413
     Roader
    Participant
    This reply has been set as private.
    in reply to: Hide BuddyPress Super Admin from #148144
     Roader
    Participant

    OTHER CODE::::

    COPY CODE
    // Remove admin from the member directory
    function bpdev_exclude_users($qs=false,$object=false){
        
        $excluded_user='1'; // Id's to remove, separated by comma
    	
        if($object != 'members' && $object != 'friends')// hide admin to members & friends 
        return $qs;
    	
        $args=wp_parse_args($qs);
    
        if(!empty($args['user_id']))
        return $qs;	
    	
        if(!empty($args['exclude']))
    		$args['exclude'] = $args['exclude'].','.$excluded_user;
        else
    		$args['exclude'] = $excluded_user;
    	
        $qs = build_query($args);
    
        return $qs;
    	
    }
    add_action('bp_ajax_querystring','bpdev_exclude_users',20,2);
    
    // Once admin is removed, we must recount the members !
    function bpfr_hide_get_total_filter($count){
        return $count-1;
    }
    add_filter('bp_get_total_member_count','bpfr_hide_get_total_filter');
    
    
    in reply to: Hide BuddyPress Super Admin from #148141
     Roader
    Participant
    COPY CODE
    <strong>FULL CODE:::</strong>
    
    // Exclude Admins from Directories and BP Widgets 
    add_filter( 'bp_after_has_members_parse_args', 'buddydev_exclude_users' );
     
    function buddydev_exclude_users( $args ) {
        //do not exclude in admin
        if( is_admin() && ! defined( 'DOING_AJAX' ) ) {
            return $args;
        }
        
        $excluded = isset( $args['exclude'] )? $args['exclude'] : array();
     
        if( !is_array( $excluded ) ) {
            $excluded = explode(',', $excluded );
        }
        
        $user_ids = array( 1, ); // enter user ids here, separated by comma
        
        
        $excluded = array_merge( $excluded, $user_ids );
        
        $args['exclude'] = $excluded;
        
        return $args;
    }
    
    // Deny access to admins profile. User is redirected to the homepage
    function bpfr_hide_admins_profile() {
    	global $bp; 
    	if(bp_is_profile && $bp->displayed_user->id == 1 && $bp->loggedin_user->id != 1) :
    		wp_redirect( home_url() );
    	exit;
    	endif;
    }
    add_action( 'wp', 'bpfr_hide_admins_profile', 1 );
    
    // Hide admin's activities from all activity feeds
    function bpfr_hide_admin_activity( $a, $activities ) {	
    	
    	// ... but allow admin to see his activities!
    	if ( is_site_admin() )	
    		return $activities;	
    	
    	foreach ( $activities->activities as $key => $activity ) {	
    		// ID's to exclude, separated by commas. ID 1 is always the superadmin
    		if ( $activity->user_id == 1  ) {			
    			
    			unset( $activities->activities[$key] );			
    			
    			$activities->activity_count = $activities->activity_count-1;			
    			$activities->total_activity_count = $activities->total_activity_count-1;			
    					$activities->pag_num = $activities->pag_num -1;				
    		}		
    	}
    	
    					
    	// Renumber the array keys to account for missing items 	
    	$activities_new = array_values( $activities->activities );		
    	$activities->activities = $activities_new;	
    	
    	return $activities;
    	
    }
    add_action( 'bp_has_activities', 'bpfr_hide_admin_activity', 10, 2 );
    
    
    in reply to: How can I protect wp-login… and others #148030
     Roader
    Participant
    COPY CODE
    // Limit WP Dashboard Access
    add_action( 'init', 'blockusers_init' );
    function blockusers_init() {
     if ( is_admin() && !current_user_can( 'administrator' ) && !( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
     wp_redirect( home_url() );exit;
     }
    }

    Okey, this code works, but, I need to add access for Shop manager, but, I dont know how

    in reply to: How can I protect wp-login… and others #148027
     Roader
    Participant

    Other think:

    How can I to restringe the access to dashboard? For example, if a suscriptor write:

    mysite.com/wp-admin He or She can in to WP DashBoard. I dont want that.

    I did try with:

    COPY CODE
    //Acceso prohibido a Dashboard de suscriptores
    function restrict_access_admin_panel(){
                    global $current_user;
                    get_currentuserinfo();
                    if ($current_user->user_level <  4) {
                            wp_redirect( get_bloginfo('url') );
                            exit;
                    }
            }
            add_action('admin_init', 'restrict_access_admin_panel', 1);
    

    But, with this code an error:

    When a User fails with the LogIn, he is redirect to: wp-login.php

    I dont want that.

    Attachments:
    You must be logged in to view attached files.
     Roader
    Participant

    Now working.

    Delete endif; from the php code.

    Working code:

    COPY CODE
    function kleo_copyright_text()
    {
      echo '<p>'. __("Copyright", 'kleo_framework').' © '.date("Y").' '. get_bloginfo('name').'. <br class="hide-for-large show-for-small"/>'. get_bloginfo( 'description' ).' </p><div class="footer-info"> | <a href="YOUR URL HERE" rel="nofollow"><strong>TERMS AND CONDITIONS</strong></a> | <a href="YOUR URL HERE" rel="nofollow"><strong>PRIVACY AND POLICY</strong></a> | <a href="YOUR URL HERE" rel="nofollow"><strong>CONTACT US</strong></a></div>';        
    }
    add_action('kleo_footer_text','kleo_copyright_text');

    CSS:

    COPY CODE
    .footer-info {
      float: right;
      margin-top: -3%;
    }
    Attachments:
    You must be logged in to view attached files.
    in reply to: Problem with Dropdown Menu #147307
     Roader
    Participant

    Problem detected.

    COPY CODE
    .top-bar ul>li a:not(.button) {
        display: inline; 
        }

    Thanks Radu!

    in reply to: Problem with Theme functions.php #146956
     Roader
    Participant

    No Laura, default Child Theme has problems. Solution:

    In functions.php —->

    COPY CODE
    <?php
    /**
     * @package WordPress
     * @subpackage Sweetdate
     * @author SeventhQueen <themesupport@seventhqueen.com>
     * @since Sweetdate 1.0
     */
    
    /**
     * Sweetdate Child Theme Functions
     * Add extra code or replace existing functions
    */ 
    
    ?>
    <?php
    
    // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED - Do not modify or remove comment markers above or below:
    
    // END ENQUEUE PARENT ACTION
    in reply to: A little problem with WangGuard #146838
     Roader
    Participant

    – Mi querida Laura, podrías pasarme un tutorial completo para conectar mi Hosting (HostaGator) + WordPress + CloudFlare?

    – También te agradecería que me digas cómo obtener un SSL gratuito, vi algo de Linux (Let’s Encrypt) pero no sé si funcione con HostGator.

    – Por otro lado algunos tips extras que han usado uds los del Equipo 7thQ para proteger su Site.

    Algo malo de BuddyPress que acabo de observar, corregible sí, es que muestra el Username del Super Admin. Si un hacker se suscribe a la página, y ve ese username, pues qué crees?

    La solución fue esta, pero a medias —> Digo a medias porque necesito un código para ocultar el Super Admin de los WidGets de BuddyPress (si sabes cómo puedo hacerlo dímelo):

    COPY CODE
    // Deny access to admins profile. User is redirected to the homepage
    function bpfr_hide_admins_profile() {
    	global $bp; 
    	if(bp_is_profile && $bp->displayed_user->id == 1 && $bp->loggedin_user->id != 1) :
    		wp_redirect( home_url() );
    	exit;
    	endif;
    }
    add_action( 'wp', 'bpfr_hide_admins_profile', 1 );
    
    // Hide admin's activities from all activity feeds
    function bpfr_hide_admin_activity( $a, $activities ) {	
    	
    	// ... but allow admin to see his activities!
    	if ( is_site_admin() )	
    		return $activities;	
    	
    	foreach ( $activities->activities as $key => $activity ) {	
    		// ID's to exclude, separated by commas. ID 1 is always the superadmin
    		if ( $activity->user_id == 1  ) {			
    			
    			unset( $activities->activities[$key] );			
    			
    			$activities->activity_count = $activities->activity_count-1;			
    			$activities->total_activity_count = $activities->total_activity_count-1;			
    					$activities->pag_num = $activities->pag_num -1;				
    		}		
    	}		
    	// Renumber the array keys to account for missing items 	
    	$activities_new = array_values( $activities->activities );		
    	$activities->activities = $activities_new;	
    	
    	return $activities;
    	
    }
    add_action( 'bp_has_activities', 'bpfr_hide_admin_activity', 10, 2 );
    
    // Remove admin from the member directory
    function bpdev_exclude_users($qs=false,$object=false){
        
        $excluded_user='1'; // Id's to remove, separated by comma
    	
        if($object != 'members' && $object != 'friends')// hide admin to members & friends 
        return $qs;
    	
        $args=wp_parse_args($qs);
    
        if(!empty($args['user_id']))
        return $qs;	
    	
        if(!empty($args['exclude']))
    		$args['exclude'] = $args['exclude'].','.$excluded_user;
        else
    		$args['exclude'] = $excluded_user;
    	
        $qs = build_query($args);
    
        return $qs;
    	
    }
    add_action('bp_ajax_querystring','bpdev_exclude_users',20,2);
    
    // once admin is removed, we must recount the members !
    function bpfr_hide_get_total_filter($count){
        return $count-1;
    }
    add_filter('bp_get_total_member_count','bpfr_hide_get_total_filter');
    
    
    in reply to: Member Directory… Search Form #146291
     Roader
    Participant

    No my friend. I dont want KLEO for now.
    Only I want: Align “Order by”, and Style for the members search. The code for search is:

    COPY CODE
    <div id="members-dir-search" class="dir-search" role="search">
    
    				<?php bp_directory_members_search_form(); ?>
    
    			</div><!-- #members-dir-search -->

    But, when I put this code in Members / Index.php, the Search appears without Css, Because SweetDate only has Css for Groups–Dir–Search and Blog.

    in reply to: Content Aware Sidebars does not work #145502
     Roader
    Participant

    Example:

    function.php ==> Okey, with this code Profile Widget appears.

    COPY CODE
    register_sidebar(array(
    		'name' => 'Profile Widget',
            'id' => 'profile-1',
    		'before_widget' => '<div id="%1$s" class="widgets clearfix %2$s">',
    		'after_widget' => '</div>',
    		'before_title' => '<h5>',
    		'after_title' => '</h5>',
    	));

    But, when I put this in Members / Single / Activity-wall.php or Whatever, Not widget appears.

    COPY CODE
    <?php
    if (is_active_sidebar( 'profile-1' )) {
        dynamic_sidebar( 'profile-1' );
    }?>
    in reply to: Member Directory… Search Form #145154
     Roader
    Participant

    Hi Radu. Thanks.
    I know How I can remove. But, I want to display Newest. So: All Members / Newest / Friends.

    For example, the code for All Members is —> But, I dont know How Get Newest…

    COPY CODE
    <div class="item-list-tabs" role="navigation">
    					<ul>
    						<li class="selected" id="members-all"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_member_count() ); ?></a></li>
    in reply to: Member Directory… Search Form #144742
     Roader
    Participant

    Radu, here I’m waiting for your solution.

    Example (pic).

    Remove blue.
    Add NEWEST (line red).

    The code for All Members is —-> But I don’t know, how I can get bp newest…

    COPY CODE
    <div class="item-list-tabs" role="navigation">
    					<ul>
    						<li class="selected" id="members-all"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_member_count() ); ?></a></li>
    Attachments:
    You must be logged in to view attached files.
    in reply to: Member Directory… Search Form #144363
     Roader
    Participant

    Radu.
    1) Group Dir Search, Inside Sweetdate, this search for Groups, has a CSS Style. But,
    members_dir_search does not have CSS.

    For this reason, when I copy the members_dir_search code and I paste it in members / index, appear without Style, because the Style is only for group_dir_search.

    2) I want to change Filter By: (Ordenando por:) for Newest or Newest Registered. So, would be: ALL MEMBERS / NEWEST / FRIENDS* (Not Filter By:)

    The code for All members and Friends is —> I tried to add Newest copying and editing, but, nothing.

    I hope that you understand me… please!

    ___
    * Note: For the next update, I if is possible, you can add here / MATCHES

    COPY CODE
    <div class="item-list-tabs" role="navigation">
    					<ul>
    						<li class="selected" id="members-all"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_member_count() ); ?></a></li>
    						
    								
    						<?php if ( is_user_logged_in() && bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
    
    							<li id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/' ?>"><?php printf( __( 'My Friends <span>%s</span>', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li>
    
    						<?php endif; ?>
    Attachments:
    You must be logged in to view attached files.
    in reply to: Member Directory… Search Form #144207
     Roader
    Participant

    Thanks Radu.
    Double Search Results solved.

    And, search form added. Only I need the Css for it.

    COPY CODE
    
    				<?php do_action( 'bp_before_directory_members_content' ); ?>
    					
    								<div id="members-dir-search" class="dir-search" role="search">
    			<?php bp_directory_members_search_form(); ?>
    		</div><!-- #members-dir-search -->

    For finish with this section, send me the code to change: Order by: for: Newest.

    Attachments:
    You must be logged in to view attached files.
    in reply to: Member Directory… Search Form #143967
     Roader
    Participant
    This reply has been set as private.
    in reply to: Member Directory… Search Form #143815
     Roader
    Participant

    Trying to return the search form.

    I copied the original BP code and put it inside child / members / index.php

    But, although the Form appears,
    (A bit disproportionate), I throw a Double Result, instead of Uno.

    Could you help me with this?

    COPY CODE
    <div id="members-dir-search" class="dir-search" role="search">
    			<?php bp_directory_members_search_form(); ?>
    		</div><!-- #members-dir-search -->
    Attachments:
    You must be logged in to view attached files.
    in reply to: Features for the Next Update. Please! #143650
     Roader
    Participant
    Not marked as solution
    in reply to: How I can see… #143247
     Roader
    Participant

    Radu, your Index.php work fine.
    But without Input Members Search (“search by name”).

    I try to add this:

    COPY CODE
    <?php if ( has_filter( 'bp_directory_members_search_form' ) ) : ?>
    
    		<div id="members-dir-search" class="dir-search" role="search">
    			<?php bp_directory_members_search_form(); ?>
    		</div><!-- #members-dir-search -->
    
    	<?php else: ?>
    
    		<?php bp_get_template_part( 'common/search/dir-search-form' ); ?>
    
    	<?php endif; ?>

    But work bad.

    in reply to: Cancel Button #143153
     Roader
    Participant

    For RADU and others

    Please look at the differences either.
    This is the reason why there is no Cancel button Comment in SD Theme.

    SweetDate: entry.php Code —>

    COPY CODE
    <input type=”submit” name=”ac_form_submit” class=”tiny button radius” value=”<?php _e( ‘Post’, ‘buddypress’ ); ?>” />&nbsp;  <?php _e( ‘or press esc to cancel.’, ‘buddypress’ ); ?>
     <input type=”hidden” name=”comment_form_id” value=”<?php bp_activity_id(); ?>” />

    BuddyPress: entry.php Code —>

    COPY CODE
    <input type="submit" name="ac_form_submit" value="<?php esc_attr_e( 'Post', 'buddypress' ); ?>" /> &nbsp; <a href="#" class="ac-reply-cancel"><?php _e( 'Cancel', 'buddypress' ); ?></a>
    						<input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />

    Buddypres: bp-legacy / js / buddypress.js —>

    COPY CODE
    // Canceling an activity comment
     if ( target.hasClass( ‘ac-reply-cancel’ ) ) {
     jq(target).closest(‘.ac-form’).slideUp( 200 );
     return false;
     }
     });

    But, insiede sweetdate / custom_buddypress / _inc / global.js
    This code does not exist. Only is: “or press esc to cancel”.

    I tried to fix it, but it does not work.

    It’s not enough with copy, paste and replace codes.

    Please help!

    in reply to: Cancel Button #142998
     Roader
    Participant
    COPY CODE
    <input type="submit" name="ac_form_submit" value="<?php esc_attr_e( 'Post', 'buddypress' ); ?>" /> &nbsp; <a href="#" class="ac-reply-cancel"><?php _e( 'Cancel', 'buddypress' ); ?></a>
    						<input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
    in reply to: Cancel Button #142002
     Roader
    Participant

    Por favor Laura, ayúdame con esto.

    Yo vi dónde está la función. entry.php

    COPY CODE
    </div>
    						<input type="submit" name="ac_form_submit" class="tiny button radius" value="<?php _e( 'Post', 'buddypress' ); ?>" /> &nbsp; <?php _e( 'or press esc to cancel.', 'buddypress' ); ?>
    						<input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
    					</div>

    El paquete Buddypress tiene:

    COPY CODE
    </div>
    						<input type="submit" name="ac_form_submit" value="<?php esc_attr_e( 'Post', 'buddypress' ); ?>" /> &nbsp; <a href="#" class="ac-reply-cancel"><?php _e( 'Cancel', 'buddypress' ); ?></a>
    						<input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
    					</div>

    Este código va después del del código anterior. Lo pegué en el entry.php modificado del Tema SweetDate y nada sucedió, quizás me faltó algo.

    Creo que con la solución a esto ya no tendría más Tickets, así que por favor habla con alguien que me explique cómo solucionar el asunto del botón Cancel.

Viewing 28 posts - 41 through 68 (of 68 total)

Log in with your credentials

Forgot your details?