?

Log in

No account? Create an account

Previous Entry | Next Entry

I'm planning my lj reboot for the year and I really wanted to design it on expressive, from the ground up.

There's only one thing - would anyone know what code would be needed in the theme layer to have each entry printed like this:

Poster username
Entry Title Goes Next
Date


I've disabled the user icons for the entry and friends page if that makes any difference.

Would very much appreciate any help!

Comments

( 15 comments — Leave a comment )
av8rmike
Jan. 27th, 2008 02:24 pm (UTC)
I think you could use the second code excerpt from here, although you won't need the CSS additions if you're disabling the user icons.
gossymer
Jan. 27th, 2008 06:21 pm (UTC)
Thanks for the link and the superquick response! It worked perfectly (though I changed the line-break between journal username and community username to " @ " instead of the "br />")

BTW, when using the hack for changing the entry linkbar to a button toolbar (here), the buttons for post_comment/post_comment_friends and read_comments/read_comments_friends defaulted to the permalink image. This is what I'm trying to do:



How can I change those first two images?

And is there a hack for changing the comment linkbars to button toolbars as well? If there isn't, it's fine, just wanted to check if I missed it...

Edited at 2008-01-27 06:23 pm (UTC)
av8rmike
Jan. 28th, 2008 03:35 am (UTC)
The code in that linked post has three functions: Entry::print_linkbar(), CommentInfo::print_readlink(), and CommentInfo::print_postlink(). If you look in the second two, it says "link to perma-link image", but you should be able to change that to whatever image you wanted.

The change (I don't like the term "hack") to print images for comment links is almost exactly the same as the changes to Entry::print_linkbar(), but I can help if you get stuck with that.
gossymer
Jan. 28th, 2008 04:09 am (UTC)
Yes, I am completely blind - sorry about that. Made the changes and the linkbar looks perfect - just need to do the CSS now.

I admit I'm not very familiar with theme layer code - but will see if I can get something together based on the entry linkbar one.

Thank you so much for the help so far! I'm a newbie to expressive, so your codes made everything so much faster *__*
gossymer
Feb. 4th, 2008 08:02 am (UTC)
Heya!

I put up the layout and I still can't seem to get the comment images to work for the custom comment pages - everything else is pretty much set though :)

If you ever get the time, I'd love the code for replacing the links in comments to pictures :)
av8rmike
Feb. 4th, 2008 02:20 pm (UTC)
Can you send me a link to your theme layer? I know how to change most of the links, but it's a fairly complicated process. You need a dozen or so icons and need to change two different functions.
gossymer
Feb. 4th, 2008 04:05 pm (UTC)
Here's the theme layer:

http://www.livejournal.com/customize/advanced/layersource.bml?id=10443905
Oye, that sounds really difficult :( If you don't have the time, I completely understand.


Here's the user layer:

http://www.livejournal.com/customize/advanced/layersource.bml?id=8776484

I wanted to use the same images I used in my old layout here:

http://gossymer.livejournal.com/141699.html?s2id=16386816
av8rmike
Feb. 6th, 2008 07:12 pm (UTC)
Part 1
This code will change the links for edit/delete/freeze/screen/etc. Obviously, replace the red URLs with your own.
function Comment::print_linkbar() {
    var Link link;
    var string sep  = """<span class="separator">|</span>""";
    var string url  = "";
    var string text = "";
    var string img_url = "";

    var string{} link_caption = {
        # TODO: These should really be separate properties
        "edit_comment"     => $*text_multiform_opt_edit,
        "delete_comment"   => $*text_multiform_opt_delete,
        "freeze_thread"    => $*text_multiform_opt_freeze,
        "unfreeze_thread"  => $*text_multiform_opt_unfreeze,
        "screen_comment"   => $*text_multiform_opt_screen,
        "unscreen_comment" => $*text_multiform_opt_unscreen,
        "watch_thread"     => $*text_multiform_opt_track,
        "unwatch_thread"   => $*text_multiform_opt_untrack,
    };

    var string{} link_images = {
        "edit_comment"     => "http://URL TO IMAGE",
        "delete_comment"   => "http://URL TO IMAGE",
        "freeze_thread"    => "http://URL TO IMAGE",
        "unfreeze_thread"  => "http://URL TO IMAGE",
        "screen_comment"   => "http://URL TO IMAGE",
        "unscreen_comment" => "http://URL TO IMAGE",
        "watch_thread"     => "http://URL TO IMAGE",
        "unwatch_thread"   => "http://URL TO IMAGE",
    };
	
    foreach var string link_key ($.link_keyseq) {
        $link = $this->get_link($link_key);
        if (defined $link) {
            $url  = $link.url;
            $text = $link_caption{$link_key} != "" ? $link_caption{$link_key} : $link.caption;
            $img_url = $link_images{$link_key} != "" ? $link_images{$link_key} : $link.icon.url;
            print safe """ $sep <a href="$url"><img src="$img_url" alt="$text" title="$text"/></a>""";
        }
    }
}
The other links (reply/thread/parent) go in a separate function.
(Edited to fix wrong keys in hashes.)

Edited at 2008-02-11 07:02 pm (UTC)
av8rmike
Feb. 6th, 2008 07:29 pm (UTC)
Part 2
Copy & paste the EntryPage::print_comment() function from the layout layer. Find the section that starts with this line:
<div class="comment-links">""";

Change this line:
"""<a class="permalink" href="$e.permalink_url">$*text_permalink</a>""";
to:
"""<a class="permalink" href="$e.permalink_url"><img src="http://permalinkURL" alt="$*text_permalink" title="$*text_permalink" /></a>""";

Change these lines:
if ($e.parent_url) { print """ $sep <a href="$e.parent_url">$*text_comment_parent</a>"""; }
if ($e.thread_url) { print """ $sep <a href="$e.thread_url">$*text_comment_thread</a>"""; }

to:
if ($e.parent_url) { print """ $sep <a href="$e.parent_url"><img src="http://parentURL" alt="$*text_comment_parent" title="$*text_comment_parent" /></a>"""; }
if ($e.thread_url) { print """ $sep <a href="$e.thread_url"><img src="http://threadURL" alt="$*text_comment_thread" title="$*text_comment_thread" /></a>"""; }

See what I'm doing? Basically, just inserting <img> tags in between the <a> tags and using the existing text properties as the alt and title text. Also, I fixed the spacing so the long lines don't wrap.

Edited at 2008-02-06 07:32 pm (UTC)
av8rmike
Feb. 6th, 2008 07:43 pm (UTC)
Part 3/3
Finally, I think I figured out how to do the reply link. Also in EntryPage::print_comment(), find this section:
if ($e.frozen) {
    print safe " $sep $*text_comment_frozen";
} else {
    " $sep "; $e->print_reply_link({"linktext" => $*text_comment_reply});
}
Change it to:
if ($e.frozen) {
    print safe """ $sep <img src="http://URL to frozen image" alt="$*text_comment_frozen" title="$*text_comment_frozen" />""";
} else {
    " $sep "; $e->print_reply_link({"img_url" => "http://URL to reply image"});
}
I think that's all. Sorry about the e-mail spam. Let me know if something didn't work.
gossymer
Feb. 7th, 2008 01:05 am (UTC)
Re: Part 3/3
OMG, thank you for all these codes - there's so much and it must have taken you quite some time to work it all out. I'll try implementing it in the morning and will confirm the results *__*

Thanks again!

*tackles and hugs*
gossymer
Feb. 7th, 2008 11:56 pm (UTC)
Re: Part 3/3
Alrighty, implemented all the changed and added in the images where required - though for some reason the permalink and the watch/track button don't show up

The layer:
http://www.livejournal.com/customize/advanced/layersource.bml?id=10443905

Custom comments can be seen:
http://gossymer.livejournal.com/143410.html

But all the other images work perfectly!
av8rmike
Feb. 11th, 2008 07:00 pm (UTC)
Re: Part 3/3
You missed an image link here in EntryPage::print_comment():
    <div class="comment-links">""";
    var string sep = """<span class="separator">|</span>""";
    """<a class="permalink" href="$e.permalink_url"><img src="http://permalinkURL" alt="$*text_permalink" title="$*text_permalink" /></a>""";
For the other thing, looks like that's a slight mistake in the (original) layout code. In the Comment::print_linkbar() function, find the instances of "watch_comment" and replace them with "watch_thread" (same goes for "unwatch" too, of course).
gossymer
Feb. 11th, 2008 07:15 pm (UTC)
Re: Part 3/3
Made the adjustments and everything is showing up perfectly, thank you!
av8rmike
Feb. 11th, 2008 07:17 pm (UTC)
Re: Part 3/3
You're welcome! Glad to hear it worked.
( 15 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