Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Forum: Plugins
    In reply to: Re-size image automatically

    Sorry ?? My knowledge is slightly limited in that area, but I would say the best would be to modify the WordPress source to do this for you.

    Forum: Plugins
    In reply to: Re-size image automatically

    I would recommend he keeps a URL snippet handy so he does not have to retype the URL all the time though.

    I am using a database and PHP to generate my property listings automatically, so for me it is easier. I do not have to type anything in, it’s all automated.

    Forum: Plugins
    In reply to: Re-size image automatically

    Yes.. He can upload using WordPress, but not click “Send to Editor”.. Instead he will need to click on the Post’s Code View, then Click the [img] button, and place the URL to the image.

    Like :

    https://www.yoursite.com/wp-content/uploads/2007/10/displaythumb.php?imagewidth=150&photoid=yourpic.jpg

    Forum: Plugins
    In reply to: Re-size image automatically

    If you have a look at https://e-complaints.co.za I have published a test JPG using displaythumb.php

    I wrote a post, uploaded the full size JPG using WordPress but noted that wordpress creates a directory structure in /uploads so I had to modify the file structure a bit.

    The displaythumb.php file now looks like this:

    <?php

    $thumbname = $_GET[photoid];
    $directory = “/home/complain/public_html/wp-content/uploads/2007/10”;
    $widthimage = $_GET[imagewidth];
    $filename = $directory . ‘/’ . $thumbname;
    $max = $_GET[max];
    //$filename = $thumbname;
    $new_h = $widthimage;
    // Content type
    header(‘Content-type: image/jpeg’);
    // Get new sizes
    $src_img = imagecreatefromjpeg($filename);
    $origw=imagesx($src_img);
    $origh=imagesy($src_img);
    $ratio=$origw*$new_h;
    $new_w=$ratio/$origh;
    $dst_img = imagecreatetruecolor($new_w,$new_h);
    imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));
    imagejpeg($dst_img);

    ?>

    I hope this was helpful

    Forum: Plugins
    In reply to: Re-size image automatically

    Are you uploading the image via WordPress, or are you referencing to it via an <img> call?

    You should be able to upload the image using WordPress Upload, but do not insert it into the post as a thumbnail or anything. Once the upload is complete, in your post, you can call the image like such :

    <img src=”https://www.yourwebsite.com/wp-content/uploads/displaythumb.php?imagewidth=150&photoid=yourimage.jpg”&gt;

    This should work quite fine ??

    I will do a test for you kwik, then send you the link and the post so u can see.

    I can write this plugin for you, it sounds very simple and I can use it too. Are the images located in the WordPress Upload folder? Or in a specific folder? And will there be a specific number of most recent images to list?

    I am doing the same thing but wrote my own upload scripts using PHP, then converted the result into a WordPress Plugin. I am using imagecreatefromjpeg php function to generate thumbnails, then using PHP upload script to post the images and assign property details into a MySQL database. Still under construction but seems to work well with WordPress.

    You can see a demo at https://www.estateagencies.co.za/demo

    The users will be able to add these listings in the WordPress Admin Area. Having some slight issues with it though… it seems to repeat itself on posts.. as well as any page.. When I get it sorted I’ll let you know and you are welcome to use it.

    Thread Starter taz72

    (@taz72)

    I also just noticed it replicates itself in every post… this is what my plugin looks like:

    <?php
    /*
    Plugin Name: wp-realtor
    Plugin URI: https://www.estateagencies.co.za/
    Description: This is the plugin to display the listings you have uploaded to estateagencies.co.za.
    Author: Darren Morrisby
    Version: 1.0
    Author URI: https://www.bizability.co.za/
    */

    // This section calls the estateagencies API
    include(“estateagencies_api.php”);

    function show_my_listings() {

    show_listings(“For Sale”, “1”, “130”, “100”, “130”, “100”);

    }

    add_action(‘the_content’, ‘show_my_listings’);

    ?>

    Forum: Plugins
    In reply to: Re-size image automatically

    My Pleasure ??

    Forum: Plugins
    In reply to: Re-size image automatically

    You can see the result more clearly here:

    150px Wide View
    ——————————————-

    https://www.estateagencies.co.za/demo/displaythumb.php?imagewidth=150&photoid=1234.jpg

    550px Wide View

    ——————————————–

    https://www.estateagencies.co.za/demo/displaythumb.php?imagewidth=550&photoid=1234.jpg

    Forum: Plugins
    In reply to: Re-size image automatically

    The thumbnail it generates uses imagewidth to work out height, as it resizes proportionally.

    Forum: Plugins
    In reply to: Re-size image automatically

    hi fouadovic

    The code I listed is in the displaythumb.php file, so you copy that code and save it as displaythumb.php. You place the displaythumb.php within your publicly visible hosting space, then you call the image by <img src=”displaythumb.php?imagewidth=450&photoid=1234.jpg”>

    It is exactly the same as calling <img src=”1234.jpg”> except you are resizing it by calling displaythumb.php

    The only thing I am not sure about is my photos are already in a folder called /photos, so if you upload via wordpress, I am not sure if you get the opportunity to specify a path to that image.

    I will dump the php file at https://www.estateagencies.co.za/displaythumb.zip for you.

    Forum: Plugins
    In reply to: Re-size image automatically

    hi fouadovic

    I am using imagefromjpeg which i borrowed from a friend of mine which seems to work well… you can see it here https://www.estateagencies.co.za/demo

    The img src attribute looks like, displaythumb.php?imagewidth=450&picture=1234.jpg

    This is what my displaythumb.php looks like:

    ————————————–

    // usage : <img src=”displaythumb.php?imagewidth=80&photoid=2874.jpg”>

    $thumbname = $_GET[photoid];
    $directory = “/home/esp007/public_html/demo/photos”;
    $widthimage = $_GET[imagewidth];
    $filename = $directory . ‘/’ . $thumbname;
    $max = $_GET[max];
    //$filename = $thumbname;
    $new_h = $widthimage;
    // Content type
    header(‘Content-type: image/jpeg’);
    // Get new sizes
    $src_img = imagecreatefromjpeg($filename);
    $origw=imagesx($src_img);
    $origh=imagesy($src_img);
    $ratio=$origw*$new_h;
    $new_w=$ratio/$origh;
    $dst_img = imagecreatetruecolor($new_w,$new_h);
    imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));
    imagejpeg($dst_img);

    ——————————–

Viewing 13 replies - 1 through 13 (of 13 total)