Jump to content

Macrura

PW-Moderators
  • Posts

    2,756
  • Joined

  • Last visited

  • Days Won

    40

Posts posted by Macrura

  1. Wow, yeah i didn't know $mail was a global variable...

    I updated the readme a bit; i think a lot if people might be overriding the global mail, because using the examples on this; So we should show both versions; they both seem to work the same.
     

    I commented out the public send();

    • Like 1
  2. I also re-read this thread and found out why i had to do the custom method to get the sender domain; However, the module does have the ability to change the sending domain on the fly, but it was not working at all when i posted the comment below; this could take some testing to figure out if the added method is necessary, or will be fixed once the send method observes all of the overrides.

    Just tested and it is working now, and i'm able to override the sending domain upon instantiation of the mail, therefore the mods i posted above are not necessary; The new version I forked on GH only has the 1 change, which is the commenting out of the send alias.

    -----

    this is the fork:

    https://github.com/outflux3/WireMailMailgun

    and i guess once all of the changes are made and it is tested, we could try and see about getting this one switched on the modules directory.

    For @adrian's dilemma, i think the easiest thing would be to have a setting in the module config that when clicked causes the module to not include the public send() method;

    so the config value is checked and then we include that method from an external file, unless there is a better way. So anyone upgrading would keep the same functionality as before, but can elect to check the box to "remove the public send() " or something like that.

    • Like 2
  3. Sure, i don't see any reason I couldn't maintain the module; I think it is basically stable and we'd just need to all contribute our changes, test it and then it should be good to go... I'll try and get that setup soon..

    • Like 6
  4. I also have made some simple customizations to this module that I feel are worth putting into the official version, and for at least 1 site that run this on, these changes are critical for the module to work. If anyone were to take it over, I could submit a pull request, or describe the change/requirement and let the maintainer implement in their interpretation of best practice.

    for one, you might notice that this module's config provides a field for the 'Domain Name'. However, in my case, the 'from' email may use different domains. My Mailgun account has many domains configured.  So instead of the $options array item called CURLOPT_URL using the module's entered domain name, i need it to use the domain from the $mail instance's from/sender. To this end i created a method getDomainName() as follows:

    	private function getDomainName() {
    		return substr(strrchr($this->mail['from'], "@"), 1);
    	}

    then replace the CURLOPT_URL with

    CURLOPT_URL => "{$this->apiUrl}" . $this->getDomainName() . "/messages", 

    I guess for this module to be flexible enough going forward, there may need to be an additional setting, where you either enter a domain name in the module config, or you tell the module to 'auto' populate the domain name from the sender domain.

    • Like 2
  5. I'm attempting to upgrade a site from 2.7.x to 3x, and one of the modules that i'm upgrading also is Tracy.

    One major issue that anyone doing this upgrade will encounter is the legacy setting for coreBranch – if that is set on your initial install, then it will be stuck in 'stable' and cause require_once failed to open stream errors on tracy-stable/src.tracy.php;

    the 2 ways to fix this are to either first just completely uninstall Tracy before upgrading, or to manually change that value in the database.

    • Like 1
  6. I usually use Settings Factory, it handles most situations and lets you have links in your admin menu to the settings.

    Most sites I build have a centralized Media Library, so i never need to deal with images in settings, e.g. if i needed to have a logo or some other image for a setting, i would make it a page reference to the media library.

  7. ok that's a bug, you can either uncheck the default skin in the module config, or upgrade to the latest version (110), which fixes that.

    Also note that the newest version would be injecting the JS var into the header so you wouldn't need to hardcode that; also you shouldn't need any extra css, as the module should just work with this version...

  8. right - as i pointed out, the error is because the $sm2 variable is not the instance of the module.  player() on null means that $sm2 is null.

    You said this in your init

    $sm2 = $modules->get('TextformatterSoundmanager');

    You either lost the variable between your init and the template, or you are in a different namespace;

    whatever the case, you can easily solve it by just re-referencing the module right before the code; just repeat that code before the other code; none of the other items you mentioned would affect anything, field name,

  9. 19 hours ago, BFD Calendar said:

    echo "$sm2->player($page->sound)"; in the template gives just the filename of the soundfile...

    the api access to the cassette ui is working for me; you just need to make sure you supply the options, because there is no way to default to the cassette for the player, because it only supports 1 audio file per page..

    Soudmanager2_Cassette___Soundmanager2_Mixed_Types_Testing___My_Great_Site.thumb.jpg.4914641fae6f7fae4a4e5beda59acef6.jpg

  10. 1 hour ago, BFD Calendar said:

    echo "$sm2->player($page->sound)"; in the template gives just the filename of the soundfile...

    not sure, it sounds like $sm2 is not the module instance; you'd need to use Tracy Debugger to bd($sm2) at that point and see if it is actually the module;
    I will test your code also to see if i can troubleshoot that issue; are you passing any options to the player, or are you setting the default player as the cassette, in the module config?

  11. you have some rules messing up the player; make sure the player CSS is loaded after your site css; The controls shouldn't appear until you hover over the cassette.

    Problem 1)

    #content p, #content ul, #content ol, #content table {
        margin: 1em 0 1.5em 0;
    }

    Problem 2)

    #content ul li {
        margin: 0 0 0 3em;
        display: list-item;
        list-style: none;
    }

    problem 3)

    #content a {
        color: #f00076;
    }

    once those are solved you should have it looking like this:

    2083216618_ScreenShot2018-12-26at11_58_19AM.jpg.d4d98691a1a405e2a0e2135b0986555a.jpg

    for the other issue, you should check to make sure that the variable $sound is not getting overwritten somewhere; for safety you should probably call it $sm2 instead of sound;

  12. so are you doing this?

    ) In order for the module to output the necessary styles and scripts, you need to echo the $config->styles and $config->scripts arrays into your site's header/footer. Here is an example:

    // In Header
    foreach($config->styles as $style) echo "<link rel='stylesheet' type='text/css' href='{$style}' />\n";
    
    // In Footer
    foreach($config->scripts as $script) echo "<script type='text/javascript' src='{$script}'></script>\n";

    I don't see the cassette css file anywhere on the page; the styles for any given player need to be either hardcoded style link references on the page, or you have to use $config scripts & styles in order for each/any of the players CSS and JS files to load;

  13. once you eliminate the errors, if you want to use that player on a page, for now you'll need to manually insert this code in the header, until i can update the module to insert that; I probably had a cached copy of the swf player on my old dev machine which is why it worked without that.. once the module is updated, then it will insert that code into the header when you have a cassette on the page..

    		<script type='text/javascript'>
    			var swfUrl = '/site/modules/TextformatterSoundmanager/soundmanager2/swf/';
    		</script>

     

  14. swfUrl needs to be defined, since that particular player requires flash; but the strange thing is this used to work on my local but is not currently working; i will check and see if there is some way of getting it to work again...

    also on your page jquery isn't loading, because of Blocked loading mixed active content

     

×
×
  • Create New...