• Resolved talgat

    (@talgat)


    @arnan,

    mfunc doesn’t work. You use a secret code only for a “mfunc”. And not for a closing “/mfunc”. Now I turned off W3 Total Cache support and use next code instead of AdRotate widget:
    <!– mfunc secret_code –>
    echo adrotate_group(2);
    <!– /mfunc secret_code –>

    For a standard Text widget it need to remove line breaks to prevent an eval error. So it will looks like:
    <!– mfunc secret_code –>echo adrotate_group(2);<!– /mfunc secret_code –>

    Also when mfunc doesn’t work impressions work for the dynamic mode only. For the standard mode impressions count one time (before a page will be cached). With the mentioned above solution mfunc and impressions work fine.

    AdRotate 3.14 free.
    WordPress 4.3.1

    Regards, Talgat

    https://www.ads-software.com/plugins/adrotate/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Arnan de Gans

    (@adegans)

    I’ve followed the manual and had some trial and error to get the current implementation working.

    If I change it to what you say, W3TC gives errors about things not being set up right. The current method works for me and many others.

    Thread Starter talgat

    (@talgat)

    @arnan,

    My suggestion works only for the text widget and themes templates. If just add a secret code to “/mfunc” in adrotate-functions.php and adrotate-widget.php it shows an eval error. I didn’t learn yet how to solve it.

    If I’m not mistaken “/mfunc” without a secret code doesn’t work since WordPress 4.1

    Anyway I have notified you.

    Regards, Talgat

    Thread Starter talgat

    (@talgat)

    @arnan,

    This is the error message from W3TC PgCache.php. Please look at the format.

    “Invalid mfunc tag syntax. The correct format is: <!– W3TC_DYNAMIC_SECURITY mfunc PHP code –><!– /mfunc W3TC_DYNAMIC_SECURITY –> or <!– W3TC_DYNAMIC_SECURITY mfunc –>PHP code<!– /mfunc W3TC_DYNAMIC_SECURITY –>.”

    I have found the way how to solve the error which you got with implementation this correct format.

    For example, for the adrotate-widget.php the code should looks like:

    if($adrotate_config['w3caching'] == 'Y')
      echo "echo adrotate_group(".$instance['adid'].", 0, 0, 0);";
    else
      echo adrotate_group($instance['adid'], 0, 0, 0);

    For the adrotate-functions.php

    if($adrotate_config['w3caching'] == "Y")
      $output .= "echo adrotate_group($group_ids, 0, 0, 0);";
    else
      $output .= adrotate_group($group_ids, 0, 0, 0);

    The same way for the call adrotate_ad function.

    Regards, Talgat

    Thread Starter talgat

    (@talgat)

    Thank you for the fix.

    Regards, Talgat

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘mfunc doesn't work’ is closed to new replies.