Re Coalman's point, I just did a bit of digging. I ran a recursive search for
One interesting point is that although CURRENT_USER_ID would (IMO) be a useful var to have available in the templates, it does turn out to be defined as a template var in
This means that anyone who wants a var to call the current user's ID in the templates had better not name their custom var CURRENT_USER_ID, even though that would be the most logical name for it, because it will cause conflicts in![Razz :P]()
Might be best to call it MY_CUSTOM_CURRENT_USER_ID_VAR_YOU_KEEP_YOUR_GRUBBY_MITTS_OFF_IT_KTHNXBAI because at least the devs aren't likely to gazump you on that one.
ETA: I'll probably just call it CURRENT_USER_ID_GLOBAL, which is boring, but descriptive and less verbose.
$template->assign_vars(array(
on the whole 3.3.x kaboodle. Obviously all of them are functional, but from the perspective of finding things that might be useful for targeting custom styling these hits seem to be the relevant ones:Code:
Search "$template->assign_vars" [Extended]includes\functions.phpLine 4016: $template->assign_vars(array(includes\ucp\ucp_pm.phpLine 362: $template->assign_vars(array(includes\ucp\ucp_pm_options.phpLine 730: $template->assign_vars(array(Line 773: $template->assign_vars(array(Line 826: $template->assign_vars(array(index.phpLine 216: $template->assign_vars(array(mcp.phpLine 337: $template->assign_vars(array(viewforum.phpLine 402: $template->assign_vars(array(viewtopic.phpLine 780: $template->assign_vars(array(
includes\ucp\ucp_pm_options.php
but even in that area it is useless for custom styling because of the way it is defined. Attempting to output it to the template just yields a blank.This means that anyone who wants a var to call the current user's ID in the templates had better not name their custom var CURRENT_USER_ID, even though that would be the most logical name for it, because it will cause conflicts in
ucp.php?i=ucp_pm&mode=options
, Welcome to the wonderful world of back end code. 
Might be best to call it MY_CUSTOM_CURRENT_USER_ID_VAR_YOU_KEEP_YOUR_GRUBBY_MITTS_OFF_IT_KTHNXBAI because at least the devs aren't likely to gazump you on that one.
ETA: I'll probably just call it CURRENT_USER_ID_GLOBAL, which is boring, but descriptive and less verbose.
Statistics: Posted by Gumboots — Sun Mar 23, 2025 9:40 pm