Search in support tickets

#964 – Post ad, add files

Posted in ‘Support’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Tuesday, 28 September 2021 09:34 CEST
Edu2021
When publishing an ad, after choosing the category, the data comes out, then "add files." and at the end the publishing options.
As in our case the files that we attach will be the logo of the advertising company, is there a way that the option "add files" is just after the category and if possible added in the data?

Thanks.
Custom Fields
Joomla Version
3.10.2
PHP Version
7.4.20
Product
AdsManager
Product Version
3.2
Wednesday, 29 September 2021 09:16 CEST
loic
Hello,

there is a way but you need to custom the code.

Best regards.
 
Wednesday, 29 September 2021 13:48 CEST
Edu2021
It's true. In \templates\adsclarity\html\com_adsmanager\edit\default.php it can be modified without problems.
But it drove me crazy for a theme that I have also tried with your original installation.
In adsmanager-> configuration-> image-> Nb IMAGES I put only 1 image, and when I edit the ad, I delete the current image then add a new one, when saving it gives an error.
Wednesday, 29 September 2021 13:50 CEST
loic
Hello,

for the image, I will check the code.

I come back to you quickly.

Best regards.
 
Friday, 01 October 2021 16:39 CEST
loic
Hello,

There is an issue with the images.

If you save the ads with no image, then edit it again, it will works.

I will look for a solution right now.

Best regards.
 
Friday, 01 October 2021 17:07 CEST
loic
Here is a solution that works.

If you see any issue with it, please answer that ticket.

In administrator/components/com_adsmanager/tables/contents.php, line 268, just after that block :
foreach($this->data['images'] as $i => $img) {
			if (in_array($img->index,$deleted_images)) {
                if(is_file(JPATH_IMAGES_FOLDER."/waiting/".$img->image)) {
                    JFile::delete(JPATH_IMAGES_FOLDER."/waiting/".$img->image);
                }
                if(is_file(JPATH_IMAGES_FOLDER."/waiting/".$img->thumbnail)) {
                    JFile::delete(JPATH_IMAGES_FOLDER."/waiting/".$img->thumbnail);
                }
                if(is_file(JPATH_IMAGES_FOLDER."/waiting/".$img->medium)) {
                    @JFile::delete(JPATH_IMAGES_FOLDER."/waiting/".$img->medium);
                }
				unset($this->data['images'][$i]);
			}
		}


Add the following code :
		$contentImages = json_decode($this->images);
		foreach($contentImages as $i => $img) {
			if (in_array($img->index,$deleted_images)) {
                if(is_file(JPATH_IMAGES_FOLDER."/waiting/".$img->image)) {
                    JFile::delete(JPATH_IMAGES_FOLDER."/waiting/".$img->image);
                }
                if(is_file(JPATH_IMAGES_FOLDER."/waiting/".$img->thumbnail)) {
                    JFile::delete(JPATH_IMAGES_FOLDER."/waiting/".$img->thumbnail);
                }
                if(is_file(JPATH_IMAGES_FOLDER."/waiting/".$img->medium)) {
                    @JFile::delete(JPATH_IMAGES_FOLDER."/waiting/".$img->medium);
                }
				unset($contentImages[$i]);
			}
		}
		$this->images = json_encode($contentImages);


Best regards.
 
Thursday, 07 October 2021 12:27 CEST
Edu2021
I check it. Thanks.
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.