How to implement a progress bar?
Drupal-id.com - July 16, 2008 - 07:12
My module imports 5.000 Users and 20.000 articles from Joomla. And I need to show a progress bar, any idea how to implement a progress bar?
while ( $data = db_fetch_object($results_user) ) {
..... IMPORT DATA HERE .....
..... SHOW PROGRESS BAR ....???
}
return "Finish imported data!"

yes
When you install drupal there is a progress bar right?
I came in contact with this functionality today.
It may be more than you bargained for.
There is something called the Batch API, which will probably answer all your questions.
Batch API
It offers many things.
- progress bar
- page refreshes if it thinks it will time out
- some other stuff I don't yet know about :)
I plan in tinkering with this toy soon.
enjoy