?

Log in

No account? Create an account

Previous Entry | Next Entry

Private sidebar box

  • Apr. 7th, 2008 at 11:45 PM
When I used smooth sailing, there was a way to make a box in the sidebar private, where only you could see it, when you were logged in. I've searched all of the sidebar:custom entries in the memories, but can't find a way to do that.

Is there a way in either of these styles? I have a permanent account, and am somewhat comfortable editing layers.

Thanks!

Comments

( 5 comments — Leave a comment )
av8rmike
Apr. 8th, 2008 12:09 pm (UTC)
How did you do it in Smooth Sailing? The technique should be the same, only the code will be a little different.
carmen
Apr. 8th, 2008 03:13 pm (UTC)
You do it with function Page::lay_print_sidebar_freetextbox_private(), but when I try to use that in my current style, it says that the function isn't defined.
av8rmike
Apr. 8th, 2008 03:46 pm (UTC)
No, it won't work that way, because that function only exists in Smooth Sailing. This should work, although I'm assuming you'll want only one custom text box (and not a second, public one, for instance).
function print_module_customtext(string title, string text, string titlelink_url) {
    var Page p = get_page();
    if (viewer_is_owner()){ # Make contents viewable to journal owner only
        open_module("customtext", $title, $titlelink_url);
        print safe $*customtext_body;
        close_module();
    }
}
carmen
Apr. 8th, 2008 04:04 pm (UTC)
Thank you, that helps! I do want more than one, but I was able to modify the code from here to make the second private.

What I ended up with, in case anyone looking through memories wants to do the same, was:

function print_module_customtext(string title, string text, string titlelink_url) {
var Page p = get_page();
open_module("customtext", $title, $titlelink_url);

"""
First custom text box is this stuff here. It has the default custom text title and so on that you've specified in your GUI interface.
""" ;

print safe $text;

close_module();

if (viewer_is_owner()){ # Make contents viewable to journal owner only
open_module("customtext", "2nd Custom Text Title", $titlelink_url);

"""
This is your second custom text box stuff. Notice I've manually input the title for this one. This will appear below the fist one.
""" ;

print safe $text;

close_module();
}

}
av8rmike
Apr. 8th, 2008 08:07 pm (UTC)
That method certainly works. Glad I could help!
( 5 comments — Leave a comment )

Latest Month

March 2016
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728293031  

S2 Help Communities

Tags

Powered by LiveJournal.com
Designed by chasethestars