Midgard Mind Reduction

2004-05-30 Some real action

Today was one of the best days I'v had since starting in Nemein. Well the weather wasn't what I had in mind when I woke up, I just had to imagined that it was a warm and a shiny day...because it wasn't but this is how I manage...=)

The thing about today was that I actually wrote a small script for a customer. That was my first offical script I have wrote using midgards functions. What I wrote was a small tool for moving articles. I used "mgd_errstr()" and "mgd_move_article()". The last one is a very funny function, returns zero if succesfull...strange...

Anyway here it is:

//Whether to run as a simulation
$simulation = false;


extract($_POST);

if (is_array($moveArt)) {
foreach ($moveArt as $id) {
if (!$simulation) {
if (!mgd_move_article ($id , $moveTo)) {
echo "ERROR: Filed to move article $id under topic $moveTo"
 . mgd_errstr() . "<br/>";
} else {
echo "Moved article $id under topic $moveTo<br/>\n";
}
} else {
echo "Article $id would have been moved under topic $moveTo
<br/>\n";
}
} else {
echo "ERROR: $moveArt is not an array, make sure you have selected
at least one article";
}


I'm eager to learn more now that I'v wrote my first offical script using midgards functions. The problem is that there hasn't been a good project for me yet, after all there isn't any better way to learn than by doing your self.

Was a interesting day.

User comments

Post a comment

Commenting is allowed only for authenticated users