Rose Fox (rosefox) wrote in lj_dev,
Rose Fox
rosefox
lj_dev

  • Mood:

Changes to code handling in S2?

I noticed that the editjournal_do syntax had been updated, so I changed this code:

if (viewer_is_owner() ) {
print "</I> | <I><A HREF=' $*SITEROOT/editjournal.bml'>edit entry</A></I> )</P>" ;
}
else {
print "</I> )</P>" ;
}


to look like this:

if (viewer_is_owner() ) {
print "</I> | <I><A HREF=' $*SITEROOT/editjournal_do.bml?journal=$e.journal.username&itemid=$e.itemid'>edit entry</A></I> )</P>" ;
}
else {
print "</I> )</P>" ;
}


and now it shows up on every entry on my friends page--including the ones I don't own and can't edit. It wasn't doing that before I made the code change, and when I undo the change and recompile, it still appears on every entry. It looks as though the 'if (viewer_is_owner() )' isn't being handled properly. Any idea what's causing that or how to fix it? (If this is something that's already in process, apologies for being impatient!)

...oh, I see. When I log out it's not there anymore, so I assume that viewer_is_owner() is being interpreted as referring to the owner of the page (in this case, my friends page, so I own it) rather than the owner of the entry. Is there any way to tell it which one I mean, or an entry-specific equivalent?
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 5 comments