Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 1:
Total number of articles?

 

 


ivar
User

Jan 28, 2003, 2:28 AM

Post #1 of 9 (6373 views)
Shortcut
Total number of articles? Can't Post

Hi, I wonder if itīs possible to show the total number of articles on the published sites index page?

The administration interface shows both the number of records found and the total number.

Kind regards

Ivar Johansson
Stockholm, Sweden


ken_itools
Staff


Jan 28, 2003, 5:02 PM

Post #2 of 9 (6352 views)
Shortcut
Re: [ivar] Total number of articles? [In reply to] Can't Post

Hi Ivar,

I've looked into it, and I'm afraid that the total number of records is not available as a global placeholder.

I can see how it would be useful to you though, so I'm going to put it on my list :)
----------
Ken Clarke - YAPG (Yet Another Perl Guy :)

interactivetools.com, inc. 
Tel: (604)689-3347 - Fax: (604)689-3342 - Toll Free: 1(800)752-0455 


Teambldr
User

Jan 28, 2003, 5:05 PM

Post #3 of 9 (6348 views)
Shortcut
Re: [ken] Total number of articles? [In reply to] Can't Post

May I suggest some flex to that such as:

Total Articles
Total Cat 1 Articles
Total Cat 2 Articles

and so on...

Just a thought!Wink
Brian


ivar
User

Jan 28, 2003, 10:56 PM

Post #4 of 9 (6341 views)
Shortcut
Re: [Teambldr] Total number of articles? [In reply to] Can't Post

Thanks, Ken!

Good idea, Teambldr!

Bye for now

Ivar Johansson
Stockholm, Sweden


Lionel
User

Jan 30, 2003, 5:54 PM

Post #5 of 9 (6329 views)
Shortcut
simple PHP solution [In reply to] Can't Post

Ivar, all AM articles have one thing in common: they all have the same prefix article_

so simply save this simple script into any name.php and place it in your published articles directory and you will have your count.

Use SSI or php include to display it.

<?
print getAllFiles(".");

function getAllFiles ($dir) {
$d = opendir ("$dir");

while ($file = readdir ($d)) {
if (is_dir ($dir."/".$file)) continue;
if ($file == ".." || $file == ".") continue;
if (preg_match('/^article_/', $file)) $count++;
}

closedir ($d);
return $count;
}

?>


ivar
User

Jan 30, 2003, 11:37 PM

Post #6 of 9 (6323 views)
Shortcut
Re: [Lionel] simple PHP solution [In reply to] Can't Post

Cool solution, Lionel!
Unfortunately I have chosen to give each article a unique file name. Frown

Thanks anyway!

Ivar Johansson
Stockholm, Sweden


Lionel
User

Jan 30, 2003, 11:41 PM

Post #7 of 9 (6322 views)
Shortcut
Re: [ivar] simple PHP solution [In reply to] Can't Post

each article or each category?


ivar
User

Jan 30, 2003, 11:43 PM

Post #8 of 9 (6321 views)
Shortcut
Re: [Lionel] simple PHP solution [In reply to] Can't Post

Each article.

Ivar J


ivar
User

Jan 31, 2003, 3:26 AM

Post #9 of 9 (6315 views)
Shortcut
Re: [ivar] simple PHP solution [In reply to] Can't Post

Solved it! Smile

I took your PHP script and replaced "article" with "printer". To get it to work in my cgi-bin directory I used IFRAME to show the number of articles on all the pages.

Ivar Johansson
Stockholm, Sweden