PDA


View Full Version : ported the upcoming events hack


Pages : 1 2 3 [4] 5

FragMaster B
04-14-2005, 08:52 PM
Thanks for all your help on this Tom. I copied your stuffinto my two templates and the minicalendar.php file. The Birthdays came in just fine. Same effect of no events tho... hmmm... I'll have to keep searching. Must be something in my settings. I only have one Calendar... so I don't think it's looking at the wrong calendar or anything.

Oh... I have yet to make any changes at all to the functions.php as I couldn't find that line in mine and a few other people in this thread stated they got it working without changing that file.

Let me know if anything esle comes to mind. Thanks again.

Tom M
04-14-2005, 10:11 PM
Oh... I have yet to make any changes at all to the functions.php as I couldn't find that line in mine and a few other people in this thread stated they got it working without changing that file.The only way to get it to work w/o changing functions.php is to change the internal name from 'adv_index' to 'index'. However doing so may cause other add-ons to break.

In my version of functions.php (3.0.3) I changed this
// query calendar permissions
if (THIS_SCRIPT == 'online' OR THIS_SCRIPT == 'calendar' OR (THIS_SCRIPT == 'index' AND $vboptions['showevents']))to// query calendar permissions
if (THIS_SCRIPT == 'online' OR THIS_SCRIPT == 'calendar' OR (THIS_SCRIPT == 'adv_index') OR (THIS_SCRIPT == 'index' AND $vboptions['showevents']))
This is line 2996 in 3.0.3 and 3139 in vb 3.0.7.

Webber
04-15-2005, 02:10 PM
This is driving me nuts LOL... I have tried every variation but still cannot cause the minicalender to show events today.

If you look at the calendar on this page:http://www.yourlincolnpark.com/lpsforum/showthread.php?t=4494
on the right you will see a mini calendar on today's date I have several events (if you look at the calendar.php page but in this calendar it is unlinked as if there are no events.

Now if you go to this page:
http://yourlincolnpark.com/lpsforum/index.php
you will see that today's day in the calendar is Linked to the calendar events.

This is the same for the main forums page as well.

The template and module page is the exact same for the module created for the showthread page as it is for the index and the forumdisplay pages.

Why won't today's date show linked to the events?

This is frustrating....please save what little non gray hair I have and advise how to fix this.

Thanks in advance

Tom M
04-15-2005, 02:20 PM
Why won't today's date show linked to the events? Have you made the CMPS file edit to includes/functions.php?

Nautiqeman
04-19-2005, 05:13 PM
Maybe I missed this but how can you get your mini calendar to have links for the days there is an event? I know it works with the big calendar but how do you do it with the mini calendar?

Annunu
04-24-2005, 10:38 AM
I installed this and it seems I did something wrong.

On my main CMPS page, my mini calendar will highlight days which have events, but not the birthdays.

And, it doesn't highlight anything on the other pages such as my forums page.

And lastly, it always says "no events are scheduled" underneath the calendar since I've added this script.

Anyone know what I've done wrong, or at least can get me started on the right track to fixing this? (I'm an amateur at this scripting stuff).

Tom M
04-24-2005, 01:19 PM
Anyone know what I've done wrongDo you have a link? It's easier to make an educated guess when it can be seen running ;)

Annunu
04-24-2005, 09:18 PM
Yes,
Here is my main page. As you can see it seems to work (except birthdays), but it only shows up things I've posted, not things other people have posted.

http://www.tsforces.com/wbb/
And, here is the forums where it doesnt seem to work at all. Well it seems to show up red date if the same user is logged on. But, it doesn't show other events by other users, and nothing goes on the listing of events for some reason.

http://www.tsforces.com/wbb/forumlist.php

Tom M
04-24-2005, 09:56 PM
Guests aren't able to see the calendar...

The changes to implement this should have no impact on the way the forums work as it's isolated to CMPS. If the calendar events displayed properly before doing the update then the question is "what else changed?". We're any other changes made to includes/functions.php?

Annunu
04-24-2005, 11:27 PM
Well there were errors on the calendar on the forumlist.php page before I made the update.

But, why isn't the events listed for all events on the main page? Why is it that I can only see the events I posted listed underneath, and not the ones other people have posted?

Tom M
04-24-2005, 11:54 PM
Which set of instructions did you follow? The most recent are in this post (http://www.vbadvanced.com/forum/showpost.php?p=41359&postcount=150).

Did you also make the changes necessary to get the CMPS minicalendar to work in functions.php?

Annunu
04-25-2005, 11:29 PM
Thanks so much for your help Tom.

I did go through all the steps again and I'm finding that this just isn't working with my template pages. It works with new modules, but not templates. For example, my forumlist is a template (not a module), so I'm predicting there is something wrong in the way my calendar is set up.

I did have that line changed in functions.php, but is there a second line I may be missing?

Tom M
04-26-2005, 12:18 AM
Well, since even a module is really a dynamically driven template that shouldn't make any difference. Feel free to email me the templates/modules you're using & I'll take a look at them if you like. However the real issue may be discovering why the calendar portion of FORUMHOME isn't working properly.

Annunu
04-26-2005, 08:19 AM
Yes it seems that if it's a CMPS page it works. If it's a template it doesn't.
Unless they were the ones above (which I redid last night), Could you maybe direct me to the scripting for the php files I could redo again, and/or the template files?
I am assuming it's reading the module/templates okay since that way works. But, when a regular page wants to call it up, it only shows odd listings.

sunnycher
04-28-2005, 05:59 PM
I followed the instructions to the T.
Can't get the birthdays to show up.
and instead of it using it's own module, it's at the bottom of the calendar.
Any ideas?
TIA!!
Cher
www.littlegreenphotographers.com/community
it's on the left.

Which set of instructions did you follow? The most recent are in this post (http://www.vbadvanced.com/forum/showpost.php?p=41359&postcount=150).

Did you also make the changes necessary to get the CMPS minicalendar to work in functions.php?

sunnycher
04-28-2005, 06:34 PM
Ok, got the birthdays to show but they have to be within a few days. How can I change it to show birthdays for the next 30 days?

Tom M
04-28-2005, 07:49 PM
Ok, got the birthdays to show but they have to be within a few days. How can I change it to show birthdays for the next 30 days?Check the number of days you have in your Admincp -> vBulletin Options -> Forum Home Page Options -> Display Calendar Events?

Loco Macheen
05-09-2005, 04:03 AM
how do i let guest see events ?
i've had no problems,, great mod. other then i'd like guest to see the events.

thank you

Samir
05-10-2005, 04:22 AM
I believe you need to set the calendar permissions so that guests can view calendar events.

mfarmerhi
05-10-2005, 06:20 AM
Awesome -- thanks to everyone for this one. Used the http://www.vbadvanced.com/forum/showpost.php?p=41359&postcount=150 txt file. Got it installed. Works great.

A question:

I'd actually like to disable the "Upcoming Events" on the Forum display; but keep it on the CMPS index page.

Should be able to do that by editing either the php or one of the templates to replace the variable for "# of days ahead to display" (whatever that variable is actually called) and simply inserting X (how many days ahead you'd like events displayed for).

2 Questions: First, is that ^ correct?
Second, if I'm correct where would I find that variable, so I could change it?

PHP newb here, so be gentle ;)

~ Mark

Tom M
05-10-2005, 01:03 PM
The easiest way to remove it from the FORUMHOME display is to edit the FORUMHOME template. From the ACP open the FORUMHOME template and remove the following
<if condition="$show['upcomingevents']">
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_events')"><img id="collapseimg_forumhome_events" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_events].gif" alt="" border="0" /></a>
<if condition="$show['todaysevents']">$vbphrase[todays_events]<else /><phrase 1="$vboptions[showevents]">$vbphrase[upcoming_events_for_the_next_x_days]</phrase></if>
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_events" style="$vbcollapse[collapseobj_forumhome_events]">
<tr>
<td class="alt2"><a href="calendar.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/calendar.gif" alt="$vbphrase[calendar]" border="0" /></a></td>
<td class="alt1" width="100%"><div class="smallfont">$upcomingevents</div></td>
</tr>
</tbody>
</if>
Your version might be sligtly different depending on which version of vb you are running. Basically, you want to remove the code wrapped by the "condition" at the start of the HTML. Make sense?

Loco Macheen
05-11-2005, 01:11 AM
I believe you need to set the calendar permissions so that guests can view calendar events.


thank you, that did it :)

Samir
05-11-2005, 01:45 AM
thank you, that did it :)Welcome. :D

mfarmerhi
05-11-2005, 05:54 AM
Make sense?Hm... yea, actually. That does seem like a simple way to exclude it from the FORUMHOME template.

Thing is, I hate foreclosing options -- erasing things that I might choose to put back in later (lol I like to keep my options open ;))

I was looking at the modified code included in the txt file. It actually looks like it would be fairly easy coding to simply remove the "if" statements for upcoming events (so that events would display, regardless of whether you entered -0- in the Vbulletin Forum Display options) and insert the number of days forward you want the script to print events from.

Thing is -- because I don't know php -- I don't know what the code would be...

Tom M
05-11-2005, 11:55 AM
If you want to go that route then in your newly modified module find
if ($vboptions['showevents'])and replace it withif (true)
It's a pure hack but does what you are suggesting. It will now execute the events code on the portal regardless of the setting under Forumhome options.

BTW - even though you delete code from a template you can always see what the original version was in order to restore something. Plus, if you only made the one change you can simply revert it back to undo the change.

mfarmerhi
05-11-2005, 06:27 PM
Nope. When I do that, then change the Forum Display option back to -0- I get: "Warning: Invalid argument supplied for foreach() in /modules/minicalendar.php on line 119" (when$future = gmdate('n-j-Y' , TIMENOW + 43200 + (86400 * ($vboptions['showevents'] - 1))); is left alone);

And no events displayed under the mini-calendar at all when using$future = gmdate('n-j-Y' , TIMENOW + 43200 + (86400 * 29));(I want events displayed 30 days in the futute, thus using "29" where $vboptions['showevents'] used to be).

Tom M
05-11-2005, 06:45 PM
Nope. When I do that, then change the Forum Display option back to -0- I get: "Warning: Invalid argument supplied for foreach() in /modules/minicalendar.php on line 119"Well, I said it was a hack! That's what I get for not testing it, huh? My original suggestion of modifying the FORUMHOME template is still the best ;)

kur1j
05-13-2005, 02:10 AM
I am trying to display events from 3 different calendars... any way or what kinda code modifications i need to make this happen? Thanks.
Edit/Delete Message.

Samir
05-13-2005, 04:23 AM
It automatically does it. I have 3 different calendars, including personal ones. The events only show up according to the permissions, so people can only see their personal events, otherwise they are not there.

kur1j
05-13-2005, 01:40 PM
It automatically does it. I have 3 different calendars, including personal ones. The events only show up according to the permissions, so people can only see their personal events, otherwise they are not there.

Ok unless I missed something it does not do what I am wanting it to do automatically.

Without setting permissions for the calendars I want ALL users to be able to view the events on each individual calendar. Example:

page of website 1:
Has center calendar is calendar id1 it displays the calendar and the list of upcoming events below it.

page of website 2:
Has center calendar is calendar id2 it displays the calendar and the list of upcoming events below it.

page of website 3:
Has center calendar is calendar id3 it displays the calendar and the list of upcoming events below it.

Each webpage on the site would be pulling the list from a different calendar and not just from a single calendar. Which in your case it pulls from the default calendar but you have permissions saying that certian people cant see certain parts of the calendar. In my case I want everyone to see all 3 but on each part of the webpage I want it to show for that particular part of the website. Here is the website in question.

http://newlifeinchristchurch.net/beta/forum/index.php?page=upcoming

http://newlifeinchristchurch.net/beta/forum/index.php?page=ga

Both are pulling the list from the same calendar.

Tom M
05-13-2005, 01:43 PM
Ok unless I missed something it does not do what I am wanting it to do automatically.Does it work the way you want it to on the ForumHome page? If so then it should work the same on the portal.

kur1j
05-13-2005, 02:02 PM
ForumHome page?

I want this http://kur1j.info/code.jpg (the circled part) to look at seperate calendars and not pull from the same calendar.

Tom M
05-13-2005, 02:24 PM
ForumHome page?

I want this http://kur1j.info/code.jpg (the circled part) to look at seperate calendars and not pull from the same calendar.My point is that the modification for the portal page will behave exactly as it does for any other pages that make use of the calendar.

kur1j
05-13-2005, 02:34 PM
My point is that the modification for the portal page will behave exactly as it does for any other pages that make use of the calendar.
ok well can you explain why it would pull from the same calendar?

Maybe it has something to do with this that was originally posted by -chef-.


EDIT:
allhandl, this can be done pretty easily. You could just shift Mini Calendar over to the center but I needed the mini where it was on the home page but a center one on a new page.
Keep in mind I am a noob but this is how I got it to display.

1. Go to "Edit Modules" and click on the "Mini Calendar".
See all the settings. It might be easier to intead of clicking "Mini Calendar" to instead right click and select "Open in new window" and you can work off that.

2. Back in regular CP, now click "Add Module". Now duplicate everything that was in "Edit Mini Calendar" except Module Title: ( name the new module something like "Center Column Calendar") and make sure the column field is set to "Center" then save.

3. Now you will have that calendar and events available as a center module and when you activate it per page, you can just unselect the regular right side one so that you don't have two calendars.

Personally, I did this on a new page "events" (index.php?page=events) and disabled ALL the right side modules and it even spaned all the over and looks quite nice. (see attached) Hope this works out for you.



would this cause it to pull from only one calendar bc every time i add another page and then change the calendar ID in the vbportal settings it keeps pulling the information from the original calendar.

Edit: I think i misread what you were saying. Are you saying that it wont change and will behave the same exact and there is no way to make it look at seperate calendars for each individual page? My point is that the modification for the portal page will behave exactly as it does for any other pages that make use of the calendar.

kur1j
05-13-2005, 04:02 PM
these people are wanting to do the same thing I am wanting to do if you dont understand me.

http://www.vbadvanced.com/forum/showpost.php?p=15170&postcount=53
http://www.vbadvanced.com/forum/showpost.php?p=15184&postcount=56

kur1j
05-13-2005, 04:43 PM
if it doesnt work like I am thinking is there some kinda manual work around where it will work?


errr thought it was an edit :(.

kur1j
05-14-2005, 01:37 AM
anyone have any ideas? This little nitch is stoping me from finishing this thing :(.

TomM: Would you mind explaining a little more if this hack already does this as I am just not seeing it.

Tom M
05-14-2005, 01:54 AM
TomM: Would you mind explaining a little more if this hack already does this as I am just not seeing it.All this modification does is duplicate the functionality of the "upcoming events" that appears on the main forum page. If that page doesn't support displaying events from multiple calendars then the modification won't either. Sorry.

kur1j
05-14-2005, 02:19 AM
aight well thanks for the info now im bummed out :(.

Itworx4me
05-25-2005, 04:26 PM
Any one having issues with the upcoming events being displayed in firefox??
It displays them correctly on the fourmhome page but says there are no event scheduled for 7 days in the cmps index page. Any Ideas???

Tom M
05-26-2005, 07:30 PM
I Use FF almost exclusively w/o any problems. Do yo have a link?

CallieJo
06-04-2005, 12:18 PM
Does this work on the new vBadvanced CMPS v2.x

Thanks:)
(http://forumdisplay.php?f=70)

Nautiqeman
06-05-2005, 04:07 PM
What code would you remove if you ONLY wanted the Upcoming Events in that module on the front page and not the mini calendar?

cgmojoco
06-05-2005, 07:01 PM
Please update this for CPMS 2!

Thanks!

Tom M
06-05-2005, 08:41 PM
Please update this for CPMS 2!

Thanks!In due time... I may not update to CMPS 2.0 until vb3.5 comes out as I've got quite a bit of other items to update at that time as well.

Anybody that wants to have a go at doing the update should feel free to do so ;)

Nautiqeman
06-06-2005, 12:55 AM
What code would you remove if you ONLY wanted the Upcoming Events in that module on the front page and not the mini calendar?
any ideas?

Tom M
06-06-2005, 01:31 AM
any ideas?There are a couple of ways to do it. The simplest is to just edit the main template and leave the code alone. You can start by just removing the $calendarbits portion.

Nautiqeman
06-06-2005, 02:04 PM
Thank you sir!

Nautiqeman
06-06-2005, 02:31 PM
I'm running vB 3.0.7... I have it set for the next 30 days and when there is nothing on the calendar under Upcoming Events it says: No events scheduled in
the next 30 days.

When there is something scheduled in the next 30 days NOTHING is under Upcoming Events... any idea as to why this is happening?

Tom M
06-06-2005, 04:49 PM
When there is something scheduled in the next 30 days NOTHING is under Upcoming Events... any idea as to why this is happening?Do you have a link where guests can see the calendar events?