Quantcast
Viewing all articles
Browse latest Browse all 1632

phpBB Custom Coding • Re: [SOLVED] viewtopc-body.html - IF user is viewing own post

Yup, comparing user ID would be ideal and safer than comparing those strings returned by template var. :/
Yes, that was what I was expecting. Comparing the whole box of frogs is messy, and ID would be much simpler. Obviously the software keeps track of post author ID and current user ID, so it's just a question of if those variables can be made available directly in the template.

Getting {postrow.POSTER_ID} in the template is a piece of cake. I have already done that. But, there doesn't appear to be any way of getting {CURRENT_USER_ID} - or something functionally similar - in the template. Obviously I could do a core hack and make it available, but I'd prefer not to.

ETA: If there is absolutely no way of getting {CURRENT_USER_ID} in the template with current core code, I think I will suggest it in phpBB Ideas. It's an obvious global variable to have available, with a range of potential uses. Cleaning up useless contact details and replacing them with something useful is just one use case. I'm sure people could think of a dozen more without too much difficulty.

Statistics: Posted by Gumboots — Sun Aug 18, 2024 9:04 pm



Viewing all articles
Browse latest Browse all 1632

Trending Articles