PDA

View Full Version : vbTimelines LITE - (User Calendars)


Geographic2
03-26-2004, 10:00 PM
vbTimelines LITE for VB 3.0 gold

(Not Counting the required hack by kentaurus)
New Files: 1
Files to Edit: 1
Templates to Add: 4


Requirements and Credits-


Go add the attachments in calendar events by kentaurus hack now. it is worth it.
and required. and worth it. Remember to click install.

https://vborg.vbsupport.ru/showthread.php?t=62264

A variation of the recent attachments hack by Mindtrix was used in this hack so please click install over there
and use the standard version as well to display recent attachments to the posts
in your forum. Don't forget to click install there too.

https://vborg.vbsupport.ru/showthread.php?t=61244



Features

The following are the features that are presently avalible in vBTimelines LITE,

Users create their own calendar.
Users become the calendar moderator for their calendar.
(Only they (and mods/admins of course) can add/edit/delete events from/to their calendar.)
Recently Added Images from user calendars.
most recently added updates are listed.
Users get Create Calendar or Jump to Your Calendar link based on if they have a calendar yet.


Why this makes sense.../What the hell would I do with that?

Users can write their own "diary" style entries.
They can input both past and future events.
Therefore it's not only a diary but a planner of sorts.
I am running a garden site. Users add entries into their "egarden"
where they can show pictures and write about their plants, veggies, and flowers.
Keep track of weather events, fertilization etc... So this is a record for them
and the community to view and learn from. You may have a similar or different use for
this so be creative. ;) The Vbulletin calendar is the most underutilized part of VB and has exciting possibilities. I could easily see this being useful in many community's. Car modders/racers can keep a timelined gallery of their projects/acheivements, Lots of communities would enjoy a diary style utility.


Installation-

Upload vbtimelines.php to your forum directory


<?php
error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'vbtimelines');
$phrasegroups = array(
);
$specialtemplates = array(
);
$globaltemplates = array(
'vbtimelines',
);
$actiontemplates = array(

);

require_once('./global.php');


$navbits = array();
$navbits[$parent] = 'vbTimelines Index';

$navbits = construct_navbits($navbits);


$allgardens=$DB_site->query("SELECT description, dateline, lupdatemonth, lupdateday, lupdateyear, calendarid, title FROM calendar
WHERE displayorder=999 ORDER BY dateline DESC LIMIT 20");

$temp="SELECT calendarid FROM calendar WHERE title='".$bbuserinfo['username']."'";
$value=$DB_site->query($temp);

if($gardens = $DB_site->fetch_array($value))
{
$newlink='<img src="./images/misc/menu_open.gif"><a href="calendar.php?c='.$gardens['calendarid'].'"> Jump to your vbTimeline</a>';
}
else
{
$newlink='<img src="./images/misc/menu_open.gif"><a href="calendar.php?add=true"> Create your new vbTimeline</a>';
}

// Start recent attachments CODE BY MINDTRIX modified by GEO
$trix = $DB_site->query("SELECT calendar, counter, attachmentid,
dateline, filename FROM attachment WHERE
calendar>0 AND dateline < " . TIME() ." ORDER BY dateline DESC LIMIT 4");

while ($recentattachment = $DB_site->fetch_array($trix))
{
eval('$latestattachments .= "' . fetch_template('recent_attachments2') . '";');
}
//End recent attachments



while($gardens = $DB_site->fetch_array($allgardens))
{
$recentattachment = $DB_site->fetch_array($trix);
eval('$vbtimelinesbits .= "' . fetch_template('vbtimelinesbits') . '";');
}

eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('vbtimelines').$stringy. '");');
?>



Create 4 new fields in the calendar table of your DB

lupdatemonth as char(2)
lupdateyear as VARCHAR(4)
lupdateday as char(2)
dateline as INT(10)


Edit In calendar.php-

Find:

$idname = $vbphrase['event'];


Add after:


if ($_REQUEST['add'] == 'true')
{
if($bbuserinfo['username']!="Unregistered")
{

}
else
{
print_no_permission();
}

// ### NAVBAR #################################################
$navbits = array();
$ltr='Add New Calendar';
$navtext = $ltr;
$navurl = "add?=true";


if ($navtext && $navurl) {
$navbits = array("calendar.php" => 'Calendar',
"calendar.php?$navurl" => $navtext);
}
$navbits = construct_navbits($navbits);
eval('$navbar = "'.fetch_template('navbar').'";');


eval('print_output("' . fetch_template('calendar_add') . '");');

}




if ($_POST['do'] == 'doaddcalendar')
{
globalize($_POST, array(
'title' => STR,
'description' => STR,
'year' => STR)
);

$name=$bbuserinfo['username'];

$today = getdate(TIMENOW - $vboptions['hourdiff']);


$dateliner = gmmktime(0, 0, 0, $today['mon'], $today['day'], $today['year']);
$q1="INSERT INTO calendar (`title`, `description`, `displayorder`,
`neweventemail`, `moderatenew`, `startofweek`, `options`,
`cutoff`, `eventcount`, `startyear`, `endyear`,
`holidays`, `lupdatemonth`, `lupdateyear`, `lupdateday`, `dateline`)
VALUES ('".$name."', '".$description."', 2, 0, 1, 116, 40,
4, 4, 1970, 2037, 0, ".$today['mon'].", ".$today['year'].", ".$today['mday'].",".$dateliner.")";


$DB_site->query($q1);


$num=$DB_site->query_first("SELECT calendarid AS cid FROM calendar
WHERE title='$name' AND description='$description'");

$temp="INSERT INTO `calendarmoderator`
(`userid`, `calendarid`, `neweventemail`, `permissions`)
VALUES ('".$bbuserinfo['userid']."', ".$num['cid'].", '".$bbuserinfo['email']."', 7);";
$DB_site->query($temp);

$temp1=$num['cid'];

$DB_site->query("INSERT INTO `calendarpermission`
(`calendarid`, `usergroupid`, `calendarpermissions`)
VALUES ($temp1, 2, 17)");

$DB_site->query("INSERT INTO `calendarpermission`
(`calendarid`, `usergroupid`, `calendarpermissions`)
VALUES ($temp1, 1, 17)");

$DB_site->query("INSERT INTO `calendarpermission`
(`calendarid`, `usergroupid`, `calendarpermissions`)
VALUES ($temp1, 3, 17)");


// ### NAVBAR #################################################
$navbits = array();
$ltr='Added New Calendar';
$navtext = $ltr;
$navurl = "";


if ($navtext && $navurl) {
$navbits = array("calendar.php" => 'Calendar',
"calendar.php?$navurl" => $navtext);
}
$navbits = construct_navbits($navbits);
$errormessage="Your Calendar has been added.";
$url="vbtimelines.php";

eval('$navbar = "'.fetch_template('navbar').'";');


eval('print_output(" ' . fetch_template('STANDARD_REDIRECT') . '");');
}

/*END ADD ENTRY CODE*/




Find:


$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "event (calendarid, userid, event, recurring, recuroption,dateline_to,dateline_from, title, allowsmilies, customfields, dateline, visible, utc)
VALUES ($calendarid, $bbuserinfo[userid], '" . addslashes($message) . "', '" . addslashes($pattern) . "', '" . addslashes($patoptions) . "', '$dateline_to', '$dateline_from', '" . addslashes($title) . "', '$allowsmilies', '" . addslashes($customfields) . "', " . TIMENOW . ", $visible, '" . addslashes($timezoneoffset) . "')
");
$eventid = $DB_site->insert_id();


Add after:

$today = getdate(TIMENOW - $vboptions['hourdiff']);
$name=$bbuserinfo[username];
$month=$today['mon'];
$day=$today['mday'];
$year=$today['year'];
$DB_site->query("UPDATE calendar
SET dateline = ".TIMENOW."
WHERE title = '$bbuserinfo[username]'
");
$DB_site->query("UPDATE calendar
SET lupdatemonth = $month
WHERE title = '$name'
");
$DB_site->query("UPDATE calendar
SET lupdateday = $day
WHERE title = '$name'
");
$DB_site->query("UPDATE calendar
SET lupdateyear = $year
WHERE title = '$name'
");




Create Templates



Add template calendar_add:


$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header

$navbar

<form action="calendar.php" method="post">
<input type="hidden" name="title" value="$bbuserinfo[username]">
<input type="hidden" name="do" value="doaddcalendar">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr align="center">

<td class="tcat" align="center" colspan="2">
<span class="smallfont"><b>Add New Calendar</b></span>
</td>
</tr>

<tr valign="top">
<td align=center>
<textarea name="description" rows="4" cols="60" class="bginput"></textarea>
</td>
</tr>


<tr valign="top">
<td align=center>
<input type="submit" class="button" value="$vbphrase[save_changes]" accesskey="s" />
<input type="reset" class="button" value="$vbphrase[reset_fields]" accesskey="r" />
</td>
</tr>



</form>

$footer
</body>
</html>



Add template vbtimelinesbits:


<tr>
<td class=alt2>
<a href="calendar.php?c=$gardens[calendarid]&month=$gardens[lupdatemonth]&year=$gardens[lupdateyear]">$gardens[title]</a></td>
<td width="60%" class=alt1 align=left>
$gardens[description]
</td>
<td class=alt2 align=right>Latest Update: <a href="calendar.php?c=$gardens[calendarid]&month=$gardens[lupdatemonth]&year=$gardens[lupdateyear]">$gardens[lupdatemonth]/$gardens[lupdateday]/$gardens[lupdateyear]</a>
</tr>




Add template vbtimelines:


$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header

$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td class="tcat">Recent Calendar Images:</td>
</tr>
<tr><td class="tcat" align=center>
$latestattachments
</td></tr></table>


<table align="center" width="100%">
<tr>
<td align ="center" width="100%">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat">Latest Calendar Updates:</td>
<td class="tcat"></td>
<td class="tcat" align="right">$newlink</td>
</tr>
$vbtimelinesbits
</table>

</td>
</tr>
</table>

$footer
</body>
</html>





Add template recent_attachments2: (ORIGINAL CODE BY MINDTRIX - Modified by Geo)


<a href="calendar.php?do=getinfo&e=$recentattachment[calendar]" target="_blank">
<img src="attachment.php?attachmentid=$recentattachment[attachmentid]&thumb=1" alt="$recentattachment[filename]" width="150" border="0"></a> <img src="./spacer.gif" height="0" width="10" border="0">



This hack is released as is, with a promise of zero support.
Not to say you'll get no reply but I have no time for support,
I'm getting married etc... so I'm too busy.


Please reply if this installation text has errors.



Screenshots

Here is the basic vbtimelines interface.

4 recent images from your users calendars, followed by a listing of 20 or so calendars with the latest updates.

Clicking an image of the recent attachments will bring you to the corresponding calendar event.

Boofo
03-27-2004, 02:40 AM
Can you make a TXT install file for this?

Geographic2
03-27-2004, 03:57 AM
To whoever just installed this make sure you have the latest version.
I made a few changes to the code @ 5:34 board time.

If you add a new calendar you should see the standard redirect page and then
be taken to vbtimelines.php.

If you instead get no redirect page with really ugly incomplete output then you should
redo the changes made to calendar.php.

gmarik
03-27-2004, 10:04 AM
It could have some RSS as well in the future?

ryancooper
03-27-2004, 02:38 PM
Can you tel us how to Create 4 new fields in the calendar table of your DB

lupdatemonth as char(2)
lupdateyear as VARCHAR(4)
lupdateday as char(2)
dateline as INT(10)


I don;t know how??

Thanks;)

Geographic2
03-27-2004, 03:46 PM
Use these queries or use PhpMyAdmin:



ALTER TABLE calendar ADD lupdatemonth char(2) NOT NULL
ALTER TABLE calendar ADD lupdateyear VARCHAR(4) NOT NULL
ALTER TABLE calendar ADD lupdateday char(2) NOT NULL
ALTER TABLE calendar ADD dateline int(10) NOT NULL DEFAULT 0


I don;t know how??


Get a book/Take a class/Code some VBstuff and learn ;)
Guess I should have provided it though ;)

moonclamp
05-25-2004, 05:37 PM
Before I install this and modify it into a journal system ...

Can you limit the amount of calendars that a member can create? Or is it limited to one by default?

Is there any way that members can choose who has access to them?

Is there a URL of a site using this ... the screenshots give me an idea of what to expect but I'd like to see the users side as well

Datenpapst
07-26-2004, 01:31 PM
Dont get it. whats that for?

nexialys
09-19-2004, 03:39 PM
!ping... looks like we have no support and no updates for this good hack...

someone ?!

and this is a LITE version.. where is the FULL one ?

Dean C
09-19-2004, 03:47 PM
This hack is released as is, with a promise of zero support.
Not to say you'll get no reply but I have no time for support,
I'm getting married etc... so I'm too busy.


The author said they couldn't offer support. You're on your own :)

nexialys
09-19-2004, 05:52 PM
hey.. i was just wondering,.. he was talking about weddings, in march... maybe he is available now.. ;)

we'll see !!!

jamesk
12-25-2004, 06:31 AM
This could also be used as a replacement to vbjournal?

Geographic2
12-26-2004, 01:57 AM
"Is there a URL of a site using this ... the screenshots give me an idea of what to expect but I'd like to see the users side as well"

http://www.giantvegenetics.com

It is called eGardens there.

At press time, there were no eGardens set up. Feel free to create one for your experimentation purposes.

User: VB Guest
Password:dotorg


Other than the screenshots you see there is not much else to see.
The rest of the functionality is exactly like your calendar system is now.
But it will be used like it never was before.


Ping. What are you pinging for? :)


I am now a married guy. :)

With still precious free moments, but what ye seek?

Quite a few items on my plate but I'm willing to bump something up in the queue if there is demand for something?

nexialys
12-26-2004, 02:24 PM
Hi Geo...

the request here is mainly to update your code to vB 3.0.3, or at least adding some freely requested features... ;)

and good luck for your new marital situation.. lol

Geographic2
12-29-2004, 01:01 AM
At the moment I am still on 3.0.0 so it will take me a little bit to move up. As I understand there are some differences in the code for attachments. I'll look into as well as putting together the non-LITE version of this which includes a bit more interesting features like say Alphabetized Timeline Browsing System so you can navigate Timelines in the same way you would the Memberlist, a comment/thread integration, some XML exporting and such so it can be used as a news feed for clubs, associations, people etc on their own static sites etc... So it'll be nice but I do need some time to put it all together in an installable format and test it on a clean system.

criscokid
01-05-2005, 09:06 AM
A feature to copy an event from the main calendars to a personal calendar would be a useful feature to include.

MikaK
01-05-2005, 01:43 PM
A feature to copy an event from the main calendars to a personal calendar would be a useful feature to include.
Very good idea! Also the ability allow inclusions into the global calendar would be really handy. Any developments towards 3.0.3?

=M=