Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Any-forum News hack Details »
Any-forum News hack
Mod Version: 1.00, by JJR512 (Member) JJR512 is offline
Developer Last Online: Jun 2006 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 2.2.x Rating: (0 vote - 0 average) Installs: 21
Released: 18 Dec 2001 Last Update: Never Downloads: 0
Not Supported Is in Beta Stage  

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: http://www.vbulletin.org/forum/showt...281#post210281

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Add-On Releases DnP AJAX Custom News Link - Offer the best news to your forum visitors silveryhat vBulletin 3.8 Add-ons 129 19 Mar 2013 05:15
Forum News (News in a Forum) JJR512 vBulletin 2.x Full Releases 91 17 Sep 2003 18:09

  #61  
Old 02 Jan 2002, 02:08
slideboxer's Avatar
slideboxer slideboxer is offline
 
Join Date: Dec 2001
Is there a way I can call the news from another page, a non-vb page?
Reply With Quote
  #62  
Old 02 Jan 2002, 05:13
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Real name: Justin J. Rebbert
slideboxer, possibly, but I'm not sure what the results would be if you just used a simple include statement...you might need to reformat the templates.

***

After having this hack in operation for a day or so on my real board, I've fixed a few minor little details that escaped me earlier. Most critical, though, is an entire group of instructions that I forgot to include, that without doing, would leave some of the features of this hack unusable. This section of the instructions adds settings to your Admin CP (in the vBulletin Options section as a new group of settings) that allow you to turn on or off vB Code support in news items, the img tag, post icons, etc. It also allows you to set the maximum length of an article, as well as how many appear on the page.

Because there were some minor modifications to the two main code files (newspost.php and homeindex.php), I have attached a new ZIP file to this post. If you have already installed the second version of this hack (posted a day ago), please upload the two main files, and follow Part 5 in the Instructions (the first four Parts are the same and can be skipped). If you have installed the original version (from the first post), please uninstall it by reversing the directions, then just start with the new version from scratch.

EDIT: Hack updated; see Post #69
__________________
-Justin J. "JJR512" Rebbert
www.JJR512.com: Chat about anything!

Last edited by JJR512; 02 Jan 2002 at 21:36.
Reply With Quote
  #63  
Old 02 Jan 2002, 10:28
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Real name: Brian
How can I make a already made post a news Item, I see the option when you first make a post but when I go and edit a post an option is not there?

Other than that, great hack.

Owe, the second part worked well.
Reply With Quote
  #64  
Old 02 Jan 2002, 17:18
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Real name: Justin J. Rebbert
On the news page (homeindex.php), to only people that have permission to post news, there should appear a link that says "Create New News Item" just above the list of news items (just above the first item). You should copy the URL to the thread you want to make a news item from, then click that link, and paste the URL into the form. From there, the process is just like if you did it when you posted the thread. Please note, this only allows you to make a news item from the first post in the thread...this is a limitation that just ocurred to me, and something I may work on for a future version.
__________________
-Justin J. "JJR512" Rebbert
www.JJR512.com: Chat about anything!
Reply With Quote
  #65  
Old 02 Jan 2002, 18:25
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Real name: Brian
Regarding the below, Ummmmmm NO!

I dont know if Im doing something wrong but the link "Create New News Item" does not appear (see attached pic)

????? Lost




Originally posted by JJR512
On the news page (homeindex.php), to only people that have permission to post news, there should appear a link that says "Create New News Item" just above the list of news items (just above the first item).
Reply With Quote
  #66  
Old 02 Jan 2002, 18:29
slideboxer's Avatar
slideboxer slideboxer is offline
 
Join Date: Dec 2001
I'm having the same problem. No linkie
Reply With Quote
  #67  
Old 02 Jan 2002, 20:34
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Real name: Justin J. Rebbert
In homeindex.php, please find:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And change this to:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Also, please make sure that you installed the template main_news_showcreatelink with the contents from the text file of the same name, and that your usergroup permissions are set to allow posting news items.

The corrected homeindex.php is also in the ZIP file in the previous attachment.
__________________
-Justin J. "JJR512" Rebbert
www.JJR512.com: Chat about anything!
Reply With Quote
  #68  
Old 02 Jan 2002, 21:06
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Real name: Brian
main_news_showcreatelink

I cannot find this template in my downloaded version?
Reply With Quote
  #69  
Old 02 Jan 2002, 21:39
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Real name: Justin J. Rebbert
OK, sorry about that! That was a change I made to homeindex.php, to use a template for the link rather than having it hardcoded in the file. But I forgot to include the new template.

The new template is in the attached ZIP. Please add the new template, also please UPDATE the template main_newindex because it has changed as well (I moved the link to below the news items rather than above it, for cosmetic reasons; you do not have to make this change if you'd rather have the link above). May as well also re-upload the two .php files, too.

UPDATE: This hack has been updated, as mentioned below in Post #81, where the attachment is now located.
__________________
-Justin J. "JJR512" Rebbert
www.JJR512.com: Chat about anything!

Last edited by JJR512; 07 Jan 2002 at 17:02.
Reply With Quote
  #70  
Old 02 Jan 2002, 22:32
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Real name: Brian
I have another problem.

When I say yes to "Can post news items" the option called "Can post news items" changes to No and does the opposite if I say No it chages to yes.

Is this suposed to happen?

Also the option "Can post news items" never stays ticked when saved.

Strange?

Reply With Quote
  #71  
Old 02 Jan 2002, 22:38
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Real name: Justin J. Rebbert
You must have something backwards in your usergroup.php file...I'll take another look at it for you, if you want.
__________________
-Justin J. "JJR512" Rebbert
www.JJR512.com: Chat about anything!
Reply With Quote
  #72  
Old 02 Jan 2002, 22:46
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Real name: Brian
Sent email asking for your addy M8.

Thanks again.

Brian

Originally posted by JJR512
You must have something backwards in your usergroup.php file...I'll take another look at it for you, if you want.
Reply With Quote
  #73  
Old 02 Jan 2002, 23:27
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Real name: Justin J. Rebbert
Your direct email address doesn't seem to be working...so: webmaster@jjr512.com
__________________
-Justin J. "JJR512" Rebbert
www.JJR512.com: Chat about anything!
Reply With Quote
  #74  
Old 03 Jan 2002, 00:33
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Real name: Justin J. Rebbert
I have the file fixed for you, but am unable to send email to either of your two addresses; they're getting returned.
__________________
-Justin J. "JJR512" Rebbert
www.JJR512.com: Chat about anything!
Reply With Quote
  #75  
Old 04 Jan 2002, 02:14
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Real name: Brian
Sorted the templates out and all seemed fine. I started to install a few news pages for members and in fact did 8 all 100%.

Here: http://www.skytronic-forums.com/homeindex.php

The problem I have now is it will not let me enter a 9th news post, coming back with a mysql error:

Database error in vBulletin 2.2.1:

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

Date: Friday 04th of January 2002 03:13:35 AM
Script: http://www.skytronic-forums.com/newspost.php
Referer: http://www.skytronic-forums.com/news...on=makenewnews

And now regardless of what post I try it comes back with the same error?

Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 18:26.

Layout Options | Width: Wide Color: