Support » Plugin: classyfrieds » Adding more than 3 images per listing

  • Resolved jmacd


    I would like to be able to upload 5 photos instead of 3.

    I have version 3.7 of Classyfrieds installed and am currently modifying the necessary files to see if I can customise the number of images/photos per single listing on my own.

    I followed your code doing manual searches on any relevant code that related to the 2 and 3 foto/image(s) and carefully copying/pasting/editing to read 4 or 5 foto/image(s). All seemed well until I modified the form_upload.php. However, I can’t see anything in it that I have done wrong, so was wondering if perhaps the init.php file is the culprit.

    Is this edited line of code for the init.php kosher?

    f (empty($cfo['form_image_field'])) $cfo['form_image_field'] = 'Allow_5_images'; // 1 || 2 || 3 || 4 || 5 || off

    Here is the site url if you care to register and/or to have a look:

    Hope you can help with this. Thanks so much.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author


    As you probably have seen already it’s a bit involved to allow 5 images instead of 3, but it’s not impossible either.

    If you edited the page-classyfried_add_listing.php you should be 90% there.
    the line in the init.php is only there to create a default setting. In your case you’re better off simply copying a code-block from line 653 – 662 in page-classyfried_add_listing.php and pasting it twice more to allow for the extra upload form-fields.

    Once you managed to get the upload form to populate the post_meta fields you need to make sure you can call them by adapting the template_vars.php and creating 2 extra shorttags e.g. {{foto4}}

    all that’s left to do is modify or create a new single_****.php layout that calls upon the 2 extra images.

    It’s an undertaking for someone that is not familiar with the code structure. Don’t hesitate to go into detail on our local forum :

    You’ll be breaking your changes on all future upgrades if you hard-code changes in our core files though.

    Plugin Author


    p.s. your tabbed sidebar widget does not play nice with wordpress thickbox.

    try sending mail on this page :

    the boxes overlap

    Well, I have been able to modify the upload form and did upload 5 images to a new test listing–all 5 images are there, I can see them on the server–but the actual classyfrieds post is registering with 3 foto fields only and as is not registering any new fields for foto 4 or 5.

    You said that I must get “the upload form to populate the post_meta fields”. I thought I was dong that with the edits I made to the template_vars.php and to page-classyfried_add_listing.php.

    Here is the altered code for page-classyfried_add_listing.php:

    [Excessive code moderated and post re-constructed. Please post large blocks of code using a pastebin.]

    Plugin Author


    This forum is not suited for large code samples and/or individual detailed adaptations of the code.

    Why don’t you mail me what you have done so far in a .zip file and we’ll get you going. -> via4321 [at]

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding more than 3 images per listing’ is closed to new replies.