D
D
Duioka2019-11-21 03:26:00
PHP
Duioka, 2019-11-21 03:26:00

How to set a link to another server with a picture in PHP?

Good day to all! I ran into a very unpleasant problem, I have a small script for processing avatars (it is not tied to a specific CMS, so it can be used everywhere). I installed the IPB forum for myself, and this script used to have an instruction saying in which file and where to replace the links to this script so that everything works. Actually, neither this file nor these lines can be found in the new version of IPB. After some digging, I found the file itself and the lines of code that are responsible for the avatars. Well, at least kill! No matter how I tried, I could not specify the url instead of the standard directory with the default avatar file. To be sure, I took a random avatar 120x120 from Google (I say in case you suddenly think that the script on my part may not be working). Tostorians, help me out!)
Below is the code that displays the user's default avatar. Just in case, I’ll say that I disabled the “First letter of the nickname, instead of the avatar” function (like Google or mail)

if ( !$photoUrl and $useDefaultPhoto )
    {
      if( $email )
      {
        return rtrim( \IPS\Settings::i()->base_url, '/' ) . '/applications/core/interface/email/default_photo.png';
      }
      else
      {
        if( \IPS\Settings::i()->letter_photos == 'letters' AND isset( $memberData['member_id'] ) AND $memberData['member_id'] AND isset( $memberData['name'] ) AND $memberData['name'] )
        {
          if( $photo = static::generateLetterPhoto( $memberData ) )
          {
            return (string) $photo;
          }
        }

        return (string) \IPS\Theme::i()->resource( 'default_photo.png', 'core', 'global' );
      }
    }
    return NULL;
  }

How do I want to implement my idea? So that instead of default_photo.png, the link goes to another photo (for example: site.com/myimage.png),
after that I will pull up my script then I'm a noob))

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question