ltwCalendar
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsProjectsltwCalendar

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old June 18th, 2002, 05:30 PM
laurence laurence is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 6 laurence User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hide Admin link in Calendar

I'd like to hide the Admin link from general site visitors. My thought was to create 2 versions of the Calendar.php file... one might be called Calendaradmin.php and it would function exactly as LTWCalendar does now. The second version, Calendar2.php, would be the same but minus the Admin link. I tried this myself, but as a php newbie, didn't get very far. Can this be done? Can you point me in the right direction please?

Reply With Quote
  #2  
Old June 18th, 2002, 05:50 PM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: Hide Admin link in Calendar

The easiest thing to do would be this...in the ltw_classes.php file there are some lines that look like:

if($this->auth->checkLogin()) {
echo "adminn";
echo "&nbsp;<a class="admin" href="javascript:launchsmall('calendar.php?display=admin &task=logout')">logout</a>n";
echo "&nbsp;<a class="admin" href="javascript:launchbig('calendar.php?display=admin&task=add')">add event</a>n";
} else {
echo "<a class="admin" href="javascript:launchsmall('calendar.php?display=admin &task=login')">admin</a>n";
}

those start around line 267...just comment out the line within the else statement...so that it looks like this:

if($this->auth->checkLogin()) {
echo "adminn";
echo "&nbsp;<a class="admin" href="javascript:launchsmall('calendar.php?display=admin &task=logout')">logout</a>n";
echo "&nbsp;<a class="admin" href="javascript:launchbig('calendar.php?display=admin&task=add')">add event</a>n";
} else {
//echo "<a class="admin" href="javascript:launchsmall('calendar.php?display=admin &task=login')">admin</a>n";
}

that removes the admin link...then you can just hit:

calendar.php?display=admin&task=login

from your browser manually to login..once logged in it will show the admin functions....

There are others ways to do this, but it would require more code modifications. I will look at adding an option to hide admin login in the future....

Reply With Quote
  #3  
Old June 18th, 2002, 06:07 PM
laurence laurence is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 6 laurence User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Hide Admin link in Calendar

Matt, while a built-in feature to achieve this would be nice, your suggestion sounds like it will be quite adequate. I'll try it now. Thanks a lot for the speedy response. And for the excellant script!

Reply With Quote
  #4  
Old June 18th, 2002, 06:14 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Hide Admin link in Calendar

if the admin is pw protected then why is it so important to hide? ..just use dhtml layers or sumthin.

Reply With Quote
  #5  
Old June 18th, 2002, 06:22 PM
laurence laurence is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 6 laurence User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Hide Admin link in Calendar

Matt, your solution works, but it's a little bit rockier that I expected. The calendar displays without the Admin link, as hoped for. And you can go to calendar.php?display=admin&task=login to login... but the login only takes you to a blank white screen. When you go to calendar.php again, you are, in fact, logged in. So it works, but for some reason the login process leaves you hanging there. This will work for me, I suppose, but I just thought I'd let you know how it came out. Thanks again.

Reply With Quote
  #6  
Old June 18th, 2002, 06:27 PM
laurence laurence is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 6 laurence User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Hide Admin link in Calendar

Hey Matt, while you're in there, you might consider one other enhancement. As an event calendar, it might be useful if, referring to the Start Time and the End Time, there was a radio box choice you could click that said "Not Relevant". (Like if the event was "Last Day to Submit Application", a Start and End time only seem confusing.)

Reply With Quote
  #7  
Old June 19th, 2002, 09:31 PM
laurence laurence is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 6 laurence User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Hide Admin link in Calendar

Matt, is there an easy way for the script to ignore the "start time" and "end time"? If there is a time for the event, it would be entered in the description area. Would I be able to "rem" a few lines of code or does this kind of modification run deeper than that?

Reply With Quote
  #8  
Old June 19th, 2002, 09:50 PM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: Hide Admin link in Calendar

Yes, that would take quite a bit more work...it is doable though and is something I am considering for my next version....

Reply With Quote
  #9  
Old June 22nd, 2002, 01:03 AM
laurence laurence is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 6 laurence User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Hide Admin link in Calendar

I look forward to any enhancements you might make to this script. In the meantime, I found the spot where the date gets displayed... I "remmed" 2 occurances of this:

echo $start_time . " - " . $end_time . "<br>n";

...in ltw_classes.php and now the times do not display. Thanks for your help.

Reply With Quote
  #10  
Old February 19th, 2004, 08:59 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Hide Admin link in Calendar

I still can't get the admin links to show up. I have reloaded, etc. and nothing, I get the login popup, type in the info, and it closes the popup and reloads the calendar.php page, but no admin links.

Reply With Quote
  #11  
Old February 20th, 2004, 04:08 AM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: Hide Admin link in Calendar

http://codewalkers.com/forum/index.php?action=displaythread&forum=ltwcalendar&id=167&realm=default

Reply With Quote
  #12  
Old April 1st, 2004, 04:13 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Hide Admin link in Calendar

Hi,

I have hacked my copy of 4.1.3 (rather roughly because i did
not have a lot of time) and thought it might be useful to
those waiting on 4.2.0

http://www.i-am-vegan.net/php/ltwCalendar-4.1.3_patched.zip

The changes are basically as follows.

Allow embedding of read only calendar into another php
script. This required the addition of a new $_REQUEST['calendar_embedded']
variable and some if statements scattered throughout
the code.

Addition of a 'add recurring event' and modification of the
display event, day, list scripts to not display the 'Ends'
portion of a recurring event, when the 'event_end' column
is used to indicate the end of recurrence of the event. As
a result assumed that all recurring events are no longer than
a day.

Modified the Event Manager so that if All Day checkbox is
clicked, the Start / End times are disabled. As a result
of checking All Day, also assumed that the event can be
no longer than a day (not sure about this one, but works
for me)

Renamed the calendar.php script to index.php, so I can
access the admin version of the calendar with just the
virtual location. For example:
http://www.mydomain.com/calendar/

Modified the style a little, so the calendar was
not so big.

Heres the code I use to embed my read only calendar.

------------------------ snip -----------------
<?php
$_REQUEST['calendar_embedded'] = 'true';
include("calendar/index.php");
?>
------------------------ snip -----------------

Not sure if this will be a help to anyone, and my changes
are a little messy, but they work as I needed them to.

All I am missing now, is recurring events of bi-weekly
and monthly.

Looking forward to 4.2.0

You can see my calendar in use here:
http://gaa.i-am-vegan.net/calendar.php

Thanks
Jason

Reply With Quote
  #13  
Old July 22nd, 2004, 06:52 PM
Denver Dave Denver Dave is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Denver, CO USA
Posts: 26 Denver Dave User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Hide Admin link in Calendar

Situations may be different, but sometimes we do not wish to draw attention to the fact that we have a login.

After I log in, I get a screen for password changes. Close that, refresh calendar and have logged in links version 4.1.3.

Reply With Quote
Reply

Viewing: Codewalkers ForumsProjectsltwCalendar > Hide Admin link in Calendar


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |