Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2004, 12:57 PM
Noiz Pollution Noiz Pollution is offline
 
Join Date: Jun 2003
Location: Glasgow, UK
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default a bit reluctant to post this...

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] 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
Reply With Quote
  #2  
Old 04-20-2004, 12:20 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 04-20-2004, 09:15 AM
Noiz Pollution Noiz Pollution is offline
 
Join Date: Jun 2003
Location: Glasgow, UK
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
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
Reply With Quote
  #4  
Old 04-22-2004, 06:41 PM
Noiz Pollution Noiz Pollution is offline
 
Join Date: Jun 2003
Location: Glasgow, UK
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Could nobody even point me at which files to look at copying code from? Or would this infringe on copyright?
Reply With Quote
  #5  
Old 04-25-2004, 03:13 PM
Noiz Pollution Noiz Pollution is offline
 
Join Date: Jun 2003
Location: Glasgow, UK
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK I guess not then...
Reply With Quote
  #6  
Old 04-25-2004, 03:51 PM
vbmechanic vbmechanic is offline
 
Join Date: Jan 2004
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 662C
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.

PHP Code:
$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.
Reply With Quote
  #7  
Old 04-25-2004, 04:27 PM
Noiz Pollution Noiz Pollution is offline
 
Join Date: Jun 2003
Location: Glasgow, UK
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by vbmechanic
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.

PHP Code:
$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
Reply With Quote
  #8  
Old 04-25-2004, 04:49 PM
vbmechanic vbmechanic is offline
 
Join Date: Jan 2004
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 662C
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!
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 05:05 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.10057 seconds
  • Memory Usage 2,243KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete