afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
[personal profile] afuna
One of the minor things that has always confused me, and I always forget to ask about, is the difference between the very similarly named "ditemid" and "jitemid" (ditto for "dtalkid" and "jtalkid"). Whenever I need to use these, I have to look for code similar to what I am working on, or look up the function definitions in cgi-bin/LJ/Comment.pm and cgi-bin/LJ/Entry.pm.

I was looking through code and stumbled across a comment that cleared things right up:
# - ditemid -- display itemid (with anum)


So! Noting here what I have gleaned:

itemid = entry
talkid = comment

j* = journal
== the per-journal internal id for the entry/comment. This is the value stored in the database. The "j" is to distinguish it from old-style itemids. In a much earlier iteration, LJ entry ids were shared among all users -- DW doesn't have any old-style itemids, and I suspect much of the earlier support is gone.

d* = display
== the display id. This is the value that you see in URLs, etc. It is combined with a random number, to make sure that bots cannot just iterate over all entries by adding +1 to the previous entry id.

If you want to get into specifics, ditemid = jitemid*256+anum.

Profile

dw_dev_training: The stylised 'd', with the word 'dev' above, and the word 'training' at the side, representing the dw_dev_training comm. (Default)
Dreamwidth Development Training

September 2022

S M T W T F S
    123
45678910
1112131415 1617
18192021222324
252627282930 

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 28th, 2025 07:33 pm
Powered by Dreamwidth Studios