Mind 2 Share All

Best Resources Share-center. Mind 2 Share everything you have............... Software's,Utilities,Web Templates,Animations,Videos,Music,Graphics,Scripts,Web Clones,Images,Tips,Tricks,Ideas,Stories,Novels,Poems,Projects,Adult,Jobs.............

Display Hits At Joomla! 1.5 Frontpage & Category Pages Tips

Show Hits at Joomla Category Pages with Each Item:

You want to show the hits for every article in category page too?

You need to add the following code in your category page:

item->hits; ?>

You can change the "Total Hits: " with anything you want...

Ideally your joomla template should have html override folder... i.e. you need to open this blog_item.php file, and add the above code where you want to display thehits.

your joomla template > html > com_content > category > blog_item.php

This will work perfectly for you I am sure as we do this daily :-) If you do not know how to edit template or your current tempalte dont have the html override folder, let us know, and one of our coder will do implement this for you.

Show Hits at Frontpage (Main page) of Your Joomla Site:

Just add the above code in the frontpage item i.e.

item->hits; ?>

into the following file:
joomla template > html > com_content > frontpage > default_item.php

(Add this in the above file at the position where you want to show the hits)

But to make this code work you need to add one more little code at joomla page i.e.

Open components/com_content/models/frontpage.php

Search for this line at about 128th line:

$query = ' SELECT a.id, a.title, a.title_alias, a.introtext, a.fulltext......... big line :-)

you need to add this code (a.hits,) at the end before the "'"

i.e.
a.attribs, a.urls, a.metakey, a.metadesc, a.access,

becomes :
a.attribs, a.urls, a.metakey, a.metadesc, a.access, a.hits,

PS. If you want any customization, or this does not work in your situation. You can submit a support ticket at our desk and let one of our expert coder do this for you.

0 comments:

Post a Comment