Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
How can I use a external database with vb Blocks
xman_79
Join Date: Jun 2006
Posts: 65

Romania
by xman_79 xman_79 is offline 15 Mar 2010

Hi , Sorry because my English is weak, but I liked to write a topic on the use of an external database within the Forum's Blocks .

Go to : admincp -> Forums & Moderators -> Forum Blocks Manager -> Add Block : Custom Html / Php

Add new block: Custom HTML/PHP
Title : Your title ;
Description : your description ;
Cache Time (in minutes) : 60;
Content Type : Php
Content : ***
Template to Use : add your template . (eg. block_html)

The content :


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The template (YOUR_TEMPLATE_NAME) .
Create a new template .


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Eg.

test2.jpg
Views: 3621
Reply With Quote
Comments
  #2  
Old 20 Mar 2010, 12:53
ChopSuey ChopSuey is offline
 
Join Date: Jun 2009
Location: Alaska
Real name: Corey
& What is in your db? For the screenshot? Looks like a normal forum block.
Reply With Quote
  #3  
Old 20 Mar 2010, 18:00
mandingo's Avatar
mandingo mandingo is offline
 
Join Date: Jun 2008
He's just showing how to call content from a different database other than your forum one.
Reply With Quote
  #4  
Old 17 Jun 2010, 16:53
xman_79's Avatar
xman_79 xman_79 is offline
 
Join Date: Jun 2006
Real name: Suleiman
Originally Posted by ChopSuey View Post
& What is in your db? For the screenshot? Looks like a normal forum block.
Yes, it is a normal forum block but the content is not from vb-db.
In my another db i have an article system, so I display the list of sections .
Reply With Quote
  #5  
Old 17 Jun 2010, 17:08
noppid noppid is offline
 
Join Date: Mar 2003
Couple of suggestions...

When going outside the vB DB class, track your new connection by explicitly using the resource identifiers Like...


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

After your mysql_free_result you might want to add mysql_close($dbc).

Try putting your ob_end_clean() before your return $output too. Although, I don't see the point of using it. I guess you're trying to catch any errors and tag them on to the output?

I'm not crazy about using constants (DEFINE) for passwords and such either.
__________________
Add a photo gallery garage to your auto forum and get noticed by your members. Find out how at the vBulletin Computer Help Forum.
An informed rider makes their first destination the motorcycle forum at rider info.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 00:23.

Layout Options | Width: Wide Color: