By default, public posts have no icon set, and this is represented by the security designation
""
. Now, the code implemented for the custom security icon tutorial does not change the public icon because Component is set up to only display an icon when the security designation does not equal ""
. This is done by the statement if($e.security != "")
. What you have to do is implement the code from the original custom security icon tutorial, and then find and replace that statement:
if($e.security != "")
with:
if($e.security != "a")
This tells LJ to display a security icon if the post is not "a" security, which posts never are. If you do not do this, this tutorial will not work. Oh, and a can be replaced with anything so long as there is a value between the "", and it is not "protected" or "private".
Then, what you have to do is, where the original code says this:
######################################## ######################################## ###############
# set icon to default icon
var string iconurl = $e.security_icon.url;
# if you don't want to change the private icon, add a # to the following line
if ($e.security=="private") { $iconurl = "YOUR PRIVATE ICON URL"; }
# if you don't want to change the protected (friends-only) icon, add a # to the following line
if ($e.security=="protected") { $iconurl = "YOUR PROTECTED ICON URL"; }
######################################## ######################################## ############### {
replace it with this code:
######################################## ######################################## ###############
# set icon to default icon
var string iconurl = $e.security_icon.url;
# if you don't want to change the private icon, add a # to the following line
if ($e.security=="private") { $iconurl = "YOUR PRIVATE ICON URL"; }
# if you don't want to change the protected (friends-only) icon, add a # to the following line
if ($e.security=="protected") { $iconurl = "YOUR PROTECTED ICON URL"; }
# the following line changes the public icon
if ($e.security=="") { $iconurl = "YOUR PUBLIC ICON URL HERE"; }
######################################## ######################################## ############### {
And there you have it. Hopefully this is of use to someone and I haven't just written out something that people already know how to do :)