Announcement

Collapse
No announcement yet.

Auto display images when images die

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Auto display images when images die

    In VB 3.8 I had a small plugin that showed an image when the link to the original image was no longer present. This was very helpful in posts that almost only showed images.

    Maybe this is also possible for VB 6?

    This was the code:

    PHP Code:
    if(THIS_SCRIPT=='showthread' || THIS_SCRIPT=='showpost')
    $this->post['message']=str_replace('<img ','<img onerror="this.src=\'https://www.elvisnachrichten.de/nopic.gif\';" ',$this->post['message']);
    Describtion:

    When images die in post, this plugin will display your custom images
    Go to Admincp > Plugins & Products > Add New Plugin or go to yourdomain/admincp/plugin.php?do=add
    Hook Location: Choose postbit_display_complete
    Title: Auto display images when images die​

    #2
    You can also do this using Replacement Variable Manager in AdminCP > Styles.

    Code:
    Search for Text​: <img
    Replace with Text: <img onerror="this.src='/images/nopic.gif'; this.onerror=null;"
    But the replacement applies to all images and not just inside posts. Missing images would happen mostly inside posts anyway.

    Btw, the this.onerror=null is important to prevent endless loop in case the replacement image happens to be not available or accessible for whatever reason.
    Buy me a coffeePayPal QR Code
    My Amazon Affiliate Link
    Fast vBulletin VPS Host:
    This site is hosted by IONOS

    Comment


      #3
      Great! It works for all pictures within the img tag!

      Thank you very much!

      Comment


        #4
        You're welcome!. Glad to help.
        Buy me a coffeePayPal QR Code
        My Amazon Affiliate Link
        Fast vBulletin VPS Host:
        This site is hosted by IONOS

        Comment

        Latest Posts

        Collapse

        Working...
        X
        Searching...Please wait.
        An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

        Please push the back button and reload the previous window.'
        An unexpected error was returned: 'Your submission could not be processed because the token has expired.

        Please push the back button and reload the previous window.'
        An internal error has occurred and the module cannot be displayed.
        There are no results that meet this criteria.
        Search Result for "|||"