Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Display all images and files in Print Thread Details »»
Display all images and files in Print Thread
Version: 1.0.4, by Elite_360_ Elite_360_ is offline
Developer Last Online: Mar 2022 Show Printable Version Email this Page

Category: Add-On Releases - Version: 4.2.x Rating:
Released: 08-13-2015 Last Update: 09-02-2015 Installs: 12
Uses Plugins
 
No support by the author.

Mark As Installed = Support

For Version Information: Go to Post #2


Description: This Mod will show all Images and files in Print Thread.

Installation:

1. Import the product-e360_printthreadimg.xml product file via AdminCP > Plugin System > Manage Products > [Add/Import Product]

2. Go To AdminCP > Settings > Options > e360 - Forums Online CountUp Options/ And config

-

Download Now

File Type: xml product-e360_printthreadimg[1-0-4].xml (5.3 KB, 32 views)

Screenshots

File Type: jpg printthread.jpg (36.1 KB, 0 views)

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
Manoel J?nior, z3r0

Comments
  #2  
Old 08-14-2015, 08:56 PM
Elite_360_'s Avatar
Elite_360_ Elite_360_ is offline
 
Join Date: Nov 2012
Location: New Hampshire
Posts: 518
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Version Information:

1.0.0 - Aug 14 2015
-First version

1.0.1 - Aug 14 2015
-Improve code.

1.0.2 - Aug 19 2015
-Fixed a Bug That @Wedframe Pointed Out With His Code.

1.0.3 - Sep 2 2015
-Fixed a bug "It now checks image type".
-Added bmp and jpe image types.
-Added non image attachments to "Print Thread".

1.0.4 - Sep 2 2015
-Added back the code i accidentally removed in 1.0.3 that converts embedded images.

--
Reply With Quote
  #3  
Old 08-19-2015, 05:56 PM
Wedframe Wedframe is offline
 
Join Date: Mar 2013
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Elite_360_, if in post I have link to full image with built-in thumbnail, like this:
[yrl=httр://someserver.net/0000000.htm][iмg]httр://someserver.net/0000000m.jpg[/iмg][/yrl]
then regexp work not correctly. And as a result, I have in post follow html:
HTML Code:
<div class="content"><img src="http://savepic.net/7168271.htm" target="_blank"><a href="http://savepic.net/7168271m.jpg" style="max-width: 100%;max-height: 100%;padding: 2px;"></a></div>
and of couse its give me wrong result:


I use next code for replace embeded Images:
PHP Code:
$post['message'] = preg_replace (  
        
'/<a href="([^"]+)\.(gif|png|jpg|jpeg)"([^>]*)>([^<]+)<\/a>/i',  
        
'<img src="\\1.\\2" alt="\\4" />',  
        
$post['message']  
    ); 
It`s work fine with attachments and with regular images.
Reply With Quote
Благодарность от:
Elite_360_
  #4  
Old 08-19-2015, 08:17 PM
Elite_360_'s Avatar
Elite_360_ Elite_360_ is offline
 
Join Date: Nov 2012
Location: New Hampshire
Posts: 518
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Added your code to 1.0.2 i was getting the same error if you make a image as a link.
Reply With Quote
  #5  
Old 09-01-2015, 11:15 PM
Wedframe Wedframe is offline
 
Join Date: Mar 2013
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Elite_360_, one more problem what I found.
If inline attachment is NOT image, then again will be error 404 to this "image"(like on above screenshot). So... I made hybrid code from your, from vB and from my own code... what first check the extension of attachment:
PHP Code:
if ($post['attach'] > 0)
    {
        
$attachments $vbulletin->db->query_read("SELECT attachmentid, filename
                FROM " 
TABLE_PREFIX "attachment
                WHERE `contenttypeid` = 1 AND `userid` = " 
$post['userid'] . "
                AND `state` = 'visible' AND `contentid` = " 
$post['postid'] . "
        "
);

        
        while (
$attachments_info $vbulletin->db->fetch_array($attachments))
        {
            
$filename strtolower($attachments_info['filename']);
            
$extension substr(strrchr($filename'.'), 1);
            
$extensions = array("jpg""jpeg""png""gif");
            if (!
in_array($extension$extensions))
            {
                continue;
            }
            
//Generate images instead links to inline attachment images
            
$post['attach'] = 0
            
$post['message'] = preg_replace("/<a href=\"(\w{4,5}:\/\/.*attachmentid\=" .$attachments_info['attachmentid']. ")\"\s(.|\n)*<\/a>/U""<img style=\"max-width:" .$vbulletin->options['adv_printthread_images_size']. "; max-height:" .$vbulletin->options['adv_printthread_images_size']. ";" .$vbulletin->options['adv_printthread_images_style']. "\" src=\"\\1\">"$post['message']);
            
        }
    
    } 
And.... I release new mod with some more functionality(and it will be still more with time):
https://vborg.vbsupport.ru/showthrea...78#post2554078
I hope its not bad idea?
Reply With Quote
  #6  
Old 09-02-2015, 07:46 PM
Elite_360_'s Avatar
Elite_360_ Elite_360_ is offline
 
Join Date: Nov 2012
Location: New Hampshire
Posts: 518
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Wedframe View Post
Go ahead just don't take any more code from future releases of this mod. Thanks for pointing out that it's not checking attachment types.
Reply With Quote
  #7  
Old 09-02-2015, 08:55 PM
Elite_360_'s Avatar
Elite_360_ Elite_360_ is offline
 
Join Date: Nov 2012
Location: New Hampshire
Posts: 518
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Updated to 1.0.3
-Fixed a bug "It now checks image type".
-Added bmp and jpe image types.
-Added non image attachments to "Print Thread".
Reply With Quote
  #8  
Old 09-03-2015, 12:59 AM
Elite_360_'s Avatar
Elite_360_ Elite_360_ is offline
 
Join Date: Nov 2012
Location: New Hampshire
Posts: 518
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Update to 1.0.4
-Added back the code i accidentally removed in 1.0.3 that converts embedded images.
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 02:29 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.04082 seconds
  • Memory Usage 2,319KB
  • Queries Executed 23 (?)
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)bbcode_html
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (3)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (2)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete