Viewing 15 replies - 16 through 30 (of 39 total)
  • Great, Marcus! I feel anxious about it… ??

    Thread Starter jpavly

    (@jpavly)

    This is great, looking forward for your update ??

    Having the exact same problem. Has anyone figured this yet?

    I’ve stepped at this problem today and made a quickfix:

    (put this at your theme’s functions.php)

    // hook
    
    add_action('em_event', em_qtranslate, 0, 3);
    
    // qtranslate
    
    function em_qtranslate($target, $arg1=null, $arg2=null, $arg3=null) {
      $target->event_name = em_qtranslate_string($target->event_name);
      $target->event_owner = em_qtranslate_string($target->event_owner);
      $target->post_content = em_qtranslate_string($target->post_content);
    }
    
    function em_qtranslate_string($raw_string) {
      if(function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage'))
        $output = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($raw_string);
      else
        $output = __($raw_string);
      return $output;
    }

    Hope that this help!

    Miren

    (@mberasategi)

    Mateus, that’s so cool! It worked!

    Hi Mateusgm!! My new hero!!!
    It works perfect in the cal view
    But not for the LOCATION link when viewing the event?
    Can you add that one … PLZ PLZ!!
    See my event here!

    CLICK ME

    Keep up the good work!

    Peter

    Glad it worked ??

    For the location this might do the job, although I havent tested it:

    // hook
    
    add_action('em_location', em_qtranslate_location, 0, 3);
    
    // qtranslate
    
    function em_qtranslate_location($target, $arg1=null, $arg2=null, $arg3=null) {
      $target->location_name = em_qtranslate_string($target->location_name);
      $target->post_content = em_qtranslate_string($target->post_content);
    }

    Hi mateusgm!

    You are cool…

    After login out of my blog and returning to do this new fix…
    The first part caused a 500 server error ??

    My theme are OLD and not up to par!
    “Js O4w” ver. 1.1.8 – But changed to fit my style!

    So I can’t yet use this cool fix ??
    Unless you can help me out some other way?

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    hey, matewusgm, thanks for the contributions. There’s another user contributing here –

    https://www.ads-software.com/support/topic/plugin-events-manager-multilingual-ticket-names?replies=6

    I’m trying to consolidate these snippets into something that could possibly make EM and qTranslate compatible. I’ve not used qTranslate for quite some time now (years), so I’m not familiar with it anymore, but would be great to see it working with EM if it’s the case of a few snippets like this.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    additionally, if we can establish any other major issues with using qtranslate and EM maybe I can offer some insight or maybe even get involved in the near future.

    Hey marcus, based on my quick experience tweaking EM code, my guess on this issue would be that the real problem lies around not calling proper WP hooks during EM objects initialization.

    For example, on EM_Event you do the following:

    $this->event_name = $event_post->post_title;
    $this->event_owner = $event_post->post_author;
    $this->post_content = $event_post->post_content;

    But doesn’t call the filters that WP calls on these attributes when it’s initializing a “normal” post (by instance: the_title, the_author, the_content).

    Although i haven’t tested this idea, if i’m correct, this fix would not only fix the issues with qTranslate, but turn your plugin compatible with any other plugin that operates through these hooks.

    Have you already thought about this?
    (just reminding you that this is only a guess based on my limited view of the code, maybe i’m just saying nonsense things here =p)

    Just tested my idea and it worked like a charm ??

    $this->event_name = apply_filters('the_title', $event_post->post_title);
    $this->event_owner = apply_filters('the_author', $event_post->post_author);

    But the application of ‘the_content’ didn’t work (gave a server 503 error) – maybe because you already call it somewhere?

    mateusgm!

    Cool (I think..) But is this fix for us all..?

    Could you post the total “FIX” to use so we all can use it and enjoy the neatness of your skills ??

    In advance: THX

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    you wouldn’t be able to use the_content because you’d create an infinite loop i think.

    you’d probably want to hook into the action em_event and then modify the event there, after instantiation, and then also run this:

    [php]
    remove_filter(‘the_content’,’em_content’);
    //your code here
    add_filter(‘the_content’, ’em_content’);
    [/php]

    I fixed the errors with post titles I saw on our site by changing classes/em-event.php, line 313, from

    $this->event_name = $event_post->post_title;

    to

    $this->event_name = __($event_post->post_title);

    as suggested by qTranslate author.

    Not sure where to apply a similar change to fix the event categories display on the Event Categories widget on the wp-admin Edit Event page.

Viewing 15 replies - 16 through 30 (of 39 total)
  • The topic ‘[Plugin: Events Manager] When used with qTranslate displays tags in titles’ is closed to new replies.