Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function to check if admin logged in or not?
#1
I'm trying to implement "Edit this page" link on each page of my GetSimple site. Since I don't want the visitors to see the same link while surfing, I thought of adding a conditional tag like "if(LOGGED IN )".

Please let me know if there's any function available who can do this task?
Using GetSimple 3.0
Reply
#2
nvinanda Wrote:I'm trying to implement "Edit this page" link on each page of my GetSimple site. Since I don't want the visitors to see the same link while surfing, I thought of adding a conditional tag like "if(LOGGED IN )".

Please let me know if there's any function available who can do this task?

There is already a plugin for this here.
You need to switch on site wide cookies (in gsconfig.php) for such a functionality, however, the site wide cookies are broken in GetSimple 3.0 - see workaround in I18N CustomFields plugin.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#3
nvinanda Wrote:I'm trying to implement "Edit this page" link on each page of my GetSimple site. Since I don't want the visitors to see the same link while surfing, I thought of adding a conditional tag like "if(LOGGED IN )".

Please let me know if there's any function available who can do this task?

The Plugin-Description says:
Quote:Allows you to edit pages from website if already logged in to admin console. Save you the time to go to admin->pages tab. Can directly go from the page to edit screen

so what is the problem? Is this not working? Did you test with being logged out?

well:

I checked with GS 3
I uploaded the plugin
it is activated
I am logged in
I open the website in another browser tab but I cannot see any hint "Edit this page" there or in the source code
So I think that this plugin is even more discrete than you want to have it ... it does not do anything ... at least following my checks
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#4
FYI: i've turned the sitewide cookie ON in 3.1 by default
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#5
Connie Wrote:I open the website in another browser tab but I cannot see any hint "Edit this page" there or in the source code
So I think that this plugin is even more discrete than you want to have it ... it does not do anything ... at least following my checks

See above: you need site wide cookies and those are broken in GetSimple 3.0.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#6
mvlcek Wrote:See above: you need site wide cookies and those are broken in GetSimple 3.0.

yes, you are right, I checked whether the constante is defined in the config-file, and it was, but I forgot whether it is functionable in 3.0 or not ...
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#7
Thanks.
I don't want to use an plugin due to some reasons. Would it be possible to get the result using functions.php and template.php in the theme folder?

I read here that it's possible using an browser javascript too, please let me know the javascript to use.
Using GetSimple 3.0
Reply
#8
Finally I developed a small javascript to do the task.
Here it is http://shortbutuseful.com/24/javascript-...rrent-url/
Remember: Use the second script and change "administrator" to"admin".
Using GetSimple 3.0
Reply




Users browsing this thread: 2 Guest(s)