vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Mini Calendar from vbPortal (https://vborg.vbsupport.ru/showthread.php?t=32087)

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/showthrea...5&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

Quote:

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

Quote:

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>

Quote:

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?

Code:

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:

Code:

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:

Code:

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:

Quote:

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

Quote:

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

Quote:

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/showthrea...5&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)

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


All times are GMT. The time now is 07:45 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03146 seconds
  • Memory Usage 1,839KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete