| View previous topic :: View next topic |
| Author |
Message |
Colocation Site Admin

Joined: Jan 07, 2004 Posts: 412
|
Posted: Thu Feb 05, 2004 10:54 pm Post subject: Admin to read hits only |
|
|
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 |
|
 |
Humpa Site Admin

Joined: Feb 05, 2004 Posts: 23
|
Posted: Fri Feb 06, 2004 12:12 am Post subject: |
|
|
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 |
|
 |
Colocation Site Admin

Joined: Jan 07, 2004 Posts: 412
|
Posted: Fri Feb 06, 2004 7:28 am Post subject: 50% |
|
|
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.
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 |
|
 |
|