Forums

Edit image path on custom theme (7 posts)

  1. patjk
    Member
    Posted 1 year ago #

    I am using Classipress to create a classified listing site on wordpress. For some reason, images aren't showing up, as shown below the ad here:
    http://www.bookpong.com/2011/02/pat/

    Anyone know how to fix this?

    Thanks

  2. nipponese
    Member
    Posted 1 year ago #

    Are you sure your img_resize.php script is working? Looks broken to me.

  3. patjk
    Member
    Posted 1 year ago #

    No, I'm not sure. How can I check/correct it?

    Thanks

  4. nipponese
    Member
    Posted 1 year ago #

    Just run the script in the URL field, for example: http://www.bookpong.com/wp-content/themes/classipress/classipress/img_resize.php?width=100&height=100&url=1297993469-1.gif

    Now that I look at it more... that's definitely the problem. Look at the URL for the script: classipress/classipress/

  5. patjk
    Member
    Posted 1 year ago #

    Thanks for the info. What in the script do I need to change to fix this issue?

    Thanks

  6. patjk
    Member
    Posted 1 year ago #

    Here is what is in the img_resize.php file. What do I need to modify to make it work? Thanks.

    <?php
    //http://localhost/th/img_resize.php?url=nike.jpg&width=100&height=500

    //Require Class
    require_once("PThumb.php");

    $image_url = "../../../wp-content/uploads/classipress/".$_GET["url"];

    //Child Class for configuration
    class pthumb_example extends PThumb{
    //Use Cache?
    var $use_cache = true;
    //Cache Dir. MUST be writable
    var $cache_dir = "cache/"; //Make sure to include trailing slash!
    //Error mode. Set to 2 to show a nicer error than the user-intruiguing error
    var $error_mode = 2;

    function pthumb_example(){
    $this -> PThumb();
    }
    //Custom method to display an "X" in case of any errors
    function display_x(){
    }
    }

    $thumbnail = new pthumb_example;

    if (!isset($image_url) || !isset($_GET["width"]) || !isset($_GET["height"])){
    $thumbnail -> display_x();
    }
    else{
    if (!$thumbnail -> fit_thumbnail($image_url,$_GET["width"],$_GET["height"])){
    $thumbnail -> display_x();
    }
    }

    //Other Errors
    if ($thumbnail -> isError()){
    $thumbnail -> display_x();
    }
    ?>

  7. patjk
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.