Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter Matthew

    (@existentialmedia)

    I’m not using the plugin. I just made this page template to “fake” it, but it works pretty well. You could definitely use it with a custom post type, in fact, it would be probably better. You’d just need to change the query_posts.

    Matthew

    (@existentialmedia)

    Maybe moving WP out of reference and into another folder like /wp

    Matthew

    (@existentialmedia)

    I don’t mean resurrect an old, but I am. I’m trying to set up nginx + php5-fpm with an upgraded subfolder WPMU to 3.0.

    I tried the rewrite rules here, but when I try to load https://domain.com/blog/wp-admin it will redirect to https://domain.com/wp-admin/, but if I load https://domain.com/blog/wp-admin/ it works.

    Well, it kind of works. None of the CSS or JS loaded with load-styles.php or load-scripts.php works.

    The load-styles/load-scripts works on the home blog and on domain mapped blogs though. I’m at a loss. Maybe the linked rewrite rules are more for subdomains? I don’t full grasp the syntax.

    Thread Starter Matthew

    (@existentialmedia)

    Well, I never did figure this out, but I came up with a different solution. I created a page template to display an ical feed.

    <?php /* Template Name: iCal */
    header('Content-type: text/calendar');
    header('Content-Disposition: attachment; filename="ical_feed.ics"'); ?>
    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//<?php bloginfo('name'); ?>//NONSGML v1.0//EN
    X-WR-CALNAME:<?php echo bloginfo('name'); ?>
    
    X-WR-TIMEZONE:<?php echo get_option('timezone_string');ê?>
    
    X-ORIGINAL-URL:<?php bloginfo('url') ?>
    
    X-WR-CALDESC:<?php bloginfo('description'); ?>
    
    CALSCALE:GREGORIAN
    METHOD:PUBLISH
    <?php
    date_default_timezone_set('America/Los_Angeles');
    function filter_where($where = '') {
    		$where .= " AND post_date >= '" . date('Y-m-d H:i:s') . "'";
    		return $where;
    	}
    add_filter('posts_where', 'filter_where');
    $myposts = query_posts('numberposts=-1&orderby=post_date&order=asc&category_name=Events');
    foreach($myposts as $post) :
    setup_postdata($post); ?>
    BEGIN:VEVENT
    DTSTART:<?php the_time('Ymd\THis'); ?>
    
    DURATION:PT1H0M0S
    SUMMARY:<?php remove_filter('the_title', 'wptexturize'); the_title(); ?>
    
    DESCRIPTION:<?php the_permalink(); ?>
    
    END:VEVENT
    <?php endforeach; ?>
    END:VCALENDAR

    Obviously if you were to use this you would want to change some of the hardcoded values.

    Matthew

    (@existentialmedia)

    I tried upgrading to 2.5.1 and it seems to work better. There is only one “issue”, as peterspublishing mentioned, it isn’t showing future posts. I’m not sure if John is intending for this to be part of the functionality though.

    I’m using it on this upcoming events page. It seems to want to show the January event, but as you see it’s not highlighting the day.

    A note about my “future” posts is that the post_status is not actually set to future, I’m using this plugin that sets future posts to publish.

    I briefly looked at the query in the plugin and it doesn’t seem like there should be any issues though, so I don’t know.

    Matthew

    (@existentialmedia)

    I’m also having the two bugs listed above. I tried what MGMaster offered, but the list mode still doesn’t filter for the category.

    In addition, when the page with the widget first loads, the widget shows no month names until it is interacted with (changing the month/showing the list).

    I noticed on that Machine Project is successfully using this plugin, but it looks like they are using a modified version as well.

    mrdumont: Could you share your fix for filtering the list correctly?

    I would rather not edit the core files for the plugin, if there is a way for these fixes to make it into the next version of the plugin that would be great. Maybe mrdumont and MGMaster could submit their changes back to the plugin author?

    Thread Starter Matthew

    (@existentialmedia)

    Whoops, it needed a fallback if there is no medium size:

    // Scroll shortcode
    function scroll_shortcode(){
    	$attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'DESC', 'orderby' => 'menu_order') );
    	foreach ( $attachments as $attachment_id => $attachment ) {
    		$attachment_meta = wp_get_attachment_metadata($attachment_id);
    		if (isset($attachment_meta['sizes']['medium']['width'])) {
    			$attachment_width = $attachment_meta['sizes']['medium']['width'] + 30;
    			$scroll_width += $attachment_width;
    		} else {
    			$attachment_width = $attachment_meta['width'] + 30;
    			$scroll_width += $attachment_width;
    		}
    	};
    	echo '<div class="scroll" style="width:'.$scroll_width.'px !important;">';
    
    foreach ( $attachments as $attachment_id => $attachment ) {
    	?><?php echo wp_get_attachment_link_canoe($attachment_id,$size='medium'); ?><?php
    }
    echo '</div>';
    }
    add_shortcode('scroll','scroll_shortcode');
    Thread Starter Matthew

    (@existentialmedia)

    OKAY I FIGURED IT OUT.

    For those interested in this problem:

    // Scroll shortcode
    function scroll_shortcode(){
    	$attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'DESC', 'orderby' => 'menu_order') );
    	foreach ( $attachments as $attachment_id => $attachment ) {
    		$attachment_meta = wp_get_attachment_metadata($attachment_id);
    		$attachment_width = $attachment_meta['sizes']['medium']['width'] + 30;
    		$width += $attachment_width;
    	};
    	echo '<div class="scroll" style="width:'.$width.'px !important;">';
    
    foreach ( $attachments as $attachment_id => $attachment ) {
    	?><?php echo wp_get_attachment_link_canoe($attachment_id,$size='medium'); ?><?php
    }
    echo '</div>';
    }
    add_shortcode('scroll','scroll_shortcode');

    Thread Starter Matthew

    (@existentialmedia)

    There is a plugin for Indexhibit that I came across that works like this. In Indexhibit the image sizes are stored in the database when you upload them. The plugin Horizontal Format grabs the sizes from the db and adds them up.

    $pages = $OBJ->db->fetchArray("SELECT *
    	FROM ".PX."media, ".PX."objects_prefs
    	WHERE media_ref_id = '$rs[id]'
    	AND obj_ref_type = 'exhibit'
    	AND obj_ref_type = media_obj_type
    	ORDER BY media_order ASC, media_id ASC");
    foreach ($pages as $go)
    {
    	$title = ($go['media_title'] == '') ? '' : "<div class='title'>" . $go['media_title'] . "</div>";
    	$title .= ($go['media_caption'] == '') ? '' : "<div class='caption'>" . $go['media_caption'] . "</div>";
    
    	$temp_x = $go['media_x'] + $this->picture_block_padding_right;
    	$this->final_img_container += ($go['media_x'] + $this->picture_block_padding_right);
    
    	$a .= "<div class='picture_holder' style='width: {$temp_x}px;'>\n";
    	$a .= "<div class='picture' style='width: {$go[media_x]}px;'>\n";
    	$a .= "<img src='" . BASEURL . GIMGS . "/$go[media_file]' width='$go[media_x]' height='$go[media_y]' alt='" . BASEURL . GIMGS . "/$go[media_file]' />\n";
    	$a .= "<div class='captioning'>$title</div>\n";
    	$a .= "</div>\n";
    	$a .= "</div>\n\n";
    }
    
    $s .= "<div id='img-container'>\n";
    if ($rs['content'] != '') $s .= "<div id='text'>" . $rs['content'] . "</div>\n";
    $s .= $a;
    $s .= "<div style='clear: left;'><!-- --></div>";
    $s .= "</div>\n";
    
    return $s;
    }

    Maybe is there a way to do this with WP? I imagine that the image sizes are stored in the DB as well. This is maybe a better route than using getimagesize.

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