New notification system - (for preventing spam)

Author Message

K259

Monday 21 June 2004 4:29:39 am

<b>The template notification/list.tpl lists all subscribers to the site with attributes:</b>

ID: (the id of the notification)
Rule Type: (i.e. ez-notification)
Class Name: (i.e. class of the object)
Path: (which node does the subscriber want to subscribe on, i.e. /content/view/full/2)
Keyword: (send a message if these keywords are published in i.e. any new article)
Additional constraint:
Edit: (button so the administrator can change the content of the notification)
Remove: (button so the administrator can remove an unwanted notification)

<b>When I try to delete one of these notifications, it's not beeing removed.
Is this a bug, or is this notification-system not complete?
The edit-function is also not working.</b>

<b>I wish to see the email-address in this list of the user which
is subscribing. Does anyone know how I can add Subscriber to this
list (tables and question are included down at the page)? </b>

<b>Another task we have to implement is then to make a function where
the administrator can confirm that the registered users are allowed to
subscribe, before an email is beeing sent.</b>

This is the code for notificationlist.tpl(view):

<form action={concat($module.functions.list.uri)|ezurl} method="post" 
name="RuleList">

{section show=$rule_list}
<table class="list" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
    <th>{"ID:"|i18n("design/standard/notification")}</th>
    <th>{"Rule Type:"|i18n("design/standard/notification")}</th>
    <th>{"Class Name:"|i18n("design/standard/notification")}</th>
    <th>{"Path:"|i18n("design/standard/notification")}</th>
    <th>{"Keyword:"|i18n("design/standard/notification")}</th>
    <th>{"Additional constraint:"|i18n("design/standard/notification")}</th>
    <th>{"Edit:"|i18n("design/standard/notification")}</th>
    <th>{"Remove:"|i18n("design/standard/notification")}</th>
</tr>

{section name=Rule loop=$rule_list sequence=array(bglight,bgdark)}
<tr>
    <td class="{$Rule:sequence}" width="1%">{$Rule:item.id}</td>
    <td class="{$Rule:sequence}">{$Rule:item.type}</td>
    <td class="{$Rule:sequence}">{$Rule:item.contentclass_name}</td>
    <td class="{$Rule:sequence}">{$Rule:item.path}</td>
    <td class="{$Rule:sequence}">{$Rule:item.keyword}</td>
    <td class="{$Rule:sequence}">{section show=$Rule:item.has_constraint}Yes{/section}</td>
    <td class="{$Rule:sequence}" width="1%"><a href={concat($module.functions.edit.uri,"/",$Rule:item.type,"/",$Rule:item.id)
|ezurl}><img name="edit" src={"e
dit.png"|ezimage} width="16" height="16" alt="{'Edit'|i18n('design/standard/notification')}" /></a></td>
    <td class="{$Rule:sequence}" width="1%"><input type="checkbox" 
name="Rule_id_checked[]" value="{$Rule:item.id}" /></td>
</tr>
{/section}
</table>
{/section}

<div class="buttonblock">
<select name="notification_rule_type">
{section name=Rules loop=$rule_type}
<option value="{$Rules:item.information.name}">{$Rules:item.information.
name}</option>
{/section}
</select>
{include uri="design:gui/button.tpl" name=new id_name=NewRuleButton 
value="New Rule"|i18n("design/standard/notification")}
{include uri="design:gui/button.tpl" name=delete id_name=DeleteRuleButton value="Remove"|i18n("design/standard/notification")}
{include uri="design:gui/button.tpl" name=send id_name=SendButton value="Send Message"|i18n("design/standard/notification")}
</div>
</form>

<b>These are the tables which are important:</b>

mysql> describe eznotification_user_link;
+---------------------+-------------+------+-----+---------+-------+
| Field               | Type        | Null | Key | Default | Extra |
+---------------------+-------------+------+-----+---------+-------+
| rule_id             | int(11)     |      | PRI | 0       |       |
| user_id             | int(11)     |      | PRI | 0       |       |
| send_method         | varchar(50) |      |     |         |       |
| send_weekday        | varchar(50) |      |     |         |       |
| send_time           | varchar(50) |      |     |         |       |
| destination_address | varchar(50) |      |     |         |       |
+---------------------+-------------+------+-----+---------+-------+
6 rows in set (0.00 sec)

mysql> describe ezuser;
+--------------------+--------------+------+-----+---------+-------+
| Field              | Type         | Null | Key | Default | Extra |
+--------------------+--------------+------+-----+---------+-------+
| contentobject_id   | int(11)      |      | PRI | 0       |       |
| login              | varchar(150) |      |     |         |       |
| email              | varchar(150) |      |     |         |       |
| password_hash_type | int(11)      |      |     | 1       |       |
| password_hash      | varchar(50)  | YES  |     | NULL    |       |
+--------------------+--------------+------+-----+---------+-------+
5 rows in set (0.00 sec)

mysql> describe eznotification_rule;
+-------------------+--------------+------+-----+---------+----------------+
| Field             | Type         | Null | Key | Default | Extra          |
+-------------------+--------------+------+-----+---------+----------------+
| id                | int(11)      |      | PRI | NULL    | auto_increment |
| type              | varchar(250) |      |     |         |                |
| contentclass_name | varchar(250) |      |     |         |                |
| path              | varchar(250) | YES  |     | NULL    |                |
| keyword           | varchar(250) | YES  |     | NULL    |                |
| has_constraint    | int(1)       |      |     | 0       |                |
+-------------------+--------------+------+-----+---------+----------------+
6 rows in set (0.00 sec)

<b>In the notificationlist.tpl I also want to list the subscribers
email-address.</b>

The user_id in the table eznotification_user_link has relation to ezuser.contentobject_id, and it's from here I have the possibillity
to get the email which I want to add to the notification/list.tpl,
so I can see which user who's subscribing which nodes.

<b>To get this data with sql:</b>

select email,rule_id,user_id from ezuser,eznotification_user_link 
where ezuser.contentobject_id=eznotification_user_link.user_id;

I'm just unsure howto get this data inside the tpl in the ez
templatesystem.

Zinistry

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 20:59:31
Script start
Timing: Jan 18 2025 20:59:31
Module start 'layout'
Timing: Jan 18 2025 20:59:31
Module start 'content'
Timing: Jan 18 2025 20:59:32
Module end 'content'
Timing: Jan 18 2025 20:59:32
Script end

Main resources:

Total runtime0.7757 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.0469152.6406
Module start 'layout' 0.00530.0029 740.687539.4766
Module start 'content' 0.00830.7661 780.1641435.3125
Module end 'content' 0.77430.0014 1,215.476612.1250
Script end 0.7757  1,227.6016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4044160.0002
Check MTime0.00140.1744160.0001
Mysql Total
Database connection0.00070.093310.0007
Mysqli_queries0.734594.6867460.0160
Looping result0.00040.0534440.0000
Template Total0.744295.920.3721
Template load0.00200.251820.0010
Template processing0.742295.681220.3711
Template load and register function0.00020.024910.0002
states
state_id_array0.00120.159110.0012
state_identifier_array0.00090.122120.0005
Override
Cache load0.00160.2083350.0000
Sytem overhead
Fetch class attribute can translate value0.00060.076610.0006
Fetch class attribute name0.00080.097210.0008
XML
Image XML parsing0.00010.013810.0001
class_abstraction
Instantiating content class attribute0.00000.000510.0000
General
dbfile0.00070.0954100.0001
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs