Pull each user's cover image via a link/code

Need help pulling an uploaded cover photo from amap_coverphoto pluginthere code listed to use the plugin but I am not sure where to input it and what the dependencies are. I can see the preview but no idea how to add it to users profile/else where, so that visitors will see the user's set cover image, not just default  cover background image. I've enabled the profile/blog/etc coverphoto and added the size in the settings, still nothing! I need something like this " https://{$host}/coverphoto/view/{$entity}{$size}{$time}.jpg ", unless someone knows how to do this correctly??

  • Asking about the cover photo feature and would like to add it to an hovercard as well. I want the cover to be on my the user's profile, I'm using profile_x and want an cover for the default Elgg profile and to be able to view it on classic and minimal theme as well, and other places later maybe. I can't get the Imgur/profile_x cover working, I'm using CloudFlare and HTTPS/HSTS, and images returns with error, can't server http over https, so I'm trying to request the cover photo the amap_coverphoto makes, and use that in each area, I have no need for Imgur, but would like to have that working as a backup/alternative. I will try your code now, thanks for your help!

  • Tried using the code on the blog and in the ownerblock.php(not sure if right area), but didn't work, tried editing the fields but only breaks the page.

    This is the amap_coverphoto script I tried before but didn't get it to work either

    How to Use

    1. Enable the plugin
    2. In plugin settings, check the type/subtype of entities for which need to enable cover photo feature
    3. On object view, include the following code
    if ($entity->covertime) {                    
        echo elgg_view('output/img', array(
            'src' => amap_cp_getCoverIconUrl($entity, 'large'),
            'alt' => elgg_echo('cover'),
        ));
    }
  • I have that too, I'm not skilled in php, I pasted the Displaying cover image code and the Add cover image in layout, both break the page, I'm using the ownerblock.php in Profile mod for editing, is this the right area to use code to display a cover on the user's profile? The hypeicons mod has no effect on my icons when enabled, I set cloudflare to dev mode, purge caches, system cache is disabled and I flushed/upgraded/flushed repeatedly, cleared the browser etc and am using multiple browsers and pc's for testing and I can't anything to work proper. I should've set this up before switching to CloudFlare/HTTPS, as that is what has broken the Imgur mod and left me in this predicament. does anyone have a working example for profiles without a theme, or is able to modify the ownblock.php(or the file needed) to get this to work for me, I'm sure this is a very simple mistake on my part, either my coding or too many plugins interfering or misordered that are causing this. 

    I like the amap_coverphoto upload page, the other cover photo mod's won't upload images for some reason, nothing happens, so I went with amap_cp, it seems good, the layout nice(I will edit it of course), I just can't get a link to pull the made covers, everything crashes the page/doesn't work or when I tried using a link(maybe in another format the link may select (site/entity/size/time.jpg) but I tried everything I know to make it pull, but I it guess a direct link can't do that?), it renders just a single image throughout the site/rather than each users, any help will be greatly appreciated! 

  • Or is anyone able to provide a working example of the Imgur mod working over HTTPS? for cover with Profile_x or able to fix it so that amap_coverphoto's will upload to the profile_x theme?

  • <div class="elgg-image"><div id="current-user-avatar" class="mrl prl">
    <label>Current cover</label><br>
    </div>
    This html code works perfect in the image preview after uploading/saving in amap_cp, but I need the preview/image link to be dependant on the entity, rather than a direct link to just one image? can this be done via img src="", or what code behind this is forming the url is a better question?
  • Can this linking be fixed if all else above fails? Is it possible to make this into a direct link the will search for the entity/size/time  " https://{$host}/coverphoto/view/{$entity}{$size}{$time}.jpg ".

    Again thanks everyone, I've been at this now for nearly a year now setup this all up(Elgg/mysite), after 8+ server crashes! I'm learning as I'm going, I have many years 
    background in computer repair, I just starting web/app & do graphic design over the past couple years, but I've only covered html as of yet will little css and js and that's still not done and I'm just starting to learn php and about https/ssl and I'm not even sure if that's setup correctly, even though it all lights up green in the Chrome dev tab under security with 256bit, to bad I didn't test Imgur beforehand, so i'd know if it was my plugins/settings and not https breaking it(the images don't get uploaded to Imgur(no image returned to Profile_x), tried multiple auths/methods and tried adding the https code listed but that too didn't work for me

  • I really don't understand why you (or anyone for that matter) would volunteer data to imgur. Elgg comes with a solid file system that is fast enough for any mid-size network. Also I find CloudFlare to not be an ideal solution for an access-controlled network, you may gain a few seconds on static resources, but none of the file or icons or covers should be cached if you respect your users' privacy, and provide settings to control access.

  • I agree fully, just wanted it working because I believed it was the easiest method and many plugins depend on it to function. but would rather everything be on my side/server. I only went with cloudflare because it's free and gave me a cert easily, I've noticed it doesn't cache very much of my site, only a few MB's, but I'm the only one on there too(yet). They limit my uploads to 100MB on the free plan and I hate that! I didn't realize about caching the user's files/images, security of user's data is of the utmost importance to me, that why I choose you get a cert from cloudflare but now I see your point. But i'm not sure how/or what is the best free option for my SSL, I will be buying one if the site ever get's user's but I want this a free as possible, at-least for now.

  • Can anyone find the problem here and how I could go about fixing it?

     

    Fatal Error.
    Too few arguments to function get_uploaded_coverphoto_timeline_file(), 0 passed in C:\inetpub\websites\MY-SITE\mod\timeline_avatar\lib\timelinefilestore.php on line 374 and exactly 1 expected
     
    Log at time 1506227607 may have more data.
     
    ArgumentCountError Object
    (
    [message:protected] => Too few arguments to function get_uploaded_coverphoto_timeline_file(), 0 passed in C:\inetpub\websites\MY-SITE\mod\timeline_avatar\lib\timelinefilestore.php on line 374 and exactly 1 expected
    [string:Error:private] => ArgumentCountError: Too few arguments to function get_uploaded_coverphoto_timeline_file(), 0 passed in C:\inetpub\websites\MY-SITE\mod\timeline_avatar\lib\timelinefilestore.php on line 374 and exactly 1 expected in C:\inetpub\websites\MY-SITE\mod\timeline_avatar\lib\timelinefilestore.php:233
    Stack trace:
    #0 C:\inetpub\websites\MY-SITE\mod\timeline_avatar\lib\timelinefilestore.php(374): get_uploaded_coverphoto_timeline_file()
    #1 C:\inetpub\websites\MY-SITE\mod\timeline_avatar\actions\timelineavatar\upload.php(85): get_resized_image_from_uploaded_timeline_file('timlineavatar')
    #2 C:\inetpub\websites\MY-SITE\vendor\elgg\elgg\engine\classes\Elgg\Includer.php(18): include('C:\\inetpub\\webs...')
    #3 C:\inetpub\websites\MY-SITE\vendor\elgg\elgg\engine\classes\Elgg\ActionsService.php(176): Elgg\Includer::includeFile('C:/inetpub/webs...')
    #4 C:\inetpub\websites\MY-SITE\vendor\elgg\elgg\engine\lib\actions.php(22): Elgg\ActionsService->execute('timlineavatar/u...')
    #5 [internal function]: _elgg_action_handler(Array, 'action')
    #6 C:\inetpub\websites\MY-SITE\vendor\elgg\elgg\engine\classes\Elgg\Router.php(100): call_user_func('_elgg_action_ha...', Array, 'action')
    #7 C:\inetpub\websites\MY-SITE\vendor\elgg\elgg\engine\classes\Elgg\Application.php(436): Elgg\Router->route(Object(Elgg\Http\Request))
    #8 C:\inetpub\websites\MY-SITE\vendor\elgg\elgg\engine\classes\Elgg\Application.php(384): Elgg\Application->run()
    #9 C:\inetpub\websites\MY-SITE\index.php(8): Elgg\Application::index()
    #10 {main}
    [code:protected] => 0
    [file:protected] => C:\inetpub\websites\MY-SITE\mod\timeline_avatar\lib\timelinefilestore.php
    [line:protected] => 233
    [trace:Error:private] => Array
    (
    [0] => Array
    (
    [file] => C:\inetpub\websites\MY-SITE\mod\timeline_avatar\lib\timelinefilestore.php
    [line] => 374
    [function] => get_uploaded_coverphoto_timeline_file
    [args] => Array
    (
    )
     
    )
     
    [1] => Array
    (
    [file] => C:\inetpub\websites\MY-SITE\mod\timeline_avatar\actions\timelineavatar\upload.php
    [line] => 85
    [function] => get_resized_image_from_uploaded_timeline_file
    [args] => Array
    (
    [0] => timlineavatar
    )
     
    )
     
    [2] => Array
    (
    [file] => C:\inetpub\websites\MY-SITE\vendor\elgg\elgg\engine\classes\Elgg\Includer.php
    [line] => 18
    [args] => Array
    (
    [0] => C:\inetpub\websites\MY-SITE\mod\timeline_avatar\actions\timelineavatar\upload.php
    )
     
    [function] => include
    )
     
    [3] => Array
    (
    [file] => C:\inetpub\websites\MY-SITE\vendor\elgg\elgg\engine\classes\Elgg\ActionsService.php
    [line] => 176
    [function] => includeFile
    [class] => Elgg\Includer
    [type] => ::
    [args] => Array
    (
    [0] => C:/inetpub/websites/MY-SITE/mod/timeline_avatar/actions/timelineavatar/upload.php
    )
     
    )
     
    [4] => Array
    (
    [file] => C:\inetpub\websites\MY-SITE\vendor\elgg\elgg\engine\lib\actions.php
    [line] => 22
    [function] => execute
    [class] => Elgg\ActionsService
    [type] => ->
    [args] => Array
    (
    [0] => timlineavatar/upload
    )
     
    )
     
    [5] => Array
    (
    [function] => _elgg_action_handler
    [args] => Array
    (
    [0] => Array
    (
    [0] => timlineavatar
    [1] => upload
    )
     
    [1] => action
    )
     
    )
     
    [6] => Array
    (
    [file] => C:\inetpub\websites\MY-SITE\vendor\elgg\elgg\engine\classes\Elgg\Router.php
    [line] => 100
    [function] => call_user_func
    [args] => Array
    (
    [0] => _elgg_action_handler
    [1] => Array
    (
    [0] => timlineavatar
    [1] => upload
    )
     
    [2] => action
    )
     
    )
     
    [7] => Array
    (
    [file] => C:\inetpub\websites\MY-SITE\vendor\elgg\elgg\engine\classes\Elgg\Application.php
    [line] => 436
    [function] => route
    [class] => Elgg\Router
    [type] => ->
    [args] => Array
    (
    [0] => Elgg\Http\Request Object
    (
    [attributes] => Symfony\Component\HttpFoundation\ParameterBag Object
    (
    [parameters:protected] => Array
    (
    )
     
    )
     
    [request] => Symfony\Component\HttpFoundation\ParameterBag Object
    (
    [parameters:protected] => Array
    (
    [__elgg_token] => L7dSGXmbTVa2-mM0c3VRqQ
    [__elgg_ts] => 1506227597
    [guid] => 36
    )
     
    )
     
    [query] => Symfony\Component\HttpFoundation\ParameterBag Object
    (
    [parameters:protected] => Array
    (
    [__elgg_uri] => /action/timlineavatar/upload
    )
     
    )
     
    [MY-SERVER] => Symfony\Component\HttpFoundation\MY-SERVERBag Object
    (
    [parameters:protected] => Array
    (
    [_FCGI_X_PIPE_] => \\.\pipe\IISFCGI-8e9471ce-edae-48a4-bb8a-2ee3e407e915
    [PHPRC] => C:\snapcatphp\php\
    [PHP_FCGI_MAX_REQUESTS] => 10000
    [ALLUSERSPROFILE] => C:\ProgramData
    [APPDATA] => C:\Windows\system32\config\systemprofile\AppData\Roaming
    [APP_POOL_CONFIG] => C:\inetpub\temp\apppools\SnapCat\SnapCat.config
    [APP_POOL_ID] => SnapCat
    [CommonProgramFiles] => C:\Program Files\Common Files
    [CommonProgramFiles(x86)] => C:\Program Files (x86)\Common Files
    [CommonProgramW6432] => C:\Program Files\Common Files
    [COMPUTERNAME] => MY-SERVER
    [ComSpec] => C:\Windows\system32\cmd.exe
    [FP_NO_HOST_CHECK] => NO
    [LOCALAPPDATA] => C:\Windows\system32\config\systemprofile\AppData\Local
    [NUMBER_OF_PROCESSORS] => 2
    [OS] => Windows_NT
    [Path] => C:\php\v7.1;C:\snapcatphp\php\v7.1;C:\Windows\system32\inetsrv;C:\inetpub\ImageMagick-7.0.5-Q16;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft\Web Platform Installer\;C:\php;C:\snapcatphp\php;
    [PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    [PROCESSOR_ARCHITECTURE] => AMD64
    [PROCESSOR_IDENTIFIER] => Intel64 Family 6 Model 23 Stepping 10, GenuineIntel
    [PROCESSOR_LEVEL] => 6
    [PROCESSOR_REVISION] => 170a
    [ProgramData] => C:\ProgramData
    [ProgramFiles] => C:\Program Files
    [ProgramFiles(x86)] => C:\Program Files (x86)
    [ProgramW6432] => C:\Program Files
    [PSModulePath] => C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
    [PUBLIC] => C:\Users\Public
    [SystemDrive] => C:
    [SystemRoot] => C:\Windows
    [TEMP] => C:\Windows\TEMP
    [TMP] => C:\Windows\TEMP
    [USERDOMAIN] => MY-DOMAIN
    [USERNAME] => MY-SERVER$
    [USERPROFILE] => C:\Windows\system32\config\systemprofile
    [windir] => C:\Windows
    [ORIG_PATH_INFO] => /index.php
    [URL] => /index.php
    [MY-SERVER_SOFTWARE] => Microsoft-IIS/8.5
    [MY-SERVER_PROTOCOL] => HTTP/1.1
    [MY-SERVER_PORT_SECURE] => 0
    [MY-SERVER_PORT] => 80
    [MY-SERVER_NAME] => MY-SITE
    [SCRIPT_NAME] => /index.php
    [SCRIPT_FILENAME] => C:\inetpub\websites\MY-SITE\index.php
    [REQUEST_URI] => /action/timlineavatar/upload
    [REQUEST_METHOD] => POST
    [REMOTE_USER] => 
    [REMOTE_PORT] => 51101
    [REMOTE_HOST] => 192.168.0.1
    [REMOTE_ADDR] => 192.168.0.1
    [QUERY_STRING] => __elgg_uri=action/timlineavatar/upload
    [PATH_TRANSLATED] => C:\inetpub\websites\MY-SITE\index.php
    [LOGON_USER] => 
    [LOCAL_ADDR] => 192.168.0.123
    [INSTANCE_META_PATH] => /LM/W3SVC/8
    [INSTANCE_NAME] => MY-SITE
    [INSTANCE_ID] => 8
    [HTTPS_MY-SERVER_SUBJECT] => 
    [HTTPS_MY-SERVER_ISSUER] => 
    [HTTPS_SECRETKEYSIZE] => 
    [HTTPS_KEYSIZE] => 
    [HTTPS] => off
    [GATEWAY_INTERFACE] => CGI/1.1
    [DOCUMENT_ROOT] => C:\inetpub\websites\MY-SITE
    [CONTENT_TYPE] => multipart/form-data; boundary=----WebKitFormBoundaryyVl4E40VKaKHFhdf
    [CONTENT_LENGTH] => 56925
    [CERT_SUBJECT] => 
    [CERT_SERIALNUMBER] => 
    [CERT_ISSUER] => 
    [CERT_FLAGS] => 
    [CERT_COOKIE] => 
    [AUTH_USER] => 
    [AUTH_PASSWORD] => 
    [AUTH_TYPE] => 
    [APPL_PHYSICAL_PATH] => C:\inetpub\websites\MY-SITE\
    [APPL_MD_PATH] => /LM/W3SVC/8/ROOT
    [IIS_UrlRewriteModule] => 7.1.1952.0
    [HTTP_DNT] => 1
    [HTTP_UPGRADE_INSECURE_REQUESTS] => 1
    [HTTP_ORIGIN] => http://MY-SITE
    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3218.0 Safari/537.36
    [HTTP_HOST] => MY-SITE
    [HTTP_COOKIE] => raygun4js-userid=950caec7-5248-010d-9619-31cb168b0be0; Elgg=rnsq896f2243jnqmia6r85i29q; elggchat_toolbar_minimized=true
    [HTTP_ACCEPT_LANGUAGE] => en
    [HTTP_ACCEPT_ENCODING] => gzip, deflate
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
    [HTTP_CONTENT_TYPE] => multipart/form-data; boundary=----WebKitFormBoundaryyVl4E40VKaKHFhdf
    [HTTP_CONTENT_LENGTH] => 56925
    [HTTP_CONNECTION] => keep-alive
    [HTTP_CACHE_CONTROL] => max-age=0
    [FCGI_ROLE] => RESPONDER
    [PHP_SELF] => /index.php
    [REQUEST_TIME_FLOAT] => 1506227607.2754
    [REQUEST_TIME] => 1506227607
    )
     
    )
     
    [files] => Symfony\Component\HttpFoundation\FileBag Object
    (
    [parameters:protected] => Array
    (
    [timlineavatar] => Symfony\Component\HttpFoundation\File\UploadedFile Object
    (
    [test:Symfony\Component\HttpFoundation\File\UploadedFile:private] => 
    [originalName:Symfony\Component\HttpFoundation\File\UploadedFile:private] => bipolar (1).jpg
    [mimeType:Symfony\Component\HttpFoundation\File\UploadedFile:private] => image/jpeg
    [size:Symfony\Component\HttpFoundation\File\UploadedFile:private] => 56407
    [error:Symfony\Component\HttpFoundation\File\UploadedFile:private] => 0
    [pathName:SplFileInfo:private] => C:\Windows\Temp\php212A.tmp
    [fileName:SplFileInfo:private] => php212A.tmp
    )
     
    )
     
    )
     
    [cookies] => Symfony\Component\HttpFoundation\ParameterBag Object
    (
    [parameters:protected] => Array
    (
    [raygun4js-userid] => 950caec7-5248-010d-9619-31cb168b0be0
    [Elgg] => rnsq896f2243jnqmia6r85i29q
    [elggchat_toolbar_minimized] => true
    )
     
    )
     
    [headers] => Symfony\Component\HttpFoundation\HeaderBag Object
    (
    [headers:protected] => Array
    (
    [content-type] => Array
    (
    [0] => multipart/form-data; boundary=----WebKitFormBoundaryyVl4E40VKaKHFhdf
    )
     
    [content-length] => Array
    (
    [0] => 56925
    )
     
    [dnt] => Array
    (
    [0] => 1
    )
     
    [upgrade-insecure-requests] => Array
    (
    [0] => 1
    )
     
    [origin] => Array
    (
    )
     
    [user-agent] => Array
    (
    [0] => Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3218.0 Safari/537.36
    )
     
    [referer] => Array
    (
    )
     
    [host] => Array
    (
    [0] => MY-SITE
    )
     
    [cookie] => Array
    (
    [0] => raygun4js-userid=950caec7-5248-010d-9619-31cb168b0be0; Elgg=rnsq896f2243jnqmia6r85i29q; elggchat_toolbar_minimized=true
    )
     
    [accept-language] => Array
    (
    [0] => en
    )
     
    [accept-encoding] => Array
    (
    [0] => gzip, deflate
    )
     
    [accept] => Array
    (
    [0] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
    )
     
    [connection] => Array
    (
    [0] => keep-alive
    )
     
    [cache-control] => Array
    (
    [0] => max-age=0
    )
     
    )
     
    [cacheControl:protected] => Array
    (
    [max-age] => 0
    )
     
    )
     
    [content:protected] => 
    [languages:protected] => 
    [charsets:protected] => 
    [encodings:protected] => 
    [acceptableContentTypes:protected] => 
    [pathInfo:protected] => 
    [requestUri:protected] => /action/timlineavatar/upload
    [baseUrl:protected] => 
    [basePath:protected] => 
    [method:protected] => 
    [format:protected] => 
    [session:protected] => 
    [locale:protected] => 
    [defaultLocale:protected] => en
    [isForwardedValid:Symfony\Component\HttpFoundation\Request:private] => 1
    )
     
    )
     
    )
     
    [8] => Array
    (
    [file] => C:\inetpub\websites\MY-SITE\vendor\elgg\elgg\engine\classes\Elgg\Application.php
    [line] => 384
    [function] => run
    [class] => Elgg\Application
    [type] => ->
    [args] => Array
    (
    )
     
    )
     
    [9] => Array
    (
    [file] => C:\inetpub\websites\MY-SITE\index.php
    [line] => 8
    [function] => index
    [class] => Elgg\Application
    [type] => ::
    [args] => Array
    (
    )
     
    )
     
    )
     
    [previous:Error:private] => 
    )
Professional Services

Professional Services

Get / offer professional help on Elgg; like customization, design, development, setup, hosting... Illegal trades are not allowed.