- new feature : RSS notification feed. Feed generator is an external tool

(FeedCreator class v1.7.2). New file feed.php

- new database field : comments.validation_date (datetime). This field is
  required for notification feed.

- new database field : users.feed_id (varchar(50)). users.feed_id is an
  alias of users.id but is much more complicated to find (50 characters,
  figures or letters, case sensitive) : the purpose is to keep it secret (as
  far as possible).

- new database field : users.last_feed_check (datetime)

- new database field : users.registration_date (datetime)

- bug fixed : no need to add the (unavailable) session id to install.php in
  the installation form.

- modified database field : images.date_available become more precise (date
  to datetime). This precision is needed for notification feed.

- new index : comments_i1 (validation_date). Might be useful for feed
  queries.

- new index : comments_i2 (image_id). Useful each time you want to have
  informations about an element and its associated comments.

- version 9.11 of mysqldump outputs database field names and table names
  with backquote "`" (didn't find how to take them off)


git-svn-id: http://piwigo.org/svn/trunk@801 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall
2005-07-16 14:29:35 +00:00
parent 315f9c5670
commit 9bafdff171
15 changed files with 2306 additions and 206 deletions
+4
View File
@@ -212,4 +212,8 @@ $conf['show_version'] = true;
// If the array is empty, the "Links" box won't be displayed on the main
// page.
$conf['links'] = array();
// feed_period : how long between two feed refresh ? Possible values are
// "hour", "half day", "day", "week", "month".
$conf['feed_period'] = 'week';
?>
File diff suppressed because it is too large Load Diff
+31
View File
@@ -110,6 +110,7 @@ SELECT id
$insert['nb_line_page'] = $conf['nb_line_page'];
$insert['language'] = $conf['default_language'];
$insert['recent_period'] = $conf['recent_period'];
$insert['feed_id'] = find_available_feed_id();
$insert['expand'] = boolean_to_string($conf['auto_expand']);
$insert['show_nb_comments'] = boolean_to_string($conf['show_nb_comments']);
if ( $mail_address != '' )
@@ -141,6 +142,13 @@ INSERT INTO '.USERS_TABLE.'
$is_first = false;
}
$query.= ')
;';
pwg_query($query);
$query = '
UPDATE '.USERS_TABLE.'
SET registration_date = NOW()
WHERE id = '.mysql_insert_id().'
;';
pwg_query($query);
}
@@ -379,4 +387,27 @@ SELECT username
return $username;
}
/**
* search an available feed_id
*
* @return string feed identifier
*/
function find_available_feed_id()
{
while (true)
{
$key = generate_key(50);
$query = '
SELECT COUNT(*)
FROM '.USERS_TABLE.'
WHERE feed_id = \''.$key.'\'
;';
list($count) = mysql_fetch_row(pwg_query($query));
if (0 == $count)
{
return $key;
}
}
}
?>
-5
View File
@@ -156,11 +156,6 @@ class Template {
// Run the compiled code.
$_str = '';
// echo '<pre>'.($this->compiled_code[$handle]).'</pre>';
$fp = @fopen( './log/debug.log', 'a+' );
fwrite( $fp, "\n\n" );
fwrite( $fp, $this->compiled_code[$handle] );
fclose( $fp );
eval($this->compiled_code[$handle]);
$this->output.= $_str;