|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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?
|
|
#2
|
|||
|
|||
|
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 " <a class="admin" href="javascript:launchsmall('calendar.php?display=admin &task=logout')">logout</a>n"; echo " <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 " <a class="admin" href="javascript:launchsmall('calendar.php?display=admin &task=logout')">logout</a>n"; echo " <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.... |
|
#3
|
|||
|
|||
|
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!
|
|
#4
|
|||
|
|||
|
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.
|
|
#5
|
|||
|
|||
|
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.
|
|
#6
|
|||
|
|||
|
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.)
|
|
#7
|
|||
|
|||
|
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?
|
|
#8
|
|||
|
|||
|
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....
|
|
#9
|
|||
|
|||
|
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. |
|
#10
|
|||
|
|||
|
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.
|
|
#11
|
|||
|
|||
|
RE: Hide Admin link in Calendar
http://codewalkers.com/forum/index.php?action=displaythread&forum=ltwcalendar&id=167&realm=default
|
|
#12
|
|||
|
|||
|
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 |
|
#13
|
|||
|
|||
|
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. |
![]() |
| Viewing: Codewalkers Forums > Projects > ltwCalendar > Hide Admin link in Calendar |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|