Forums / National / Russian / Tips & Tricks

Только ответы и решения, никаких вопросов.

Kopusha
#47910 2024-03-22 21:23

To find where you are try

Extention?

{PHP.env.ext} or {PHP.e}

Module?

{PHP.m}

Zone?

{PHP.z}

Added 17 seconds later:

Or use {PHP|dump}

$env['ext']; // содержит название текущего расширения $env['location']; // условное название раздела сайта

// примеры... // для админки $env['location'] = 'administration'; $env['ext'] = 'admin';

// для плагинов $env['location'] = 'plugins';

//для любых расширений $env['ext'] = 'имя_расширения';

//страница логина $env['location'] = 'users'; $env['ext'] = 'users';

// для главной страницы $env['location'] = 'home'; $env['ext'] = 'index';

Added 2 minutes later:

Sometimes we need redirect user entered a page immediately

{PRD_ID|cot_url('folio', 'id=$this','', 1)|cot_redirect()}

Added 1 minute later:

Link to users profile page

By user ID

{COMMENTS_POSTER_ID|cot_url('users', 'm=details&id=$this')}
{PRJ_OWNER_ID|cot_url('users', 'm=details&id=$this')}

By user name (bad habit)

{COMMENTS_POSTER_NAME|cot_url('users', 'm=details&u='$this)}
{PRJ_OWNER_NAME|cot_url('users', 'm=details&u='$this)}

Added 49 seconds later:

Modify any tag in TPL on the fly

{ANY_TAG|cot_rc_modify($this, 'class="" style="" placeholder=""')}

Added 26 seconds later:

If can admin some area

For example all pages

<!-- IF {PHP|cot_auth('page', 'any', 'A')} -->

Only that category in pages or folio

<!-- IF {PHP.c|cot_auth('page', '$this', 'A')} -->
{PHP.c|cot_auth('folio', $this, 'A')}

If can write in that category

<!-- IF {PHP.c|cot_auth('page', '$this', 'W')} -→

Added 45 seconds later:

If user is owner

If user is in his own profile details

<!-- IF {PHP.usr.id} == {USERS_DETAILS_ID} -->

If this comment is yours

<!-- IF {PHP.usr.id} == {COMMENTS_ROW_AUTHOR_ID} -->

Added 2 minutes later:

If plugin config TPL + PHP

<!-- IF {PHP.cfg.plugin.placemarks.enable_radius} -→

if ($cfg['plugin']['placemarks']['enable_radius'])

Существует ли функция?

if (function_exists("uk_com")) { uk_com("notify", "com"); }