logo
Create Account |  Retrieve Password
header ruleheader rule

2.0 PR1 - Preview Release

0.97 - Stable

 
Back to General Support

Address Book w/ Data from Users Table
smccandl
Posted on 07/09/08 16:09:03
Number of posts: 13
smccandl posts:

I'd like to display contact information for all registered users on the site using the addressbook module.  Unfortunately, it looks like you need to create contacts within the address book and I don't see a way to use existing data from the exponent_users table.  Can this be done without code modifications?

Replies:

Re: Exponent CMS AddressBook w/ Data from Users Table
smccandl
Posted on 07/15/08 21:29:22
Number of posts: 13
smccandl replies:

Ok, I solved my own problem by writing a PHP script to sync user contact data from the user tables into an empty addressbook module in the addressbook_contact table.  I've scheduled the script in cron so profile updates are propogated to the addressbook hourly. The PHP script is freely available and can be downloaded on my site: http://smccandl.net.



code for your solution
coolgeekone
Posted on 09/26/09 22:18:27
Number of posts: 31
coolgeekone replies:

Hi there,

I'm interested in the solution but can't seem to download the code from your website.



Re: Exponent CMS AddressBook w/ Data from Users Table
smccandl
Posted on 09/27/09 13:49:17
Number of posts: 13
smccandl replies:

Thanks for the heads up.  I've fixed my site and you can find the code download on this page:

http://smccandl.net/?q=node/4

Let me know if you have any questions about getting it to work.

Scott



do_sync.php changes
coolgeekone
Posted on 09/27/09 20:56:51
Number of posts: 31
coolgeekone replies:

Hi Scott,

I'm afraid I don't know PHP.  Can you give me an example of what I should change the $location_data in the do_sync.php file.

I should be ok with adding it the cron jobs.

 

From your web site.

Be sure to modify the $location_data variable in do_sync.php and set variables in db_connect.php!



Re: Exponent CMS AddressBook w/ Data from Users Table
smccandl
Posted on 09/28/09 08:39:22
Number of posts: 13
smccandl replies:

Since you can have multiple address books on different pages (similar to other modules), Exponent uses a location_data field in the database to serve as a reference.  Each instance of addressbook module will have a different value for the location_data field.

You'll need to look in the database, probably using phpMyAdmin, to find this value in the exponent_addressbook_contact table. It'll be a long, ugly string of characters and it should be easy to identify if you only have one addressbook module in your site.

Scott



Untitled Post
coolgeekone
Posted on 09/28/09 08:48:29
Number of posts: 31
coolgeekone replies:

quote:

Since you can have multiple address books on different pages (similar to other modules), Exponent uses a location_data field in the database to serve as a reference.  Each instance of addressbook module will have a different value for the location_data field.

You'll need to look in the database, probably using phpMyAdmin, to find this value in the exponent_addressbook_contact table. It'll be a long, ugly string of characters and it should be easy to identify if you only have one addressbook module in your site.

Scott

I only have one address book so it be easy to locate.  Another question, would this work for Exponent 0.96.6 and 0.97 also?

The site I'm working on is live but not many users yet.  I'm trying to see if v2.0 is anywhere near release.

Thanks for the quick response.  Would be cool if this site had a chat feature too as you are online at the moment.



Re: Exponent CMS AddressBook w/ Data from Users Table
smccandl
Posted on 09/28/09 09:09:48
Number of posts: 13
smccandl replies:

Should work for .96 and .97, but may need to tweak the sql queries to match the tables.  No idea whether or not it will work on 2.0, but probably can be adjusted if necessary.

If I were you, I'd create the target addressbook on a non-public page and test out the syncing by running the script.  The script only reads/pulls data from your users table (it doesn't modify) so you don't need to worry about messing up your existing site, but you could always install another copy of exponent in a different location for testing to be cautious.

Good luck!

Scott



testing code
coolgeekone
Posted on 09/28/09 09:22:30
Number of posts: 31
coolgeekone replies:

It looks like v2.0 isn't anywhere near being being a public release yet.  I have a dev server at home that I play around with both 0.96 and 0.97 which I always try stuff out on first.

 




Login to reply to this topic.

bottom
Buy Phentermine
Buy Priligy
Buy valium
Buy Cialis
Buy Codeine
Buy Duromine
Buy prednisone
Buy Strattera
Exponent CMS: Content Management System Web Hosting and Exponent CMS Support
Provided by OIC Group Inc., Peoria Illinois IL