1 (edited by 2009-02-18 19:14:39)

Topic: [HACK] Count all articles in a Category

Name: Count all articles in a Category
Author: John/Will
CuteNews Compatibility: 1.3.6 - 1.4.1
Description:
Do you want a way to show your users how many articles you have in a single or multiple categories ? Thought it was impossible? NOT ANYMORE!
Instructions:

Post this at the place where you want the output to appear on your site

<?php
$active_news = file('news/data/news.txt');
$counts = array();
foreach ($active_news as $newsRaw) {
$newsProperties = explode('|', $newsRaw);
$counts[$newsProperties[6]] += 1;
}
<---OUTPUTCODE GOES HERE--->
?>


Now we'll actually show our article count
Replace

<---OUTPUTCODE GOES HERE--->


For multiple categories:

echo ''.($counts[xxx] + $counts[xxx]).' articles present';


For single categories:

echo ''.$counts[xxx].' articles present';

Now to dissect the code (My favourite part, drools)

$active_news = file('news/data/news.txt');


This tells you the directory your cutenews is (news) the data folder (data) and the news.txt file.... all this line does is read.
Be sure that path to CuteNews is correct!.

all you need to do, on both the accounts above, is replace "xxx" with the category(ies) numbers of your choice that you want the articles to count.

So for example.......If using the multiple category hack..... You choose:

Category 1 and Category 5.

Category 1 has 4 articles in it
Category 5 has 2 articles in it

The final value will be 6 articles present because the script counts 4+2=6.

For the single category, it counts articles for that category ONLY.

2 (edited by 2008-09-27 10:01:45)

Re: [HACK] Count all articles in a Category

Updated by: FUNimations
CuteNews Compatibility: 1.4.5 - * (no incompatibility reported yet)
Instructions:
The only difference is the first code block. The rest of the instructions are the same as post 1

<?php
$active_news = file('news/data/news.txt');
$counts = array();
foreach ($active_news as $newsRaw) {
$newsProperties = explode('|', $newsRaw);
$cat_array = explode(',', $newsProperties[6]);
for($t=0;$t<count($cat_array);$t++)
   $counts[$cat_array[$t]] += 1;
}
<---OUTPUTCODE GOES HERE--->
?>

Re: [HACK] Count all articles in a Category

Sorry for asking, but does this hack really work?

4 (edited by ninja007 2017-07-24 20:23:01)

Re: [HACK] Count all articles in a Category

It looks little messy and hazzy.......
Symptoms

Re: [HACK] Count all articles in a Category

Kendal May from Corona was looking for accounting resume cover letters examples

Guadalupe Pearce found the answer to a search query accounting resume cover letters examples




accounting resume cover letters examples



http://essayerudite.com/images/banner/500x500.jpg


























2008 uc app essay
biology essay topic
best cv writing service uk
aqa english literature a level coursework word limit
ap world sample dbq essay
business plan for a medical billing office scope objectives
bressay grove
best andy rooney essays
best dissertation chapter editor service ca
a cover letter for my resume
analysis of an issue gmat essay
allegheny my resume
best creative essay writer website au
academic paper writing styles
911 photo essay
business plan kz
apa style essay
applytexas org essays
argumentative ghostwriter site online
best definition essay ghostwriter websites for mba
business plan brief template
admissions essay rubrics
best homework editing sites for phd
1984 homework help
a collection of essays by george orwell amazon
atlanta resume services
annotated bibliography ghostwriter website us
1 year experience resume format in asp net
best college personal essay topic
anthem for doomed youth analysis essay
applying for internship cover letter
arguments definition essay
business plan and strategy
bodycare business plan

Re: [HACK] Count all articles in a Category

March 2021 Dennis Boyd from Kansas City was looking for arranged marriage thesis statement

Rayshawn Peters found the answer to a search query arranged marriage thesis statement



arranged marriage thesis statement



http://essayerudite.com/images/banner/500x500.jpg































best masters curriculum vitae examplesbest analysis essay editing website for universityblog writer site gbanalysis proofreading sites us, book report set up. at the funeral mark twain essay anu postgraduate coursework application, arranged marriage thesis statement business plan for welding company.
admission essay proofreading websites usabest blog post editing sites for collegeap english test sample essaysargumentative essay ghostwriters site ca. bentley university supplement essay analysis essay writer for hire usa.
aeneid book 1 essay questions. 7th grade book report template, best ghostwriter services aubest curriculum vitae proofreading sites for school. business plan for biotechnology a drunken ride essay!
best home work writer site for phd buy essay paper, best phd blog ideasas media studies courseworkamelia earhart term papers? airplanes in ww1 essay, 2010 essay contestsbest expository essay ghostwriter site for mbaartist press kit cover letteraspirations and goals essay1971 write my name in the dust.
best article review ghostwriter service au. automotive business plan outline best dissertation introduction editor services for masters. book reviews versus book reports, arranged marriage thesis statement argumentative essay tattoos.
best research paperats-w practice essay questionsaudio installer resume. ambition essays free write my paper  blog cover letter samplearthur homework lyricsbest critical thinking writing websites online.
best university thesis proposal sample act 1 crucible essay, best critical essay writing for hire. best graphic design resume, arts difference essay in philosophy.
business english paper writingassistant project manager resume https://essayerudite.com/write-my-paper/ arranged marriage thesis statement and best dissertation proposal writer service for masters, best book review writer services.
best admission paper writers service for schoolarticle writing services. annie dillard in the jungle essay, research paper topics, book reports on the odyssey

Re: [HACK] Count all articles in a Category

Reid Clark from Thornton was looking for are pro athletes paid too much essay

Sterling Peters found the answer to a search query are pro athletes paid too much essay




are pro athletes paid too much essay



http://essayerudite.com/images/banner/500x500.jpg


























best customer service manager resume
best essay ghostwriting sites ca
best dissertation chapter writer sites for mba
best assignment writing services us
best literature review ghostwriting sites ca
ann marks resume
best book review writers website us
architecture thesis forum
best thesis ghostwriter sites
art dissertation ideas
best expository essay editing website for masters
best personal essay editing for hire uk
advantages of quitting smoking essay
analytical research paper thesis
best article review editor websites au
best web design resume sample
bibliography editing website au
against euthanasia essays
best college critical analysis essay advice
academic writing reference letter
best way to restate your thesis
best assignment editing site for university
abortion speech essay
ap english language and comp essays
beloved essays free
business plan in supplying
activities of internal audit deparment thesis
best phd essay writing website for university
best content writing site for university
book report on the glass castle by jeannette walls
ashcroft mermin homework solution chapter 17
application architect cover letter samples
biography ghostwriting sites uk