[paid accounts] Adding "Add to memories" and "Edit" links alongside the "Leave a comment" link

Jun 04, 2005 00:20

1. Create a new theme layer. (Follow the steps in this post to create a theme layer.) If you have already created a theme layer for the style, just add the following code to it.

code )

!old, entry comment bar, paid accounts

Leave a comment

Comments 155

writan_bur June 4 2005, 09:17:48 UTC
Is there a way to also add the 'permanent link' to this? I'd be grateful if someone could either give me the code or tell me which code to add where.

Thanks

Reply


afuna June 4 2005, 10:38:42 UTC
Ugh, sorry. Messed up the code a bit. Here's the fixed version of the comment:

The code to create a permanent link is
print """ Link""";

Replace the text in read with your desired link text :)

As for where to put it within the layer, that depends on where you want it to show up.

# Comments
"""

""";
var Link edit;
var Link mem;

if ($p.view != "entry" or $p.view != "reply")
{
$edit = $e->get_link("edit_entry");
$mem = $e->get_link("mem_add");

#1
if (defined $edit )
{
print """ $*text_edit | """;
}

print """ $*text_memories""";

#2
if ($p.view != "entry" or $p.view != "reply")
{
$e.comments->print();
}
elseif ($e.comments.enabled)
{
$e.comments->print_postlink();
}
else
{
" ";
}

#3
"""""";If you want to insert the permalink before the edit/memory links, then replace #1 with the permalink code ( ... )

Reply

writan_bur June 4 2005, 10:50:10 UTC
Erm, where do I find that part of the code? Or do I need to copy/paste the '# Comments' part as well?

sorry for asking all these questions, but I'm only just starting to experiment with tweaking styles to fit my own needs...

Reply

afuna June 4 2005, 11:03:36 UTC
No worries, everyone has to start somewhere. First of all, if you haven't already done so, go read the tutorial on creating layers

Copy and paste the entire function containing the code you want to edit -- in this case, it would probably be best to use the code in the entry above since it contains a bugfix that hasn't gone live on the site yet. A function would be the function header,
function print_entry(Page p, Entry e, Color bgcolor, Color fgcolor)
{
...
}
and everything in between the braces.

If you want to try your hand at editing other functions, you should go get the source code for Flexible Squares, over here. Then use the "Download" link ( "View as HTML" works as well, I think, but I usually just use "Download")

For future reference, go to http://www.livejournal.com/customize/advanced and explore a bit ;)

Reply

writan_bur June 4 2005, 11:07:47 UTC
Ok, I'm following you so far. I've already created the layer and copied the code n the post above.

My problem is: where does the code for the perm link go? Do I have to copy the whole comment code you posted above and then replace """"""; (after #3) with it?

Because I couldn't find the # comment bit in the main code above...

Reply


thespyglass June 5 2005, 13:29:19 UTC
This is great, thanks for this :)

Reply


roark28 June 6 2005, 18:17:42 UTC
Is there a way to change the link text on the Friends view? I am trying to get it to say "Add" instead of "Mem." Also, is there a way to add the Edit and Link links to the friends view? Thanks so much ^^

Reply

cyrnelle June 6 2005, 18:24:36 UTC
Only in the friends view?

Try the "Text to add an entry to the memories" option under the "Text" tab in the wizard, if you want to change it in all views. If only in the friends view, well, I guess there should be a way to do that, but I can't quite think of how to do it. (I'm not entirely sure it could be done either, actually.) Maybe you should post the question to the community? :)

Reply

roark28 June 6 2005, 18:56:40 UTC
Hehe yeah I just found that, thanks XD

Reply


kangetsuhime June 7 2005, 02:10:55 UTC
For some reason I get an error when trying to compile that. Unsure why. I'm adding it to the theme I had already set up (for the header etc)

A cap of the error, if it helps.

Reply

afuna June 7 2005, 10:21:31 UTC
Got it. Check to see whether you have any unclosed sets of triple quotation marks ("""). There should be no code for programming logic ( if-statements, function headers, etc) that are in between """ and """;
If you copied and pasted the entire function from the tutorial, the problem might be in some of the previous code.

Reply

kangetsuhime June 7 2005, 13:21:45 UTC
Thanks, that made a lot more sense and it compiled fine now :) Glitter sparkles for you.

Reply

afuna June 7 2005, 13:25:20 UTC
Yay, I love glitter sparkles ;) *grabs greedily*

Glad to be of service. (Nice icon, by the way!)

Reply


Leave a comment

Up