Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Yesterday at 02:04 PM
Ivo Pereira Posted April 12, 2015 Posted April 12, 2015 Hello,I'm using PHP & TXT Widget and I'm needing to insert an iframe that needs to include the ID of the current logged-in user in the URL.As with this plugin I can use PHP, how can I print the ID of the actual user? Thanks a lot!
Ivo Pereira Posted April 12, 2015 Author Posted April 12, 2015 I was able to achieve it. I was using the wrong code block. Needed to activate the "Active PHP widget" in plugin settings, then get the "PHP Code" block (that appeared after activating the setting) and get it to layout.After that, this did it:<?php $logged_in = \IPS\Member::loggedIn(); if (!empty($logged_in)) { echo '<iframe src="http://example.com/' . $logged_in->member_id . '" width="100%" height="400" frameborder="0"></iframe>'; } ?>
Recommended Posts
Archived
This topic is now archived and is closed to further replies.