larger smaller normal text version of this page

Revision [645]

Last edited on 2006-07-17 18:25:01 by HernoL
Additions:
[[PhplistDevelopment phplist Development]]
Deletions:
[[PhplistDevelopment Phplist Development]]


Revision [202]

Edited on 2005-04-22 23:59:11 by PascalVanHecke
Additions:
- collect the rss items from the mentioned lists, latest first
%% $itemreq = Sql_Query("select {$tables["rssitem"]}.*
from {$tables["rssitem"]} where {$tables["rssitem"]}.list in ($liststosend) order by added desc, list,title limit $max");
while ($item = Sql_Fetch_Array($itemreq)) {
Sql_Query("select * from {$tables["rssitem_user"]} where itemid = {$item["id"]} and userid = $userid");
if (!Sql_Affected_Rows()) {
array_push($itemstosend,$item["id"]);
}%%


Revision [201]

Edited on 2005-04-22 23:16:32 by PascalVanHecke
Additions:
More on fetching rss content: the function rssUserHasContent($userid,$messageid,$rssfrequency) is being called during processqueue, for a given user, messageid and rss-frequency (that is both the users ' and the messages rss frequency!)
Execution of this function:
- check whether there are: either
- no messages sent for this user previously at all
- no messages sent since intervallength (and intervallength is determined by the frequency)
%% $cansend_req = Sql_Query(sprintf('select date_add(last,%s) < now() from %s where userid = %d',
$interval,$tables["user_rss"],$userid));
$exists = Sql_Affected_Rows();
$cansend = Sql_Fetch_Row($cansend_req);
if (!$exists || $cansend[0]) {%%
- then all lists are being collected
- this message has been sent to (note there is only one rss message per frequency, so give the fact that a user has a certain frequency, there is only one message he can get rss messages by!)
- this user is subscribed to
%% $listsreq = Sql_Query(sprintf('
select %s.listid from %s,%s where %s.listid = %s.listid and %s.userid = %d and
%s.messageid = %d',
$tables["listuser"],$tables["listuser"],$tables["listmessage"],
$tables["listuser"],$tables["listmessage"],
$tables["listuser"],$userid,$tables["listmessage"],$messageid));%%
Deletions:
More on fetching rss content: (to be done)


Revision [186]

Edited on 2005-04-14 22:38:44 by YanB [formatted title of page]
Additions:
=====Process Queue Workflow Description=====
Deletions:
=====ProcessQueueWorkFlowDescription=====


Revision [177]

Edited on 2005-04-12 09:43:15 by PascalVanHecke
Additions:
(this is a draft text, aiming to explain how the send process actually works, text based on version 2.8.12)
Deletions:
(text based on version 2.8.12)


Revision [175]

Edited on 2005-04-11 23:43:58 by PascalVanHecke
Additions:
More on fetching rss content: (to be done)


Revision [174]

Edited on 2005-04-11 23:43:09 by PascalVanHecke
Additions:
- show how many users to process:
- %% output( "Found them: $num to process");%%
- limit to the max number in a batch:
- %% if ($num_per_batch > 0) {
$query .= sprintf(' limit %d,%d',$reload * $num_per_batch,$num_per_batch);
$userids = Sql_query("$query");%%
- fetch user by user:
- %% $users = Sql_query("select id,email,uniqid,htmlemail,rssfrequency,confirmed from {$tables['user']} where id = $userdata[0]");%%
- check whether is_email($user[1]) (user's email addres is a valid email address)
- check whether user's indicated rss frequency matches the rss frequency of the message:
- %%if ($rssfrequency == $message["rsstemplate"]) {%%
- fetch rss content for this user
- %%$rssitems = rssUserHasContent($userid,$messageid,$rssfrequency);%%
- check whether number of rss items is above threshold
- %% $cansend = sizeof($rssitems) && (sizeof($rssitems) > $rss_content_treshold);%%
- (note: semantically, this should better be >= )
- if all these conditions have been met, send the message
- indicate in table the user has been sent this rss message
- %% Sql_Query("replace into {$tables["user_rss"]} (userid,last) values($userid,date_sub(now(),interval 15 minute))");%%
- continue with next user


Revision [173]

Edited on 2005-04-11 23:30:39 by PascalVanHecke
Additions:
- set status in process
- %% $status = Sql_query('update '.$tables["message"].' set status = "inprocess",sendstart = now() where id = '.$messageid);%%
- check whether a custom userselection has been set for the message, if so, fetch those users:
- %% if ($userselection && $numattr[0]) {%%
- otherwise, fetch all users subscribed to the lists the message has been sent to:
- %% $query = "select distinct {$tables['listuser']}.userid
from {$tables['listuser']},{$tables['listmessage']} ";
$query .= "where {$tables['listmessage']}.messageid = $messageid and
{$tables['listmessage']}.listid = {$tables['listuser']}.listid $exclusion ";%%
Deletions:
-


Revision [172]

The oldest known version of this page was created on 2005-04-11 22:02:16 by PascalVanHecke
Page was generated in 0.0341 seconds