Reason behind their naming is so each image is unique to their item id to prevent image name problems or for security reasons. They are using md5 hash to create filenames.
Here is an example for you if you want to make the changes.
You can change to itemtitle + itemid.jpg if you like. So it would look like below example. Please note third party plugins or modules which looks for original code might not work with this mod or you would have to change them as well.
Title: Super Outing Massimo Dutti Sport
- Code: Select all
Main Image:
Super_Outing_Massimo_Dutti_Sport_1.jpg
Cache Files:
Super_Outing_Massimo_Dutti_Sport_1_Generic.jpg
Super_Outing_Massimo_Dutti_Sport_1_L.jpg
Super_Outing_Massimo_Dutti_Sport_1_M.jpg
Super_Outing_Massimo_Dutti_Sport_1_S.jpg
Super_Outing_Massimo_Dutti_Sport_1_XL.jpg
Super_Outing_Massimo_Dutti_Sport_1_XS.jpg
See following file for naming code.
File: administrator\components\com_k2\models\item.php
Find Line: 295
Code:
- Code: Select all
$handle->file_new_name_body = md5("Image".$row->id);
Replace it with below code:
- Code: Select all
$handle->file_new_name_body = $row->title . $row->id;
Now you need to find and change every instance of original code to changed code in following files.
- Code: Select all
administrator\components\com_k2\models\item.php
administrator\components\com_k2\models\items.php
administrator\components\com_k2\views\item\view.html.php
administrator\components\com_k2\views\items\tmpl\default.php
components\com_k2\models\item.php
components\com_k2\models\itemlist.php
modules\mod_k2_content\helper.php
modules\mod_news_pro_gk4\tmpl\layout.parts.php
Change where exists with new code
- Code: Select all
.md5("Image".$row->id). change to .$row->title.$row->id.
md5("Image".$current->id) change to $current->title.$current->id;
.md5("Image".$item->id). change to .$item->title.$item->id.
.md5("Image".$news_id). change to .$news_title.$news_id.
See you around...