PDA

View Full Version : Mini Calendar from vbPortal


wajones
11-02-2001, 10:00 PM
As requested, here is the small calendar from vbPortal.
I want to also give credit to one of my users "rabidmoogle" for help in optimizing my original hack.

It's a standalone file, with the template included for testing.
1. Create a new template called "small_calendar"
2. Cut and paste the included template from the script into the new template.
3. rename the cal.php.txt to cal.php and copy it to your forums directory and run to test.
4. Cut and paste the code between the <?php and ?> to the location of your choice to use in another script.

SgtSling
11-03-2001, 07:27 PM
any install instructions?
Thanks!

Jakeman
11-04-2001, 01:42 AM
truly excellect. thank you very much wajones. :)

ideally i would like to use a $variable in my header template which would call this calendar to display... having this functionality in my header would make integration with my new layout very easy for me. do you know what would be required to do this? ...as in, what php file(s) do i need to copy the calendar code to in order to get this functionality in my header (calendar functionality on all vb pages)? and what $variable do i use in my templates to call the calendar?

this is greatly appreciated wajones. this is exactly what i wanted... a stand alone hack for the vbportal mini calendar. your help with my above questions on implementation would also be greatly appreciated. :)

Jakeman
11-04-2001, 02:06 AM
test works :)

http://www.mac-gamer.com/dev/cal.php

wajones
11-04-2001, 02:51 AM
To include it in vBulletin, this is untested but should work.

Replace the eval("dooutput(\"".gettemplate(small_calendar)."\");"); in the cal.php file with eval("\$smallcalendar .= \"".gettemplate("small_calendar")."\";");

Then put include 'cal.php'; in the phpinclude template, you should now be able to use $smallcalendar in what ever template you want.

Jakeman
11-04-2001, 04:34 AM
it worked. i had to remove everything outside of the <?php ?> and also remove the include global.php in the cal.php file for it to work. however, it "breaks" my calendar while the phpinclude template is including cal.php . the symtoms are the same as what sysmom described in this thread for the today's events hack: https://vborg.vbsupport.ru/showthread.php?s=&threadid=21232&perpage=15&pagenumber=5

it must be something in the cal.php file that is conflicting. if that file is included in the phpinclude it breaks my calendar regardless of whether i'm using the calendar variable on my pages or not... when i remove the include for cal.php everything works again. sysmom suggested it may be a variable getting tromped on.

once again, your help is greatly appreciated. :)

Jakeman
11-04-2001, 05:00 AM
oops :)

linkage4u http://www.mac-gamer.com/dev/

the broken calendar can be seen by clicking on the calendar button on the top.

Alien
11-04-2001, 11:18 AM
Hey,

For a couple of weeks now I've been requesting a non-vb page calendar hack in the requests forum that worked identical to the phpportal type but without having to use the portal script. When I saw this thread it looked like what I needed however when I looked at the instructions it doesn't seem to be? This doesn't seem to have the functionality that allows it to run on a non-vb page? Like calling it via SSI in a .shtml page?

Any help in doing this would be GREATLY appreciated, I want to replace my plain calender that has no integration with vb. :)

Thanks!

Bane
11-04-2001, 02:19 PM
This should run fine on a non vb page I would think. I'm running it in a pop-up window now and its dandy.

Jakeman
11-05-2001, 02:43 AM
problem solved... more or less. :)

i duplicated the global.php file and named the duplicate to calglobal.php. in the calglobal i removed the statement that parses the phpinclude template. then i changed the require statement in the calendar.php file to require calglobal.php instead of global.php . so now i don't have the problem anymore at the small cost of not having the mini calendar on the big calendar page (which makes sense i guess).

cheers!

JJR512
11-05-2001, 02:58 AM
Which problem does this solve, exactly?

Jakeman
11-05-2001, 04:14 AM
Originally posted by JJR512
Which problem does this solve, exactly?

when the cal.php was being included on the calendar.php pages it "broke" the big calendar's layout and didn't allow posting of new events. instead of troubleshooting the code (cos i suck! :p ) i just cleverly removed the phpinclude template from all calendar pages. :)

JJR512
11-05-2001, 04:50 AM
Originally posted by Jakeman
in the calglobal i removed the statement that parses the phpinclude template.
How do I do this? I've just looked at the calglobal.php file (copied version of global.php), and don't see anything I can tell what to do with. :)

JJR512
11-05-2001, 04:55 AM
Nevermind, I just realized it is in the global.php in the forums root folder, not the forums/admin folder. (I wish people would be more specific about this!)

Alien
11-05-2001, 10:46 AM
For the life of me, I still cannot get this to function in a php include via a .shtml page...

I can run the script itself alone and it will show the calendar perfectly, but an include will NOT work for me... :p

My structure:
http://www.aliensoup.com/blah.shtml (not yet live)
http://forums.aliensoup.com

Any clues? :confused:

Alien
11-05-2001, 10:50 AM
Oh yes, I also have a request. :)

Can it also be made so if there are no events on that day, but there are BIRTHDAYS on that day, that it creates a link to that day just like it does with actual events?

Either that, or the ability to post birthdays on a non-vb page would be really great too! Even in another hack maybe. Hmm!

Alien
11-07-2001, 01:43 PM
Anyone? :p

Jakeman
11-07-2001, 06:00 PM
the mini calendar already links the day numbers to list the entire day.

Alien
11-07-2001, 09:38 PM
All I noticed, is if you have created a public event for that day then the link will show up.. If their are no events it will not show a link to that day.. I wanted to have it so:

If a day has a public event, show a link.
If a day has a birthday, show a link.

If a day has NEITHER, don't have a link.

:D

Alien
11-07-2001, 09:40 PM
...and I still can't get it to work within a php include on a non-vb .shtml page. :p

Jakeman
11-08-2001, 12:09 AM
i don't know about that .shtml page thing.

so it doesn't show a link for birthdays right now? mine does... i think. www.macsubculture.com/dev/

Jakeman
11-08-2001, 12:10 AM
9th and 11th on my calendar... but i think those were put in manually by those people. i have birthdays disabled.

JJR512
11-08-2001, 04:14 AM
I've discovered a problem on my board that was solved after disabling this hack. I'd like someone else to confirm or deny that they have the same problem.

One of my users told me that after saving changes to her profile, her birthday showed up in her edit profile screen as Nov 31, 2001. Now that is an invalid date to begin with. When looking at her profile, it shows up as Dec. 1 (no year). She can go back to her profile and change it, but after saving it, the changes to do not remain, they don't stick. Now if I edit the database directly, the changes there do stick, so I rules out a database problem and determined it had to be a script problem somewhere.

The problem went away when I removed the include 'cal.php'; statement from the phpinclude template.

Alien
11-08-2001, 03:49 PM
Heya!

Yeah they were put in manually, that's why it's triggering the link.. I want it to also trigger the link if their are no events but their ARE birthdays. :D

Well, hopefully someone can help on that one sometime.. Now I gotta figure out how to get this to work on a php include on a .shtml page.. <sigh>

Originally posted by Jakeman
9th and 11th on my calendar... but i think those were put in manually by those people. i have birthdays disabled.

Jakeman
11-08-2001, 04:39 PM
i can confirm the birthday submit bug. i don't use birthdays though so it doesn't really matter for me.

jarvis
11-09-2001, 03:12 AM
I'm trying to play around with the small_calendar template, but am not having any luck trying to narrow down the size of the mini-calendar.

I've tried changing the table width, but it still seems to look the same every time. I'm no HTML guru, but any help would be greatly appreciated.

Thanks!!

Jakeman
11-28-2001, 05:56 AM
i am attempting to add a condition that displays the text "No Events Today" if there are no events on that day. When i added the else to this block of code it worked for showing no events for the day but it had the side effect of only showing a max of one event for the day even if there are more than one. i'm referring to the $todaysevents var. i am not sure of the logic i should use here. any help?


while ($event=$DB_site->fetch_array($events)) {
if ($event[eventdate]==vbdate("Y-m-d",time())) {
$eventsubject=htmlspecialchars($event[subject]);
$todaysevents="
<li><smallfont><b><a href=\"$bburl/calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$event[eventid]\">$eventsubject</a></b></smallfont></li>";
} else {
$todaysevents="<li><smallfont><b>No Events Today</b></smallfont></li>";
}
}

Jakeman
12-02-2001, 05:15 PM
i also noticed a problem on the evening of Nov 30. it seems that the month rotation is based on the server time without accounting for the user's time offset. but then the linked days are for whatever month it is after taking the time offset into account. so then when you click on days it takes you to the next month instead of the previous month. dunno if this makes sense. :p

wajones, i think you aren't taking the user's time offset into consideration for all parts of the calendar.

...still didn't get that 'No events today' condition working.

Jakeman
12-05-2001, 06:58 AM
i got the 'No Events Today' condition working. instructions for those that want to add this:

find:


while ($event=$DB_site->fetch_array($events)) {
if ($event[eventdate]==vbdate("Y-m-d",time())) {
$eventsubject=htmlspecialchars($event[subject]);
$todaysevents.="
<li><smallfont><b><a href=\"$bburl/calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$event[eventid]\">$eventsubject</a></b></smallfont></li>";
}
}


after it add this:


if (!$todaysevents) {
$todaysevents="<li><smallfont><b>No Events Today</b></smallfont></li>";
}


i did it all by myself! woo woo! :cool:

Craig Antill
01-27-2002, 12:00 PM
How do I include this on a non vB .php page ??

I get the following error:

Warning: Failed opening 'global.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr/www/craig/craigantill/html/forum/cal.php on line 4

Fatal error: Call to undefined function: vbdate() in /usr/www/craig/craigantill/html/forum/cal.php on line 9

sccr410
01-31-2002, 07:18 PM
Do you have it in the 'forum' directory? I just installed this hack ( http://www.sandiegopegasus.com ) and it worked perfectly.

Craig Antill
01-31-2002, 08:26 PM
Sure do.

kypdurron
02-01-2002, 10:00 PM
did anyone solve the "birthday not showing" bug?

mondaynightmike
02-13-2002, 01:59 PM
I am also having the problem of it not running on vbulletin.

When i run http://www.f1modelnews.com/modelforums/cal.php it works fine, yet i want to include it on my main forums page and all i get is a load of code and all the colours are changed and it messes up my whole layout.

any help?????

syion
04-03-2002, 01:21 AM
I can run the cal.php by calling it by it self (see link below)
http://www.vfdbl.com/forum/cal.php

When I try to include the cal.php in another page I get a bunch of errors. I created a simple *.php file to call the cal.php in see link below
http://www.vfdbl.com/calendar.php (not to be confused with forum/calendar.php)

Below if the script that I included inside the calendar.php page that I am using to call up the cal.php



<?php ?>
<meta http-equiv="Content-Language" content="en-us">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="200" id="AutoNumber1">
<tr>
<td>
<?php include ("http://www.vfdbl.com/forum/cal.php"); ?>
&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>



I know several others have indicated that they have had the same problem but I do not know how they corrected it.

Please Help :)

syion
04-03-2002, 07:10 PM
I have been reading over the posts and it seems a number of people can get this calendat to work by calling up the cal.php file; However many including my self can not get the cal.php file to work on non vb pages.

I have tried numerous times to include cal.php in my web stites non-vb pages. Can some one please post some answers to this problem here. It would help a number of us out.

Thanks

See my links in the previous post to see what I mean :confused:

***UPdate***# 1

If you try and include the cal.php inside a non vb page that is not inside the forums directory it does not work ! Please prove me wrong :)

<?php include ("http://www.vfdbl.com/forum/cal.php"); ?>

This is what code i am using to embed cal.php in non vb pages in my website - I can not get it to work if the file is out side of the forums dir.

***Update*** # 2
I have found out what the problem is but do not know how to fix it.

I created a file called test.php all the file contained is this :

<?php include ("http://www.vfdbl.com/forum/cal.php"); ?>

Test php is supposed to include cal.php As you can see I saved test.php in the forums dir along with cal.php

I then tried to call up test.php this is very weird - it brought be first to the login page for my VB site the URL up top still said http://www.vfdbl.com/forum/test.php so I was at the correct page. i then entered my username and password and it then showed me the "thank you for logging in, username" and the URl changed to http://.........../members.php then I was taken to the cal.php file and the calendar showed up fine. The url has now changed to

http://www.vfdbl.com/forum/cal.php?

My understanding is if you include a php in test.php and you call up test.php the url should remain test.php and display what ever file you called up inside test.php - this seems to not be working correctly

I will keep you posted as to my progress and if others can help we who are having trouble would appreciate it - thanks

syion
04-03-2002, 09:10 PM
I found it all came down to the security settings in the admin panel.

I had to change a setting for this group:

Unregistered / Not Logged In

I had to allow this group to view the board

I had previously disabled all of their rights. Now I have enabled only the allow them to view the board.

I have been able to now embed the cal.php file inside files outside of vb and the forums directory.

This will explain why some people could get it to work and others could not.

Cheers - i hope this helps :D

jarvis
04-04-2002, 02:58 AM
Hmm... I had already allowed guests to view my board... I really think it comes down to whether user is browsing using cookies or not. Just a guess, but my calendar is a bunch of gibberish when included on my home page (shtml).

I wish someone would take a look at this hack again, because it would be nice to add to a non-Vb page. :(

filburt1
04-08-2002, 01:58 AM
Originally posted by kypdurron
did anyone solve the "birthday not showing" bug?

I'm trying to get birthdays as well as public events to show up on my minical, anybody fixed this?

mbaskett
07-09-2002, 02:53 PM
Originally posted by Jakeman
it worked. i had to remove everything outside of the <?php ?> and also remove the include global.php in the cal.php file for it to work. however, it "breaks" my calendar while the phpinclude template is including cal.php . the symtoms are the same as what sysmom described in this thread for the today's events hack: https://vborg.vbsupport.ru/showthread.php?s=&threadid=21232&perpage=15&pagenumber=5

it must be something in the cal.php file that is conflicting. if that file is included in the phpinclude it breaks my calendar regardless of whether i'm using the calendar variable on my pages or not... when i remove the include for cal.php everything works again. sysmom suggested it may be a variable getting tromped on.

once again, your help is greatly appreciated. :)

I sure would like to see an actual code fix for this... that workaround is not feasible for alot of people, especially those who use other code in the phpinclude template (such as the remove register icon if logged in (https://vborg.vbsupport.ru/showthread.php?s=&threadid=33051))

Any hope of finding what's breaking the calendar pages?

Dean C
07-15-2002, 01:27 PM
i would love this on a non-vb php page in my forums directory... but im getting the same errors as everyone else

Sod
07-17-2002, 05:21 PM
I've been trying to set this up on a non VB .shtml page for a few days now and think I've found the reason why some people are getting gibberish whenever they try to load this on a .shtml page.

I use the following call from my home page to load the calendar:

<!--#include virtual="forum/cal.php" -->

What I've discovered is that if certain settings are enabled in the browser (both IE and Netscape), I get gibberish when I view the page.

http://www.sitordance.com/http1.1.gif

On all systems I've tried (4 - windows nt, 2000 and XP running IE 6 and Netscape 4.75), the call above produces garbage if the "Use HTTP1.1 through proxy connections" option in IE is enabled.

On some systems, the include call above works (but not on WinXP) if only "Use HTTP 1.1" is enabled.

Result: Disabling "Use HTTP1.1 through proxy connections" allows viewing the mini calendar through the call on some machines. On XP, both options need to be disabled before the calendar is displayed properly.

Note: Just loading the "cal.php" page by itself without using the SSI call above works without disabling either of the options above.

To disable the options in IE: Go to the Tools menu > Internet Options > Advanced. The HTTP options should be about halfway down.

Can anyone else confirm these findings?

Kars10
07-24-2002, 08:30 PM
Hello Guys!!
Can someone please tell me what exactly is to do, to run this calendar on my Vbindex page (home.php)??
I read the current posts but thats not really helpfull to me.
Thanks very much! ;)

rustylewis
07-24-2002, 09:29 PM
I guess I will throw in here. I was able to get this working on one of my sites. This is a page I created so I could keep up with what is going on using active desktop.

http://www.northwestdiver.com/test/activedesktest.php

I used the code pretty much just like wajones posted it. I did add a $templatesused variable for the template it uses (which I have no idea if it needs it or not. I also change include global to require global.

I put the code in a cal.php page in the forums directory. I then used an include with the full url

<?php include('http://www.domain.com/forum/cal.php');?>

It seems to work just fine.

I don't know if that helps anyone or not. Just my experience ...

Megabit
07-24-2002, 11:20 PM
Minifreunde...

In testing, I was able to get this working with Vbindex. Basically here is a method that worked in my test (much of which is contained within this thread)...
[list=1] Create a new template called "small_calendar"
Cut and paste the included template from the cal.php.txt file script into the new "small_calendar" template that you created. Save the cal.php.txt file with all of the template text removed (all that should be left is what is between the<?php and ?> on the first and last lines of the text file).
Rename the cal.php.txt to cal.php and copy it to your forums directory.
Run the cal.php file (from your forums directory) in your browser. Make sure that the file works - and displays a calendar. If the calendar does not display here, you'll need to figure out the problem before proceeding (if it doesn't work here, it won't work when you go to display it on your Vbindex home page.
Replace the following text in the cal.php file:
eval("dooutput(\"".gettemplate(small_calendar)."\");"); with
eval("\$smallcalendar .= \"".gettemplate("small_calendar")."\";");
Remove the following line from cal.php file (for it to work properly): include global.php.
Perform the following edits, based on Jakeman's suggestions, so that the Big VB Calendar will continue to work (this essentially removes the phpinclude template from the calendar pages):

Copy the global.php to a new file called calglobal.php.

Edit the calglobal.php file and remove (or comment out) the line that is just under the Parse PHP include statement.

Edit the calendar.php file (provided by Vbulletin) and change the require statement (on line 7) from global.php to calglobal.php.
Edit the "phpinclude" template (this template comes with VBulletin) - and add the text include 'cal.php'; to it - and be sure to save the template. This will allow the calendar to be used in any of the Vbindex templates.[/list=1]
Now, you need to decide where to display the calendar. I tested it in the "home_right" template that you create as part of the Vbindex installation - but you could easily put it in the "home_left" template as well. You'll need to edit the template and set up the code (you'll need to know a little HTML) to display the calendar. Just put in $smallcalendar wherever you want the calendar to display.

Important Note:
I found that I had to shrink the default calendar down to fit into the right column. To do this, I had to edit the "small_calendar" template (where I added the font face and size specifications, as well as changed the width).

If you need some more specific info on how I edited the "home_right" and "small_calendar" templates to fit it all in, let me know (note that I'd encourage you to play with the settings in these templates to make it look the way that you'd like it - as you could use a variety of choices here).

Hope this helps you to try it out on your Vbindex home page.

Dean C
07-25-2002, 01:28 PM
wicked... ill try this 2nite :D

Kars10
07-25-2002, 02:03 PM
I?ve tried and the calendar worked separatly on cal.php.
But i?ve include it in to my vbindex - no chance.
@ Megabit, can i send you my home.php (vbindex-site) and my cal.php to you? Please help me?? :confused:

Megabit
07-25-2002, 08:28 PM
Minifreunde... You can send them to me, but unless you have some major changes in one or both of those files, then I suspect that the problem may not be with those files.

Are you sure that your Vbindex templates are coded correctly? For example, if you accidentally do not code the template correctly, the calendar will not display. If you like, I can send you a sample text file that you could just copy and paste into the Vbindex template to see if that works for you.

Kars10
07-26-2002, 06:11 AM
Hello Megabit.
I used vbindex with some changes but all workes perfect for me.
When you "PM" me your Email-Adress i will send ?ou my codes.
This would be a big help for me.
I mean if i run cal.php it works and when i include cal.php in the phpinclude template i get a parse error with this ()..in Line 110 if i run the cal.php. Is there also a way to place the hole cal.php code in the vbindex file??
I am a very relaxed worker and think about every step i make.
This is not my first modi and here i get some major problems... :confused:

Kars10
07-26-2002, 04:58 PM
Hello Guys!
It works!!! Ive put the code in the vbindex.php and now it works!!!
Thanx for you´re help.
One Question: how can i change the dateformat?
Curently it looks like: July 26, but i want it look like 26 Juli (because Germany).

Megabit
07-26-2002, 08:54 PM
Minifreunde... Glad to see that you have it working. Since it's working within the vbindex.php file, maybe there was just a missing or out of place parenthesis, or an extra space somewhere in the cal.php file - since you said that you were getting a parse error (and Line 110 just contains right bracket, I believe). I had originally thought that it just wasn't displaying on you vbindex page (without an error), but anyway, glad to see that you're working now.

As for your date/language format, I believe that you would have to set the locale with the following string:

setlocale (LC_TIME, "de_DE");

Then, find the line "$cal_date=strftime('%B %e');" in the cal.php file (or where you have it in your vbindex home page - since you put the cal.php file there). You may need to change this to "$cal_date=strftime('%e %B');" - as the %e gives you the day and the %B gives you the month (so this would reverse the string order).

I don't have the issue with changing the language - so all I can do is tell you to try it and see if it works. By the way, note that the locales are OS dependent and have to exist on the system that this is running on - and there could be more than one German locale.

For more on the strftime function and the locale settings in PhP, check out:
http://php.benscom.com/manual/en/function.strftime.php

Kars10
07-27-2002, 06:01 AM
Thanx Megabit that worked for me!!!
This calendar rules, my users love it!! ;)

Megabit
07-28-2002, 11:23 PM
Glad that worked for you Minifreunde! You are very welcome...

SuB_ZeR0
09-09-2002, 09:31 PM
hey ... what do I need to do to change the current date's square so that it stands out with a different color? Like the big calendar style, without changing the "firstaltcolor" and "secondaltcolor"... Thanks.

evilholli
09-25-2002, 03:59 AM
Originally posted by Minifreunde
I?ve tried and the calendar worked separatly on cal.php.
But i?ve include it in to my vbindex - no chance.
@ Megabit, can i send you my home.php (vbindex-site) and my cal.php to you? Please help me?? :confused:

hi... I'm having the same problem... could someone please help me fix this? :)

wajones
09-25-2002, 04:18 AM
I only support vbPortal, sorry...

-----Original Message-----
From: vBulletin.org Forum Mailer [mailto:post@vbhacks.com]
Sent: Tuesday, September 24, 2002 9:59 PM
To: waj@adelphia.net
Subject: Mini Calendar from vbPortal

Hello wajones,

evilholli has just replied to a thread you have subscribed to entitled -
Mini Calendar from vbPortal - in the Full Releases forum of
vBulletin.org Forum.

~~~~~ NEW ~~~~~
New at vBulletin.org!
You can now reply to the thread by replying to this message. All you
need to do is to make sure this code appears in the e-mail subject:

You should also remove this text to ensure your reply is readable by
other forum users.
~~~~~ NEW ~~~~~

Here are the contents of the post:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Originally posted by Minifreunde
I?ve tried and the calendar worked separatly on cal.php.
But i?ve include it in to my vbindex - no chance.
@ Megabit, can i send you my home.php (vbindex-site) and my cal.php to
you? Please help me?? :confused:

hi... I'm having the same problem... could someone please help me fix
this? :)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This thread is located at:
https://vborg.vbsupport.ru/showthread.php?threadid=32087&goto=newpos
t

There may be other replies also, but you will not receive any more
notifications until you visit the board again.

Yours,
vBulletin.org Forum team

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unsubscription information:

To unsubscribe from this thread, please visit this page:
https://vborg.vbsupport.ru/member2.php?action=usub&threadid=32087

To unsubscribe from ALL threads, please visit this page:
https://vborg.vbsupport.ru/member2.php?action=usub&type=allthread

bouncer18
10-15-2002, 04:51 AM
mm cant get it to work either...
owell

groovesalad
10-19-2002, 02:12 AM
Did anyone ever figure out why you can't post public events once this mini calendar is installed?

SpankMe
10-23-2002, 07:32 AM
Just installed this hack on my newly started Kiwi Biker forums (http://www.kiwibiker.co.nz) . It going to be an excellent tool for help users keep track of current and furture motorbike events.

Hazaar to wajones :D

FleaBag
11-02-2002, 03:09 PM
Any idea how to make this work with vBindex?

Tigga
11-02-2002, 03:21 PM
[QUOTE]Originally posted by GamerForums
Any idea how to make this work with vBindex?

FleaBag
11-03-2002, 08:50 PM
I took a look at your code but wasn't sure how to port that into vBindex 'cos I didn't look at your templates.

NTLDR
11-03-2002, 09:03 PM
Search the vBindex thread, I know this calendar was talked about there and i think I posted instructions on how to add it.

Tigga
11-03-2002, 11:07 PM
Gamerforums - Check your PM's. I sent you the template for the calendar, so hopefully that'll help. :)

lifesourcerec
01-15-2003, 06:14 AM
Originally posted by Jakeman
i got the 'No Events Today' condition working. instructions for those that want to add this:

find:


while ($event=$DB_site->fetch_array($events)) {
if ($event[eventdate]==vbdate("Y-m-d",time())) {
$eventsubject=htmlspecialchars($event[subject]);
$todaysevents.="
<li><smallfont><b><a href=\"$bburl/calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$event[eventid]\">$eventsubject</a></b></smallfont></li>";
}
}


after it add this:


if (!$todaysevents) {
$todaysevents="<li><smallfont><b>No Events Today</b></smallfont></li>";
}


i did it all by myself! woo woo! :cool:

Now, which file is this referring to?

lifesourcerec
01-15-2003, 09:05 AM
This the only code I see close to it


while ($event=$DB_site->fetch_array($events)) {
$eventsubject = htmlspecialchars($event[subject]);
if ($caltitlelength != 0 and isset($caltitlelength)!=0)
{
if (strlen($eventsubject) > $caltitlelength)
{
$eventsubject = substr($eventsubject,0,$caltitlelength) . "...";
}
}

PennylessZ28
02-19-2003, 01:17 PM
Originally posted by Megabit
Minifreunde...

In testing, I was able to get this working with Vbindex. Basically here is a method that worked in my test (much of which is contained within this thread)...

[list=1]
Create a new template called "small_calendar"

Cut and paste the included template from the cal.php.txt file script into the new "small_calendar" template that you created. Save the cal.php.txt file with all of the template text removed (all that should be left is what is between the<?php and ?> on the first and last lines of the text file).

Rename the cal.php.txt to cal.php and copy it to your forums directory.

Run the cal.php file (from your forums directory) in your browser. Make sure that the file works - and displays a calendar. If the calendar does not display here, you'll need to figure out the problem before proceeding (if it doesn't work here, it won't work when you go to display it on your Vbindex home page.

Replace the following text in the cal.php file:
eval("dooutput(\"".gettemplate(small_calendar)."\");"); with
eval("\$smallcalendar .= \"".gettemplate("small_calendar")."\";");

Remove the following line from cal.php file (for it to work properly): include global.php.

Perform the following edits, based on Jakeman's suggestions, so that the Big VB Calendar will continue to work (this essentially removes the phpinclude template from the calendar pages):

Copy the global.php to a new file called calglobal.php.

Edit the calglobal.php file and remove (or comment out) the line that is just under the Parse PHP include statement.

Edit the calendar.php file (provided by Vbulletin) and change the require statement (on line 7) from global.php to calglobal.php.

Edit the "phpinclude" template (this template comes with VBulletin) - and add the text include 'cal.php'; to it - and be sure to save the template. This will allow the calendar to be used in any of the Vbindex templates.
[/list=1]
Now, you need to decide where to display the calendar. I tested it in the "home_right" template that you create as part of the Vbindex installation - but you could easily put it in the "home_left" template as well. You'll need to edit the template and set up the code (you'll need to know a little HTML) to display the calendar. Just put in $smallcalendar wherever you want the calendar to display.

Important Note:
I found that I had to shrink the default calendar down to fit into the right column. To do this, I had to edit the "small_calendar" template (where I added the font face and size specifications, as well as changed the width).

If you need some more specific info on how I edited the "home_right" and "small_calendar" templates to fit it all in, let me know (note that I'd encourage you to play with the settings in these templates to make it look the way that you'd like it - as you could use a variety of choices here).

Hope this helps you to try it out on your Vbindex home page.

Followed your directions to the tooth.... but

I am geting
Parse error: parse error, unexpected T_IF in /disk3/home2/web/beginner/fbody/forum/global.php(304) : eval()'d code on line 10
At the top of my forum and vbindex pages.

The cal.php file works fine in /forum/ however outside of the forum page it does not.

Any suggestions?

PennylessZ28
02-19-2003, 01:52 PM
Alright when I removed the include from the phpinclude, my error went away. However I still couldn't get it to show up with vbindex.

I have the most recent version of vbulletin 2.3 and vbindex.

So here is what I did, I opened up the vbindex file and added

require('./cal.php');

right underneath require('./global.php');

Then I inserted $calendar in a spot in my home template.

This of course after already doing some of the things you said to do. for anyone following along, I suggest you go read the vbindex thread as well, I spent some time reading both of these and after tinkering I got it to work.

catocom2
03-20-2003, 11:28 AM
Cool Hack!
Thanks
and thanks to Jakeman, and Megabit for the instruction. :cool:

catocom2
03-21-2003, 09:11 PM
Well I thought I had this one set.
Everything seems to be working great, except when I
try to download attachments. I get these errors...

Warning: Cannot add header information - headers already sent by
(output started at /home/threadwo/public_html/forum/cal.php:120)
in /home/threadwo/public_html/forum/attachment.php on line 54

Warning: Cannot add header information - headers already sent by
(output started at /home/threadwo/public_html/forum/cal.php:120)
in /home/threadwo/public_html/forum/attachment.php on line 55

Warning: Cannot add header information - headers already sent by
(output started at /home/threadwo/public_html/forum/cal.php:120)
in /home/threadwo/public_html/forum/attachment.php on line 56

Warning: Cannot add header information - headers already sent by
(output started at /home/threadwo/public_html/forum/cal.php:120)
in /home/threadwo/public_html/forum/attachment.php on line 57

Warning: Cannot add header information - headers already sent by
(output started at /home/threadwo/public_html/forum/cal.php:120)
in /home/threadwo/public_html/forum/attachment.php on line 58

Warning: Cannot add header information - headers already sent by
(output started at /home/threadwo/public_html/forum/cal.php:120)
in /home/threadwo/public_html/forum/attachment.php on line 62

(then some jiggerish, depending on what the file is)

If I disable the minical, the attachments d/l fine.
Also the upload is fine.

Anybody have any ideas?

catocom2
03-21-2003, 09:46 PM
Well,
it seems I do have some other problems. :(
I'm gonna have to backup through the stagged backups
I've made, and see if I can see where the other problems
are coming from.

pdatoon
05-07-2003, 03:26 PM
10-23-02 at 09:32 AM SpankMe said this in Post #59 (https://vborg.vbsupport.ru/showthread.php?postid=312878#post312878)
Just installed this hack on my newly started Kiwi Biker forums (http://www.kiwibiker.co.nz) . It going to be an excellent tool for help users keep track of current and furture motorbike events.

Hazaar to wajones :D


Hi man,

I have seen that you had Event today and Coming events listed at the bottom of the small calendar. Could you tell me how you do that? Mine just have the calendar :surprised:

pdatoon
05-08-2003, 09:11 AM
Anyone? :(

gmarik
05-24-2003, 08:39 AM
Guys, how is it with 2.3?

CatholicSin
06-15-2003, 03:24 PM
I am curious, what does this error message mean (what did I do wrong with my install?) if anyone can help it would be great.


Fatal error: Call to undefined function: vbdate() in /home/lochlain/domainname/docs/TMP3lgljgj6wr.php on line 141

mbowers
06-30-2003, 03:33 AM
Just installed this (w/ myvbindex) - pretty cool hack. Just wondering, where it shows today's event underneath the calendar, is it possible to have that text change when you rollover other dates that have events posted? Like, let's say it's Thursday, and Thursday is user BoBo's birthday. On Friday, someone has posted a calendar event for BoBo's birthday party. If you rollover Friday's date, the text changes from "Today's Events: BoBo's Birthday!" to "Events for Friday, June 27th: BoBo's Birthday Party"...

...you get the idea..

Mbow

bosix
08-02-2003, 11:34 PM
01-31-02 at 10:18 PM sccr410 said this in Post #31 (https://vborg.vbsupport.ru/showthread.php?postid=217205#post217205)
Do you have it in the 'forum' directory? I just installed this hack ( http://www.sandiegopegasus.com ) and it worked perfectly.



puff anyone help me

I showing my calender non-vbpage like http://www.sandiegopegasus.com site.

my calender showing cal.php www.electronicafe.com/forum/cal.php

and future events show smp: in 15 days birthdays & public events


Sorry My english bad :(

Russ_T
12-18-2003, 08:45 PM
Ok its been working fine with myvbindex for a while now but I would like to change it so instead of showing todays events, it shows upcoming events (and I specify in my php say the next fortnight).

I've tried to do this myself but to no avail, anyone fancy working with me on it? I think it would be a good change to the mod (if wajones is too busy to help of course).

Thanks for the mod wajones!

WeBBy
12-19-2003, 04:43 AM
I installed this calendar on a site I am building and I love it! :D It was just the ticket I needed....

But, I did notice that many of my errors (doin allot of mods), all have this "// End of vbPortal calendar script" showing up, even though the script may not even be called at the time. Anyway, that I can live with and so I forgot about it.

You can check it out by simply going to http://www.basementsystems.com/dealerarea/. You get an error because the index.php file needs a specific template in order to work. The actual error is no template for the index.php to use, so blank page. But why the cal script end comment????

Now, I installed the OakGalley hack and I cannot upload any images. The reason seems to be the cal.php script. This is the error I am getting:

Warning: Cannot modify header information - headers already sent by (output started at /home3/www/basementsystems/dealerarea/cal.php:121) in /home3/www/basementsystems/dealerarea/gallery/upload_handle.php on line 108

So, it would seem that cal.php is running in the background or something. I also noticed, about the time I installed the script, that pages will not auto-redirect anymore (haven't tried to fix that yet), but now I am thinking that maybe this is all inter-related.

Any ideas? Any help?

Thanx

EDIT: IGNORE THIS POST (I really should just delete this post but maybe someone is as stupid as I am and will be helped by it). Removing the end comment "<-- End of vbPortal calendar script" solved the whole problem. What a dumb ass .. lol :O

Russ_T
12-26-2003, 11:10 PM
Ok heres my little contribution. It's a quick and dirty fix but it's the only way I could think to do it using the current structure and not knowing any sql didn't help. I really need a book.

Ok in index.php replace


// vbPortal mini calendar - by wajones
if ($showcalendar) {
$year = date('Y');
$doublemonth = vbdate('m',time());
$month = date('n');
$day = '1';
$today = vbdate('m-d',time());
$events=$DB_site->query("SELECT eventdate,subject,eventid,public FROM calendar_events WHERE eventdate LIKE '$year-$doublemonth-%' AND ((userid='$bbuserinfo[userid]' AND public='0') OR (public='1'))");
while ($event=$DB_site->fetch_array($events)) {
if ($showtodaysevents AND $event[eventdate]==vbdate('Y-m-d',time())) {
$eventsubject = htmlspecialchars($event['subject']);
if ($event['public']=='1') {
$todaysevents .= "<li><a href=\"$bburl/calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$event[eventid]\"><smallfont color=\"{calpubliccolor}\">$eventsubject</smallfont></a></li>";
}
if ($event['public']=='0') {
$todaysevents .= "<li><a href=\"$bburl/calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$event[eventid]\"><smallfont color=\"{calprivatecolor}\">$eventsubject</smallfont></a></li>";
}
eval("\$eventstoday = \"".gettemplate('index_calendar_todaysevents')."\";");
}
}
if (!$bbuserinfo['startofweek']) {
$bbuserinfo['startofweek'] = '1';
}


with


if ($showcalendar) {
$year = date('Y');
$doublemonth = vbdate('m',time());
$month = date('n');
$day = '1';
$today = vbdate('m-d',time());
$events=$DB_site->query("SELECT eventdate,subject,eventid,public FROM calendar_events WHERE eventdate LIKE '$year-$doublemonth-%' AND ((userid='$bbuserinfo[userid]' AND public='0') OR (public='1')) ORDER BY eventdate");
while ($event=$DB_site->fetch_array($events)) {
$thetime = time();
for ($i = 0; $i < 14; $i++) {
if ($showtodaysevents AND $event[eventdate]==vbdate('Y-m-d',$thetime)) {
$eventsubject = htmlspecialchars($event['subject']);
if ($event['public']=='1') {
$todaysevents .= "<li><a href=\"$bburl/calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$event[eventid]\"><smallfont color=\"{calpubliccolor}\">$eventsubject</smallfont></a></li>";
}
if ($event['public']=='0') {
$todaysevents .= "<li><a href=\"$bburl/calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$event[eventid]\"><smallfont color=\"{calprivatecolor}\">$eventsubject</smallfont></a></li>";
}
eval("\$eventstoday = \"".gettemplate('index_calendar_todaysevents')."\";");
}
$thetime = $thetime + 86400;
}
}
if (!$bbuserinfo['startofweek']) {
$bbuserinfo['startofweek'] = '1';
}

$enddate = time() + 1209600;
$doublemonth = vbdate('m',$enddate);
$year = vbdate('Y',$enddate);

$events=$DB_site->query("SELECT eventdate,subject,eventid,public FROM calendar_events WHERE eventdate LIKE '$year-$doublemonth-%' AND ((userid='$bbuserinfo[userid]' AND public='0') OR (public='1')) ORDER BY eventdate");
while ($event=$DB_site->fetch_array($events)) {
$thetime = time();
for ($i = 0; $i < 14; $i++) {
if ($showtodaysevents AND $event[eventdate]==vbdate('Y-m-d',$thetime)) {
$eventsubject = htmlspecialchars($event['subject']);
if ($event['public']=='1') {
$todaysevents .= "<li><a href=\"$bburl/calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$event[eventid]\"><smallfont color=\"{calpubliccolor}\">$eventsubject</smallfont></a></li>";
}
if ($event['public']=='0') {
$todaysevents .= "<li><a href=\"$bburl/calendar.php?s=$session[sessionhash]&action=getinfo&eventid=$event[eventid]\"><smallfont color=\"{calprivatecolor}\">$eventsubject</smallfont></a></li>";
}
eval("\$eventstoday = \"".gettemplate('index_calendar_todaysevents')."\";");
}
$thetime = $thetime + 86400;
}
}

if (!$bbuserinfo['startofweek']) {
$bbuserinfo['startofweek'] = '1';
}

$year = date('Y');
$doublemonth = vbdate('m',time());
$events=$DB_site->query("SELECT eventdate,subject,eventid,public FROM calendar_events WHERE eventdate LIKE '$year-$doublemonth-%' AND ((userid='$bbuserinfo[userid]' AND public='0') OR (public='1')) ORDER BY eventdate");
while ($event=$DB_site->fetch_array($events)) {}


Then just alter the index_calendar_todaysevents template to read something like

Next fortnight's events

instead of

Today's events


And that should work fine.

BUT this horrid work around adds two more queries to your home page and is generally horrid. Now can someone with some skill and time turn that code into something pretty please?

All credit to wajones for the original code for me to hack about though. Thank you.


(working demo at http://www.zclub.net :) )

vdich
03-12-2004, 06:00 PM
Ok heres my little contribution. It's a quick and dirty fix but it's the only way I could think to do it using the current structure and not knowing any sql didn't help. I really need a book.

Ok in index.php replace




with




Then just alter the index_calendar_todaysevents template to read something like

Next fortnight's events

instead of

Today's events


And that should work fine.

BUT this horrid work around adds two more queries to your home page and is generally horrid. Now can someone with some skill and time turn that code into something pretty please?

All credit to wajones for the original code for me to hack about though. Thank you.


(working demo at http://www.zclub.net :) )


Sorry, but it dont work on my page..... (Next fortnight's events)