art1c0 / mooha

Automatically exported from code.google.com/p/mooha
0 stars 0 forks source link

How do I add new items to the Mooha database tables #31

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This isn't a bug - but a request for brief instructions / assistance.  (This 
issues page was the only place I could find to add this request)

I am using Mooha on my server.  It is successfully retrieving all of my phone 
calendar items and phonebook items and storing them in the database.  But what 
I now want to do is have some custom PHP code which adds more Calendar items to 
the database tables, so that those items can be sent to my phone during a 
synchronization session.

I have tried adding items to the "mooha_items" table in the database, and also 
tried adding corresponding entries to the "mooha_map" table in the database, 
but haven't had any success.  Does anyone know how to do this?

thanks in advance
Gavin

Original issue reported on code.google.com by smartmul...@gmail.com on 6 Dec 2010 at 3:12

GoogleCodeExporter commented 9 years ago
I managed to figure it out.  Making Mooha send items to the client is easy - 
just have to add item(s) to the mooha_items table - make sure the item_anchor 
field is set to the current time in seconds - e.g. in php -  date('U');

The problems I was having (it wasn't sending items to my phone) were due to 
unrelated bugs in the code  (as per other issues I had with Mooha, the 
$_SESSION variables were all null/empty at the beginning of each request - 
possibly because each request comes from a different IP address via my provider 
- Optus).  I solved all issues I was having by ripping out all of the $_SESSION 
code from Mooha and replacing it with get/set function calls to the 
JFactory::getSession() object in Joomla  (I have integrated Mooha with a custom 
component for the Joomla CMS).

Gavin

Original comment by smartmul...@gmail.com on 2 Jan 2011 at 7:31