[SOLVED] How to make Sidebar Stats viewing Admin-only?

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 07-15-2007, 05:22 PM
New Pligger
 
Join Date: Jun 2007
Posts: 4
Hi.

The title says it all. What do I have to change (and where) to make the Stats sidebar only appear in admin accounts?

Thanks.
Reply With Quote
  #2 (permalink)  
Old 07-16-2007, 12:01 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,960
FYI: Admin already has a stats shown in the admin panel - the simplest way is to disable the sidebar_stats module if you think others donot have to see it.

Other possible case is:
Just open your /modules/sidebar_stats/templates/sidebar_stats.tpl and add this line below the first line where some config files are loaded:
Code:
{if $isadmin eq 1}
and at the end of the file before
Code:
{* this is a temporary fix. When you load a new config file the existing config gets dropped. *}
add
Code:
{/if}
Reply With Quote
  #3 (permalink)  
Old 07-16-2007, 02:03 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
I have a similar problem:
I want to hide "who voted" from non-admins. Since the relevant file story.php is not a tpl file the syntax must be different. Can you tell me?

Edit: Consequently, I have to do the same with "Commented" at user.php.

Last edited by tbones; 07-16-2007 at 02:08 AM.
Reply With Quote
  #4 (permalink)  
Old 07-16-2007, 02:45 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,960
A simple way I would recommend is to just hide the "Who voted tab" - when there is no link - users will not follow - and show it only to admin.

This will do it:
In file /templates/yget/story_center.tpl

Replace this line
Code:
<span><a href="#" rel="who_voted">{#PLIGG_Visual_Story_Who_Voted#}</a></span>
with
Code:
{if $isadmin eq 1}<span><a href="#" rel="who_voted">{#PLIGG_Visual_Story_Who_Voted#}</a></span>{/if}
Tested and works - any other thing will consume more effort and more file modifications
Reply With Quote
  #5 (permalink)  
Old 07-16-2007, 02:56 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
Great! Do you have a similar solution for "Commented" ?
Reply With Quote
  #6 (permalink)  
Old 07-16-2007, 03:08 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
Where is my coffee? *g* I´ve meant "Voted"

Edit: I did some extensive trial´n´error and found yget/user_center.tpl as the responsible file for display.

Last edited by tbones; 07-16-2007 at 04:01 AM.
Reply With Quote
  #7 (permalink)  
Old 07-16-2007, 04:37 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,960
Quote:
Originally Posted by tbones View Post
Great! Do you have a similar solution for "Commented" ?
? - I didnot get what you exactly wanted - you meant - you donot want the comments to be displayed?

Quote:
Originally Posted by tbones
Where is my coffee? *g* Iīve meant "Voted"

Edit: I did some extensive trialīnīerror and found yget/user_center.tpl as the responsible file for display.
me still confused - if you could detail on what you fixed/found - that might help someone who might be interested in similar things..
Reply With Quote
  #8 (permalink)  
Old 07-16-2007, 05:02 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
I confused myself due to the lack of coffee ;-)

Ok, thatīs what I want:
Users (except admin and god level) mustnīt see who voted for their stories. To achieve this the tabs "Who voted" at yget/story_center.tpl and "Voted" at yget/user_center.tpl have to be written inside the conditional.

I mixed up "Voted" and "Commented", sorry.
Reply With Quote
  #9 (permalink)  
Old 07-16-2007, 05:03 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,960
np, hope you got your cup of coffee
Reply With Quote
  #10 (permalink)  
Old 07-16-2007, 05:09 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,960
For hiding from user profile the stories where the user voted and enabling it only for the admin and that user - as requested by tbones:

In file templates/yget/story_center.tpl

Replace this code
Code:
<li><a href="{$user_url_news_voted}" class="navbut{$nav_nv}"><span>{#PLIGG_Visual_User_NewsVoted#}</span></a></li>
to

Code:
{if $isadmin eq 1 or $user_login eq $user_logged_in}<li><a href="{$user_url_news_voted}" class="navbut{$nav_nv}"><span>{#PLIGG_Visual_User_NewsVoted#}</span></a></li>{/if}

Last edited by dollars5; 07-16-2007 at 05:19 AM.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pligg prof. can you make some empty area's in de sidebar for banners etc. Fred007 Questions and Comments 3 12-31-2008 01:30 AM
Module Hooks Yankidank Wiki Articles 1 09-15-2008 11:33 PM
[SOLVED] Enable 'admin' to killspam from a user's profile longcountdown Questions and Comments 5 05-26-2008 02:16 PM
How do I make the footer sit BELOW the sidebar on all pages? littledipper Questions and Comments 5 11-29-2006 05:54 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development