Forum Replies Created

Viewing 15 replies - 1 through 15 (of 247 total)
  • Plugin Author Chris

    (@zenation)

    Hi,
    could you check if the latest updated fixed that issue?

    Plugin Author Chris

    (@zenation)

    Hi,
    that is a known issue. It’s already fixed but for some weird reason I cannot push the updated the the WordPress repository. I have linked to the working version here https://www.ads-software.com/support/topic/ssl-dont-work/ Just download the zip file and install it from here.

    Plugin Author Chris

    (@zenation)

    Hi and thanks for the feedback.

    1) This is not how the filtering works.
    2) Neither the filtering you’re looking for, nor use of mutiple API keys work out of the box with this plugin.

    At least the filtering is an interestin feature and I made a note to implement proper filtering via WP’s add_filter function in a future version.

    That said, for both your use cases, you can be done by implementing your own wrapper class in PHP that lets you do all of that. For example:

    <?php
    // The original class is still required since the new wrapper class will extend its functionality from it.
    if( !class_exists( 'RelatedYouTubeVideos_API' ) ) {
    
      $file = str_replace( '/', DIRECTORY_SEPARATOR, ABSPATH ) . 'lib' . DIRECTORY_SEPARATOR . 'RelatedYouTubeVidoes' . DIRECTORY_SEPARATOR . 'API.php';
    
      if( file_exists( $file ) ) {
        
        include_once $file;
        
      }
    
    }
    
    if( class_exists( 'RelatedYouTubeVideos_API' ) ) {
    
      /**
       * This is a NEW, CUSTOM API WRAPPER CLASS
       */
      if( !class_exists( 'Custom_RYTV_API' ) ) {
    
        class Custom_RYTV_API extends RelatedYouTubeVideos_API {
    
          public function __construct( $argDevKey, $argCachetime = 24 ) {
        
            parent::__construct();
      
            $this->apiKey               = trim( strip_tags( $argDevKey ) );
    
            $this->options['devKey']    = $this->apiKey;
            $this->options['cachetime'] = (int) $argCachetime;
      
          }
      
          public function validateConfiguration( $argConfig, $argQueryReplacements = array() ) {
        
            $data               = parent::validateConfiguration( $argConfig );
        
            $queryReplacements  = (array) $argQueryReplacements;
        
            foreach( $queryReplacements as $needle => $replacement ) {
          
              $data['search']     = str_ireplace( $needle, $replacement, $data['search'] );
          
            }
        
            return $data;
        
          }
        }
    
      }
      
      $newApiKey = 'whateveritis';
    
      // You should now be able to manually set an API key.
      /// For each API key, you have to instanciate a "new Custom_RYTV_API" object
      $CustomRYTVApi = new Custom_RYTV_API( $newApiKey, $customCacheTime = 24 );
    
      // Your list of (non-casesensitive) terms that shall be replaced with whatever you like
      $rytv_queryFilter = array(
        'porn'  => '',
        'nude'  => ''
      );
    
      $data     = $CustomRYTVApi_1->validateConfiguration(
        array(
         'relation' => 'postTitle',
         'max'      => '3',
         'width'    => 150,
         'height'   => 150,
         'lang'     => 'en',
         'region'   => 'de',
         'class'    => 'left center inline bg-black',
         'preview'  => true
        ),
        // Pass along your filter list
        $rytv_queryFilter
      );
      
      $results  = $CustomRYTVApi->searchYouTube( $data );
    
      $html     = $CustomRYTVApi->displayResults( $results, $data );
      
      echo $html; // Or do with it whatever you like ;)
    
    }
    • This reply was modified 7 years ago by Chris.
    Plugin Author Chris

    (@zenation)

    Hi Alex,
    the width and height parameters only take postive integer numbers.

    I think the best thing would be to add your own css class (‘class’ => ‘newClassname’) and do the responsive adjustments based on that.

    Regards,
    Chris

    • This reply was modified 7 years ago by Chris.
    • This reply was modified 7 years ago by Chris.
    Plugin Author Chris

    (@zenation)

    Mhhh. Works for me?! My first guess is that you should try ‘extact’ => false. That might be too restrictive. If this still fails you can do a little test.

    Assuming you have something like this

    /* Do your configuration */
    $data = $RytvAPI->validateConfiguration(
      array(
        'relation'    => 'keywords',
        'terms'       => 'keyword1',
        'filter'      => '+postTitle keyword2 keyword3',
        'max'         => '1',
        'width'       => '250',
        'height'      => '150',
        'lang'        => 'en',
        'class'       => 'left horizontal bg-black center',
        'preview'     => false,
        'exact'       => true,
        'viewRelated' => false
      )
    );

    add the line

    var_dump( $data );exit;die();

    Then take a quick look a the result: There will be something like ‘search’ => string ‘keyword1 YourPostTitle keyword2 keyword3’ in the output. Copy that value, search for that (wrapped in double quotes if you want exact/true matches) on Youtube.com and compare your results.
    And don’t forget to delete that code line again since you don’t want your site visitors to see this ??

    • This reply was modified 7 years ago by Chris.
    Plugin Author Chris

    (@zenation)

    Hi,
    you could use a workaround:

    [relatedYouTubeVideos relation=”keywords” terms=”myFirstKeyword” filter=”+postTitle anotherKeyWordOrTheSameAgain”]

    Plugin Author Chris

    (@zenation)

    Hi,
    WordPress has its own offical shortcode for that:
    https://en.support.wordpress.com/videos/youtube/
    But it does not provide a preview mode, for example.

    Even though this plugin is not specifically made for it you might use the video ID as keyword and limit the results to 1.

    [relatedYouTubeVideos relation="keywords" terms="1sYhwTYDn9E" max="1" lang="en" class="left horizontal bg-black center" previewMode="true"]

    Plugin Author Chris

    (@zenation)

    Hi,
    you’re not using this plugin by any chance?
    https://www.ads-software.com/plugins/video-thumbnails/

    I’ve created a tool a while back (https://www.ads-software.com/support/topic/separate-php-file-for-the-contstants/) which acts as a link between that one and mine. Not sure if it sill works with their current version, though.

    Plugin Author Chris

    (@zenation)

    Hi,
    I am aware of this issue and technically, I’ve already fixed it. It’s just that I’m having some issues regarding SVN. And as a result I can’t commit new versions to the WordPress repository at the moment.

    If you like you can download and use this version (1.9.6) here instead: https://drive.google.com/open?id=0BwfxKrUNhfSyVEtKUENUMWdjSjQ

    It includes the https fix and will be exactly the version I’m going to publish as soon as I’m able to figure out my SVN/repository thingy.

    Chris

    Plugin Author Chris

    (@zenation)

    Hi,
    try this

    [relatedYouTubeVideos relation="keywords" terms="my post term" max="1" lang="es" width="320" height="240"]

    instead. Width and height can be their own attribute. If you have CSS classes with the names of “width-320” and “height-240” you should pack them both inside the class attribute like this:

    [relatedYouTubeVideos relation="keywords" terms="my post term" max="1" lang="es" class="width-320 height-240"]

    But I would go with the first approach.

    Plugin Author Chris

    (@zenation)

    You’re welcome, I’m glad it works ??

    Plugin Author Chris

    (@zenation)

    You’re right, it is because of https/http.
    I thought I had fixed that a while ago (which is why I didn’t think this could be the reason – again).
    As it turns out I haven’t pushed the new version to the WordPress directory yet. I remember I was waiting for some feedback and must have forgotten about it.

    I hope this will do the trick, so would you mind installing this newer (beta) plugin version instead?

    https://drive.google.com/open?id=0BwfxKrUNhfSyVEtKUENUMWdjSjQ

    Plugin Author Chris

    (@zenation)

    Hi,
    it -shouldn’t- matter if it’s http or https. At least I don’t think so?!
    Have you tried the non-preview approach (just for the sake of testing)? Is it redirecting there, too?
    And do you have a sample URL I can take a look at?

    Plugin Author Chris

    (@zenation)

    Hi,

    first you might try a simple demo shortcode like this

    [relatedYouTubeVideos relation="keywords" terms="monthy python" max="1" preview="true"]

    If that is not working, there might be something wrong with your API key.

    Make sure (via the “Google Console”) that it’s a “web browser (Javascript)” key (even if you’re using it on a server). Those seem to be the least restrictive ones.

    Screenshot 1

    Screenshot 2

    Or could you post the exact shortcode you’re using?

    Also, have you checked the Youtube for the targeted result? Eg, it is quite common to get 0 results when you’re looking for (more or less) complex “exact” search query.

    Plugin Author Chris

    (@zenation)

    Hi, do you have a sample URL? I’m running PHP 7 and the plugin seens to work. But all that this means is that I can’t replicate the error on my systems.

Viewing 15 replies - 1 through 15 (of 247 total)