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
  #42  
Old 12-27-2001, 07:45 AM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have the basic functionality of the new version working, I'm pretty sure. I still have some details to clean up, such as a way to edit a news item now that news items are stored separately from the thread/post. But I am about to go to bed now, and I would like for some people to test out the new version on a basic level, in case there's something I've missed that doesn't work right.

Let me briefly re-explain how the new version works, first of all.

The old version simply looked in the thread table for threads marked as news items, then found the first post for the thread and got the message body from that post and re-displayed it on a separate page, the news page. What was shown as the news item was always whatever was in the first post of a thread marked as a news item. What I didn't like about that was that for the thread (as seen the normal way in the message board), I might want to post the entire news article that I've copied from some other site, but for the news item (what shows up on the news page), I might only want one or two paragraphs to show up. Just an excerpt, to keep things brief.

Now I could have easily set it up so the news page only shows the first 500 characters, or some other number you choose, of the message body from the thread's first post. But this can throw off bbcode parsing, for example if the 500 characters ends in the middle of a vB code tag. I could just not bbcodeparse what goes on the news page, but then we lose the nice formatting that imparts. Another added bonus is that with the new way I am introducing here, you aren't limited to the first 500 characters; sometimes the second and third paragraphs are better to put on a news page, because the first few lines might just be sub-headline stuff you don't need there. This new method I am introducing here gives you much more flexibility, as you are about to see.

So what is this new method? Well, I described it in my previous post, but I'll reiterate. Basically, when you start a thread and check the box to make it a news item, now what will happen is you will go to a new page which looks a lot like the new thread or new reply page. This page will have the subject (or "headline") and message (or "article") areas already filled with the subject and message you already typed out in the new thread page. But this is where the magic is...you see, you can now edit what is in those areas, to make it different from what shows up in the thread as seen in the message board. What you leave here will show up on the news page. You don't have to make any changes, if you don't want to; you can just leave it as it is, and click the Submit button again, what goes on the news page matches what goes in the thread. But you can change it, you can shorten it, you can remove or add vB Code tags, whatever. If you really wanted to, you could even completely change the text; I don't know why you would want to, I'm just illustrating the independence of the news item from the thread.

Please go here: http://www.jjr512.com/testvb/index.php and test it out. Start a new thread (unregistered users should still have Super Moderator abilities), be sure to check it as a news item, and submit it. Then you see the new form; go ahead and change it, just so you see. After you submit the new form, you get taken to the news page; see how it has whatever you left in the previous form, before you submitted it. Then click the link that takes you to the thread, and see how it still has whatever you originally started the thread with, before you changed it for the news page.

I think all I have left to do is make a way for you to be able to edit the news item (what you see on the news page). Do not bother to do the Edit Thread process, because that now is not involved (the "is news" check box is still there, but that isn't used anymore, I just haven't taken it out yet).

Also, to sianews: You will notice the URL field is there on the new form. So yes, that feature will be there. But so far, I haven't fixed the template so it shows up on the news page yet, but rest assured, it will be there; that's just a cosmetic fix now, since the structure is set up for it.

So please go try it out and let me know what you think. I have to make that edit method I just mentioned, I have to fix back the Edit Thread screen, I have to add that URL field to the news page, I have a few other minor things to put back on the news page, like the nav links...if there is anything else I need to do, let me know.

Once I get those details worked out, I will re-release this hack. But I already have plans for the NEXT release: making it multi-page ready, so you aren't just limited to a hard number of news items, but rather to a number of news items per page, with a "next page" link that takes you to the next xx oldest news items. I also would like to add some type of search feature, that would search through the news items themselves. But we'll worry about these things later; let's focus on what we have now, see that the basic idea works OK, then I'll get those other details taken care of and we'll have us a new release in the next day or two.
Reply With Quote
  #43  
Old 12-27-2001, 09:14 AM
Dockaych Dockaych is offline
 
Join Date: Nov 2001
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just tested out your system, and I have to say... it's a little strange. I completely understand how it works, but to me it just seems to overly complicate things!! The advantages of using a forum based news system over something like Newspro are that what will appear on the news listings will be exactly the same as the thread. Your system seems to introduce a completely new and seperate news management system (you will have to have archiving, news editing abilities, etc etc).

I'm not belittling the time and effort you've put into this, I'm just giving my genuine impressions of it.

Personally, I would have preferred to see something more intuitive and frankly less complicated, such as the option of news specific tags in the post, such as [summary]This is the summary which will appear on the news page, but will be hidden in the forum[/summary]. Anyway, this is just my opinion.

The system you have is quite powerful I just hope that it's increased complexity doesn't cripple it's simplicity.
Reply With Quote
  #44  
Old 12-27-2001, 06:26 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I understand what you're saying. As with many things, there are multiple ways to accomplish the same overall basic result, and each way as its own set of advantages and disadvantages. I considered some choices and decided on what I felt was best for me; this hack is primarily for me and my own board. I just put it here in case anybody else, after considering what it does and how it does it, decides that this is right for him/her and his/her board, too.

But you seem to have uncovered a bug in my system...I'm assuming that you signed a news post with "dock" in bold. Then you deleted the original thread. As it is now, deleting the thread has no effect on the news item, and the news item relies on the threadid to get the forumid, and if the script can't get a forumid, it causes a database error.

I guess what would make the most sense here is for me to fix it so that when a thread is deleted, a news item with the same threadid also gets deleted. In other words, if you delete a thread, any news item from that thread also gets deleted. Anyone have any thoughts on that?
Reply With Quote
  #45  
Old 12-29-2001, 01:16 PM
TheComputerGuy's Avatar
TheComputerGuy TheComputerGuy is offline
 
Join Date: Oct 2001
Location: TX
Posts: 580
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I love this hack, and want to install it but all I get is this error

Database error in vBulletin 2.2.0:

Invalid SQL: INSERT INTO post (postid,threadid,title,username,userid,postcount,d ateline,attachmentid,pagetext,allowsmilie,showsign ature,ipaddress,iconid,visible,hidden) VALUES (NULL,'637','','TheComputerGuy','8','1009638606',' 0','thats cool','1','1','206.42.40.97','0','1','0')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Saturday 29th of December 2001 10:10:06 AM



I even took a brand new copy of newthread.php and edited it
Reply With Quote
  #46  
Old 12-29-2001, 07:44 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It looks like you've done something with an "insert into post" query. My hack doesn't have anything to do with a query like that. I think you've edited in the wrong place.

I don't know how or why, but it looks like the postcount value is missing from this query. In the field names, postcount comes in between userid and dateline; in the values part, it goes right from 8, which I assume is more likely to be your userid and not your post count, to 1009638606, which is a dateline value. (Or if that is your postcount, then it's the userid value that's missing.)
Reply With Quote
  #47  
Old 12-29-2001, 09:41 PM
TheComputerGuy's Avatar
TheComputerGuy TheComputerGuy is offline
 
Join Date: Oct 2001
Location: TX
Posts: 580
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
  #48  
Old 12-30-2001, 08:28 AM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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=
Reply With Quote
  #49  
Old 01-01-2002, 05:27 AM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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: https://vborg.vbsupport.ru/showthrea...456#post210456
Reply With Quote
  #50  
Old 01-01-2002, 07:02 AM
slideboxer's Avatar
slideboxer slideboxer is offline
 
Join Date: Dec 2001
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
  #51  
Old 01-01-2002, 07:37 AM
slideboxer's Avatar
slideboxer slideboxer is offline
 
Join Date: Dec 2001
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
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 08:38 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05225 seconds
  • Memory Usage 2,337KB
  • Queries Executed 27 (?)
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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete