WC Rolling Calendar for SSI

Started by weekend camper, June 03, 2005, 02:48:56 PM

Previous topic - Next topic

weekend camper

Link to Mod

This mod is used to pull events through SSI based on dates, not last posts.  For example, if there is a blood donor clinic mid-month, it will be displayed until mid-month, regardless of how many other events are posted in the meantime.

@edit:  seems to work fine with versions 1.03-1.05, at least on my upgraded boards. 

Took a look at making it work with 1.1XXX but the Post.php is significantly different so it will likely be 1.1final before I get around to making the mod work with the newer version.



mennou

Template Parse Error!
There was a problem loading the /Themes/default/Post.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.         

how can i fix that??

Kindred

well, I would first try clikcing on the link that talks about accessing the file directly.

That will usually give you a line number around where the error is occuring.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

mennou

Parse error: parse error, unexpected T_STRING in /usr/home/mixspot/public_html/forum/Themes/default/Post.template.php on line 796

Kindred

yup... that looks like you're missing a closing quote...

1) open Post.Template.php
2) go to line 796
3) looks for code that was added by the mod...  confirm that all echos are closed with '; and confirm that arrays are &var['name']
(with opening and closing quotes)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

mennou

it doesn't  work... i give up 

weekend camper

@ Mennou, if you're still around.

If you can, post up a dozen or so lines around line 796. 

It seems like you might be using a custom skin?  I only have tested on the default forum skin.  I have a feeling that the mod 'split' some existing code and thats why you are getting the loose/lost closing quote error.

Dig through the modifications.xml and you should be able to manually figure out where the mod is breaking your current template.

Also, this mod has not been tested with SMF versions below 1.0.3, if you are running an earlier version.

DoW Kid Rock

This is an awesome mod!

been wondering how I could keep them in chronological order

weekend camper

Wellllllllllllllllllllllllllllllllllllllll,

being somewhat new to php, I found a large bug to do with register_globals on/off.

in Post.php (with the mod loaded in already)

find near (mine) line 1250 the line

Quote// attempting to make the sql insert work regarding the event begin/end dates.

insert ABOVE it the following:


$year_rolling_begin = $_REQUEST['year_rolling_begin'];
$month_rolling_begin = $_REQUEST['month_rolling_begin'];
$day_rolling_begin = $_REQUEST['day_rolling_begin'];

$year_rolling_end = $_REQUEST['year_rolling_end'];
$month_rolling_end = $_REQUEST['month_rolling_end'];
$day_rolling_end = $_REQUEST['day_rolling_end'];

$year = $_REQUEST['year'];
$month = $_REQUEST['month'];
$day = $_REQUEST['day'];



That should take care of the mod NOT inserting the beginning/ending/actual dates into the smf_messages table.

May update the d/l package if I have time before 1.1 goes final.


weekend camper

#9
was having global moderators not being able to attach properly (at all) in the 'event' boards, so this fix should do it:


find around line 600 in Post.template.php in 1.0.5

        // Is the user allowed to post any additional ones? If so give them the boxes to do it!

if ($context['can_post_attachment'])
{
echo '
<tr id="postAttachment2">
<td align="right" valign="top">
<b>', $txt['smf119'], ':</b>
</td>
<td class="smalltext">
', ($context['attached'] != '' ? $txt['attach_preview'] . ': ' . $context['attached'] . '<br />' : ''), '
<input type="file" size="48" name="attachment[]" onchange="updateAttachmentCache();" />';



replace with:


// Is the user allowed to post any additional ones? If so give them the boxes to do it!
// modified to make the darn mod work when allowing global mods and mods attachment permissions on certain boards
if ($context['can_post_attachment'])|| (in_array(2, $user_info['groups'])) || (in_array(3, $user_info['groups']))
{
echo '
<tr id="postAttachment2">
<td align="right" valign="top">
<b>', $txt['smf119'], ':</b>
</td>
<td class="smalltext">
', ($context['attached'] != '' ? $txt['attach_preview'] . ': ' . $context['attached'] . '<br />' : ''), '
<input type="file" size="48" name="attachment[]" onchange="updateAttachmentCache();" />';


This method requires the following as well:

in Post.template.php around line 5 find:


// The main template for the post page.
function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings, $months;


add below it:


global $user_info;

myaicons

i scratch your back you scratch my back...
funny thing about my back is its located on my...

HR

Exactly what does it do? I read the words just not picturing the outcome.

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

ke4obt

The way I understand it, you post somthing in your calendar as an event. Using SSI, this mod keeps the "current" events in chronological order in your list of events in your stats/info section.
I just wish someone would take it over and update it to work with at LEAST 1.1.7/1.1.8 and possibly with 2.x.
I think it sounds like a great mod but don't know enough about coding to even attempt to play around with it.
Anybody willing to volunteer???

Thanks Much

Flip - KE4OBT
     The Blind Ham
Helping other blind hams
get on the air!


Yes I am really a BLIND user!

So, if a mod doesn't install properly, and I can't get help from your part of the forum,
I will come begging for YOUR help since you wrote it and know how it works
um, uh, well,
At least I would really, really hope you do!
HEE-HEE-HEE

Angelotus


weekend camper

SMF 2 RC1 appears to have a suitable built in function:

around line 1750:
// Show the most recent events.
function ssi_recentEvents($max_events = 7, $output_method = 'echo')



Its sorted by cal.start_date DESC, so it looks like it has the same functionality.  I haven't tried it to confirm.


It looks like its a non-issue for 2.0RC1 users.

weekend camper

since there has been interest, a quick (very quick) code change will get you the gist of the rolling calendar feature -- namely showing upcoming events (7 by default) into chronological order from today's date.


http://www.simplemachines.org/community/index.php?topic=252573.0

the fix at that thread appears to be for 1.1.x forums.  It wont pull the text from the post though, nor can you limit by anything other than number of events (max) to show.





In looking at the code better, the SSI for 2.0RC1 hasn't been updated to allow for rolling events, so disregard my above post.




Angelotus

Thanks, so is it possible this mod can be updated for 2.0?

Advertisement: