Page 1 of 1

Gallery Edit [ Edit Item ]

Posted: Tue Apr 22, 2025 7:17 pm
by Semen_ssr
А можем вызвать [ Edit Item ] галлеры стоя на ней в браузере https://domain.com/galleries/slug.html , при условии, что мы залогинены в браузере в админку естественно. По аналогии Wordpress - Edit post.
Может кого-то еще интересует
[ Thumbs Stats ]
[ Gallery Edit ]
Меня интересует именно [ Edit Item ] - /admin/?operation=rot_edit&redir=true&gallery_id=12345 текстовка, группы, теги, модели.
Сейчас нужно по признакам искать ее в /admin/?operation=rotation&sub=rot_list& ,
В принципе (Source) бы не помешал.

Re: Gallery Edit [ Edit Item ]

Posted: Wed Apr 23, 2025 1:24 pm
by admin
можно добавить в темплейт галеры

/admin/?operation=rot_edit&redir=true&gallery_id=<!--GALLERY_ID--> и получится нужная ссылка

я верно понял задачу?

Re: Gallery Edit [ Edit Item ]

Posted: Wed Apr 23, 2025 9:17 pm
by Semen_ssr
Да, по идее мне этого достаточно )

Re: Gallery Edit [ Edit Item ]

Posted: Thu Apr 24, 2025 7:14 am
by admin
Отлично)

Re: Gallery Edit [ Edit Item ]

Posted: Thu Apr 24, 2025 5:40 pm
by Semen_ssr
Я что то не могу до конца сформулировать чату ЖПТ задачу,

Code: Select all

<?php
session_start();

$is_admin = false;

if (isset($_SESSION['user']) && $_SESSION['user'] === 'admin') {
    $is_admin = true;
}

if (isset($_COOKIE['admin_logged_in']) && $_COOKIE['admin_logged_in'] === '1') {
    $is_admin = true;
}

if ($is_admin): ?>
    <a class='menu-link' href='/admin/?operation=rot_edit&redir=true&gallery_id=<!--GALLERY_ID-->'>[ Edit Item ]</a>
<?php endif; ?>
нужно всего лишь, чтоб пункт меню:

Code: Select all

 <a class='menu-link' href='/admin/?operation=rot_edit&redir=true&gallery_id=<!--GALLERY_ID-->'>[ Edit Item ]</a>
выводился при условии, что я залогинен в браузере )

Хелп )

Re: Gallery Edit [ Edit Item ]

Posted: Sat Apr 26, 2025 8:53 am
by admin
авторизация в админке есть только внутри scj/admin (htaccess ее делает )
на рендомном урле этого нет

но из того что есть немного кривой вариант но одной строкой

if ($_COOKIE['recreate_cache']) {
выводим что надо
}

recreate_cache ставится в rotation - special


Recreate visited pages
Script will set a secret cookie to your browser
each page that you visit on your site will be created (&skip_cache= analogue)
Active for 10 hours, your can deactivate it any time.

Re: Gallery Edit [ Edit Item ]

Posted: Sat Apr 26, 2025 12:51 pm
by Semen_ssr
Бомба!)

Re: Gallery Edit [ Edit Item ]

Posted: Sat Apr 26, 2025 1:07 pm
by Semen_ssr
Кому надо рабочая движуха:

Code: Select all

<?php
if ($_COOKIE['recreate_cache']) {
    echo "<a  
           href='/scj/admin/?operation=rot_edit&redir=true&gallery_id=<!--GALLERY_ID-->' 
           onclick=\"window.open(this.href, '_blank', 'width=800,height=600'); return false;\">
           [ Edit Item ]
        </a>
    ";
}
?>

Re: Gallery Edit [ Edit Item ]

Posted: Sun Apr 27, 2025 9:24 am
by admin
спасибо!