Auction plugin, display of images not working

Anyone got this to work with Elgg 2.3.10.  

OS: Linux Mint.  

Auction plugin: https://elgg.org/plugins/1117178 

 

  • I don't think it will work on Elgg 2.3 without a thorough code upgrade. The latest version available (1.7) was released for Elgg 1.8 and much has changed since then (first with Elgg 1.9 and then again - a bit less - with Elgg 2.0). Maybe someone will respond who has done the code upgrade but not released a working version. But to be honest I wouldn't have too high hopes. If you need an auction plugin urgently, it might be necessary to hire a developer to do the work. You could also take a look at the plugins available at https://github.com/hypeJunction?tab=repositories. If I remember correctly there were some shopping plugins available there. But I can't say for sure (and not by own experience) if they are fully working or even providing full functionality as they are or are rather a kind of basis that you would have to extend/customize to get a full working solution. Problem with these plugins (like with the auction plugin) is that the developer of the hype* plugin has stopped working further on these plugins (they work on Elgg 2 but in future releases of Elgg like version 3 already they would likely require some updates).

  • The following code points to thumbnail.php and I thingk that the thumbnail php has an error in it, any help would be much appriciated.

    <?php

    $wiauctionguid = $vars['wiauctionguid'];
    $size =  $vars['size'];

    echo "<img src='" . elgg_get_site_url() . "mod/wiAuction/thumbnail.php?wiauctionguid={$wiauctionguid}&size={$size}' class='elgg-photo'>";

     

     

    when I replace <img src='" . elgg_get_site_url() . "mod/wiAuction/thumbnail.php?wiauctionguid={$wiauctionguid}&size={$size}' class='elgg-photo'> with <img src='https://www.google.co.uk/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'>, I get the Google image.

    When I am not using an image in the aution then the noimage.png image should appear in the auction but the noimage.png does not appear.

    thumbnail.php:

    <?php
     
    // Get engine
    require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
     
    // Get file GUID
    $wiauctionguid = (int) get_input('wiauctionguid', 0);
     
    $wiauctionpost = get_entity($wiauctionguid);
    if (!$wiauctionpost || $wiauctionpost->getSubtype() != "wiauction") {
    exit;
    }
     
    // Get owner
    $owner = $wiauctionpost->getOwnerEntity();
     
    // Get the size
    $size = strtolower(get_input('size'));
    if (!in_array($size,array('large','medium','small','tiny','master'))) {
    $size = "medium";
    }
     
    // Use master if we need the full size
    if ($size == "master") {
    $size = "";
    }
     
    // Try and get the icon
    $filehandler = new ElggFile();
    $filehandler->owner_guid = $owner->guid;
    $filehandler->setFilename("wiauction/" . $wiauctionpost->guid . $size . ".jpg");
     
    $success = false;
    if ($filehandler->open("read")) {
    if ($contents = $filehandler->read($filehandler->size())) {
    $success = true;
    }
     
    if (!$success) {
    $path = elgg_get_site_url() . "mod/wiAuction/graphics/noimage{$size}.png";
    header("Location: $path");
    exit;
    }
     
    header("Content-type: image/jpeg");
    header('Expires: ' . date('r',time() + 864000));
    header("Pragma: public");
    header("Cache-Control: public");
    header("Content-Length: " . strlen($contents));
     
    $splitString = str_split($contents, 1024);
     
    foreach($splitString as $chunk) {
    echo $chunk;
    }

     

     

     

  • In elgg 2.0 engine/start.php does not exist, so the below line is not valid:

    require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");

    Try replacing it with this:

    $autoload_root = dirname(__DIR__);
    
    if (!is_file("$autoload_root/vendor/autoload.php")) {
    
    $autoload_root = dirname($autoload_root);
    
    }
    
    require_once "$autoload_root/vendor/autoload.php";
    
    
    \Elgg\Application::start();
  • Thank you very much Rohit Gupta, That worked.

    Except the lightbox popup does not display the image, will look in to that.

     

  • viewimage.php had the same engine/start.php in it, so replaced:

    require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");

    with this:

    $autoload_root = dirname(__DIR__);
     if (!is_file("$autoload_root/vendor/autoload.php")) {
     $autoload_root = dirname($autoload_root);
     } 
    require_once "$autoload_root/vendor/autoload.php";
     \Elgg\Application::start();

    Thanks  Rohit Gupta, That also worked.

    Now the lightbox popup does display the image.

    Had also to tweak the size of the images to display right in the lightbox.