Welcome to Geeklog Saturday, May 08 2021 @ 09:14 pm EDT

Geeklog Forums

I want more calendar on my frontpage


Status: offline

Spacehamster

Forum User
Newbie
Registered: 08/07/05
Posts: 9
Location:Netherlands
curious
I'm currently working on a site that will mainly use the calendar part of Geeklog.
Can anyone be so kind to advice me (or give me the link to advice) how to replace the story stuff that shows up on the front page with the calendar?
Including the calendar.php stuff would be just perfect..

Pretty please with sugar and chocolatesirup on top. praying it will work
---Grtz-------------M1r4-->
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
Hmm, if you don't need the story listing at all, then a quick and dirty solution would be to copy calendar.php over index.php.

It will still link to calendar.php a lot, though (unless you replace them in calendar.php itself, and possibly in the templates).

bye, Dirk
 Quote

Status: offline

matthewcox

Forum User
Junior
Registered: 11/12/03
Posts: 31
Location:Asheville, North Carolina
Here are two possible solutions that don't require any modifying of the calendar.php which for those familiar with htaccess is pretty simple but if htaccess is foreign to you it may same more difficult than Dirk's suggestion.

ArrowMethod that allows you to keep all the functionality of the index.php which includes topics subpages

If you on an Apache webserver you can start by modifying or creating the .htaccess file in your webroot directory and make the DirectoryIndex line point to calendar.php Google htaccess if you have any questions about how to do this.

The "DirectoryIndex" directive will determine what page your domain defaults to(usually points to index.php or index.html)

By using the DirectoryIndex line in the following .htaccess file http://www.yourdomain.com/ will automatically go to your calendar

ex.
PHP Formatted Code

##############
# Example Geeklog .htaccess file
AuthUserFile /dev/null
AuthGroupFile /dev/null

DirectoryIndex calendar.php index.php index.html   # usually points to index.php first

ErrorDocument 404 /404.php

 


Arrow Disable index.php all together and replace with calendar
If you want to completely disable the index.php page you could redirect it to calendar.php page as well.

here are the lines you need to add to .htaccess to do this (in this case you could leave DirectoryIndex as index.php) It does require you have mod_rewrite installed on apache which usually is these days but ask you sysadmin if you're not sure.

PHP Formatted Code

# Redirect internally index.php to calendar.php
RewriteEngine On
RewriteRule ^index.php /calendar.php [L]

 


Before you do this, make sure your admin block is set to the left or you'll have hard time getting to the admin menus.

Arrow Both solutions would require menu tweaks
You'll problably want to replace the standard menus with your own "normal block" with your hand entered html menu. For your navigation bar both home and calendar would go to the same place so pick the one you prefer.

Not sure if this achieves what you're after but hope it helps.

-Matthew Cox
 Quote

Status: offline

matthewcox

Forum User
Junior
Registered: 11/12/03
Posts: 31
Location:Asheville, North Carolina
Forgot to mention that both of the htaccess solutions have the advantage that because you don't have to modify the geeklog code you don't have to rehack it everytime there's an upgrade.Big Celebration
 Quote

Status: offline

Spacehamster

Forum User
Newbie
Registered: 08/07/05
Posts: 9
Location:Netherlands
curious
Wonderful, I'm actually getting advice!
But it's not *precisely* what I'm looking for....
Actually I'm not afraid of hacking into it at all.
It's digging through a lawine of code-that-someone-else-wrote that is shying me from doing deep research.
(Although I have to say I love the way of indentation, seems I'm not the only one that prefers the brackets UndeR the keywords.)

I would like to keep the story funtionality somewhere on the background.
I just want the calendar take it's place.
The most perfect situation would be to have the index.php show the current week, but the month would be a close second perfect thing.

A pointer to the piece of code to switch these would be excellent advice for me.
---Grtz-------------M1r4-->
 Quote

Status: offline

matthewcox

Forum User
Junior
Registered: 11/12/03
Posts: 31
Location:Asheville, North Carolina
Arrowa cleaner way to do it
use the 1st method in my earlier post to make
DirectoryIndex calendar.php index.php index.html

The url for the weekly display is
http://yoursite.com/calendar.php?mode=&view=week

You can hardcode calendar.php with the default value
?mode=&view=week
To do this edit the following code in calendar.php
PHP Formatted Code

if (!in_array ($view, array ('month', 'week', 'day'))) {
    $view = '';  //change this to $view = 'week';
}


 



This would avoid using redirects and would be transparent to the users.


 Quote

All times are EDT. The time is now 09:14 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content