Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
VB Schemes? External MySql DB connection? Integration?

 

 


void
User

Mar 5, 2008, 12:31 PM

Post #1 of 9 (943 views)
Shortcut
VB Schemes? External MySql DB connection? Integration? Can't Post

Would it be possible to populate CB with entries from an external database like that of VB?

It could either pull the info by connecting to VB's database and pulling it out, or VB could push it into CB by using some API supplied by you guys.

I reckon the pull solution is the easiest and most CB like, since it the most generic (can be used to integrate to other mysql products) and requires the least programming/technical knowledge.

I specifically, would like to pull "publishable" posts from VB and present them as front page comments or articles. The selection criteria could be post ratings (from trusted VIP forum members), approved posts (from fully moderated forums) or any other criteria that can be formulated by mysql queries.

It would be nice if you could register foreign mysql DB connections in CB, assign a presentation layer and query criteria, etc.

I would use this for www.atheist,net and www.ateist.net currently running article manager 1.41. I havent found any good reason to upgrade. Yet :o)


Dave
Staff / Moderator


Mar 5, 2008, 1:10 PM

Post #2 of 9 (940 views)
Shortcut
Re: [void] VB Schemes? External MySql DB connection? Integration? [In reply to] Can't Post

Both are possible, but might require a bit of effort or custom code to get working right. There's some support for connecting to external databases, but it's not documented or well tested.

What features of CMS Builder do you want to use on the VB database? Do you want to be able to edit the records through CMS Builder? Or just display them in the viewers? Or use the search features?

There's a few options. Let me know more about how you want them to work together and we'll see what we can figure out.

Dave Edis - Senior Developer
interactivetools.com


void
User

Mar 5, 2008, 2:22 PM

Post #3 of 9 (938 views)
Shortcut
Re: [Dave] VB Schemes? External MySql DB connection? Integration? [In reply to] Can't Post

Hi Dave,

I'm only looking to do read only stuff. I'd better leave the editing to vbulletin :)

Any examples on how to do that?


Dave
Staff / Moderator


Mar 5, 2008, 2:33 PM

Post #4 of 9 (936 views)
Shortcut
Re: [void] VB Schemes? External MySql DB connection? Integration? [In reply to] Can't Post

If it's read only, maybe you could do a direct MySQL query? Something like this:


Code
<?php 
mysql_connect('hostname', 'username', 'password');
$result = mysql_query("SELECT * FROM yourTableName ORDER BY yourSortField");
if (!$result) { die("MySQL Error: ". htmlspecialchars(mysql_error()) . "\n"); }
while ($record = mysql_fetch_assoc($result)):
?>

Title: <?php echo $record['title']; ?><br/>
... display other fields here ...

<?php endwhile ?>


Would that work for you?

Dave Edis - Senior Developer
interactivetools.com


void
User

Mar 6, 2008, 1:10 AM

Post #5 of 9 (930 views)
Shortcut
Re: [Dave] VB Schemes? External MySql DB connection? Integration? [In reply to] Can't Post


In Reply To
Would that work for you?

That is how I do it today. Thanks.


(This post was edited by void on Mar 6, 2008, 1:11 AM)


Dave
Staff / Moderator


Mar 6, 2008, 9:54 AM

Post #6 of 9 (920 views)
Shortcut
Re: [void] VB Schemes? External MySql DB connection? Integration? [In reply to] Can't Post

Ok, I just want to make sure I'm answering your question correctly.

Was there some feature from CMS Builder that you wanted to use that did more than a straight MySQL query? If there is let me know how you want it to be different from what you have now and I'll try and figure it out for you.

Dave Edis - Senior Developer
interactivetools.com


void
User

Mar 6, 2008, 10:07 AM

Post #7 of 9 (919 views)
Shortcut
Re: [Dave] VB Schemes? External MySql DB connection? Integration? [In reply to] Can't Post

Hi Dave,

Yes, I wanted to map the VB DB and use CB's presentation engine to generate various scripts.

Btw, does CB support lister/viewer generation? Like when you click an item in a list of articles and read the selected article?

And can the menu items be hierarchical?

Thanks


(This post was edited by void on Mar 6, 2008, 10:08 AM)


Dave
Staff / Moderator


Mar 6, 2008, 1:31 PM

Post #8 of 9 (914 views)
Shortcut
Re: [void] VB Schemes? External MySql DB connection? Integration? [In reply to] Can't Post

Yes, CMS Builder lets you generate code for "list viewers" and "page viewers". Where the "list viewer" shows the list of records with paging and the "page viewer" shows one specific record.

You'd have to do some experimenting but I think basically all you'd need to do to use the VB tables in the viewers is set the tablename to your VB table and clear the table_prefix. In your viewer code you'll see a line like this:


Code
$options['tableName'] = 'news';


Replace that with this:


Code
$TABLE_PREFIX = ""; 
$options['tableName'] = 'nameOfYourVBTable';


And it should work just fine. That assumes all the tables are in the same database. If they're not you'd just need to connect to the other database with one line first.

>And can the menu items be hierarchical?

There's a few workarounds in the forum but there's no built in support for hierarchical records or subcategories yet.

Hope that helps, any other questions just let me know.

Dave Edis - Senior Developer
interactivetools.com


void
User

Mar 7, 2008, 1:44 AM

Post #9 of 9 (904 views)
Shortcut
Re: [Dave] VB Schemes? External MySql DB connection? Integration? [In reply to] Can't Post

I have no more questions. For now :) Thank you for your efforts, Dave. It is much appreciated.

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4