Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Beta Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by JJR512 JJR512 is offline
Developer Last Online: Jun 2006 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 12-17-2001 Last Update: Never Installs: 21
Is in Beta Stage  
No support by the author.

We've all seen plenty of news hacks here before. I'm talking about a hack that gets all new threads in a specific forum and shows the first post from the new threads on a separate, non-vB page. These hacks usually show a specific number of threads that you specify, or all threads from the past number of days that you specify. The forum that these threads come from is setup by you, by putting the forumid numbers in a variable in the hack's code file.

I feel that this is a limited system. You are limited to posting news items only in the one or few threads that you specify up front are to be used to get news items from, and then those forums are limited to only posting news items in (because every new thread in it becomes a news item). This just didn't seem like the best solution to me, because if I wanted to cover a particular topic, for example, computer hardware, I would have to have two separate forums: One to post hardware news, and one for non-news items like help and tips.

So what makes my hack different is that you can now post news items in ANY forum. When you post a new thread, there will be a new option in the same area as "parse urls" and "disable smilies"; this new option is called, "make a news item?" If you leave that box unchecked, the thread gets posted as normal. But if you check it, then not only does the thread get posted, but it will also show up on a separate page. So now, you can post news items and non-news items in the same forum, in any forum, and only the threads you want to be news items will show up as news items.

I have set up a permission for this checkbox, so it will only appear for the usergroups you want it to appear for. Setting this permission is just like setting any other usergroup permission, like the ability for the usergroup to post new threads, move threads, download attachments, etc.

You can change the news status of a thread, in other words, change a thread from being a news item to not a news item, or vice-versa, via a new option that appears on the Edit Thread screen from the Admin Tools.

This hack also includes a simple "latest threads" feature, that on the same page as the news items will show the most recently-replied to threads (the most recently active threads). I did these two things together because I knew they would be very similar to code, and would appear on the same page. However, each part is completely separate from the other part, and it is very easy to only use one part of the hack or the other.

Here is an image of the checkbox:


Here is the new permission setup (by default, for any new usergroups you create, this permission will be set to 'NO'):


There is a working demo of this hack. The test forums is located here, and the news page is located here. You can use the test forums as an unregistered user; I have set up the unregistered usergroup to have Super Moderator powers, so you should be able to play around with the Edit Thread admin tool, etc.

I'm posting this in the Beta forums because I'd like for some other people to let me know it works OK for them. It works fine for me, on two boards; I originally wrote it and developed it for my regular board, which was heavily hacked to begin with. I then setup a clean, unhacked, totally stock board as a testing grounds, and recreated the hack, and again, it worked fine. I want to confirm that it works fine for at least one other person, but I'm also hoping that someone more experienced than myself can take a look at it to see if I've coded it the best way possible.

The other issue I hope to address here in Beta relates to how the text from news item threads is formatted to appear on the news page. Currently, this hack gets the entire contents of the first post of a thread, and it is run through the bbcode parser, so what you see on the news page is just like what you see in the thread itself, including smilies, all vB Code tags converted, etc. Also, the entire post is used; it is not run through any process that limits it to a certain number of characters. The reason I did not set up a character limit was mainly so that the bbcode parser would not get confused if a closing tag was completely or partially cut out. I figured that since I included a permission system, that at least for me would limit the ability to make a thread a news item to Admins and Mods, I could teach my staff to keep news item threads short.

However, I have toyed with the idea (in my mind) of changing the hack so that if you check a box to make a thread a news item, when you submit the thread, instead of the thread being posted straight away, instead, first you are taken to another page with a textarea containing the contents of the post. In this second textarea, which contains what you just typed in the normal newthread screen, you can edit or change what you typed, and what you do here would get stored in an additional field added to the thread table, and this is what would get shown on the news page. That way, you could start a thread, put an entire news article in it or whatever, mark it to be a news item, submit it, then pare down the contents of the post to just a little blurb suitable for a news item display on the news page, while the original bit you typed gets saved as a post and shown in the thread as normal. (Hope that makes sense.) If I hear enough of a demand for something like this, or get any other ideas, I may consider it. The downside to this is it becomes a little more complicated to post a news item thread.

OK, so install it or play with the demo, and let me know if it's ready for a full release!

Edit on Jan. 1, 2002: This hack has been updated to Version 2, with new features as discussed throughout this thread. Please go to this post: https://vborg.vbsupport.ru/showthrea...281#post210281

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #92  
Old 01-23-2002, 07:27 AM
dlst dlst is offline
 
Join Date: Dec 2001
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi JJR512, thanks for all the hard work you've put into this.

I've installed the latest release, and have found the following problems/bugs that I haven't seen mentioned:

problem 1: SQL Error

Go to homeindex.php (stock, I have not modified it from newest release)
Click on "Create a new news item"
Without entering anything, click on "Submit thread URL"
The following error occurs:

Invalid SQL: SELECT forumid FROM thread WHERE threadid=
mysql error: You have an error in your SQL syntax near '' at line 1

mysql error number: 1064

I guess because there is no threadid and therefore the select fails... While you're in "error-checking-mode" is there a way to verify the URL is valid, belongs to this site, etc. before continuing?

problem 2: Javascript Error in newspost.php

Start a new thread, making the thread a news item. You get redirected to newspost.php.
Click on "Submit" after making no changes to your input.
The following error occurs:

A javascript pop-up (via IE5.5) with "A run-time error has occurred, line 58 with the following error:
'subject.value' is null or not an object"

The script continues to process, and you end up at homeindex.php, but no news items show up. The page is otherwise complete, but without news items. I get the empty page you see here: http://207.235.6.72/forum/homeindex.php

problem 3: Permissions problem in forumpermission.php

If you go to the admin, under "Forums & Moderators", click on "Permissions"
If you set custom permissions for a forum here, it has the effect of DISallowing news posting privileges for the group whom you have just changed.

For example, if you click on Administrators-Edit, select "Use Custom Settings", leave ALL the settings alone, and submit... you will find that Administrators are no longer able to post news items to that board.

-------

Thanks again for this great hack.

-dlst
Reply With Quote
  #93  
Old 01-26-2002, 03:28 AM
dlst dlst is offline
 
Join Date: Dec 2001
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm... anybody home? Well in case anyone is reading this thread, I found the solution to the Javascipt error I found:

[QUOTE]Originally posted by dlst

problem 2: Javascript Error in newspost.php

Start a new thread, making the thread a news item. You get redirected to newspost.php.
Click on "Submit" after making no changes to your input.
The following error occurs:

A javascript pop-up (via IE5.5) with "A run-time error has occurred, line 58 with the following error:
'subject.value' is null or not an object"

[/B]
Reply With Quote
  #94  
Old 01-26-2002, 03:50 AM
dlst dlst is offline
 
Join Date: Dec 2001
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Man, I'm on a role... I fixed problem one (sort of). First, here's the problem (quoted from above):

[QUOTE]Originally posted by dlst
problem 1: SQL Error

Go to homeindex.php (stock, I have not modified it from newest release)
Click on "Create a new news item"
Without entering anything, click on "Submit thread URL"
The following error occurs:

Invalid SQL: SELECT forumid FROM thread WHERE threadid=
mysql error: You have an error in your SQL syntax near '' at line 1

mysql error number: 1064

I guess because there is no threadid and therefore the select fails... While you're in "error-checking-mode" is there a way to verify the URL is valid, belongs to this site, etc. before continuing?

Reply With Quote
  #95  
Old 01-26-2002, 04:37 AM
dlst dlst is offline
 
Join Date: Dec 2001
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok fine, I'll do my own homework! Sheesh. J/K

As I posted above, It would be nice to have the script verify the validity of the URL and present the user with a meaningful error message... and NEVER a MySQL error. Well, it's done, with a few modifications to newspost.php.

[QUOTE]Originally posted by dlst
problem 1: SQL Error

Go to homeindex.php (stock, I have not modified it from newest release)
Click on "Create a new news item"
Without entering anything, click on "Submit thread URL"
The following error occurs:

Invalid SQL: SELECT forumid FROM thread WHERE threadid=
mysql error: You have an error in your SQL syntax near '' at line 1

mysql error number: 1064

I guess because there is no threadid and therefore the select fails... While you're in "error-checking-mode" is there a way to verify the URL is valid, belongs to this site, etc. before continuing?

Reply With Quote
  #96  
Old 01-26-2002, 04:00 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by slideboxer
Is there a way I can call the news from another page, a non-vb page?
Reply With Quote
  #97  
Old 01-26-2002, 05:39 PM
slideboxer's Avatar
slideboxer slideboxer is offline
 
Join Date: Dec 2001
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nakkid, thanks a bunch.
Reply With Quote
  #98  
Old 01-27-2002, 11:39 PM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I know you guys are all working with the new version of this hack, but I'm still using the original one and I love the results. the newer one just had too much going on. the original hack was simple and did a great job. make a post and mark it to be placed on the homepage. done and simple. I I have it ignore poll posts that have been marked as news. then copied the get news sub and have it ignore all non poll posts using differnt tempates for those.

now I have my news items donw the center, activbe topics off to the side, and polls in a small box to the side. you can vote from there or if you've already voted you see the results. I also added a modified version of the vbportal calendar and remake of the welcome panel.

anyway, just wanted to say thanks for the great any forum news hack. When I'm done with it, it's going to make for a real nice homepage

http://www.ccdv.com/forum/homeindex.php

PS - I'd still like to come up with a nice way to truncate the message without screwing up the vbcode and without this whole second post thing in the new version. bigmattyh had something that looked like it would work, but I couldn't get it to.
Reply With Quote
  #99  
Old 01-27-2002, 11:43 PM
bigmattyh's Avatar
bigmattyh bigmattyh is offline
 
Join Date: Nov 2001
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Mutt,

I think I'll go back and see if I can include a different version of the truncation process -- one that's much more flexible. Maybe tonight, or tomorrow?

Matt
Reply With Quote
  #100  
Old 02-01-2002, 03:06 AM
slideboxer's Avatar
slideboxer slideboxer is offline
 
Join Date: Dec 2001
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm sure this is probably an easy fix but I'm simply no hacker - cut and paste? now that's a different story . I'm trying to include my welcome panel (from the welcome panel hack) in the main_newindex template. How do I get the welcome panel information to display in in this template the same way it does in the forumhome template?

Plus, any news on getting the polls to work?
Reply With Quote
  #101  
Old 02-01-2002, 12:45 PM
SirSteve SirSteve is offline
 
Join Date: Oct 2001
Posts: 382
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Am I able to select/override what forums/subforums the "News" checkbox is in? Obviously, if I have a news forum, I don't need this checkbox to be displayed.
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 10:50 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.05135 seconds
  • Memory Usage 2,321KB
  • Queries Executed 25 (?)
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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete