vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Logician NEWS: Drag Any Message to Your Main Page (https://vborg.vbsupport.ru/showthread.php?t=39278)

rkettner 06-04-2002 10:42 PM

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?

rkettner 06-05-2002 12:46 AM

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?

Logician 06-05-2002 11:07 AM

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

rkettner 06-05-2002 04:37 PM

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?

Logician 06-06-2002 08:48 AM

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

Unknown553 06-06-2002 09:48 PM

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!

Till 06-08-2002 12:10 AM

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

Logician 06-08-2002 12:51 AM

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.

Logician 06-10-2002 11:40 AM

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.

Till 06-10-2002 11:49 AM

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


All times are GMT. The time now is 11:23 AM.

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.01507 seconds
  • Memory Usage 1,757KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete