Advertisement:

Author Topic: [SOLVED] Name alerts in user-alerts.php  (Read 3081 times)

prutix

  • Newbie
  • *
  • Posts: 19
[SOLVED] Name alerts in user-alerts.php
« on: March 01, 2015, 04:05:20 pm »
Hi all,

How to display the name of the alert in User account manager - "user-alerts.php" as in panel administrator Users -> Aletrs (/oc-admin/themes/modern/users/alerts.php)

Thank you!



« Last Edit: March 02, 2015, 11:39:11 pm by prutix »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Name alerts in user-alerts.php
« Reply #1 on: March 01, 2015, 11:07:59 pm »
Hi,

In your theme user-alerts.php:

1.- Locate:

Code: [Select]
<?php while(osc_has_alerts()) { ?>
and replace it with:

Code: [Select]
<?php while(osc_has_alerts()) {
                    
$alert json_decode(osc_alert_search(), true); ?>

2.- A few lines below, replace:

Code: [Select]
<?php _e('Delete this alert''modern'); ?></a></div>
with:

Code: [Select]
<?php _e('Delete this alert''modern'); ?></a><span style="padding-left: 100px;"><?php echo $alert['sPattern']; ?></span></div>
(This if for Modern theme, if you're using another one look for line containing 'Delete this alert' and insert the new span in its right place).

Regards

prutix

  • Newbie
  • *
  • Posts: 19
Re: Name alerts in user-alerts.php
« Reply #2 on: March 02, 2015, 10:58:31 pm »
Hi,

In your theme user-alerts.php:

1.- Locate:

Code: [Select]
<?php while(osc_has_alerts()) { ?>
and replace it with:

Code: [Select]
<?php while(osc_has_alerts()) {
                    
$alert json_decode(osc_alert_search(), true); ?>

2.- A few lines below, replace:

Code: [Select]
<?php _e('Delete this alert''modern'); ?></a></div>
with:

Code: [Select]
<?php _e('Delete this alert''modern'); ?></a><span style="padding-left: 100px;"><?php echo $alert['sPattern']; ?></span></div>
(This if for Modern theme, if you're using another one look for line containing 'Delete this alert' and insert the new span in its right place).

Regards

Good job teseo!
Thank you very much.
I appreciate your help!

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Name alerts in user-alerts.php
« Reply #3 on: March 02, 2015, 11:16:15 pm »
Glad to be of help. :)

Please add [SOLVED] to the title of this thread.

prutix

  • Newbie
  • *
  • Posts: 19
Re: Name alerts in user-alerts.php
« Reply #4 on: March 02, 2015, 11:37:30 pm »
How can I add a few specific informations alert?
For example, category or location.

Thanks in advance!

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: [SOLVED] Name alerts in user-alerts.php
« Reply #5 on: March 03, 2015, 12:21:03 am »
I'm afraid that osc_alert_search() function doesn't return data in a friendly format, Search Pattern (what Admin Dashboard and this code of mine show) is the only clear parameter.

Regards

prutix

  • Newbie
  • *
  • Posts: 19
Re: [SOLVED] Name alerts in user-alerts.php
« Reply #6 on: March 03, 2015, 12:39:09 am »
In panel administrato,r category displays each alert, but in when go on /oc-admin/themes/modern/users/alerts.php I can not find the code...

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: [SOLVED] Name alerts in user-alerts.php
« Reply #7 on: March 03, 2015, 01:17:41 am »
In panel administrato,r category displays each alert

I can't see anything of that, screenshot please.

Rehgards

prutix

  • Newbie
  • *
  • Posts: 19
Re: [SOLVED] Name alerts in user-alerts.php
« Reply #8 on: March 04, 2015, 12:33:21 am »
In panel administrato,r category displays each alert

I can't see anything of that, screenshot please.

Rehgards

First, it is a search in the subcategory "Autoturisme" (a parent category "Auto-moto-ambarcatiuni")
The second is a search without any category.


Another subjesct is the link "Dezactiveaza".
What is his function?

I suppose that with this function we can disable sending mail to users when appear new items according to their alerts.

We can put this link in User Account Manager (user-alerts.php)?

Thank you!

monah

  • Full Member
  • ***
  • Posts: 223
Re: [SOLVED] Name alerts in user-alerts.php
« Reply #9 on: March 08, 2015, 05:37:41 pm »
and how to add a category name and a link to the category?

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: [SOLVED] Name alerts in user-alerts.php
« Reply #10 on: January 05, 2018, 01:38:35 am »
Teseo, I would like to ad there a link to the search page for that alert with it's parameters.

I tried for link

Code: [Select]
osc_search_url(json_decode(osc_alert_search(), true));
But the json_decode(osc_alert_search(), true) is not in the format that the osc_search_url function gets it's params.

Is there a built in function that decodes that json stored in DB to a compatible osc_search_url function format?

And if there isn't, which function is encoding that json from the result of Params::getParamsAsArray();?

EDITED: Solved here https://forums.osclass.org/development/insert-the-search-url-of-an-alert-in-db-alerts-table-s_search-column/msg159295/#msg159295
« Last Edit: January 07, 2018, 04:49:01 pm by marius-ciclistu »