Forum Replies Created

Viewing 15 replies - 91 through 105 (of 155 total)
  • Thread Starter Ron Strilaeff

    (@ronstrilaeff)

    Well, I know that this is outside of the scope of your plugin, but I’m trying to pull out the essential code for the upload form into my own page template for visitors to upload images using drag and drop.

    But I’m getting this error when it wants to call the media_upload_form function.

    Fatal error: Call to undefined function media_upload_form()

    It does not change anything if I include this code

    include_once(ABSPATH . WPINC . '/media.php' );

    at the top of my page template file.

    Can you straighten me out if you have the time or point me in the direction of a premium plugin that does drag and drop uploading and cropping (using plupload and jcrop maybe)? I read here that they are included in wp so it seems a natural to use them. That is what I really want but I don’t have the php and js expertise to make it happen.

    Thanks, Ron

    Well Jen, you said in another thread that QC is working. By default, after installation it is turned off, so in order to turn it on, at some point you must have been able to see the config options in your admin sidebar. Did it just go away?

    Your options should be visible under http://www.tedxeastsideprep.com/wp-admin/network when you are logged an as super admin (the same username that lets you install a plugin to multisite).

    It may not show up on your main site if you are only logged in as a site admin.

    If that doesn’t work, I suggest a reinstall of the plugin.

    It seems like those Quick Cache config options are only available when you are looking at:
    mainsite.com/wp-admin or
    mainsite.com/wp-admin/network
    but NOT anysubsite.com/wp-admin

    Even though I’m logged in as superadmin in all cases. Is that what it looks like to you?

    This does seem a bit strange at first, but it is supersite-wide config option similar to adding a new plugin. And I know that I have a healthy installation of multisite (subdomain) with a Quick Cache that is fully functional.

    Hi Kirkward,

    If it’s not too much trouble could you paste in the entire working code?
    I’m starting to work on something similar. There are lots of bits and pieces everywhere, but and it’s hard to find a working example of the whole thing, from form fields to finished post.

    Thanks, Ron

    I posted a comment on the author’s site to get some attention.

    It sounds like this in not supposed to work during the uploading and saving of the image, but somehow after it is published.

    @boxcarpress You may be able to get “single sign-on” for all blogs in a network by using these “free” plugins. The first one is the defacto standard for domain mapping, the second one depends on it and is “Designed to be run in concert with” the third one according to its author. GLHF!

    1. http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/
    2. http://wordpress.org/extend/plugins/sso-cross-cookie-for-multisite/
    3. http://wordpress.org/extend/plugins/ssl-subdomain-for-multisite/

    For the record I have abandoned my efforts to do this since I realized that I had more similarities than differences among my intended sub-sites on that project so I decide to make them all custom taxonomies (“galleries”) under one site. This post by Ipstenu helped clarify my thinking on this.

    @trejder Good point. That does make sense for someone who is setting up a mini host or community of bloggers as the original design (ie: wordpress.com) was conceived. I can live with entering it for each of “my” subsites. Thanks.

    What I ended up doing was in my canvas child theme, since I did not need support for the flexibility woo provided inside their header.php file

    <div id="logo"> here, </div>

    I copied it to my child theme’s folder and replaced everything inside that div with my own code which loads a $logo_url image file that matches (by name) the slug of the top level parent of the page being displayed. Then if that file does not exist, I simply defaulted to a specific “home” image. My images are all full width banners, so I’ll have to tweak my css or code or something if/when I want their woo_ad_top to overlay the right side of my header image

    This way all I have to do down the road to make a special header image appear on a page is to make one of the correct size and copy it to my /child-theme/images/headers folder.

    I still have to work out what and how to show something relevant on multi-post and single-post style “pages”.

    Thanks all for the inspiration.

    This got me curious since I might want to use page templates with a CPT with ‘page’ capabilities.

    I am seeing a similar thing: my CPT has these args (among others):

    'capability_type' => 'page',
    'hierarchical' => true,
    'supports' => array('title','editor','custom-fields','page-attributes'),

    But the page template dropdown is not showing up in the “Page Attributes” box, in fact the box title is only “Attributes”.

    hmmmm … I just did some code snooping and found this bit of logic in the core file \wp-admin\includes\meta-boxes.php (line 577 of wp-version 3.4.2)

    if ( 'page' == $post->post_type && 0 != count( get_page_templates() ) ) {
    ... show the "Template" dropdown ... }

    That $post->post_type is the name of the database field and the value must be literally ‘page’ for this to show up. So if I understand this correctly, my ‘cpt-page’ will never have that Template dropdown!

    I’m starting to think that the custom page templates to show my custom post types need to be of the kind described on these two Codex pages:
    http://codex.wordpress.org/Post_Type_Templates and
    http://codex.wordpress.org/Template_Hierarchy

    Hopefully some guru like the writer of this plugin will dive in to enlighten us. πŸ™‚

    Thread Starter Ron Strilaeff

    (@ronstrilaeff)

    Thanks Brad for that common sense solution. It is easy to screw up the taxonomy relationships by going outside the UI. This plugin (and your “Professional WordPress” book (first edition) has been a good education for me.

    Ron

    Mine is 755 too so that’s not the problem.

    Dumb question: on the bottom of the wp-admin sidebar, open up Quick Cache -> Config Options, and make sure that quick cache is enabled (after being activated). I know that’s one of those “Is it plugged in?” questions but it should work with an auto install and default settings.

    I don’t see any error log file mentioned in the documentation but php (or wp, not sure) generates an “error_log” file in the wp-admin folder (and maybe other places).

    You can also put this in your wp-config.php file and then change the first false to true temporarily. It will create a debug.log log file inside the /wp-content/ directory.

    define( 'WP_DEBUG', false );  // false or true
    if (WP_DEBUG) {
      define('WP_DEBUG_LOG', true);
      define('WP_DEBUG_DISPLAY', false);
      @ini_set('display_errors',0);
    }

    But before you do all that, just make sure the qc is actually turned on πŸ˜›

    Thread Starter Ron Strilaeff

    (@ronstrilaeff)

    Hi dpaule..

    See the lines below //ronedit
    Hope this helps.

    // Return Current URL
    	function _trackableshare_buildurl() {
    		//ronedit replaced by line below return 'http'.($_SERVER['HTTPS']?'s':'').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    		//ronedit this plugin always thinks that my site is https even when it is not
    		return 'http'.(('on' == strtolower($_SERVER['HTTPS']))?'s':'').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    	}
    // Return Button Paths
    	function _trackableshare_setpaths($file,$admin=false) {
    		if($file == 'custom') {
    			$path = WP_CONTENT_DIR.'/uploads/trackableshare/';
    		        //ronedit replaced by line below $url = ($_SERVER['HTTPS']?str_replace('http://','https://',WP_CONTENT_URL):WP_CONTENT_URL).'/uploads/trackableshare/';
    			$url = (('on' == strtolower($_SERVER['HTTPS']))?str_replace('http://','https://',WP_CONTENT_URL):WP_CONTENT_URL).'/uploads/trackableshare/';
    		} else {
    			$path = ($admin?'../':'').TRACKABLESHARE_PLUGINS.'/'.TRACKABLESHARE_DIRNAME.'/buttons/'.$file.'/';
    			//ronedit replaced by line below $url = ($_SERVER['HTTPS']?str_replace('http://','https://',WP_PLUGIN_URL):WP_PLUGIN_URL).'/'.TRACKABLESHARE_DIRNAME.'/buttons/'.$file.'/';
    			$url = (('on' == strtolower($_SERVER['HTTPS']))?str_replace('http://','https://',WP_PLUGIN_URL):WP_PLUGIN_URL).'/'.TRACKABLESHARE_DIRNAME.'/buttons/'.$file.'/';
    		}
    		return array($path,$url);
    	}

    oh, and btw .. the correct spelling is “nub” and I are one πŸ™‚

    You can also verify it is working by looking for recent cached files saved on your server (using filezilla, for example). They start with “qc-” and are in wp-content/cache. Sort them with most recent at the top and look for ones created in the last few minutes.

    Also, if you cleared the qc cache manually (from wp-admin), all those files should disappear. Then navigate with a non-logged in browser to some obscure page, and a new “qc-” file should appear. Open it in an editor (it’s plain text) and about 5 lines down you should see the page title. This will be good evidence that it is the page your anonymous visitor requested.

    Minify may also strip out all comments from the page presented to the user, but the raw cached file might still have the qc comments at the bottom. I’m not perfectly clear on that last statement, but I think minify’s purpose in life is to strip out all non-executable code to reduce load time.

    Just so everyone is clear… auto-save, post revisions and auto-draft are three separate things. There are way too many posts about this but I just decided to write here since this is a recent thread.

    The wp-config.php defines of

    define( 'AUTOSAVE_INTERVAL', 86400 );  // in seconds: 86400 = 1 day
    define( 'WP_POST_REVISIONS', false); // false means turn off saving of revisions

    takes care of the the first two, but the auto-draft post_status should be ignored and does not need fixing.

    The auto-draft post_status was put in there as background housekeeping for all the random ways a post/page can get edited or attached to before saving as draft or published so nothing gets lost.

    It is your invisible friend.

    The good news is that it looks like wordpress core now has a built in function to daily, automatically remove posts with post_status = ‘auto-draft’ that are over a week old. The code below is in post.php:

    /**
     * Deletes auto-drafts for new posts that are > 7 days old
     *
     * @since 3.4.0
     */
    function wp_delete_auto_drafts() {
    	global $wpdb;
    
    	// Cleanup old auto-drafts more than 7 days old
    	$old_posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'auto-draft' AND DATE_SUB( NOW(), INTERVAL 7 DAY ) > post_date" );
    	foreach ( (array) $old_posts as $delete )
    		wp_delete_post( $delete, true ); // Force delete
    }

    Alos, in the file post-new.php there is this code:

    // Schedule auto-draft cleanup
    if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) )
    	wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' );

    I’m not quite sure how they are connected, but I’m betting all those ‘auto-draft’ posts are fairly recent and will get purged with no sweat on our part.

    I’m using canvas. The custom header is above either the normal woo header image or the title and tagline text because the

    add_action( 'woo_header_inside', 'woo_custom_header_image' );

    Is above the <div id="logo">

    Did you manually modify your woo header.php, or did you just blank out the title and tagline and leave out the normal woo header image?

    Either way I can never see an image… there has to be a simpler way to do this.. I seems like pretty basic functionality for any website.

Viewing 15 replies - 91 through 105 (of 155 total)