Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Rob Fielding Posted March 11, 2022 Posted March 11, 2022 Hi, I have some advertising code which needs to go in the footer section of my theme. Is there some conditional code which I can surround it with so it only shows to guests. One of the advantages I offer my registered users is less adverts so I only want this advert to show to guests. I was hope there was some code that would be along the lines conditional show if user=guest Advertising code/script end conditional Thanks a lot, Rob
opentype Posted March 11, 2022 Posted March 11, 2022 {{if \IPS\Member::loggedIn()->member_id === NULL}} This content *only* shows to guests, since they have a NULL member_id. {{endif}} {{if \IPS\Member::loggedIn()->member_id}} This content *only* shows to logged-in users since their member_id is a number, which will equal true. {{endif}} Rob Fielding 1
Rob Fielding Posted March 11, 2022 Author Posted March 11, 2022 Thanks @opentype - that was a super speedy and very helpful response. Much appreciated!!
Recommended Posts