Public security icon

Feb 06, 2008 19:20

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... )

security icons

Leave a comment

Comments 12

simons_flower February 6 2008, 20:38:31 UTC
I'm overriding the entire layout (I've customized bits and pieces of the Smooth Sailing original), so I'm not sure adding just these bits to a stylesheet will help, but this is what I have.

After the
function Entry::lay_print_subjectline
add:
var string securityicon = (defined $.security_icon?""+$.security_icon ( ... )

Reply

euphrosyna February 6 2008, 20:48:39 UTC
That's really like the code I used in Opal, but I don't have the
function Entry::lay_print_subjectline in my layer and I can't seem to insert it anywhere without errors. :/

Thanks anyway!

Reply

simons_flower February 6 2008, 21:00:17 UTC
I thought you might not be able to, because what I'm using is a full base layout, not just a theme layer.

*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


minniemax February 9 2008, 18:39:36 UTC
can you just try this?

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

euphrosyna March 2 2008, 12:33:44 UTC
I am ridiculously late in replying... I'm so sorry. When I try that I get an error in my layer:

Error compiling layer:
Compile error: line 383, column 31: Unknown local variable $securityicon

Reply

minniemax March 2 2008, 12:57:18 UTC
Oh, sorry, my bad, I somehow thought you have the beginning of the code already.

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

euphrosyna March 2 2008, 13:00:22 UTC
Ooh, i think that may have worked... no errors anyway!

Reply


Leave a comment

Up