?

Log in

No account? Create an account

Previous Entry | Next Entry

entry count question

  • Apr. 26th, 2008 at 7:57 PM
Hello!  I'm trying to add the entry count into my datetime line, and my current code is

          """<div class="dateitem">$myday, $mydate @ $mytime -- {#$en.itemid}</div>""";

The problem is that the count is not being done correctly.

Please help!

The link to my layer is:  http://www.livejournal.com/customize/advanced/layeredit.bml?id=11062079

Comments

( 14 comments — Leave a comment )
av8rmike
Apr. 27th, 2008 04:09 am (UTC)
What isn't being done correctly about it?
ex_uniquewo
Apr. 27th, 2008 12:54 pm (UTC)
oneway wants to print the 'real' entry number - if it's the tenth entry they've written, they want to display the number 10 - and not the number semi-random number LJ gives entries. I don't know really how to do this so I sent them your way. :)

Edited at 2008-04-27 02:08 pm (UTC)
av8rmike
Apr. 27th, 2008 02:32 pm (UTC)
Just curious, is there another customization community that I should be monitoring? I thought I knew of them all, but people seem to be asking you for Expressive things in other places. ;)
ex_uniquewo
Apr. 27th, 2008 02:37 pm (UTC)
XD I don't think there is. oneway commented in explainittome.

Edit: oh wait. Are you reading everything_lj? I'm not helping there but often send people over there when there is some CSS issue I can't resolve. They're much better at this than I am.

Edited at 2008-04-27 03:10 pm (UTC)
av8rmike
Apr. 29th, 2008 02:53 am (UTC)
Entry ordinal = $en.itemid / 256
oneway
Apr. 29th, 2008 03:23 am (UTC)
I tried that, and its just showing up with "/256" at the end...
av8rmike
Apr. 29th, 2008 04:06 am (UTC)
I think sometimes there are limits to the amount of operations you can inline. I did the operation a little differently in my own journal, for instance:
var int entry_num = $en.itemid / 256;

...

"""<div class="dateitem">$myday, $mydate @ $mytime -- {#$entry_num}</div>""";

oneway
Apr. 29th, 2008 04:11 am (UTC)
Hmm, its closer. But its still going over. I only have 1277 entries and my latest is numbered at 1329...
av8rmike
Apr. 29th, 2008 04:28 am (UTC)
Is it possible that you've deleted 52 entries?
oneway
Apr. 29th, 2008 04:43 am (UTC)
Hmm, I suppose so. Wont it still count just the entries without all the entries I deleted?
av8rmike
Apr. 29th, 2008 05:03 am (UTC)
No, because the itemid is generated when the entry is first created and never changes. If you have 11 entries and delete entry #10, its itemid disappears but entry #11's won't change.

Case in point: This entry id is 122089, or the 476th entry. The latest entry's id is 122614, or the 478th entry. Someone must have posted and deleted an entry in the last day or two! =)
ex_uniquewo
Apr. 29th, 2008 03:46 pm (UTC)
I thought the number was: (Number of entries made) * 256 + (random number between 0 and 255).
That's why I didn't know how to fetch it.

(Quoted from a recent request).
av8rmike
Apr. 29th, 2008 04:01 pm (UTC)
It is, sort of. Instead of number of entries made, it's the "jitemid" or journal item ID, which increments with every entry. Like I wrote before, deleting an entry doesn't cause the jitemid to decrease. To get the itemid from the ordinal, you have to multiply by 256 and add a random number between 0 and 255.
ex_uniquewo
Apr. 29th, 2008 05:26 pm (UTC)
Oh cool! I'll remember that. Thanks for the explanation.
( 14 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