Free Press Release Submission




MB Publishing Webmaster Resource ::
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin 


Admin to read hits only

 
Post new topic   Reply to topic    MB Publishing Webmaster Resource Forum Index -> Php Nuke Version 6.5
View previous topic :: View next topic  
Author Message
Colocation
Site Admin
Site Admin


Joined: Jan 07, 2004
Posts: 404

PostPosted: Thu Feb 05, 2004 10:54 pm    Post subject: Admin to read hits only Reply with quote

I'm looking at a way of removing the "hits count" from the modules archive and top. I'm aware this could be achieved through removal of the code for "reads" or simply commenting it out with //

However, I as an admin, would still like to be able to view the hits. Would this be achieved by using an "if" statement?
Back to top
View users profile Send private message Visit posters website Yahoo Messenger
Humpa
Site Admin
Site Admin


Joined: Feb 05, 2004
Posts: 23

PostPosted: Fri Feb 06, 2004 12:12 am    Post subject: Reply with quote

For the modules/Stories_Archive/index.php
In the function show_all and function show_month, you will see this code:
Code:
    echo "<table border=\"0\" width=\"100%\"><tr>"
   ."<td bgcolor=\"$bgcolor2\" align=\"left\"><b>"._ARTICLES."</b></td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._COMMENTS."</b></td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._READS."</b></td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._USCORE."</b></td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._DATE."</b></td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._ACTIONS."</b></td></tr>";

And this code:
Code:
   echo "<tr>"
       ."<td bgcolor=\"$bgcolor1\" align=\"left\">$lang_img $title</td>"
       ."<td bgcolor=\"$bgcolor1\" align=\"center\">$comments</td>"
       ."<td bgcolor=\"$bgcolor1\" align=\"center\">$counter</td>"
       ."<td bgcolor=\"$bgcolor1\" align=\"center\">$rated</td>"
       ."<td bgcolor=\"$bgcolor1\" align=\"center\">$time[0]</td>"
       ."<td bgcolor=\"$bgcolor1\" align=\"center\">$actions</td></tr>";

You just need to break up those "echo" strings, and put an "if" statement around the one for reads/counter.
Like this:
Code:
    echo "<table border=\"0\" width=\"100%\"><tr>"
   ."<td bgcolor=\"$bgcolor2\" align=\"left\"><b>"._ARTICLES."</b></td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._COMMENTS."</b></td>";
   global $admin;
   if(is_admin($admin)) {
      echo "<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._READS."</b></td>";
   }
   echo "<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._USCORE."</b></td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._DATE."</b></td>"
   ."<td bgcolor=\"$bgcolor2\" align=\"center\"><b>"._ACTIONS."</b></td></tr>";

and this:
Code:
   echo "<tr>"
       ."<td bgcolor=\"$bgcolor1\" align=\"left\">$lang_img $title</td>"
       ."<td bgcolor=\"$bgcolor1\" align=\"center\">$comments</td>";
   if(is_admin($admin)) {
      echo "<td bgcolor=\"$bgcolor1\" align=\"center\">$counter</td>";
   }
   echo "<td bgcolor=\"$bgcolor1\" align=\"center\">$rated</td>"
       ."<td bgcolor=\"$bgcolor1\" align=\"center\">$time[0]</td>"
       ."<td bgcolor=\"$bgcolor1\" align=\"center\">$actions</td></tr>";

In the modules/Top/index.php you will see this:
Code:
           echo "<strong><big>·;</big></strong> ;;$lugar: <a href=\"modules.php?name=News&file=article&sid=$sid\">$title</a> - ($counter "._READS.")<br>\n";

Change it to this:
Code:
           global $admin;
           echo "<strong><big>·;</big></strong> ;;$lugar: <a href=\"modules.php?name=News&file=article&sid=$sid\">$title</a>";
           if(is_admin($admin)) {
                echo " - ($counter "._READS.")";
             }
           echo "<br>\n";
Back to top
View users profile Send private message Visit posters website
Colocation
Site Admin
Site Admin


Joined: Jan 07, 2004
Posts: 404

PostPosted: Fri Feb 06, 2004 7:28 am    Post subject: 50% Reply with quote

That didn't seem to work for the modules/Stories_Archive/index.php

Logged in as admin there are the following columbs:
Articles comments reads Score Date Actions

I have the exact same information present when logged out as admin.

Also there is a problem with the "show all" link, this might be a problem of .htaccess rewrites.

icon_question.gif




It did work wonderfuly though for the modules/Top/index.php

Now I desire that same info for all the items in the Top file, i.e. votes, downloads etc.
Back to top
View users profile Send private message Visit posters website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    MB Publishing Webmaster Resource Forum Index -> Php Nuke Version 6.5 All times are GMT + 1 Hour
Page 1 of 1

 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Home | News Feeds | Release Archive | Web Marketing | Weight Loss | Publish Your Links | Press Release Topics | Free Downloads | Press FAQs | AvantGO | Amazon Store
Webmaster Forums | Search Releases | Press Topics | Feedback | Submit Press Release | Webmaster Surveys | Recommend | Top | Account | PM | Prweb | Free Link Submission | Add Downloads | New Media | Audio School | TOS

The comments are property of their posters, all the rest 2004 - 2008 by MB
Audana Ltd
You can syndicate our news using the file backend.php
Web site engine's code is Copyright © 2003 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.827 Seconds. -