Forum Replies Created

Viewing 15 replies - 16 through 30 (of 36 total)
  • Thread Starter bitoolean

    (@bitoolean)

    Using revision 16, the errors I mentioned above are still present.
    You seem to have updated that code, but you haven’t fixed the single quotes and double quotes enclosing issue. I think replacing single quotes with double quotes and vice-versa, as I did mention in the first post will solve the issue (in fact I know so because I’ve already done it and it worked).

    jQuery('head').append('<scr' + 'ipt type="text/javascript" src="<?php echo plugins_url( "jquery.js" , __FILE__ );?>"></scr' + 'ipt>');

    To sum up, because valid HTML needs to enclose attribute values in double quotes (“), you need to enclose the strings belonging to Javascript which are parts of HTML code within single quotes. PHP only interprets code within the PHP tags, and it is interpreted first and replaced with the actual path, so it doesn’t matter which ones you use to enclose strings belonging to PHP code. Javascript has to use single quotes, because using double quotes would mean needing to escape every double quote within the HTML-part strings with a backslash. So, we have PHP and HTML usding double-quoted strings inside Javascript using single-quoted strings.

    Then the javascript is syntactically correct and won’t break execution.

    Thread Starter bitoolean

    (@bitoolean)

    Is this only happening to me? Check this at indignat.socioblog.ro (clicking on the post excerpts’ titles doesn’t AJAX-load content), so the syntax error below breaks script execution (I was wrong again saying it invalidates HTML, but because it deals with HTML code generation):

    if (! jQueryScriptOutputted) {
      //only output the script once..
      jQueryScriptOutputted = true;
      //output the jquery script
      document.write("<scr" + "ipt type='text/javascript' src="http://indignat.socioblog.ro/wp-content/plugins/advanced-ajax-page-loader/jquery.js?84cd58"></scr" + "ipt>");
     <strong>Uncaught SyntaxError: Unexpected identifier</strong>
    }

    You see, there is a double-quoted string (the jQuery path specified as the value for the SRC attribute) inside another double-quoted string.

    It seems you’ve published revision 14 in the meantime. I’ll check that too a little later.

    There’s also again the “AAPL_wanings is not defined” within the jQuery(document).ready at line:
    if (AAPL_warnings == true)

    Thread Starter bitoolean

    (@bitoolean)

    I’ve marked this topic as resolved and asked people to ignore it because I started a newer one where I explained things more clearly. I can’t delete the thread, but if anyone can, please do so.

    Thread Starter bitoolean

    (@bitoolean)

    I think I did a mistake by saying that WP returns a path enclosed in double quotes, that wouldn’t make much sense indeed. I was just confused when I examined the source code of the live page. That string appeared to be very wrongly escaped and thus breaking the entire script processing in my case (it invalidated the HTML), even with the jQuery check being disabled.

    I don’t even know why a jQuery is included with AAPL, and why it overrides the default WP path. I don’t understand, because I’ve already overridden the default WP path with that of the one hosted by Google (and I specify a major version only which acts like a wildcard on the minor version, always getting the latest one). So AAPL should probably check the jQuery version already loaded and then decide whether it should use its own one? (which may be older!). I’m new to web programming, and I’m just learning PHP and Javascript etc., so I’m not giving advice, I’m just asking. Maybe letting the user know he needs to update his jQuery.js would be enough. Now I have two useless rather large jQuery libraries sitting on the server…

    Anyway, I had disabled the plugin, deleted the plugin folder and uploaded version 2.5.12, then enabled it again, and it didn’t work at all, so I just reverted to 2.5.9. I update the plugin manually just to make sure I don’t lose my settings, and because I have to (it’s free hosting, the server limits max. execution time of PHP scripts to 10 seconds only).

    I’ll try the latest version, revision 13, and return with results.

    I have no filters set either and I had to manually specify the UA code.

    I’m not using multisite, although I am using a handful of good plugins which haven’t caused issues on the admin side before though.

    The “help improve” message always shows, there’s only one button (to deny sharing of statistical data), it has a fixed position at coordinates 0, 0 and clicking the button doesn’t do anything.

    I’m just learning PHP and I may not understand the code well, but could there be something wrong with the following conditional?
    if ( !isset( $options['tracking_popup'] ) && !isset( $_GET['allow_tracking'] ) )

    I’ve recently updated to WP 3.4.1 as well.

    EDIT: As an alternative temporary fix, I’ve edited the class-pointer.php, by commenting out the whole content of the enqueue() function. That portion is responsible with displaying the box on the admin panel.

    Thread Starter bitoolean

    (@bitoolean)

    I think I’ve already voted it 😛 but I’ll vote it works with the latest WordPress as well.

    It’s not weird that the Romanian translation doesn’t show up – I have a plugin which makes my admin panel display in English and the visitor pages strings in Romanian.

    Next I’ll have to make some other widgets compatible with AAPL, like the facebook like button, but that should hopefully be easier now.

    Yes, your plugin is great and deserves more recognition indeed, even if it does a simple job apparently. I only use the greatest and most useful plugins! When I’m done customizing the website, I’ll have a dedicated page where I’ll list every component I’m using and the free hosting.

    Thread Starter bitoolean

    (@bitoolean)

    I imagined I would feel relieved, but I didn’t imagine I would feel so happy and satisfied. I haven’t felt so good in a while! ;)) I’ve invested a lot of time into making this website work (AAPL of course needed work to be made compatible and even work at all in my case), so it feels very rewarding to see it isn’t for nothing.

    The solution is working. Now I can worry about more pleasant stuff like customizing the theme and replacing overly complex widgets with simpler PHP coding and other optimizations. I can’t pay you money, but I can at least translate the admin panel interface of Youtube Lyte to Romanian (if the plugin supports it), or whatever you think I can do to pay you back.

    I’m going to post the fix to the public AAPL reload codes (for people to use) if you don’t. I feel like the fail callback should be kept (it will catch and log eventual errors caused by changes in the script of future versions of Youtube Lyte), just for safety.

    I’m so glad the site is coming together 😀

    Thread Starter bitoolean

    (@bitoolean)

    On the good side, at least now the page contents load and are layout correctly.

    This is the new code executed by AAPL_reload_code(), conforming to the jQuery documentation:

    var onSuccess = function( script, scriptStatus, jqXHR){
      console.log('AAPL lyte loaded data: ' + script);
      console.log('AAPL lyte jqXHR status: ' + jqXHR.status);
      console.log('AAPL lyte getScript status: ' + scriptStatus);
      ly.te();
    };
    var onFailure = function(jqXHR, settings, exception){
      console.log('AAPL lyte getScript exception: ' + exception);
    };
    jQuery.getScript('/wp-content/plugins/wp-youtube-lyte/lyte/lyte.js').done(onSuccess).fail(onFailure);

    On the bad side, youtube lyte still doesn’t show up, BUT… thanks to the console.log in the onFailure callback set with fail() above, we can now see a more insightful exception (I’m guessing, during execution of the lyte script that jQuery has loaded asynchronously):
    ReferenceError: bU is not defined

    EDIT: Setting the onSuccess callback as the getScript’s second parameter’s value instead of using done() results in the same exception.

    Remember to empty the browser’s cache before debugging (the next time you can spare the time), so that you get the new reload_code.js, otherwise you may see the same thing as before. Also, I’m completely disabling auto-minifying until you get back to me.

    Have a nice day!

    Thread Starter bitoolean

    (@bitoolean)

    OK, I’ve been trying, unsuccessfully. I’ve used the uncompressed version. I’ve even tried replacing the jQuery.getScript with a document.write(<script… but that just breaks the website resulting in an empty page (there’s nothing but a head including that script tag when I examine the markup).

    I’m only just learning javascript, so I’m probably wrong, but maybe the error “ly is not defined” is caused by jQuery not executing the script in the context of the global object, or because the jQuery.getScript gets called within the so-called reload function defined by the AAPL plugin, while your script doesn’t expect that. Your code is too advanced for me to understand, so I’m not sure of what exactly I am trying to say here, but maybe, for example, you define things that should belong to the global object and they turn out not to.

    If you access my website again, remember that auto-minifying of JavaScript is only disabled for logged-in users, so just post a “test” comment on any post during that browsing session (you will asked to log in with a third-party account like facebook/yahoo through a third-party service).

    This is what my “reload code” AAPL settings section looks like:

    jQuery.getScript('/wp-content/plugins/wp-youtube-lyte/lyte/lyte.js');
    ly.te();

    And here is where you can see examples of reload codes (javascript) other people used to fix the functionality of some other plugins/widgets using javascript:
    http://software.resplace.net/WordPress/AjaxPageLoader.php

    Thread Starter bitoolean

    (@bitoolean)

    I wish I did… Just navigate to the main page of the website at indignat.socioblog.ro, then click on the title of the first post excerpt. If you click the “continue” ( […]-> symbol ) link instead of the title of the post, AJAX doesn’t occur (I don’t know how to ajaxify those links manually), you just navigate to the post URL. So, click on the post’s title instead.

    For now I’ve only included a call to jQuery.getScript('/wp-content/plugins/wp-youtube-lyte/lyte/lyte-min.js') in the “reload” section (I’m writing the path out of memory, it’s not necessarily exactly that one).

    Thread Starter bitoolean

    (@bitoolean)

    I wasn’t in the country for a month, and I didn’t have time to care about the website. I was going to answer immediately, but I only found out I had to leave two days before, so I really couldn’t answer at that time. I was surprised to see you noticed this forum thread this easily. Is that because I tagged it “wp-youtube-lyte”?

    When I visit the post’s URL directly, the video appears as expected, so Youtube Lyte is working correctly. However, when I navigate to the post by clicking a link within the website, it is loaded dynamically as static data (I suppose) by Advanced AJAX Page Loader, which means that JavaScript code indeed doesn’t execute (because all I get is blank).

    So I “summon” the code in lyte-min.js by means of jQuery.getScript() which also executes it. This call has to be made by Advanced AJAX Page Loader after loading the post content, so I put that snippet of code in the “reload” section specifically created for that purpose in the plugin’s settings page on the WordPress admin panel… I tried calling ly.te() as well, and even on its own, without executing the whole script first. Nothing works 🙁

    I examined the page and it seems the post’s content is still there in the HTML. However, the DIV having the ID=”content” has its LEFT property’s value set to 20000px (yes, four zeroes) in the element’s inline CSS style attribute value. Also, after the P paragraph elements, where the video should be, there are only two empty divs:

    <div class="lyMe" id="WYL_oRnEsCYpfC0" style="width:480px;height:360px;overflow:hidden;"></div>
    <div class="lL" style="width:480px;"></div>

    And this is the opening tag of the WordPress “content” DIV:
    <div id="content" role="main" style="display: block; position: absolute; left: 20000px; ">

    You can see it by accessing the first (latest) article at indignat.socioblog.ro

    Thank you for all of your help. I’ll keep trying to get it to work tomorrow most probably.

    Thread Starter bitoolean

    (@bitoolean)

    Please ignore this thread…

    Thread Starter bitoolean

    (@bitoolean)

    I don’t need the jQuery check / loader / initializer, so I simply comment out the whole initJQuery() function definition and the following call to that function (within the PHP file).

    I also remove everything from the jQuery document load event handler in ajax-page-loader.js except the call to AAPL_loadPageInit(“”);

    This fixes the plugin version 2.5.9, but not the latest version (2.5.12).

    The website using it can be found here.

    I repeat, no need for a PHP expert at all. Just basic HTML (and you can grab the knowledge you need on the way). I’d help you, but I’m busy getting my own site right, and I haven’t even tried fiddling with this plugin too much myself – I’m auto-registering users who comment by logging in through their third-party social networks accounts as a means of verifying e-mail, so I’d have liked to remove all those unnecessary stepts – confirmation pages and e-mail messages required for this plugin to subscribe someone, but that’s too much work – I’m lazy, I admit, so I just let it work the way it was meant to.

    I’ve finished translating the subscribe e-mail and pages templates to Romanian however, if anyone’s interested.

Viewing 15 replies - 16 through 30 (of 36 total)