Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 02-16-2017, 04:15 PM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
What you would want for the first line is:

PHP Code:
$content preg_replace('/\[URL\](http.*?\.(png|jpg|gif))\[\/URL\]/i''[img]https://vborg.vbsupport.ru/[/img]'$post['pagetext']); 
Thank you Mark ...

You are always so gracious and helpful on this site... :up:

Regards,
Doug
Reply With Quote
Благодарность от:
MarkFL
  #12  
Old 02-16-2017, 05:14 PM
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Posts: 738
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
What you would want for the first line is:

PHP Code:
$content preg_replace('/\[URL\](http.*?\.(png|jpg|gif))\[\/URL\]/i''[img]https://vborg.vbsupport.ru/[/img]'$post['pagetext']); 
is this the final?

Code:
$content = preg_replace('/\[URL\](http.*?\.(png|jpg|gif))\[\/URL\]/i', '', $post['pagetext']);
if ($content != $post['pagetext'])
 {
 global $vbulletin;
 $pagetext = $content;
require_once(DIR . '/includes/class_bbcode.php');
 $bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
 $post['pagetext_html'] = $bbcode_parser->parse($pagetext, $post['forumid'], 1);
 $post['pagetext_html'] = html_entity_decode($post['pagetext_html']);
 }
because in post #2 you do not have all this code

Thank you very much
Reply With Quote
  #13  
Old 02-16-2017, 05:21 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Stratis View Post
is this the final?

Code:
$content = preg_replace('/\[URL\](http.*?\.(png|jpg|gif))\[\/URL\]/i', '', $post['pagetext']);
if ($content != $post['pagetext'])
 {
 global $vbulletin;
 $pagetext = $content;
require_once(DIR . '/includes/class_bbcode.php');
 $bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
 $post['pagetext_html'] = $bbcode_parser->parse($pagetext, $post['forumid'], 1);
 $post['pagetext_html'] = html_entity_decode($post['pagetext_html']);
 }
because in post #2 you do not have all this code

Thank you very much
Post #2 was what worked on my local dev site, but then I realized it worked for me because I have post caching turned off there...so, I revised the code to reparse the post for the OP, who has post caching turned on.
Reply With Quote
  #14  
Old 02-16-2017, 05:59 PM
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Posts: 738
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I have "Cached Posts Lifespan" to zero (0)
so i will use the first line. Thanks Mark.
Reply With Quote
  #15  
Old 02-16-2017, 06:12 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Stratis View Post
Ok, I have "Cached Posts Lifespan" to zero (0)
so i will use the first line. Thanks Mark.
In that case, you would want:

PHP Code:
$post['pagetext'] = preg_replace('/\[URL\](http.*?\.(png|jpg|gif))\[\/URL\]/i''[img]https://vborg.vbsupport.ru/[/img]'$post['pagetext']); 
Reply With Quote
  #16  
Old 02-16-2017, 06:19 PM
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Posts: 738
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, Yes

--------------- Added [DATE]1487278112[/DATE] at [TIME]1487278112[/TIME] ---------------

I forgot to ask, I want to recognize when link images turn to img, is there a way to put in code some title that I would like and to show at the bottom of the image?

or attribute to see when hover image
Reply With Quote
  #17  
Old 02-21-2017, 12:22 PM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, for my clarity and so I don't screw it up ...

Is this the code I need to use to create the plugin discussed?

Quote:
$post['pagetext'] = preg_replace('/\[URL\](http.*?\.(png|jpg|gif))\[\/URL\]/i', '', $post['pagetext']);
if ($content != $post['pagetext'])
{
global $vbulletin;
$pagetext = $content;
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$post['pagetext_html'] = $bbcode_parser->parse($pagetext, $post['forumid'], 1);
$post['pagetext_html'] = html_entity_decode($post['pagetext_html']);
}
Thanks ..

Regards,
Doug
Reply With Quote
  #18  
Old 02-21-2017, 12:52 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BadgerDog View Post
Ok, for my clarity and so I don't screw it up ...

Is this the code I need to use to create the plugin discussed?



Thanks ..

Regards,
Doug
You want:

PHP Code:
$content preg_replace('/\[URL\](http.*?\.(png|jpg|gif))\[\/URL\]/i''[img]https://vborg.vbsupport.ru/[/img]'$post['pagetext']);

if (
$content != $post['pagetext'])
{
    global 
$vbulletin;
    
$pagetext $content;
    require_once(
DIR '/includes/class_bbcode.php');
    
$bbcode_parser = new vB_BbCodeParser($vbulletinfetch_tag_list());
    
$post['pagetext_html'] = $bbcode_parser->parse($pagetext$post['forumid'], 1);
    
$post['pagetext_html'] = html_entity_decode($post['pagetext_html']);

Reply With Quote
  #19  
Old 02-21-2017, 01:10 PM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
You want:

PHP Code:
$content preg_replace('/\[URL\](http.*?\.(png|jpg|gif))\[\/URL\]/i''[IMG]$1[/IMG]'$post['pagetext']);

if (
$content != $post['pagetext'])
{
    global 
$vbulletin;
    
$pagetext $content;
    require_once(
DIR '/includes/class_bbcode.php');
    
$bbcode_parser = new vB_BbCodeParser($vbulletinfetch_tag_list());
    
$post['pagetext_html'] = $bbcode_parser->parse($pagetext$post['forumid'], 1);
    
$post['pagetext_html'] = html_entity_decode($post['pagetext_html']);

Thanks again .. :up:

Regards,
Doug
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 04:49 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.09954 seconds
  • Memory Usage 2,282KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (5)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (9)post_thanks_box
  • (1)post_thanks_box_bit
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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