• Resolved pdo2641

    (@pdo2641)


    First, great plugin. Suggest you show two variables in your help so one can know the variables in the shortcode are seperated by a space, not a commoa.

    Second, I appeal to your genius.
    I use formidablePro forms plugin.

    I coded a Post Snippet, encryptme.

    $qstring ="{fn}|{ln}|{em}|{pid}|{oid}|{rid}";
    
      //echo $qstring."<br/>";
       $password="mysecretpassword";
       $salt = substr(md5(mt_rand(), true), 8);
    
        $key = md5($password . $salt, true);
        $iv  = md5($key . $password . $salt, true);
    
        $ct = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $qstring, MCRYPT_MODE_CBC, $iv);
    
        echo urlencode(base64_encode('Salted__' . $salt . $ct));

    The short code:
    [encryptme fn="John' ln="Doe" em="[email protected]" pid="PWA" oid="87" rid="WSC1034"]

    If I place the short code in a formidable field, it returns the encrypted string just fine…wonderful.
    However, if I use a formidable short code, i.e., a shortcode representing the contents of another field on the form, [Field#] in place of the literals for the variables in the Post Snippets shortcode, it get lost in its underwear.
    I’ve used [85], ‘[85]’, “[85]” flavors, where 85 is field number. No go.
    Short code in a short code. Can you do a ‘do_shortcode’?

    https://www.ads-software.com/plugins/post-snippets/

Viewing 1 replies (of 1 total)
  • Thread Starter pdo2641

    (@pdo2641)

    Update: Shortcodes can’t be passed as variables with this plugin. I suspect another update to fix something caused a problem with short codes being passed. There is some earlier comments to indicate it once worked.

    If I have a Post Snippet short code [encryptme mycontent = “Super”]. The snippet with PHP and Shortcode checked is thus
    Name: encryptme, Variables: mycontent. Code: $qstring = {mycontent};
    echo $qstring;
    It will return: Super.

    If,however I use [encryptme mycontent = “[frm-field-value field_id=67]”] and the shortcode [frm-field-value field_id=67] would return Super, it doesn’t work. I’ve encapsulate with single quotes, single quote and doublequoted, added do_shortcode to the PHP. Many of the returns were bizarre, but know were correct.
    If anyone can see an error in my code, please comment.
    So, it appears if you’re using the plugin for passing variables (not literals) as shortcodes to PHP, it doesn’t work (anymore). Too bad.

    Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Short Code within Short code’ is closed to new replies.