Log in

View Full Version : a bit reluctant to post this...


Noiz Pollution
04-19-2004, 12:57 PM
Hi folks,

Like the thread title says I'm feeling a bit reluctant to post this as I'm imagining I'll get a whole load of replies along the lines of "use the search!".

Anyway, I'm currently in the process of designing a new custom homepage for forums owned by my associate (not registered here) and I've installed this [hack (https://vborg.vbsupport.ru/showthread.php?t=62164&page=1&pp=50)] to give me the basic outline.

The page will be mostly static except for the inclusion of posts from 3 announcements forums (the site is irish dance based and needs 1 general, 1 for feis events and 1 for shows) and I'm wondering how I would go about including them. The feis announcements would be the main focus showing a limited version of the post with the other 2 in the right hand column showing only the thread name linking to the threads. I would need to be able to limit the number of threads showing for each of these as well.

I'd imagine I'll have to create a whole new set of custom templates for this which I'm more than happy to do, I'm just stumped as to where to start with the actual coding.


If anybody can point me at a how-to or anything else which may help it would be much appreciated, I've had a look at the current portal systems available but they seem a little too complex for our needs.


Cheers,
Robert

Boofo
04-20-2004, 12:20 AM
I would go with either vBindex or vbAdvanced for this. They have what you need already built in. It would be more trouble than it's probably worth to do it all from scratch. ;)

Noiz Pollution
04-20-2004, 09:15 AM
I would go with either vBindex or vbAdvanced for this. They have what you need already built in. It would be more trouble than it's probably worth to do it all from scratch. ;)
That's the thing, I'm really interested to learn how to do it but starting simply, I just need a push in the right direction.


Cheers,
Robert

Noiz Pollution
04-22-2004, 06:41 PM
Could nobody even point me at which files to look at copying code from? Or would this infringe on copyright?

Noiz Pollution
04-25-2004, 03:13 PM
OK I guess not then...

vbmechanic
04-25-2004, 03:51 PM
OK I guess not then...
What you're asking isn't as simple as you might imagine. Your question boils down to:

- How do I write PHP to query the mySQL database to pull threads from a few different forums?

There is no place in the vBulletin code that would be appropriate for you to copy from-- the way that forumdisplay works is more complex and quite a bit different from the simple sort of pull you want to accomplish here.

Where do you start coding? On the home page that you've created. You don't really need to create templates for it unless you want to.


$threads = $DB_site -> query ("SELECT * FROM ".TABLE_PREFIX."thread WHERE forumid='5'");

while ($thread = $DB_site -> query_first ($threads)) {

do this;
}


That's a start.. that will pull thread info from forum 5. Add in a "LIMIT 0,5" to limit it to 5 threads. Replace the do this with what you want to do with the thread info...

Honestly it would take a few pages to explain everything you want to do. I think that's why Boofo suggested you start with one of the portals and pick it apart.

Noiz Pollution
04-25-2004, 04:27 PM
What you're asking isn't as simple as you might imagine. Your question boils down to:

- How do I write PHP to query the mySQL database to pull threads from a few different forums?

There is no place in the vBulletin code that would be appropriate for you to copy from-- the way that forumdisplay works is more complex and quite a bit different from the simple sort of pull you want to accomplish here.

Where do you start coding? On the home page that you've created. You don't really need to create templates for it unless you want to.


$threads = $DB_site -> query ("SELECT * FROM ".TABLE_PREFIX."thread WHERE forumid='5'");

while ($thread = $DB_site -> query_first ($threads)) {

do this;
}


That's a start.. that will pull thread info from forum 5. Add in a "LIMIT 0,5" to limit it to 5 threads. Replace the do this with what you want to do with the thread info...

Honestly it would take a few pages to explain everything you want to do. I think that's why Boofo suggested you start with one of the portals and pick it apart.
Hi vbmechanic,

As far as the templates are concerned I'd like to create new ones in order to seperate the homepage and the forums a bit.

I can see that this will get complex, I just don't want to step on anyone's toes by taking their work and pulling it apart. I've got basic PHP and MySQL knowledge and see this as an opportunity to help build on that as well.

Time to get my hands dirty I think :)


Many thanks,
Robert

vbmechanic
04-25-2004, 04:49 PM
Hi vbmechanic,

As far as the templates are concerned I'd like to create new ones in order to seperate the homepage and the forums a bit.

I can see that this will get complex, I just don't want to step on anyone's toes by taking their work and pulling it apart. I've got basic PHP and MySQL knowledge and see this as an opportunity to help build on that as well.

Time to get my hands dirty I think :)


Many thanks,
Robert
No problem..

I just meant you don't have to template the code if you don't want to. You can have it output HTML straight from the PHP without going through the template system. If you do this first, it makes the coding a bit easier.. then once you've got it working how you want it, move the HTML parts into a template.

I don't think there is any harm in examining someone else's code to learn how to do things. Good luck!