Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-24-2004, 02:09 PM
Jhorra Jhorra is offline
 
Join Date: Apr 2004
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Simple query request

Greetings,

I have been looking around for a good portal or CMS, but have yet to find one that I like. Thus I am just going to put together a simple one myself for my site. The problem is I'm not familiar enough with php to put together the correct query. I need three querys:

Query for last five news posts, specific forum for news.
Query for latest poll and how to output the graph.
Query for welcome box information.

I can manipulate the results for all but the poll. I don't know how to make the graph. Can anyone help me out with this?
Reply With Quote
  #2  
Old 05-24-2004, 04:34 PM
Dark_Wizard Dark_Wizard is offline
 
Join Date: Nov 2001
Location: North Carolina
Posts: 1,251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jhorra
Greetings,

I have been looking around for a good portal or CMS, but have yet to find one that I like. Thus I am just going to put together a simple one myself for my site. The problem is I'm not familiar enough with php to put together the correct query. I need three querys:

Query for last five news posts, specific forum for news.
Query for latest poll and how to output the graph.
Query for welcome box information.

I can manipulate the results for all but the poll. I don't know how to make the graph. Can anyone help me out with this?
Take a look at how it's done in poll.php and it's associated templates...
Reply With Quote
  #3  
Old 05-24-2004, 04:40 PM
Jhorra Jhorra is offline
 
Join Date: Apr 2004
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I can do that for the poll. Is there something I can look at for a welcome box? Basically I want it to pull their Avatar, username and probably if they have a new private messages.

The last 5 news posts I think I know how to do that, but I'm not positive on all the variables. If I had to guess I would say it looks something like this:
PHP Code:
$query "SELECT * from posttable WHERE forum = newsforum and "something to indicate its a new post and not a reply" limit 5" 
Does that look right?
Reply With Quote
  #4  
Old 05-24-2004, 04:45 PM
Dark_Wizard Dark_Wizard is offline
 
Join Date: Nov 2001
Location: North Carolina
Posts: 1,251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jhorra
Ok, I can do that for the poll. Is there something I can look at for a welcome box? Basically I want it to pull their Avatar, username and probably if they have a new private messages.

The last 5 news posts I think I know how to do that, but I'm not positive on all the variables. If I had to guess I would say it looks something like this:
PHP Code:
$query "SELECT * from posttable WHERE forum = newsforum and "something to indicate its a new post and not a reply" limit 5" 
Does that look right?
Close...the table would be "thread" and it would be forumid = $newsforumid

this depends on how you set it up...have you looked at vBIndex or vBAdvanced for a portal system? They are both excellent products.
Reply With Quote
  #5  
Old 05-24-2004, 04:49 PM
Jhorra Jhorra is offline
 
Join Date: Apr 2004
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I don't like the floating box look. I want it to fit into this page www.thechristianparent.com The top box on the left will be the welcome box, the second one will be for polls. Then the middle area will be the 5 news posts, except I'll format it so it's more like slashdot news than a post window that you get with vbadvanced.

As far as the query, do I need to put something in to differentiate whether it's a reply or a new thread?
Reply With Quote
  #6  
Old 05-24-2004, 04:57 PM
Dark_Wizard Dark_Wizard is offline
 
Join Date: Nov 2001
Location: North Carolina
Posts: 1,251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jhorra
Well I don't like the floating box look. I want it to fit into this page www.thechristianparent.com The top box on the left will be the welcome box, the second one will be for polls. Then the middle area will be the 5 news posts, except I'll format it so it's more like slashdot news than a post window that you get with vbadvanced.

As far as the query, do I need to put something in to differentiate whether it's a reply or a new thread?
It's a little more than that...it would involve the post table and the thread table for the info....
Reply With Quote
  #7  
Old 05-24-2004, 05:01 PM
Jhorra Jhorra is offline
 
Join Date: Apr 2004
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you give me the fields I need to query from both tables? I should be able to figure it out from there.
Reply With Quote
  #8  
Old 05-24-2004, 05:18 PM
Reeve of shinra's Avatar
Reeve of shinra Reeve of shinra is offline
 
Join Date: Oct 2001
Location: NYC
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can just toss the html for that front page into the template for vbindex and work with it a little to get the results your looking for. Personally, I think thats one of the stronger points of VBIndex and VBadvanced. Building your own portal page is a good excersize though so best of luck.
Reply With Quote
  #9  
Old 05-28-2004, 03:54 PM
Jhorra Jhorra is offline
 
Join Date: Apr 2004
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What do I look for to do the welcome box, does vB use sessions where I can just pull the session value, or do I need to check the cookie?
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 09:38 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.04198 seconds
  • Memory Usage 2,241KB
  • Queries Executed 11 (?)
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
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_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