Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-27-2010, 04:56 PM
burn0050 burn0050 is offline
 
Join Date: Sep 2008
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Active Posts Widget

Hi,
I'm trying to make a scrolling new posts widget. This will use javascript to poll a page every few seconds to look for new posts.

The main thing I can't figure out - how do I know what are only forum posts? There doesn't seem to be a field in the forum table that specifies what is the main forum - it looks like it has a main category, cms comments, main forum (this is a fresh install). Threads are in more than just the forum. Can anyone help?

The second thing will be putting javascript into a widget - it seems like the static html type would work for this, but from what I read it looks like I would have to create a new widget type. Is this correct?

Thanks!
Bill
Reply With Quote
  #2  
Old 08-27-2010, 05:08 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't understand your question. Posts are stored in the posts table.

I don't think you'd have to create a new widget type. If you are going to have a query, then you will want to use a PHP widget.
Reply With Quote
  #3  
Old 08-27-2010, 05:38 PM
burn0050 burn0050 is offline
 
Join Date: Sep 2008
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
I don't understand your question. Posts are stored in the posts table.

I don't think you'd have to create a new widget type. If you are going to have a query, then you will want to use a PHP widget.
Posts of all types are stored in the post table - comments on articles, for instance. I only want posts that are related to forums, not article or blog comments.

The query won't reside in the widget - the widget will use the xmlhttp object in javascript to hit a php page. This separate php page will contain the query that will return the latest posts to the user. The javascript will then insert new divs with post information - this will be a scrolling widget that will have divs added to the top that are new posts (really, links to the posts, just user subject and thread will be displayed).

Thanks,
Bill
Reply With Quote
  #4  
Old 08-27-2010, 08:20 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When you write your post query, you will exclude those posts that are in threads that are in forums that you don't want to include (like the article forum).
Reply With Quote
  #5  
Old 08-27-2010, 08:44 PM
burn0050 burn0050 is offline
 
Join Date: Sep 2008
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
When you write your post query, you will exclude those posts that are in threads that are in forums that you don't want to include (like the article forum).
Yes, that is my plan. What I'm asking is HOW to determine if a forum is a forum? I want to programmatically exclude posts that are not forum posts, but there's no way to tell in the forum table, from what I can see. I don't want to just exclude forum id '3' in the code - hardcode it - I want to be able to determine if an entry in the forum table is actually a forum and not something like a comment thread. I don't want to include/exclude based on the title, because the title can be changed.

The documentation talks about a form "category" - but I don't know how it makes that association. Is there another table for forum categories?
Reply With Quote
  #6  
Old 08-27-2010, 09:42 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The forum table lists forums. Period. ALL of those are listed in your Forum Manager. They are ALL forums. Some may then be identified as Categories. That option is stored in forum.options. It's bitfield is called "cancontainthreads" and the value is 4 (so, 0 if No, 4 if true). See the forumoptions bitfields defined in bitfield_vbulletin.xml. There is one forum set to contain article comments and that is set in $vbulletin->options['vbcmsforumid'], so it's a variable.
Reply With Quote
  #7  
Old 08-27-2010, 09:56 PM
burn0050 burn0050 is offline
 
Join Date: Sep 2008
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
The forum table lists forums. Period. ALL of those are listed in your Forum Manager. They are ALL forums. Some may then be identified as Categories. That option is stored in forum.options. It's bitfield is called "cancontainthreads" and the value is 4 (so, 0 if No, 4 if true). See the forumoptions bitfields defined in bitfield_vbulletin.xml. There is one forum set to contain article comments and that is set in $vbulletin->options['vbcmsforumid'], so it's a variable.
Thank you! Exactly what I needed to know!

So, if "cancontainthreads" is false(0) - then it is the comment forum? Or, would it be best to just exclude $vbulletin->options['vbcmsforumid'] in the query "and forumid <> " . $vbulletin->options['vbcmsforumid'] ? Or would I exclude all forums that can't contain threads (in case someone has created another forum that is something like a category)?

Thanks,
Bill
Reply With Quote
  #8  
Old 08-28-2010, 02:10 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the comment forum is not a category. It is just a plain forum like all other forums. The only difference is that you can get this forumid from the variable $vbulletin->options['vbcmsforumid'] (it's the setting in vboptions > Content Management > Associated Forum for Comments) So, you can use that variable in the query to not grab any posts that are in threads that are in the forum $vbulletin->options['vbcmsforumid']
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 02:21 AM.


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.05307 seconds
  • Memory Usage 2,227KB
  • 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
  • (3)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