2
   

Help Pleez, I'd like to have information display only to adm

 
 
Reply Fri 16 Jan, 2004 04:16 pm
Hi Gang/CdK,
It's been a while since I posted in this forum. Not so coincidentally, it's been a while since I touched the guts of my board.
I installed some statistics mods, which basically show how many visitors came today. I'd like to make it so that shows up only for admins. I don't remember exactly what module(s) the statistics were added to, i imagine it was to the main topics but i'm not sure (i barely remembered where to find, or what to look for, regarding footers (overall_footer).
Anyway, it wasn't in the footers.
Any way some kind soul can give me a hand, regarding what code to insert before the lines?
I'm pretty sure it would be around the same spot where the "go to admin panel" message is, though I don't remember what module that's in - ugh.
Sorry for the vagueness, and any help is, as always, appreciated! Smile
(I did't put the site in as i'm not sure if that's against the rules these days, but it is www gadgetaddict com (hopefully by spreading/not making it an url, i'm not violating anything) Smile
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 2 • Views: 1,927 • Replies: 10
No top replies

 
Craven de Kere
 
  1  
Reply Fri 16 Jan, 2004 10:14 pm
Why not just remove the links from the site and just access it through a direct URL?

Because displaying the link based on admin level would either require an admin switch or alterations to the php code that are more complicated than the problem is worth.

And even of the link is only displayed for admin the users can always reach the page unless the page itself is also protected.

How much security do you need for this? Would just removing the visible links be enough?
0 Replies
 
gadgetaddict
 
  1  
Reply Sat 17 Jan, 2004 02:35 pm
Hi CdK,
actually, i'm not really concerned about security regarding the statistics information - in a nutshell, my membership has been woefully less than i wanted, and i see no reason to "brag" about it on each page. i'm not sure how the "go to admin" checks to see administrator level, but that's kinda how i'd like the statistics to show up - if you're admin, it shows, if not, it's quite. it's part of the "total users online, users today, etc." verbiage.
i THINK I added a mod to give the enhanced stats, unless they're part of php out of the box. I'm not even sure in what module they're located, so I don't know where to go to start fiddling.
any ideas?
0 Replies
 
roger
 
  1  
Reply Sat 17 Jan, 2004 02:36 pm
Would it be easier to set up a private forum?
0 Replies
 
gadgetaddict
 
  1  
Reply Sat 17 Jan, 2004 02:41 pm
hi guys,
thanks for the replies. i think maybe i posted my question poorly, because i don't even understand the replies so i think we're not talking about the same things.
at the bottom of my forums page (basically, the forums index) it shows:

In total 80 user have visited this site today :: 12 Registered, 0 Hidden and 74 Guests , 10 of them within the last hour.

in addition to the usual verbiage. the rest of the stuff is fine; i'd like the above line to only show for admins.

i THINK it should be easily doable? or not?
0 Replies
 
Craven de Kere
 
  1  
Reply Sat 17 Jan, 2004 03:35 pm
Ah, ok I thought it was just a link.

What you can do is make an administration switch.

This is how it is done:

Open includes/page_header.php

FIND

Code:$template->assign_block_vars('switch_user_logged_in', array());



Add this after that code:

Code: if ( $userdata['user_level'] == ADMIN )
{
$template->assign_block_vars('switch_admin_logged_in', array());
}



Now you will have an admin switch. And if you wrap something in the switches (in the template file) it should display only for admin level users.

Like so:

Code:<!-- BEGIN switch_admin_logged_in -->
The line you want hidden.
<!-- END switch_admin_logged_in -->
0 Replies
 
gadgetaddict
 
  1  
Reply Mon 19 Jan, 2004 12:20 pm
thanks CdK,
you're a genius! (or at least the only one to answer my posts! Smile )
any idea where the statistics are displayed - is it in whoisonline or something to that effect? i have no idea which module it is...
thanks again!
0 Replies
 
Craven de Kere
 
  1  
Reply Mon 19 Jan, 2004 02:12 pm
The line you mentioned should be in the index_body.tpl file, if I understand you correctly.

Since it's non-standard phpBB and is a mod you should be able to look at whatever mod you installed to know the exact line. I've not used that mod so I can't tell you what the line is.
0 Replies
 
gadgetaddict
 
  1  
Reply Mon 19 Jan, 2004 02:54 pm
thanks CdK, i think your last 2 posts are EXACTLY what i need to do what i want Smile i'll give it a shot tonight/tomorrow. if you hear about a big cloud of steam in new jersey, then you'll know it didn't work....
0 Replies
 
gadgetaddict
 
  1  
Reply Thu 22 Jan, 2004 01:34 pm
hi CdK,
this is what i found in index_body.tpl, as you directed, and it appears to be the appropriate section:
<tr>
<td class="row1" align="left"><span class="gensmall">{L_USERS_TODAY} {L_USERS_LASTHOUR}<br />{USERS_TODAY_LIST}</br></span></td>
</tr>

so, now i intend to find page_header.tpl, and add your code, and then put the begin and end switch statements you give me around the <tr> blah blah </tr> - in other words, i'll put the begin BEFORE the <tr> and i'll put the end after the </tr>
sound about right, even though we're defining that admin array in the header template, and putting the switch in the body template?
i'll give it a shot, and shout if it worked or gave me php errors - thanks again! Smile

UPDATE: EUREKA! i DID IT, AND IT WORKED PERFECTLY, NO ERRORS!!!!! Craven, thank you again!!!!!! F'ing genius!
0 Replies
 
Craven de Kere
 
  1  
Reply Thu 22 Jan, 2004 02:17 pm
Well, I'm glad it worked. But what you describe might have caused problems.

The <td> tags are table cells, so it would have been best to simply wrap it around the text 9i.e. after the first td and before the last), otherwise it might ruin the table structure.

Another one was that it was the php page header, and not the tpl file.

But hey, if it worked then it worked and I'm happy for ya!
0 Replies
 
 

Related Topics

Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » Help Pleez, I'd like to have information display only to adm
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 04/25/2024 at 02:54:06