Hello. Sorry if this has been answered before, but I can't find it.
How do I add a custom "unlocked" security icon to Public posts? I feel like it should be obvious, as I have customised all the others (and I did it before in Opal), but I can't do it. :(
(
Read more... )
Comments 12
After the
function Entry::lay_print_subjectline
add:
var string securityicon = (defined $.security_icon?""+$.security_icon ( ... )
Reply
function Entry::lay_print_subjectline in my layer and I can't seem to insert it anywhere without errors. :/
Thanks anyway!
Reply
*grins* And it is really close to the Opal overrides because that's what I originally used them in.
Chances are the final version will be something close to what I offered. The usericon overrides are a different kettle of fish entirely, which is why you can override them with the above code. (I have those overridden as well, with very similar code.)
Sorry I could be of more help.
Reply
function Entry::lay_print_subjectline(Color bg, Color fg, bool usecolour) {
var Page p = get_page();
if ($.security=="protected") { $securityicon = "<
img height=HH width=WW src='http://your_picture.jpg' alt='[protected]' />"; }
if ($.security=="private") { $securityicon = "<
img height=HH width=WW src='http://your_picture.jpg' alt='[private]' />"; }
if ($.security=="") { $securityicon = "<
img height=HH width=WW src='http://your_picture.jpg' alt='[public]' />"; }
if ($.itemid!=int($*layout_guestbook_entryid)) {
"""
""";
if ($p.view!="day") {
# print " base_url()+"/calendar/$.time.year/"+zeropad($.time.month,2)+"/"+zeropad($.time.day,2)+"/\">"+$.time->date_format("%%dayord%%")+"-";
# print " base_url()+"/calendar/$.time.year/"+zeropad($.time.month,2)+"/\">"+$.time-> ( ... )
Reply
Error compiling layer:
Compile error: line 383, column 31: Unknown local variable $securityicon
Reply
You need to add this:
var string securityicon = (defined $.security_icon?""+$.security_icon:"");
just before the first "if"
I hope it helps; I know it works for me, so it can't be completely wrong ;-)
If you want, you could make your layer visible and I could take a look.
Btw. the new possibility to see filtered entries is named "custom", so the code for this one would be:
if ($.security=="custom") { $securityicon = "
( ... )
Reply
Reply
Leave a comment