Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter ProImpactLLC

    (@proimpactllc)

    Not to sound rude and out of frustration…. I guess if WP would fix the code, we wouldn’t be monkeying with it. This has been broken for a while.

    Thread Starter ProImpactLLC

    (@proimpactllc)

    RandyKing,
    I have 2 template.php files on the server. One in public_html/wp-admin/includes and the other, public_html/wp-includes. I opened both with the cPanel Code Editor and there was no white space before the opening commands. However, what I did find in both files is that there was no ending command ?> in either file. The version /home/dockmast/public_html/wp-includes/template.php only goes to line 410 and ended like this:

    */
    function load_template( $_template_file, $require_once = true ) {
    	global $posts, $post, $wp_did_header, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;
    
    	if ( is_array( $wp_query->query_vars ) )
    		extract( $wp_query->query_vars, EXTR_SKIP );
    
    	if ( $require_once )
    		require_once( $_template_file );
    	else
    		require( $_template_file );
    }
    
    I added ?> to see if closing the code would work, it did not.  I did save which overwrote the original code.  No FTP.
    
    The second version: /home/dockmast/public_html/wp-admin/includes/template.php is ended at 1867 like this:
    function convert_to_screen( $hook_name ) {
    	if ( ! class_exists( 'WP_Screen' ) ) {
    		_doing_it_wrong( 'convert_to_screen(), add_meta_box()', __( "Likely direct inclusion of wp-admin/includes/template.php in order to use add_meta_box(). This is very wrong. Hook the add_meta_box() call into the add_meta_boxes action instead." ), '3.3' );
    		return (object) array( 'id' => '_invalid', 'base' => '_are_belong_to_us' );
    	}
    
    	return WP_Screen::get( $hook_name );
    }

    [Please post code or markup snippets between backticks or use the code button. Or better still – use a pastebin. Your posted code may now have been permanently damaged/corrupted by the forum’s parser.]

    And again did not have the closing ?>. So I added and saved. No luck.

    In both cases, neither file showed empty spaces or lines before the opening code.

    I also rechecked my pluggable.php to make sure the changes did save from yesterday, and they did…

    I really appreciate you helping us out with this.

    Same problem.

    Thread Starter ProImpactLLC

    (@proimpactllc)

    RandyKing,
    You were correct in that there were 2 missing characters in the plugable.php and I was able to sucessfully add the remaining code (verified no other space or characters before or after the last 2 characters). however, I still receive the following warning:

    Warning: Cannot modify header information – headers already sent by (output started at /home/dockmast/public_html/wp-admin/includes/template.php:1642) in /home/dockmast/public_html/wp-includes/pluggable.php on line 876

    thanks for you attention.

    Thread Starter ProImpactLLC

    (@proimpactllc)

    As an update.. I downloaded an older version (1.2.8.7)from Yoast.com and this does NOT create a conflict. So it does have something to do with the latest version.

    Thread Starter ProImpactLLC

    (@proimpactllc)

    Thread Starter ProImpactLLC

    (@proimpactllc)

    Duh! Not sure what I was thinking!
    Tizz, thanks for your patience. That fixed it.
    I appreciate the support.

    Thread Starter ProImpactLLC

    (@proimpactllc)

    Here is the file that I am looking at (I did a complete search of the installation and this is the only sitemap.php that comes up for NextGen

    <?php
    /**
    * Main PHP Class for XML Image Sitemaps
    *
    * @author Alex Rabe
    * @version 1.0
    *
    *
    */
    class nggSitemaps {

    var $images = false;

    /**
    * nggSitemaps::__construct()
    *
    * @return
    */
    function __construct() {

    add_filter(‘wpseo_sitemap_urlimages’, array( &$this, ‘add_wpseo_xml_sitemap_images’), 10, 2);

    }

    /**
    * Filter support for WordPress SEO by Yoast 0.4.0 or higher ( http://wordpress.org/extend/plugins/wordpress-seo/ )
    *
    * @since Version 1.8.0
    * @param array $images
    * @param int $post ID
    * @return array $image list of all founded images
    */
    function add_wpseo_xml_sitemap_images( $images, $post_id ) {
    $newimage[‘src’] = $image->imageURL;
    $this->images = $images;

    // first get the content of the post/page
    $p = get_post($post_id);

    // Backward check for older images
    $p->post_content = NextGEN_Shortcodes::convert_shortcode($p->post_content);

    // Don’t process the images in the normal way
    remove_all_shortcodes();

    // We cannot parse at this point a album, just galleries & single images
    add_shortcode( ‘singlepic’, array(&$this, ‘add_images’ ) );
    add_shortcode( ‘thumb’, array(&$this, ‘add_images’ ) );
    add_shortcode( ‘nggallery’, array(&$this, ‘add_gallery’) );
    add_shortcode( ‘imagebrowser’, array(&$this, ‘add_gallery’ ) );
    add_shortcode( ‘slideshow’, array(&$this, ‘add_gallery’ ) );

    // Search now for shortcodes
    do_shortcode( $p->post_content );

    return $this->images;
    }

    /**
    * Parse the gallery/imagebrowser/slideshow shortcode and return all images into an array
    *
    * @param string $atts
    * @return
    */
    function add_gallery( $atts ) {

    global $wpdb;

    extract(shortcode_atts(array(
    ‘id’ => 0
    ), $atts ));

    // backward compat for user which uses the name instead, still deprecated
    if( !is_numeric($id) )
    $id = $wpdb->get_var( $wpdb->prepare (“SELECT gid FROM $wpdb->nggallery WHERE name = ‘%s’ “, $id) );

    $images = nggdb::get_gallery($id, ‘pid’, ‘ASC’, true, 1000);

    foreach ($images as $image) {
    $src = $image->imageURL;
    $newimage = array();
    if ( !empty($image->title) )
    $newimage[‘title’] = $image->title;
    if ( !empty($image->alttext) )
    $newimage[‘alt’] = $image->alttext;
    $this->images[$src] = $newimage;
    }

    return;
    }

    /**
    * Parse the single image shortcode and return all images into an array
    *
    * @param array $atts
    * @return
    */
    function add_images( $atts ) {

    extract(shortcode_atts(array(
    ‘id’ => 0
    ), $atts ));

    // make an array out of the ids (for thumbs shortcode))
    $pids = explode( ‘,’, $id );

    // Some error checks
    if ( count($pids) == 0 )
    return;

    $images = nggdb::find_images_in_list( $pids );

    foreach ($images as $image) {
    $src = $image->imageURL;
    $newimage = array();
    if ( !empty($image->title) )
    $newimage[‘title’] = $image->title;
    if ( !empty($image->alttext) )
    $newimage[‘alt’] = $image->alttext;
    $this->images[$src] = $newimage;
    }

    return;
    }

    }
    $nggSitemaps = new nggSitemaps();

    Thread Starter ProImpactLLC

    (@proimpactllc)

    OK… I must be looking at the wrong file to edit. Maybe that is why I can’t fix it.

    I’m looking at public_html/wp-content/plugins/nextgen-gallery/lib/sitemap.php

    I’m not finding $this->images[$src] = $newimage;

    Thread Starter ProImpactLLC

    (@proimpactllc)

    Thanks. But I can’t find the style sheet that needs to be edited.

Viewing 10 replies - 1 through 10 (of 10 total)