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

did 2.4 break the Display constant?


  • Please log in to reply
10 replies to this topic

#1 Kenny McNett

Kenny McNett

    Member

  • Members
  • PipPip
  • 17 posts

Posted 02 March 2012 - 04:43 PM

This array was working fine before the update, but now it throws an error. Any ideas?

array(
org_tubepress_api_const_options_names_Meta::VIEWS => false,
org_tubepress_api_const_options_names_Meta::DESCRIPTION => false,
org_tubepress_api_const_options_names_Display::RESULTS_PER_PAGE => 3,
org_tubepress_api_const_options_names_Display::DESC_LIMIT => 50,
org_tubepress_api_const_options_names_Display::CURRENT_PLAYER_NAME => org_tubepress_api_const_options_values_PlayerValue::POPUP,
org_tubepress_api_const_options_names_Display::THUMB_HEIGHT => 105,
org_tubepress_api_const_options_names_Display::THUMB_WIDTH => 135,
org_tubepress_api_const_options_names_Display::PAGINATE_ABOVE => false,
org_tubepress_api_const_options_names_Display::PAGINATE_BELOW => false,
org_tubepress_api_const_options_names_Display::THEME => 'sidebar',
org_tubepress_api_const_options_names_Display::FLUID_THUMBS => false
)

error:
Fatal error: Class 'org_tubepress_api_const_options_names_Display' not found in xxxxx.php on line 33

Line 33 refers to the 3rd line of the array I pasted above.

Any help would be really appreciated!

(filename/path removed for security)

#2 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 02 March 2012 - 08:48 PM

Hi,

I had intended for most of these class names to remain internal, so I'm sorry if I messed up some of your custom code! Can I ask how you're using this array? Might help me to understand and avoid this type of thing in the future.

The org_tubepress_api_const_options_names_Display class was broken up and scattered across these files, mostly into Thumbs.class.php. You're welcome to parse through those files and find the new constants, but I would recommend simply using the constants' values, i.e.

array('views' => false,'description' => false,'resultsPerPage' => 3,...
As those will virtually never change.

#3 Kenny McNett

Kenny McNett

    Member

  • Members
  • PipPip
  • 17 posts

Posted 03 March 2012 - 11:06 PM

Eric, thanks for the reply. I needed support for multiple tubepress widgets because I needed different widget settings for my front page than for my inside pages, so I hired a dev to code it up. The attached file is what he created, and what uses the constants that don't work now. It is located in the /lib/ folder in my site's theme.

The dev also made the link on the thumbnail go directly to my videos page and play the video assigned to that thumbnail. That's another option I didn't find in the native Tubepress, but we needed.

For reference, the dev site URL with the broken widget in the sidebar is http://www.fittedweb...ywilliams/blog/. The functioning (native TubePress) widget is on the home page of that site.

Can you help me modify it so it works correctly with 2.4 (and future versions)?

I'm happy to donate the code to you if it helps to add multiple widget support and/or that style of thumbnail link to a future version of Tubepress.

You made a really fantastic plugin. Thank you,

Kenny

#4 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 05 March 2012 - 01:04 AM

Hi Kenny,

Thanks very much for sharing your code - I really appreciate the contribution and this will definitely expedite the implementation of multiple widgets for TubePress. I've PM'd you an updated version of that file that should work for the foreseeable future of TubePress. I tested it locally and it seems to work as expected, but please let me know how it works for you.

Thanks!

#5 Kenny McNett

Kenny McNett

    Member

  • Members
  • PipPip
  • 17 posts

Posted 07 March 2012 - 11:16 PM

Thanks Eric! Your code worked. You're the bomb dot com. Remember how ppl used to say that for realz?

Fix one prob, find another. I PM'd you back about the problem of widget thumbnails not smoothly linking directly to the video page (which worked in 2.2.9).

#6 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 10 March 2012 - 12:42 PM

Fix one prob, find another. I PM'd you back about the problem of widget thumbnails not smoothly linking directly to the video page (which worked in 2.2.9).


OK, cool. I'll get to that ASAP - probably later today or tomorrow. Thanks again..

#7 Marie Trevino

Marie Trevino

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 06 April 2012 - 01:00 AM

Is this integrated into 2.4.1, or is there something to do to make this work?
Thanks,
Marie

#8 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 06 April 2012 - 10:29 AM

Hi Marie,

The fix in this case was simply to change the array from

array(   org_tubepress_api_const_options_names_Meta::VIEWS => false,   org_tubepress_api_const_options_names_Meta::DESCRIPTION => false,   org_tubepress_api_const_options_names_Display::RESULTS_PER_PAGE => 3,   org_tubepress_api_const_options_names_Display::DESC_LIMIT => 50,   org_tubepress_api_const_options_names_Display::CURRENT_PLAYER_NAME => org_tubepress_api_const_options_values_PlayerValue::POPUP,   org_tubepress_api_const_options_names_Display::THUMB_HEIGHT => 105,   org_tubepress_api_const_options_names_Display::THUMB_WIDTH => 135,   org_tubepress_api_const_options_names_Display::PAGINATE_ABOVE => false,   org_tubepress_api_const_options_names_Display::PAGINATE_BELOW => false,   org_tubepress_api_const_options_names_Display::THEME => 'sidebar',   org_tubepress_api_const_options_names_Display::FLUID_THUMBS => false);
to

array(    'resultsPerPage'       => 3,    'views'                => false,    'description'          => true,    'descriptionLimit'     => 50,    'playerLocation'       => 'popup',    'thumbHeight'          => 105,    'thumbWidth'           => 135,    'paginationAbove'      => false,    'paginationBelow'      => false,    'theme'                => 'sidebar',    'fluidThumbs'          => false);
If you have a different situation, please feel free to post your code and I'll be happy to adjust it to work with the 2.4.x series of TubePress. These class names and constants were never really meant to be visible to the user, so that's why they changed without notice. But if you use the value of the constants, then you can make modifications without worrying about upgrades.

Let us know. Thanks!

#9 Marie Trevino

Marie Trevino

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 06 April 2012 - 05:21 PM

Thanks, but I was referring to the multiple widget created by Fitted Web Design.

There is currently only 1 widget with TubePress, which only works from a feed. :(

Do you have another widget? Ideally, one that shows (perhaps) the most recent video, found on (linked to) the full gallery/video page. If not, do you know of third-party widgets that integrate with TubePress? Currently I use another widget that shows 1 video from any one of several video websites; nice - but I'd rather integrate with TubePress Pro. :-)

Thanks,
Marie

#10 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 09 April 2012 - 02:26 PM

Hi Marie,

Do you have another widget? Ideally, one that shows (perhaps) the most recent video, found on (linked to) the full gallery/video page.


Does your video gallery page have a TubePress gallery? If so, then you could easily tell the TubePress widget to show just a single thumbnail of the "latest" video from that page. Assuming your video gallery page is using a shortcode such as

[tubepress]
you could simply add the "resultCountCap" option to restrict the widget to a single thumbnail. e.g.

[tubepress resultCountCap="1"]
Would that meet your requirements? I hope I'm understanding the problem clearly.. Thanks!

#11 Marie Trevino

Marie Trevino

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 09 April 2012 - 04:16 PM

Thanks - I'll give that a try!!