My Subscriptions

No active or expired subscriptions. View Available Subscriptions

News Feed

Receive our Newsletter

Advanced Search

Save $50 on your CMS Expo Registration

Receive $50 off the registration fee for the CMS Expo featuring Joomla! in Dever, Colorado (USA). Click here to register at the reduced rate.
Pages: [1] 2
Print
Author Topic: Done : Plugin For CB Intergration  (Read 9482 times)
abhigudi
Newbie
*

Karma: +0/-0
Posts: 6


View Profile
« on: August 23, 2007, 05:48:19 AM »

I've just written a plugin for Community Builder integration where in the users profile, the events which he add are shown.. Three files need to be changed for this to work.. Along with one db change.. Sorry guys i cant point out the line numbers as my component files are heavily modified..

-----------------------------------------------------------
Filenames : admin_events.php , jcalpro.php
-----------------------------------------------------------

Two common changes in these files..
1. Find the INSERT query and add this field to be inserted..

$query = "INSERT INTO ".$CONFIG_EXT['TABLE_EVENTS']." (
   title, description, contact, url, email, picture, cat, day, month, year, start_date, end_date, approved, recur_type, recur_val, recur_end_type, recur_count, recur_until, published, userid) VALUES
('$title','$description','$contact','$url','$email','$picture','$cat','$day','$month','$year
','$start_date','$end_date','$approve','$recur_type','$recur_val','$recur_end_type','$recur_
count','$recur_until', '1','$userid')";

2. Find this line in the code..
if (isset($form['cat'])) $cat = $form['cat']; else $cat = '';
Add this on the next line..
if (isset($form['userid'])) $userid = $form['userid']; else $userid = '';

-----------------------------------------------------------
Filenames : /themes/default/theme.php
-----------------------------------------------------------

Two changes in this file..

1. Add global declaration $my at the top of the page..

global $my;

2. Find the template for adding an event

// HTML template to display an event form
$template_add_event_form = <<<EOT


Add the followning code

<!-- BEGIN userid_hidden -->
<input type='hidden' name='userid' value="$my->id"/>
<!-- END userid_hidden -->


after the <!-- END url_row -->

-----------------------------------------------------------
Database -> Tablename #__jcalpro_events
-----------------------------------------------------------

Alter the table and add a new field userid int(15)

If you have any question with integration please do email me at jay@yulop.com / jayanth@amonks.in
Logged

V-man
Administrator
Hero Member
*****

Karma: +16/-3
Posts: 2408


Ignorance is curable, stupid is forever.


View Profile
« Reply #1 on: August 23, 2007, 12:38:22 PM »

Wow! Thanks a bunch.

We'll compare this to our efforst for CB in the next release.

Users can also follow this topic on the CB forum:

http://www.joomlapolis.com/index.php?option=com_joomlaboard&Itemid=38&func=view&catid=41&id=43825#43825
« Last Edit: August 23, 2007, 10:40:06 PM by V-man » Logged

*** Please read this post and the FAQs before posting in the forum. ***
*** Documentation links: JCal Pro | Advanced Search ***
*** Support questions via PM or e-mail will be ignored.

*** Paid Support is available through Open Source Support Desk.
abhigudi
Newbie
*

Karma: +0/-0
Posts: 6


View Profile
« Reply #2 on: August 24, 2007, 01:43:21 AM »

Hey V-Man..

Its just a little payback for such a nice component.. Any help you need with this , please shoot across an email..

I'll also release some more features which will shock you in a couple of weeks time Smiley
Logged

V-man
Administrator
Hero Member
*****

Karma: +16/-3
Posts: 2408


Ignorance is curable, stupid is forever.


View Profile
« Reply #3 on: August 24, 2007, 01:53:59 PM »

We are almost ready to release a new version. Please PM me what features you are looking at. Might be better to apply them to the new version.
« Last Edit: August 24, 2007, 01:57:07 PM by V-man » Logged

*** Please read this post and the FAQs before posting in the forum. ***
*** Documentation links: JCal Pro | Advanced Search ***
*** Support questions via PM or e-mail will be ignored.

*** Paid Support is available through Open Source Support Desk.
crony
Newbie
*

Karma: +0/-0
Posts: 15


View Profile
« Reply #4 on: August 29, 2007, 02:40:14 PM »

Sorry, but I have a problem...
I do not see anything in the CB tab...

I've done all the hack twice

There's nothing added in the database except the number of events, user id stay at 0...

Any idea  Huh

Suggestions to improve:
-the author displayed (and linked to the profile )in the mod last event
-the author displayed (and linked to the profile) in the full calendar
« Last Edit: August 29, 2007, 02:46:31 PM by crony » Logged
crony
Newbie
*

Karma: +0/-0
Posts: 15


View Profile
« Reply #5 on: August 31, 2007, 06:26:17 PM »

Am I the only one to get that problem  Huh
Logged
V-man
Administrator
Hero Member
*****

Karma: +16/-3
Posts: 2408


Ignorance is curable, stupid is forever.


View Profile
« Reply #6 on: August 31, 2007, 06:49:58 PM »

Looks that way so far. Remember, most people are not hacking their site with user contributions.
Logged

*** Please read this post and the FAQs before posting in the forum. ***
*** Documentation links: JCal Pro | Advanced Search ***
*** Support questions via PM or e-mail will be ignored.

*** Paid Support is available through Open Source Support Desk.
crony
Newbie
*

Karma: +0/-0
Posts: 15


View Profile
« Reply #7 on: September 01, 2007, 12:51:39 PM »

Does that mean you didn't try this hack ?

I've tested with a clean install with CB pre-installed : (old version, but I've updated CB then, so I'm wondering if the update of CB has been done correctly, which could explain this malfunction...or not...cos I've tried with CB not updated as well...)
http://www.aide-joomla.fr/component/option,com_docman/task,doc_details/gid,124/Itemid,148/

Then did the hack, same result...means nothing appears in tab event...

Why Master ?  Grin

Will you integrate this option in 1.6.x release ?

Thanx
« Last Edit: September 01, 2007, 12:57:44 PM by crony » Logged
V-man
Administrator
Hero Member
*****

Karma: +16/-3
Posts: 2408


Ignorance is curable, stupid is forever.


View Profile
« Reply #8 on: September 01, 2007, 02:31:31 PM »

Yes, looking at this hack for 1.6.
Logged

*** Please read this post and the FAQs before posting in the forum. ***
*** Documentation links: JCal Pro | Advanced Search ***
*** Support questions via PM or e-mail will be ignored.

*** Paid Support is available through Open Source Support Desk.
crony
Newbie
*

Karma: +0/-0
Posts: 15


View Profile
« Reply #9 on: September 01, 2007, 02:43:02 PM »

Ok, ready for a beta test if needed Smiley
Logged
crony
Newbie
*

Karma: +0/-0
Posts: 15


View Profile
« Reply #10 on: September 02, 2007, 11:38:18 AM »

IT WORKS !!!  Cheesy

After redoing the hack for the third time, (before sending the files to Jay for help...), I noticed a little difference between the 2 queries in admin_events.php and jcalpro.php, the 2nd query to update in jcalpro.php is in fact :

Code:
$query = "
INSERT INTO ".$CONFIG_EXT['TABLE_EVENTS']." (
title, description, contact, url, email, picture, cat, day, month, year, start_date, end_date, approved, recur_type, recur_val, recur_end_type, recur_count, recur_until, userid
) VALUES (
'$title','$description','$contact','$url','$email','$picture','$cat','$day','$month','$year','$start_date','$end_date','$approve','$recur_type','$recur_val','$recur_end_type','$recur_count','$recur_until','$userid'
)";


Please notice the
Code:
, '1',
which is in the first query, but not in the second !
That little difference makes the trick !

Thank you to Jay for asking me to send my modified files, that makes me get back to them and find the solution myself !  Wink

I'm very happy to support this project at my little level (regarding some recent angry posts... )
The final user is most of the time the faulty guy, not the developper who knows, and gives to the community is work ! I thank them for that, and some people should calm down, and think about respect, and should check what they may have done incorrectly first...if you double check and don't find anything...then, triple check  Cool

Regards
« Last Edit: September 02, 2007, 11:41:02 AM by crony » Logged
abhigudi
Newbie
*

Karma: +0/-0
Posts: 6


View Profile
« Reply #11 on: September 03, 2007, 01:42:14 AM »

I should have checked that.. Very sorry about that.. Smiley
Logged

notsonice
Newbie
*

Karma: +0/-0
Posts: 2


View Profile
« Reply #12 on: September 12, 2007, 06:56:04 AM »

Crony,  I was having the same problem as you.  I added the ,'1' in and now my database updates with the user id.  (at the moment that me me, myself and I). thanks.   
(almost time for me to continuing my learning experience of trying to add in a country/region/state/city location hack which is working in it's own page)

Jay, my problem is that the 'my own events' tab isn't updating with any info. Any hints on what to look for?

Thanks.

Craig

Logged
crony
Newbie
*

Karma: +0/-0
Posts: 15


View Profile
« Reply #13 on: September 13, 2007, 11:54:16 AM »

Hello Craig,

Sorry but I didn't get that problem, all is functionning perfectly ...
Maybe a problem with the configuration of Jcal ? (allow new events by certain users or stuff like that ? )

Logged
spignataro
Newbie
*

Karma: +0/-0
Posts: 1


View Profile
« Reply #14 on: November 04, 2007, 10:47:06 PM »

With the new events use the following code for the events.php file:

(JCal Client 1.6 - only please - no modifications are needed to the database - or files - just download the plugin_events.zip and replace the content of events.php with the posted code below)

Code:
<?
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );



class geteventsTab extends cbTabHandler
{
function geteventsTab()
{
$this->cbTabHandler();
}
 
/*Main function */
function getDisplayTab($tab,$user,$ui)
{

global $database,$mosConfig_live_site, $mosConfig_absolute_path, $mosConfig_lang, $my;
$cl=1;
$row=1;


$generatedisplay="<table width=\"100%\"><tr>";

//die(print_r($user->username.'me'));

$database->setQuery("SELECT * FROM #__jcalpro_events WHERE username='$user->username' AND approved='1'");
$myevents = $database->loadObjectList();
foreach ($myevents as $myevents)
{
$eventtitle=$myevents->title;
$eventdesc=$myevents->description;
$eventdate=$myevents->start_date;
$eventextid=$myevents->extid;

$eventlink=$mosConfig_live_site."/index.php?option=com_jcalpro&extmode=view&extid=".$eventextid;

if ($cl==1)
{
$generatedisplay.="</tr><tr>";
if ($row==1)
{
$style="background-color:#E4E4E4;";
$row=2;
}
else
{
$style="background-color:#F4F4F4;";
$row=1;
}
}

$generatedisplay.="<td width=\"33%\" style=\"text-align:center; ".$style."\"><a href=\"".$eventlink."\"><b>Event : ".$eventtitle."</b></a><br>Description : ".$eventdesc."<br>Date : ".$eventdate."<br></td>";

$cl=$cl+1;

if ($cl==3)
{
$cl=1;
}

}
$generatedisplay.="</table>"; 

return $generatedisplay;
}

}
?>

« Last Edit: November 04, 2007, 10:49:32 PM by spignataro » Logged
Pages: [1] 2
Print
Jump to:  

Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com

Original Joomla Template design by RocketTheme ( Conversion by Bloc)