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

Multiple playlists: wont revert back to 1st panel [SOLVED]


  • Please log in to reply
24 replies to this topic

#21 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 13 September 2012 - 01:11 PM

OK I'm still not getting the limited characters on a custom theme so I will try and describe what I have done so far.

Created new directory:
wp-content/tubepress-content/themes/titlelimit

Copied > gallery.php into this directory > made the amendments to line 44 above

In WP page: [tubepress theme="limittitle"] - it shows the default player but the thumbnails titles still show full title not just 10 characters. - I am obviously missing a step but cant quite figure it out.


This is the right procedure. Hmm - do you have a link to the page that is using this shortcode? The URL that you PM'd me the other week doesn't seem to be using the "limittitle" theme.

Only issue: Its still showing the big YouTube default play. I only want it to display thumbnails after a search & these to open in shadowbox. Just thumbnails without the video player.


The

[tubepress output="ajaxSearchInput" ...
shortcode should just display the thumbs and play them in Shadowbox. Again, do you have a link to a page that demonstrates this? I'll be glad to take a look.

Sometimes "no playlist can be found" - I think that's how its worded.
I'm going to be having quite a bit on content from YouTube on each page so was more wondering if there was any API settings I can put into settings to make these load better.
I have not changed any cache settings within the player. Normal Google Chrome cache settings if that is what you are referring to.


I would highly recommend enabling TubePress's API cache. You can do so from WP Admin > Settings > TubePress > Cache. Tick the first checkbox to enable the cache. That should help "smooth out" any API errors. Give it a try and let us know?

Thank you!

#22 maverick

maverick

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts

Posted 14 September 2012 - 07:03 AM

Thank for your reply Erik.

Yes Check the page now as I updated it again. >I PM'd you the link.

Theres lots of text in my previous posts so to recap
two errors still remain: (More than likely USER Errors!)

1. Showing static video player when using Aajax search (I want it to show only the thumbnails)
By the way, when you test it and do a search the results display under the "search Results Tab" I created - in case you wondered where they were.

2. Using Custom theme "limittitle" - Players does display but titles length is not limited to 10 characters.

<?php
/**
 * Copyright 2006 - 2012 Eric D. Hough (http://ehough.com)
 *
 * This file is part of TubePress (http://tubepress.org)
 *
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 *
 * Uber simple/fast template for TubePress. Idea from here: http://seanhess.net/posts/simple_templating_system_in_php
 * Sure, maybe your templating system of choice looks prettier but I'll bet it's not faster :)
 */
?>

<div class="tubepress_container" id="tubepress_gallery_<?php echo ${org_tubepress_api_const_template_Variable::GALLERY_ID}; ?>">

  <?php echo ${org_tubepress_api_const_template_Variable::PLAYER_HTML}; ?>

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

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

    <div class="tubepress_thumbs">
        <?php foreach (${org_tubepress_api_const_template_Variable::VIDEO_ARRAY} as $video): ?>

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

          <?php if (${org_tubepress_api_const_template_Variable::META_SHOULD_SHOW}[org_tubepress_api_const_options_names_Meta::TITLE]): ?>
          <dt class="tubepress_meta tubepress_meta_title"><?php echo ${org_tubepress_api_const_template_Variable::META_LABELS}[org_tubepress_api_const_options_names_Meta::TITLE]; ?></dt><dd class="tubepress_meta tubepress_meta_title"><a id="tubepress_title_<?php echo $video->getId(); ?>_<?php echo ${org_tubepress_api_const_template_Variable::GALLERY_ID}; ?>" rel="tubepress_<?php echo ${org_tubepress_api_const_template_Variable::EMBEDDED_IMPL_NAME}; ?>_<?php echo ${org_tubepress_api_const_template_Variable::PLAYER_NAME}; ?>_<?php echo ${org_tubepress_api_const_template_Variable::GALLERY_ID}; ?>"><?php
$title = $video->getTitle();
$limit = 25;
$title = (strlen($title) > $limit) ? substr($title, 0, 25) . '...' : $title;
echo htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
?></a></dd>
          <?php endif; ?>

          <?php if (${org_tubepress_api_const_template_Variable::META_SHOULD_SHOW}[org_tubepress_api_const_options_names_Meta::LENGTH]): ?>

          <dt class="tubepress_meta tubepress_meta_runtime"><?php echo ${org_tubepress_api_const_template_Variable::META_LABELS}[org_tubepress_api_const_options_names_Meta::LENGTH]; ?></dt><dd class="tubepress_meta tubepress_meta_runtime"><?php echo $video->getDuration(); ?></dd>
          <?php endif; ?>

          <?php if (${org_tubepress_api_const_template_Variable::META_SHOULD_SHOW}[org_tubepress_api_const_options_names_Meta::AUTHOR]): ?>

          <dt class="tubepress_meta tubepress_meta_author"><?php echo ${org_tubepress_api_const_template_Variable::META_LABELS}[org_tubepress_api_const_options_names_Meta::AUTHOR]; ?></dt><dd class="tubepress_meta tubepress_meta_author"><?php echo $video->getAuthorDisplayName(); ?></dd>
          <?php endif; ?>

          <?php if (${org_tubepress_api_const_template_Variable::META_SHOULD_SHOW}[org_tubepress_api_const_options_names_Meta::KEYWORDS]): ?>

          <dt class="tubepress_meta tubepress_meta_keywords"><?php echo ${org_tubepress_api_const_template_Variable::META_LABELS}[org_tubepress_api_const_options_names_Meta::KEYWORDS]; ?></dt><dd class="tubepress_meta tubepress_meta_keywords"><?php echo $raw = htmlspecialchars(implode(" ", $video->getKeywords()), ENT_QUOTES, "UTF-8"); ?></dd>
          <?php endif; ?>

          <?php if (${org_tubepress_api_const_template_Variable::META_SHOULD_SHOW}[org_tubepress_api_const_options_names_Meta::URL]): ?>

          <dt class="tubepress_meta tubepress_meta_url"><?php echo ${org_tubepress_api_const_template_Variable::META_LABELS}[org_tubepress_api_const_options_names_Meta::URL]; ?></dt><dd class="tubepress_meta tubepress_meta_url"><a rel="external nofollow" href="<?php echo $video->getHomeUrl(); ?>"><?php echo ${org_tubepress_api_const_template_Variable::META_LABELS}[org_tubepress_api_const_options_names_Meta::URL]; ?></a></dd>
          <?php endif; ?>

          <?php if (${org_tubepress_api_const_template_Variable::META_SHOULD_SHOW}[org_tubepress_api_const_options_names_Meta::CATEGORY] &&
              $video->getCategory() != ""):
          ?>

          <dt class="tubepress_meta tubepress_meta_category"><?php echo ${org_tubepress_api_const_template_Variable::META_LABELS}[org_tubepress_api_const_options_names_Meta::CATEGORY]; ?></dt><dd class="tubepress_meta tubepress_meta_category"><?php echo htmlspecialchars($video->getCategory(), ENT_QUOTES, "UTF-8"); ?></dd>
          <?php endif; ?>

          <?php if (${org_tubepress_api_const_template_Variable::META_SHOULD_SHOW}[org_tubepress_api_const_options_names_Meta::RATINGS] &&
              $video->getRatingCount() != ""):
          ?>

          <dt class="tubepress_meta tubepress_meta_ratings"><?php echo ${org_tubepress_api_const_template_Variable::META_LABELS}[org_tubepress_api_const_options_names_Meta::RATINGS]; ?></dt><dd class="tubepress_meta tubepress_meta_ratings"><?php echo $video->getRatingCount(); ?></dd>
          <?php endif; ?>

          <?php if (${org_tubepress_api_const_template_Variable::META_SHOULD_SHOW}[org_tubepress_api_const_options_names_Meta::LIKES] &&
              $video->getLikesCount() != ""):
          ?>

          <dt class="tubepress_meta tubepress_meta_likes"><?php echo ${org_tubepress_api_const_template_Variable::META_LABELS}[org_tubepress_api_const_options_names_Meta::LIKES]; ?></dt><dd class="tubepress_meta tubepress_meta_likes"><?php echo $video->getLikesCount(); ?></dd>
          <?php endif; ?>

          <?php if (${org_tubepress_api_const_template_Variable::META_SHOULD_SHOW}[org_tubepress_api_const_options_names_Meta::RATING] &&
              $video->getRatingAverage() != ""):
          ?>

          <dt class="tubepress_meta tubepress_meta_rating"><?php echo ${org_tubepress_api_const_template_Variable::META_LABELS}[org_tubepress_api_const_options_names_Meta::RATING]; ?></dt><dd class="tubepress_meta tubepress_meta_rating"><?php echo $video->getRatingAverage(); ?></dd>
          <?php endif; ?>

          <?php if (${org_tubepress_api_const_template_Variable::META_SHOULD_SHOW}[org_tubepress_api_const_options_names_Meta::ID]): ?>

          <dt class="tubepress_meta tubepress_meta_id"><?php echo ${org_tubepress_api_const_template_Variable::META_LABELS}[org_tubepress_api_const_options_names_Meta::ID]; ?></dt><dd class="tubepress_meta tubepress_meta_id"><?php echo $video->getId(); ?></dd>
          <?php endif; ?>

          <?php if (${org_tubepress_api_const_template_Variable::META_SHOULD_SHOW}[org_tubepress_api_const_options_names_Meta::VIEWS]): ?>

          <dt class="tubepress_meta tubepress_meta_views"><?php echo ${org_tubepress_api_const_template_Variable::META_LABELS}[org_tubepress_api_const_options_names_Meta::VIEWS]; ?></dt><dd class="tubepress_meta tubepress_meta_views"><?php echo $video->getViewCount(); ?></dd>
          <?php endif; ?>

          <?php if (${org_tubepress_api_const_template_Variable::META_SHOULD_SHOW}[org_tubepress_api_const_options_names_Meta::UPLOADED]): ?>

          <dt class="tubepress_meta tubepress_meta_uploaddate"><?php echo ${org_tubepress_api_const_template_Variable::META_LABELS}[org_tubepress_api_const_options_names_Meta::UPLOADED]; ?></dt><dd class="tubepress_meta tubepress_meta_uploaddate"><?php echo $video->getTimePublished(); ?></dd>
          <?php endif; ?>

          <?php if (${org_tubepress_api_const_template_Variable::META_SHOULD_SHOW}[org_tubepress_api_const_options_names_Meta::DESCRIPTION]): ?>

          <dt class="tubepress_meta tubepress_meta_description"><?php echo ${org_tubepress_api_const_template_Variable::META_LABELS}[org_tubepress_api_const_options_names_Meta::DESCRIPTION]; ?></dt><dd class="tubepress_meta tubepress_meta_description"><?php echo $video->getDescription(); ?></dd>
          <?php endif; ?>

        </dl>
      </div>
      <?php endforeach; ?>

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

PM'd you link > let me know if you require anything else.

Thanks, S

#23 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 17 September 2012 - 01:33 PM

OK, we're getting there!

Showing static video player when using Aajax search (I want it to show only the thumbnails)


Change this shortcode from

[tubepress output="ajaxSearchInput" searchResultsDomId="#test_results_div" searchProvider="youtube" searchResultsRestrictedToUser="EpicMealTime"]
to

[tubepress output="ajaxSearchInput" searchResultsDomId="#test_results_div" searchProvider="youtube" searchResultsRestrictedToUser="EpicMealTime" playerLocation="shadowbox"]
That will make the search results play with Shadowbox.js.

Using Custom theme "limittitle" - Players does display but titles length is not limited to 10 characters.


Your template is correct. The problem is that it doesn't appear to be in the correct location. From TubePress's debug output...

Could not read file at /home5/<redacted>/site/wp-content/tubepress-content/themes/limittitle/gallery.tpl.php. Falling back to default.
So in other words, TubePress was trying to use the "limittitle" theme's copy of gallery.tpl.php but it wasn't found in the expected location (wp-content/tubepress-content/themes/limittitle/gallery.tpl.php). What's the current location of the "limitttile" theme directory?

#24 maverick

maverick

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts

Posted 18 September 2012 - 01:20 PM

OK, we're getting there!



Everything is resolved so far now Erik - thank you very much for taking the time.

The code you provided worked a treat.

The reason why it could not find the correct custom theme directory was because - 'basically I was being an idiot and had named it titlelimit not limittitle on the page'. (Learnt from my mistakes).

Thanks man. Awesome plugin > Awesome support. Do you have twitter I will post a public TY. Got a good tech start-up follow list who would benefit from the plugin.

#25 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 19 September 2012 - 04:24 PM

Great! Glad that we finally got everything worked out. Your situation was more complex than most, which explains why it took us so long :p

Do you have twitter I will post a public TY. Got a good tech start-up follow list who would benefit from the plugin.


No Twitter just yet, but I always appreciate any positive press and linking to http://tubepress.org. Thanks!

Let me know if there's anything else I can do for you. Cheers.