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

  #46  
Old 29 Dec 2001, 22:41
TheComputerGuy's Avatar
TheComputerGuy TheComputerGuy is offline
 
Join Date: Oct 2001
Real name: Joe
I will get a new copy of Vb and insert ur hack first...sorry for taking ur time up, but thanks for the hack
Reply With Quote
  #47  
Old 30 Dec 2001, 09:28
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Real name: Justin J. Rebbert
I believe I have completed the functionality of the new release. There are a few cosmetic things to tidy up, I still have to display the source URL, but basically, it's done.

I would like some more testing/input before I wrap it up as a release...I'll wait a day or two before releasing it.

There are now methods to edit and delete news items, as well as create a new news item based on a thread that wasn't previously a news item.

To edit, click the edit link on a news post's dateline; this will take you to a screen just like an edit post screen. It has the familiar Delete bit at top, and the message below. It works exactly the same way as editing a post.

To make a new news item after you have already posted the thread, simply copy the URL to the thread, then click the link on the news page above all the news items that says, "Create new news item," and copy the URL into the appropriate field on the next screen. This is similar to vBulletin's Merge Threads funtion, the way the screen works. Just put in the URL and submit it; you are then taken to the same screen to edit your news item that you would see if you had done it the normal way, by submitting a new thread and checking the Make News Item box.

Please note that deleting a news item has absolutely no effect on the thread it was based on. However, deleting a thread will delete any news item based on it.

Test board: http://www.jjr512.com/testvb/index.php?s=
__________________
-Justin J. "JJR512" Rebbert
www.JJR512.com: Chat about anything!
Reply With Quote
  #48  
Old 01 Jan 2002, 06:27
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Real name: Justin J. Rebbert
OK, everything seems to work fine, so I'm going to release it now.

For the record, about Dockaych's issue of private forums being shown: I have added a permission-checking system so that any particular user will only see headlines and news items from forums he/she is able to view. This means an Admin will see headlines from admin forums, whereas a regular member will not. To test this, just post something in a private forum, see that you can see it, then log out, and see that you can't see it.

Please let me know if you have any problems with my installation directions or the hack itself.

If you have already installed the previous version, I highly recommend completely uninstalling it before installing the new version. This includes all database modifications, because they are not used by this new version.

EDIT: This hack has been updated; the latest version is here: http://www.vbulletin.org/forum/showt...456#post210456
__________________
-Justin J. "JJR512" Rebbert
www.JJR512.com: Chat about anything!

Last edited by JJR512; 02 Jan 2002 at 05:15.
Reply With Quote
  #49  
Old 01 Jan 2002, 08:02
slideboxer's Avatar
slideboxer slideboxer is offline
 
Join Date: Dec 2001
Awsome, I've been dying to set this up on my board but have been waiting for the release. Thanks, and great job!
Reply With Quote
  #50  
Old 01 Jan 2002, 08:37
slideboxer's Avatar
slideboxer slideboxer is offline
 
Join Date: Dec 2001
At the risk of sounding ignorant let me ask this...

The instructions involve creating a new table in the sql database. How do I go about doing this? :stupid:
Reply With Quote
  #51  
Old 01 Jan 2002, 08:43
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Real name: Justin J. Rebbert
Do you have access to a tool like phpMyAdmin, or can you telnet into your account?
__________________
-Justin J. "JJR512" Rebbert
www.JJR512.com: Chat about anything!
Reply With Quote
  #52  
Old 01 Jan 2002, 08:44
slideboxer's Avatar
slideboxer slideboxer is offline
 
Join Date: Dec 2001
Got the telnet... Have to check on that tool, though.
Reply With Quote
  #53  
Old 01 Jan 2002, 08:48
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Real name: Justin J. Rebbert
I'm not exactly sure how to run queries via telnet, but maybe someone else can look in the instructions to see what needs to be done, and tell you exactly how to do it via telnet.
__________________
-Justin J. "JJR512" Rebbert
www.JJR512.com: Chat about anything!
Reply With Quote
  #54  
Old 01 Jan 2002, 09:03
slideboxer's Avatar
slideboxer slideboxer is offline
 
Join Date: Dec 2001
OKay, I went and found and installed phpMyAdmin.. now what? :stupid:
Reply With Quote
  #55  
Old 01 Jan 2002, 09:12
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Real name: Justin J. Rebbert
Well, you select your database on the left side (if you have more than 1), click it to open the list of all the tables, then on the right side below the list of tables is a box that says Run SQL query/queries etc. Copy the query into that box and hit Go.

Don't forget to make a backup copy of your database first. You can do that through the admin cp.
__________________
-Justin J. "JJR512" Rebbert
www.JJR512.com: Chat about anything!
Reply With Quote
  #56  
Old 01 Jan 2002, 10:08
slideboxer's Avatar
slideboxer slideboxer is offline
 
Join Date: Dec 2001
I'm so proud of myself Got it up and running, no bugs, no problems. Thanks ofr your tie and help.
Reply With Quote
  #57  
Old 01 Jan 2002, 10:42
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Real name: Brian
Well done M8, Im glad you finaly have it up and running, especialy from the first version and problems you had.

One thing I like you have done and I hope all other hack makers take note of this is the fact that you state this in your instructions I QUOTE "Near the end of the line, before WHERE, right after "$cangetattachment", add this" in other words, other hacks ask you to totaly overwrite lines and therefore screw previous hacks up, you have asked users to add line rather than overwite.

Nice one.

Congrats M8.
Reply With Quote
  #58  
Old 01 Jan 2002, 10:53
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Real name: Justin J. Rebbert
Yeah, that was how I wrote the instructions originally (to overwrite the entire line), and that's what gave you the problems that you had earlier. It was 100% because of that which made me try to figure out a better way to write the instructions.

Most of the rest of the file modifications are just additions, not modifications of existing code, but there is one part that goes into newthread.php that modifies what's already there, and this will interfere with another hack...I know this because I wrote the other hack, too! It's the one that gives you a different redirect message for if you post a non-poll thread or a poll thread. You kind of have to look at what both hacks want you to do if you want them both to work...or I guess I will post what I, personally, am using on my board to solve it, if anybody needs me to.

Speaking of polls, there is still one thing that I haven't tested with this hack yet, and that's what happens when you check both to make a thread a poll and a news item. I know something not right is going to happen, because both polls and news items involve redirecting you to a different page after the thread gets posted. Either it will take you to the poll setup screen and you'll have to create the news item manually, or it will take you to the news item setup screen and not only will there be no poll in that thread, but it might not be visible, either, because when you check that poll box, the thread isn't made visible until after you setup the poll. I still need to look at this issue, see what happens, and figure out what to do about it. In the meantime, I suggest that nobody try to create both a poll and news item thread at the same time.
__________________
-Justin J. "JJR512" Rebbert
www.JJR512.com: Chat about anything!
Reply With Quote
  #59  
Old 01 Jan 2002, 14:29
TheComputerGuy's Avatar
TheComputerGuy TheComputerGuy is offline
 
Join Date: Oct 2001
Real name: Joe
YAY...

This hack is AWESOME!!!
__________________
I'll buy your forum!
Reply With Quote
  #60  
Old 01 Jan 2002, 14:51
TheComputerGuy's Avatar
TheComputerGuy TheComputerGuy is offline
 
Join Date: Oct 2001
Real name: Joe
on homeindex.php line 29 it states
$editlink="<a href=\"http://www.jjr512.com/testvb/newspost.php?s=$session[sessionhash]&action=editnews&newsid=$gnresults[newsid]\">(edit this news item)</a>";

That needs to be edited for your site....


Other than that...maybe I missed the instructions for this great hack, as I waited for this version to come out!
__________________
I'll buy your forum!
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 01:04.

Layout Options | Width: Wide Color: