Help with changes

Accueil Forums Main plugin support Help with changes

20 sujets de 21 à 40 (sur un total de 41)
  • Auteur
    Messages
  • #479732
    Fabio
    Participant
    Cette réponse a été marquée comme privée.
    #479735
    Fabio
    Participant
    Cette réponse a été marquée comme privée.
    #479911
    Thomas Lartaud
    Admin bbPress

    Can you check for a plugin conflict? Also, try to switch theme to see if it could be the cause of this issue.

    Also, temporarily disable/remove any template or any WP Customer Area customization you could have done (templates / code snippets)

    #479943
    Fabio
    Participant

    I did the reported tests, but nothing has changed.
    we could try setting the code:
    function custom_cuar_get_single_content_action_links($links)
    {
    if (is_admin()) return $links;

    $post_id = get_queried_object_id();

    $files = cuar_get_the_attached_files($post_id);
    if (isset($files) && !empty($files)) {
    foreach ($files as $file) {
    $links[] = array(
    ‘title’ => ‘ ‘ . __(‘Download’, ‘cuar’),
    ‘tooltip’ => __(‘Download file(s)’, ‘cuar’),
    ‘url’ => $file[‘caption’],
    ‘extra_class’ => ”
    );
    }
    }

    return $links;
    }

    add_action(‘cuar/private-content/view/single-post-action-links?post-type=customer-private-file’,
    ‘custom_cuar_get_single_content_action_links’);

    add_action(‘cuar/private-container/view/single-post-action-links?post-type=customer-private-file’,
    ‘custom_cuar_get_single_content_action_links’);

    at least you see the button, and only the link that doesn’t work well.

    #479950
    Thomas Lartaud
    Admin bbPress

    I don’t think you saw my last comment 😉

    Regards.

    #479955
    Fabio
    Participant

    I have disabled all the css applied to the plugin.
    but nothing has changed.
    I also changed the theme …. but even in this case nothing has changed.

    #479956
    Thomas Lartaud
    Admin bbPress
    Cette réponse a été marquée comme privée.
    #480435
    Fabio
    Participant
    Cette réponse a été marquée comme privée.
    #480436
    Fabio
    Participant

    I will not make any access until your notice

    #480439
    Thomas Lartaud
    Admin bbPress
    Cette réponse a été marquée comme privée.
    #480462
    Fabio
    Participant
    Cette réponse a été marquée comme privée.
    #480495
    Thomas Lartaud
    Admin bbPress

    Hi,

    Can you create a file named cuar.php which include the following code, and place it in your child-theme folder?

    <?php
    get_header(); ?>
    
    	<div id="primary" class="site-content">
    		<div id="content" role="main">
    
    			<?php while ( have_posts() ) : the_post(); ?>
                    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                        <header class="entry-header">
                            <h1 class="entry-title"><?php the_title(); ?></h1>
                        </header>
                        <div class="<?php echo cuar_entry_class(); ?>">
                            <?php the_content(); ?>
                            <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
                        </div><!– .entry-content –>
                        <footer class="entry-meta">
                            <?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
                        </footer><!– .entry-meta –>
                    </article><!– #post –>
    			<?php endwhile; // end of the loop. ?>
    
    		</div><!– #content –>
    	</div><!– #primary –>
    
    <?php get_footer(); ?>
    

    Let me know when it’s done.

    ===

    Or, Feel free to grant me an FTP access so I can check this up by myself.

    Regards.

    #480510
    Fabio
    Participant

    File inserted
    but if they should serve you, ask

    #480530
    Thomas Lartaud
    Admin bbPress
    Cette réponse a été marquée comme privée.
    #480534
    Fabio
    Participant
    Cette réponse a été marquée comme privée.
    #480631
    Thomas Lartaud
    Admin bbPress

    Hi,

    I don’t get why there are some missing parts of the area on your installation.

    Are you sure you removed any customization you may have done? CSS edits, templates or new functions? Can you comment out them all, please?

    #480656
    Thomas Lartaud
    Admin bbPress

    Oooookayyy, after some headaches times, I’ve finally found the issue.

    It looks like your theme is incorrectly using echo get_the_content() instead of the_content(). Your issue is related to this FAQ.

    Note that you should report to your theme author that he should not use get_the_content() to get main contents, but he should use the_content() instead because WP applies some hooks to the_content, that are not applied to get_the_content. You’ll probably get some other issues with others plugins if you keep using this.

    Try the following :
    – Restore your files and dabatase
    – Create the file cuar.php in your child theme folder
    – Paste the code below in this file
    – Clear browser cache
    – Try again to display a private file post
    – If not enough, rename the page slug Files to Documents or something else

    <?php
    if ( !defined('ABSPATH') ){ die(); }
    
    global $avia_config, $wp_query;
    
    /*
     * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
     */
    get_header();
    
    /**
     * @used_by				enfold\config-wpml\config.php				10
     * @since 4.5.1
     */
    do_action( 'ava_page_template_after_header' );
    
    if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title();
    
    do_action( 'ava_after_main_title' );
    ?>
    
        <div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'>
    
            <div class='container'>
    
                <main class='template-page content  <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content','post_type'=>'page'));?>>
    
                    <?php
                    /* Run the loop to output the posts.
                    * If you want to overload this in a child theme then include a file
                    * called loop-page.php and that will be used instead.
                    */
    
                    $avia_config['size'] = avia_layout_class( 'main' , false) == 'fullsize' ? 'entry_without_sidebar' : 'entry_with_sidebar';
                    $post_loop_count= 1;
                    $post_class 	= "post-entry-".avia_get_the_id();
    
    
    
                    // check if we got posts to display:
                    if (have_posts()) :
    
                        while (have_posts()) : the_post();
                            ?>
    
                            <article class='post-entry post-entry-type-page <?php echo $post_class; ?>' <?php avia_markup_helper(array('context' => 'entry')); ?>>
    
                                <div class="entry-content-wrapper clearfix">
                                    <?php
                                    echo '<header class="entry-content-header">';
                                    $thumb = get_the_post_thumbnail(get_the_ID(), $avia_config['size']);
    
                                    if($thumb) echo "<div class='page-thumb'>{$thumb}</div>";
                                    echo '</header>';
    
                                    //display the actual post content
                                    echo '<div class="entry-content" '.avia_markup_helper(array('context' => 'entry_content','echo'=>false)).'>';
                                    cuar_the_single_content();
                                    echo '</div>';
    
                                    echo '<footer class="entry-footer">';
                                    wp_link_pages(array('before' =>'<div class="pagination_split_post">',
                                        'after'  =>'</div>',
                                        'pagelink' => '<span>%</span>'
                                    ));
                                    echo '</footer>';
    
                                    do_action('ava_after_content', get_the_ID(), 'page');
                                    ?>
                                </div>
    
                            </article><!–end post-entry–>
    
    
                            <?php
                            $post_loop_count++;
                        endwhile;
                    else:
                        ?>
    
                        <article class="entry">
                            <header class="entry-content-header">
                                <h1 class='post-title entry-title'><?php _e('Nothing Found', 'avia_framework'); ?></h1>
                            </header>
    
                            <?php get_template_part('includes/error404'); ?>
    
                            <footer class="entry-footer"></footer>
                        </article>
    
                    <?php
    
                    endif;
                    ?>
    
                    <!–end content–>
                </main>
    
                <?php
    
                //get the sidebar
                $avia_config['currently_viewing'] = 'page';
                get_sidebar();
    
                ?>
    
            </div><!–end container–>
    
        </div><!– close default .container_wrap element –>
    
    
    
    <?php
    get_footer();
    

    Note : Basically, I have just copied enfold/page.php to enfold/cuar.php and replaced echo get_the_content with cuar_the_sinngle_content().

    Regards.

    #481299
    Fabio
    Participant

    I did everything you told me, but now it’s not even the dashboard anymore

    #481320
    Fabio
    Participant

    I did a test that might be interesting to let you know.
    1) access to the reserved area (white dashboard)
    2) renamed cuar.php in cuar.php_
    3) f5 on dashboard that is visible again
    4) I open a file page
    5) renamed cuar.php_ in cuar.php
    6) f5 on the page of the file that I see with all the annexes including the download button

    so cuar.php on the file page works … it only has something that alters the dashboard

    but if I try to download the file the system responds:
    “You are not authorized to access this file”

    #481996
    Fabio
    Participant

    I’M HAPPY!!!!!
    With a little imagination, I found the solution.
    in the file care.php I entered this condition:
    3851 is the ID of the Dashboard
    if (is_page (3851)
    {execute page.php code}
    else
    {execute code you reported}

    everything seems to work !!!!
    Last help, having assigned the owner the site administrator, a user cannot download the files of which he is the author!
    how should i set the privileges?

20 sujets de 21 à 40 (sur un total de 41)
  • Vous devez être connecté pour répondre à ce sujet.