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

Reply
 
Thread Tools
Logician NEWS: Drag Any Message to Your Main Page Details »»
Logician NEWS: Drag Any Message to Your Main Page
Version: 1.00, by Logician Logician is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 05-30-2002 Last Update: Never Installs: 105
 
No support by the author.

This is a news script which will drag vb forum messages from your vb db to your non-vb main page/news page. There are a lot of good news script around but I needed a highly customizable main page news script with some special features and wrote it myself. I'm using it in my site's main page for a long time, but I was just too lazy to write installation/help documents to share it here, sorry!

FEATURES:

* This script simply pulls forum messages which you marked as "news" from your vb database and post them in your non-vbulletin (main/other) page.
* You can mark messages as "NEWS" in any forum you want (including private forums). You dont need to restrict your news to a specific forum.
* You can drag any message to your main page, regardless of its date. So news is NOT supposed to be the most recent messages in your board.
* You do NOT have to carry the whole message to your main page as news. You can import it all or simply take some part of it. So eg. you can drag a message's the first paragraph to your news page and link the thread for "Read More".
* Moreover you can insert invisible custom NEWS text which will be dragged to your main page to your board messages, but not shown in the original forum thread. So your original thread message and news text on your main page can be different than eachother.
* You can have sticky news in your main page (even if they are not sticky in your forum).
* News does NOT need to be the first message in the thread. You can tag any reply message as news and pull it to your main page either.
* Script parses ALL of your message icons/smilies (including your custom add-ons) and some of the important vBCode like: [url] [email] [img] [b] [i] [u]
* You can specify which members may post news.
* You can form your News' title seperately, apart from of the original thread/message title.
* You can set maximum number of news shown in your main page.
* You can set maximum number of characters that all shown news should not exceed. Some messages can be long and some can be short and if you set a character limit, the script will automatically compile enough news from your database to fit your web page's relevant part according to the limit you set.
* You can enable/disable:
News Poster Name
News Date
News Read Number
News 'Send to a Friend' Link
Comment number/Add comment button/Last commenter
Will viewing news increase the original thread's view count or not
News is sticky or not
for ALL your news INDIVIDUALLY.
* All news tags are invisible in the original thread. So forum readers do not notice any difference when you tag a message as news.
* Dragging a message to your main page as news is as simple as inserting a hidden [news]Title of My News[/news] tag to your forum message.

Well, these features are what I needed in my news script, so it should suffice to you too!

It's an easy to install script and will work with ALL vbulletin versions because it's an add-on, not a hack. I can give support as much as I have time, but please ask here, not via email or PM.

If you use the script, please click INSTALL. If you post the URL of your news page after installation, you can help other users see the script in action in different pages and in custom designs, thank you!

Logician

Show Your Support

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

Comments
  #22  
Old 06-04-2002, 10:42 PM
rkettner rkettner is offline
 
Join Date: Oct 2001
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Although I love this script (GREAT JOB), one feature missing. I can't use my custom vb code within posts.

Example: I use
and
to center images in news posts. Of course, the code translates to HTML that does the centering work.

Unfortunately, the news output does not center the images, and reveales the [center] codes.

ANY FIXES?
Reply With Quote
  #23  
Old 06-05-2002, 12:46 AM
rkettner rkettner is offline
 
Join Date: Oct 2001
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One more thing... it seems quotes don't work in titles. For example..

This type of title works perfectly

This type of title "does not" work

Is there any fix for this?
Reply With Quote
  #24  
Old 06-05-2002, 11:07 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
it seems quotes don't work in titles
Yep good catch. I have to work on that for sometime but here is quick fix for you if you need to use " in the title:
In newsconfig.php, find:
preg_match("/(\[)(news)(])(\r\n)*([^\"]*)(\[\/news\])/siU", $news[$i][pagetext], $matches1);

and replace it as:
preg_match("/(\[)(news)(])(\r\n)*([^`]*)(\[\/news\])/siU", $news[$i][pagetext], $matches1);

and find:
$news[$i][pagetext]= preg_replace("/(\[)(news)(])(\r\n)*([^\"]*)(\[\/news\])/siU", "" ,$news[$i][pagetext]);

and replace it as:
$news[$i][pagetext]= preg_replace("/(\[)(news)(])(\r\n)*([^`]*)(\[\/news\])/siU", "" ,$news[$i][pagetext]);

it should do the trick..

Quote:
I can't use my custom vb code within posts.
This is not a bug. As I said in my original post the script parses ALL your smilies and message icons and SOME of your important vb code. This behaviour is intentional. I could add a feature to parse all your vb code, but I didnt want to add an extra SQL query as this script is intended to be a main page script which means it will run so many times and every query we save in such a script will significiantly increases your SQL performance. Therefore I just added the feature to parse only important vb codes like [i] [b] [u] [email] [url] and [image]. If you want to add others, you can do it with little PHP knowledge and some practise:

Check the code:

$news[$i][pagetext]= preg_replace("/(\[)(b)(])(.*)(\[\/b\])/siU", "<b>\\4</b>",$news[$i][pagetext]);

You can use this sample to add extra vbcode. For example add this line after them:

$news[$i][pagetext]= preg_replace("/(\[)(center)(])(.*)(\[\/center\])/siU", "<div align='center'>\\4</div>",$news[$i][pagetext]);

Not tested but this should parse [center] tag correctly.

Regards,
Logician
Reply With Quote
  #25  
Old 06-05-2002, 04:37 PM
rkettner rkettner is offline
 
Join Date: Oct 2001
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Logician
[B]
Yep good catch. I have to work on that for sometime but here is quick fix for you if you need to use " in the title:
In newsconfig.php, find:
preg_match("/(\[)(news)(])(\r\n)*([^\"]*)(\[\/news\])/siU", $news[$i][pagetext], $matches1);

and replace it as:
preg_match("/(\[)(news)(])(\r\n)*([^`]*)(\[\/news\])/siU", $news[$i][pagetext], $matches1);

and find:
$news[$i][pagetext]= preg_replace("/(\[)(news)(])(\r\n)*([^\"]*)(\[\/news\])/siU", "" ,$news[$i][pagetext]);

and replace it as:
$news[$i][pagetext]= preg_replace("/(\[)(news)(])(\r\n)*([^`]*)(\[\/news\])/siU", "" ,$news[$i][pagetext]);

it should do the trick..


This is not a bug. As I said in my original post the script parses ALL your smilies and message icons and SOME of your important vb code. This behaviour is intentional. I could add a feature to parse all your vb code, but I didnt want to add an extra SQL query as this script is intended to be a main page script which means it will run so many times and every query we save in such a script will significiantly increases your SQL performance. Therefore I just added the feature to parse only important vb codes like [i] [u] [email] [url] and [image]. If you want to add others, you can do it with little PHP knowledge and some practise:

Check the code:

$news[$i][pagetext]= preg_replace("/(\[)(b)(])(.*)(\[\/b\])/siU", "<b>\\4</b>",$news[$i][pagetext]);

You can use this sample to add extra vbcode. For example add this line after them:

$news[$i][pagetext]= preg_replace("/(\[)(center)(])(.*)(\[\/center\])/siU", "<div align='center'>\\4</div>",$news[$i][pagetext]);

Not tested but this should parse [center] tag correctly.

Regards,
Logician
THANKS!

What code would I add in order to parse list tags? I regularily use bulleted lists on my page, and would like to continue to do so. Is that possible?
Reply With Quote
  #26  
Old 06-06-2002, 08:48 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Unknown553

I didn't post it 3 years ago....
@Unknown553: I figured out your problem, you modification was wrong:

Only this line should have been changed:

return date ("M. jS, Y \a\\t g:i A", mktime($saat+$timeset, $dakika, $saniye, $ay, $gun, $yil));

A few lines above there is another line:

$gelentarih=date("Y-d-m H:i:s",$gelentarih);

it should left intact (You edited that one too)

Modify this line back to original and you should be fine..

@rkettner: You asked for the most difficult vbcode LOL. Give me sometime I'll see what I can do for you to have it parsed.. (no promise though)

Regards,
Logician
Reply With Quote
  #27  
Old 06-06-2002, 09:48 PM
Unknown553's Avatar
Unknown553 Unknown553 is offline
 
Join Date: Oct 2001
Location: Las Vegas, NV, USA
Posts: 144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Logician

@Unknown553: I figured out your problem, you modification was wrong:

Only this line should have been changed:

return date ("M. jS, Y \a\\t g:i A", mktime($saat+$timeset, $dakika, $saniye, $ay, $gun, $yil));

A few lines above there is another line:

$gelentarih=date("Y-d-m H:i:s",$gelentarih);

it should left intact (You edited that one too)

Modify this line back to original and you should be fine..

Regards,
Logician
That did the trick, thank you very much Logician!
Reply With Quote
  #28  
Old 06-08-2002, 12:10 AM
Till Till is offline
 
Join Date: May 2002
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi!

Great hack!

Only problem which I encountered is, that when I move my news over to the vBulletin database, the dates are lost on when they are added.

Any suggestions? I could probably do it by hand, but that is a pain in the ass.

Thanks,
Till
Reply With Quote
  #29  
Old 06-08-2002, 12:51 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Till
Only problem which I encountered is, that when I move my news over to the vBulletin database, the dates are lost on when they are added. Any suggestions? I could probably do it by hand, but that is a pain in the ass.
Maybe you should only edit the news date of the messages which will be dragged to your main page. I guess these cant be more than 10 so it shouldnt be a big deal to edit them. For rest of them date is not so important because they are not displayed in the main page anyway.

There is also a hack around which helps admin to edit thread dates. This can save you from editing the dates with SQL.
Reply With Quote
  #30  
Old 06-10-2002, 11:40 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by rkettner

What code would I add in order to parse list tags? I regularily use bulleted lists on my page, and would like to continue to do so. Is that possible?
As I promised:

Edit newsconfig.php, find:

$news[$i][pagetext]= preg_replace("/(\[)(url)(])(\r\n)*([^\"]*)(\[\/url\])/siU", "<a href=\"\\5\" target=\"_blank\">\\5</a>",$news[$i][pagetext]);

BEFORE that add:

if (preg_match("/(\[)(list)(])(.*)(\[\/list\])/siU", $news[$i][pagetext],$matches1))
{
$matches1[4]=preg_replace("/(\[\*\])(.*)/siU", "<li>\\2", $matches1[4]);echo $matches1[4];
$news[$i][pagetext]=preg_replace("/(\[)(list)(])(.*)(\[\/list\])/siU", $matches1[4], $news[$i][pagetext]);
}

This code will parse bulleted list tag.
Reply With Quote
  #31  
Old 06-10-2002, 11:49 AM
Till Till is offline
 
Join Date: May 2002
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Logician

Maybe you should only edit the news date of the messages which will be dragged to your main page. I guess these cant be more than 10 so it shouldnt be a big deal to edit them. For rest of them date is not so important because they are not displayed in the main page anyway.

There is also a hack around which helps admin to edit thread dates. This can save you from editing the dates with SQL.
Hi,
yeah, I checked out the hack, however it's easier to do it by hand since - as you stated - there are not more than 10.

But I am a little off with what field to modify, is it the "dateline" field? I can't really make out a field of type date or (unix)timestamp, other than the "editpost" one, which is too obvious.

Thanks,
Till
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:33 AM.


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.05066 seconds
  • Memory Usage 2,328KB
  • 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
  • (8)bbcode_quote
  • (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
  • (1)pagenav_pagelinkrel
  • (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