Jump to content


These Forums Are Now Read-Only


For TubePress support, please post a question here or open a support ticket and we will be glad to assist.


Photo

Upgrade removes Pro


  • Please log in to reply
9 replies to this topic

#1 < no first name > Fleming

< no first name > Fleming

    Member

  • Members
  • PipPip
  • 11 posts

Posted 14 December 2010 - 12:04 AM

I have 2.0.0 Pro and I clicked the auto upgrade to go to 2.1.2 and after it upgraded, it was no longer Pro. What happened?

#2 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 14 December 2010 - 12:35 AM

TubePress Pro doesn't go through the normal WP update mechanism since it's non-public (but still open) source code. I'm looking for a way to make this more obvious to users of TubePress Pro in a WordPress environment.

Here are docs on how to upgrade your TubePress Pro installation: http://tubepress.com...pg...epress_pro

Sorry for the confusion. Let me know if you need help with the upgrade. Thanks.

#3 < no first name > Fleming

< no first name > Fleming

    Member

  • Members
  • PipPip
  • 11 posts

Posted 16 December 2010 - 06:56 PM

I think I remember seeing something about having to convert templates, but I can't find it now. I have one so is there a page that explains that?

#4 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 19 December 2010 - 05:23 PM

Your html templates shouldn't require any modifications to work with the new theme system. You just need to create a theme and copy in your templates to your theme.There are some docs on how to do here in appendix C: http://tubepress.com...pp..._templates

Let me know if you need any assistance along the way and I'll be happy to help. Thanks.

#5 < no first name > Fleming

< no first name > Fleming

    Member

  • Members
  • PipPip
  • 11 posts

Posted 24 December 2010 - 10:19 AM

I was just about to do this this morning, but saw one other thing that I better check with you on. Your documentation says "Please note that the template shortcode attribute is now obsolete, and its functionality has been replaced with the theme shortcode attribute." Does that mean that I have to go into every WP post and page that has the Tubepress code with the "template" shortcode and change it to "theme?" Or does your plugin (hopefully) still recognize the old "template?" I assume it does recognize it, or we'd all have a lot of manual changes to make. So, just checking.

#6 < no first name > Fleming

< no first name > Fleming

    Member

  • Members
  • PipPip
  • 11 posts

Posted 30 December 2010 - 04:27 PM

Hello?

#7 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 31 December 2010 - 08:00 PM

I'm very sorry, I could have sworn that I had replied to your last post already. My bad!

Does that mean that I have to go into every WP post and page that has the Tubepress code with the "template" shortcode and change it to "theme?" Or does your plugin (hopefully) still recognize the old "template?"


You're going to hate me, but the "template" tag will not by any version of TubePress after 2.1.0. The issue was that "template" expected a filename, whereas "theme" expects (essentially) a directory name. Frankly, not enough users were using custom HTML templates for me to spend a lot of time writing the code to make it backwards compatible. I apologize. I really hated making a breaking change like this, but in the long run the theme-based approach is much more sustainable and "upgrade proof".

So now the question is, how do you go about making changes to all the shortcodes that you have in use? Assuming you're currently running less than 2.1.0, I would suggest something along the lines of the following:

  • Create a TubePress theme and copy over your existing HTML templates into it. Instructions for this can be found here and here.
  • Find all of your shortcodes. This will be the tricky part. I would suggest running the following SQL query against your wp_posts table

    SELECT * FROM wp_posts WHERE 'post_content' LIKE '%[tubepress%';
  • Add the "theme='mytheme'" to your shortcodes along side of your "template='...' shortcode attributes. TubePress should ignore the "theme" attribute since it's only around in 2.1.0 or higher.
  • Upgrade TubePress, carefully following the instructions found here: http://tubepress.com...pg...epress_pro

This process assumes that you're upgrading a live installation. If you can do any of the testing on a production machine, that would probably be a bit safer. Regardless, I'm willing to help you out at any step of the way. I feel terrible that the upgrade made a whole lot of new work for you.

Happy New Year!

#8 < no first name > Fleming

< no first name > Fleming

    Member

  • Members
  • PipPip
  • 11 posts

Posted 01 January 2011 - 01:19 PM

Yes, I hate you. :)

I'm a bit confused as to how to convert my template to a theme. Can you look my template and tell me what I need to do to create a theme that functions identically? I've listed it below. I would have simply attached the file for you but the uploader didn't like any file types I tried.

<?php 
/**
 * Copyright 2006 - 2010 Eric D. Hough (http://ehough.com)
 */
?>

<?php $lecture_count = 1; ?>

<div class="tubepress_container" id="tubepress_gallery_<?php echo ${org_tubepress_template_Template::GALLERY_ID}; ?>">
  <?php echo ${org_tubepress_template_Template::PRE_GALLERY}; ?>
  
  <div id="tubepress_gallery_<?php echo ${org_tubepress_template_Template::GALLERY_ID}; ?>_thumbnail_area" class="tubepress_thumbnail_area">

    <?php if (isset(${org_tubepress_template_Template::PAGINATION_TOP})) : echo ${org_tubepress_template_Template::PAGINATION_TOP}; endif; ?>

    <ul class="tubepress_thumbs_course">
        <?php foreach (${org_tubepress_template_Template::VIDEO_ARRAY} as $video): ?>
     
<h2><a id="tubepress_title_<?php echo $video->getId(); ?>_<?php echo ${org_tubepress_template_Template::GALLERY_ID}; ?>" rel="tubepress_<?php echo ${org_tubepress_template_Template::EMBEDDED_IMPL_NAME}; ?>_<?php echo ${org_tubepress_template_Template::PLAYER_NAME}; ?>_<?php echo ${org_tubepress_template_Template::GALLERY_ID}; ?>"><?php echo htmlspecialchars($video->getTitle(), ENT_QUOTES, "UTF-8"); ?> (#<?php echo $lecture_count++ ?>)</a></h2>  

      <li class="tubepress_thumb_course">

        <a id="tubepress_image_<?php echo $video->getId(); ?>_<?php echo ${org_tubepress_template_Template::GALLERY_ID}; ?>" rel="tubepress_<?php echo ${org_tubepress_template_Template::EMBEDDED_IMPL_NAME}; ?>_<?php echo ${org_tubepress_template_Template::PLAYER_NAME}; ?>_<?php echo ${org_tubepress_template_Template::GALLERY_ID}; ?>"> 
          <img alt="<?php echo htmlspecialchars($video->getTitle(), ENT_QUOTES, "UTF-8"); ?>" src="<?php echo $video->getThumbnailUrl(); ?>" width="<?php echo ${org_tubepress_template_Template::THUMBNAIL_WIDTH}; ?>" height="<?php echo ${org_tubepress_template_Template::THUMBNAIL_HEIGHT}; ?>" />
        </a>

        <ul class="tubepress_meta_group_course">

          
          
<li class="tubepress_meta_course tubepress_meta_description_course"><?php echo htmlspecialchars($video->getDescription(), ENT_QUOTES, "UTF-8"); ?></li>

          </ul>  
        </li>  
 
      <?php endforeach; ?>

      </ul>
    
    </div>

    <?php if (isset(${org_tubepress_template_Template::PAGINATION_BOTTOM})) : echo ${org_tubepress_template_Template::PAGINATION_BOTTOM}; endif; ?>



  <?php if (isset(${org_tubepress_template_Template::SHORTCODE})): ?>
     <script type="text/javascript">function getUrlEncodedShortcodeForTubePressGallery<?php echo ${org_tubepress_template_Template::GALLERY_ID}; ?>(){return "<?php echo ${org_tubepress_template_Template::SHORTCODE}; ?>";}jQuery(document).ready(function(){TubePressAjax.initPagination(<?php echo ${org_tubepress_template_Template::GALLERY_ID}; ?>);})</script>
  <?php endif; ?>

  <script type="text/javascript">
    jQuery(document).ready(function(){
        TubePress.centerThumbs("#tubepress_gallery_<?php echo ${org_tubepress_template_Template::GALLERY_ID}; ?>");
    });
  </script>
</div>


#9 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 02 January 2011 - 04:09 PM

There were just a few tiny tweaks I made to your template, mostly just stripping out some JS that is no longer necessary. Here's the template: http://pastebin.com/L5SFFtxj. Feel free to run a diff on your original template to see the changes I made, but there was really nothing significant that needed to be done.

Here's what you need to do to create a theme that functions identically.

  • Create a directory at wp-content/plugins/tubepress/content/themes/lecture. If the "content" or "themes" directory doesn't already exist, just create them. In this example the new theme's name, which you'll refer to in your shortcodes, is "lecture"
  • Copy the file from http://pastebin.com/L5SFFtxj to content/themes/lecture/gallery.tpl.php
  • Pick up on step 2 from my previous post. When you do upgrade TubePress, please make sure to follow the upgrade instructions carefully. The most important part is to copy over the "content" directory into your upgraded installation.
Does that make more sense? Let me know how else I can help.

#10 < no first name > Fleming

< no first name > Fleming

    Member

  • Members
  • PipPip
  • 11 posts

Posted 02 January 2011 - 07:00 PM

Done! I cheated. I used a Search and Replace WP plugin to add the new theme shortcode to each instance in the posts. That saved hours.

Your theme worked great for me, I really appreciate you doing that for me. I would have screwed it up I'm sure.

Okay, now that you know someone is using themes, keep the backwards compatibility on upgrades. :)