Hi,

According to the 1.4beta3 release notes, it should be possible to first
overwrite fields in an article object and then calling the update()
method. I am not sure what update() actually does - does it update the
time stamps?

Anyway, this doesn't seem to work for me. The fields keep their old
values. Can anyone confirm that this approach really work with 1.4b3?

Background:
===========

I want to implement a quick and dirty hit counter w/o using the standard
mysql layer provided by php. Everything should happen within the midgard
engine.
I store the hit count in extra1 of a certain article (this article is my
"about" information). Here is my simple code:

<?
 function counter ($id) {
     $article = mgd_get_article($id);
     $num = $article->extra1;
     $num = $num + 1;
     $article->extra1 = (string) $num;
     $article->update(); ?>
     <font size="+1">Hit count: &(num);</font>
    <? };
?>

Anyway, it doesn't count, because extra1 never gets overwritten. Do I
have to resort to the cumbersome function
mgd_update_article(................) ?

TIA,

Frank

-- 
Dr Frank Boehme                      | Email: [EMAIL PROTECTED]
National University of Ireland, Cork | phone: +353-21-903163
Dept of Computer Science             |   fax: +353-21-903113
Cork, Ireland                        |

--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]

Reply via email to