PDA

View Full Version : How to display entries from MySQL into sidebar in vb 4?


rayofvictory
03-13-2010, 09:10 PM
This is the first time I ever had to use vbulletin for a client. The requirement is that I have to publish a feed from MySQL in the sidebar for CMS/blog and forum of vbulletin 4 implementation.

Could you please point me in the right direction?

Lynne
03-13-2010, 09:58 PM
I don't know what you mean by "publish a feed from MySQL". However, I'll tell you that you will probably do this for your CMS page by creating a PHP widget and on the Forum page by creating a PHP block. I don't know about the blog.

rayofvictory
03-14-2010, 03:45 PM
Thanks for the quick reply!

Publish from feed in the sense :

I have to display the following results :

SELECT <a href = 'http://abc.com/profile?ID=11.aspx'>Check 1</a> FROM xyz where DATE between curdate() AND ExpiryDate limit 20;

That should display a feed like thing on the right sidebar with the following output (all links are hyperlinks)..

Check 1
Check 2
Check 3
......so on.

Did I make sense? What is the best way of doing it? Thank you so much!

Lynne
03-14-2010, 11:27 PM
I guess you want a PHP widget (for the CMS page) and block (for the forum.php page). there have been several released in the mods forum if you need to see examples.

rayofvictory
03-14-2010, 11:36 PM
Please look at this thread : https://vborg.vbsupport.ru/showthread.php?t=238270

Am struggling for so many hours now! How to display an array in a PHP block?

p.s : (Though I have a license, it still is blocking my own code from being displayed in the forums. I am baffled with the whole license process)..

fdifranco
03-16-2010, 03:19 AM
I wrote a PHP widget for a fellow a few weeks ago.

It sounds like you are trying to do something similar. Have a look at this post (https://vborg.vbsupport.ru/showthread.php?t=237244).

You will want to change the SQL to suit your needs and also make links out of the data by adding the appropriate <a></a> tags.

So take what I wrote and tweak it a little bit. It shouldn't be too difficult.

-fab

rayofvictory
03-16-2010, 03:32 AM
I wrote a PHP widget for a fellow a few weeks ago.

It sounds like you are trying to do something similar. Have a look at this post (https://vborg.vbsupport.ru/showthread.php?t=237244).

You will want to change the SQL to suit your needs and also make links out of the data by adding the appropriate <a></a> tags.

So take what I wrote and tweak it a little bit. It shouldn't be too difficult.

-fab

Sir, you are fabulous! I got everything working in the last hour but was having issues trying to concatenate <br/> tags. Was using </br> and it didn't work, now it does!

I really really appreciate your help :) I wish there is more support staff like you here for a commercial product like this. Searching without keyword knowledge is a pain for newbie vb4 users like me. Thanks again :)