2.5.1 - Remove FAQ View Count and Total FAQ in Categories

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
rhobson
Posts: 3
Joined: Tue May 19, 2009 12:51 am

2.5.1 - Remove FAQ View Count and Total FAQ in Categories

Post by rhobson »

First off, I want to say thank you and this application is a great piece of work. I have already edited my templates and tweaked it to a very usable theme. I only have 2 more things I want to tweak out - I want to remove the FAQ View and Category FAQ counts. As stated in an earlier post, I tried to change the code in Faq.php from:

Code: Select all

$listItem = sprintf('<li>%s<br /><span class="little">(%d %s)</span></li>',
                    $oLink->toHtmlAnchor(),
                    $visits,
                    $this->pmf_lang['msgViews']);
to

Code: Select all

$listItem = sprintf('<li>%s</li>', $oLink->toHtmlAnchor());
All I get when I make this change is a blank page. No clues in any of the logs (apache, system, etc.) I also checked out line 1588 in Faq.php as suggested in another post, but did not find the block of code referenced.

Any suggestions/help to remove these from being displayed?

Your help is appreciated.

-Robert
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: 2.5.1 - Remove FAQ View Count and Total FAQ in Categories

Post by Thorsten »

Hi,

your code example looks not like phpMyFAQ 2.5, it looks more like 2.0.

In inc/Faq.php you have to go to line 435 and change

Code: Select all

                $listItem = sprintf('<li>%s<br /><span class="little">(%d %s)</span>%s</li>',
                    $oLink->toHtmlAnchor(),
                    $visits,
                    $this->pmf_lang['msgViews'],
                    ($row->sticky == 1) ? '<br /><br />' : '');
to

Code: Select all

                $listItem = sprintf('<li>%s%s</li>',
                    $oLink->toHtmlAnchor(),
                    ($row->sticky == 1) ? '<br /><br />' : '');
for removing the number of views. For removing the numbers of records in a category view to have to open inc/Category.php, go to line 651 and change

Code: Select all

                $num_entries = sprintf(' (%d %s ',
                                        $number[$parent],
                                        $PMF_LANG['msgEntries']);
                $num_entries .= sprintf(' <a href="feed/category/rss.php?category_id=%d&category_lang=%s" target="_blank"><img id="category_%d_RSS" src="images/feed.png" width="16" height="16" alt="RSS" /></a>)',
                                        $parent,
                                        $this->language,
                                        $parent);
to

Code: Select all

                $num_entries = sprintf(' <a href="feed/category/rss.php?category_id=%d&category_lang=%s" target="_blank"><img id="category_%d_RSS" src="images/feed.png" width="16" height="16" alt="RSS" /></a>)',
                                        $parent,
                                        $this->language,
                                        $parent);
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
rhobson
Posts: 3
Joined: Tue May 19, 2009 12:51 am

Re: 2.5.1 - Remove FAQ View Count and Total FAQ in Categories

Post by rhobson »

Simply brilliant. Thank you for the assistance. I made a couple modifications, but it worked as advertised. You will definitely be seeing more of me. :mrgreen:

Actually, as you pointed out, I am running an older release. Oddly enough, in the admin panel shows my phpMyFAQ Version as phpMyFAQ 2.5.1. I will be upgrading to the latest stable release shortly (in the next day or 2). My guess is these changes will be lost when I upgrade. Where are these changes located in 2.5.2?

I also would like to remove the number of views from the "Most Popular" side bar and the date from the "Latest Faq" side bar. Where are these code modifications? I tried to zero out the dates, but it appears it defaults to Unix time. Again, I'll be upgrading to 2.5.2. Is this release able to use the same templates? Has the database schema changed any?

I appreciate the assistance. Is your wish list updated? hehe :D

-Robert
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: 2.5.1 - Remove FAQ View Count and Total FAQ in Categories

Post by Thorsten »

Hi,
rhobson wrote:Actually, as you pointed out, I am running an older release. Oddly enough, in the admin panel shows my phpMyFAQ Version as phpMyFAQ 2.5.1. I will be upgrading to the latest stable release shortly (in the next day or 2). My guess is these changes will be lost when I upgrade. Where are these changes located in 2.5.2?
you have to re-edit these fixes after updating to 2.5.2.
rhobson wrote:I also would like to remove the number of views from the "Most Popular" side bar and the date from the "Latest Faq" side bar. Where are these code modifications? I tried to zero out the dates, but it appears it defaults to Unix time. Again, I'll be upgrading to 2.5.2. Is this release able to use the same templates? Has the database schema changed any?
There are new template changes and no database changes in the 2.5.x release cycle. The next database change will happen with 2.6.
rhobson wrote:I appreciate the assistance. Is your wish list updated?
Always. ;-)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply