- Posts: 6
COMMUNITY FORUM
- Forum
- Free Joomla Extensions & Templates
- Simple Image Gallery
- change display order of images? and remove filename..
change display order of images? and remove filename..
- Bigjohn
- Topic Author
- Offline
- New Member
Less
More
10 years 10 months ago #54411
by Bigjohn
change display order of images? and remove filename.. was created by Bigjohn
IS this possible in the 'free' version?
And can you insert like a 'break' in the gallery - show 4 pictures, then a horizontal divider, then 4 more? Or do you have to divide those into separate galleries?
Thanks
And can you insert like a 'break' in the gallery - show 4 pictures, then a horizontal divider, then 4 more? Or do you have to divide those into separate galleries?
Thanks
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 10 months ago #54412
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: change display order of images? and remove filename..
Hello Bigjohn,
You have to use seperate galleries for this functionality.
You have to use seperate galleries for this functionality.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Bigjohn
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
10 years 10 months ago #54413
by Bigjohn
Replied by Bigjohn on topic Re: change display order of images? and remove filename..
Thanks - I expected as much.
what about the order in which images are displayed?
what about the order in which images are displayed?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 10 months ago #54414
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: change display order of images? and remove filename..
Unfortunately the ordering functionality is only available in the PRO version.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Bigjohn
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
10 years 10 months ago #54415
by Bigjohn
Replied by Bigjohn on topic Re: change display order of images? and remove filename..
Well that's good to know. I might have to go PRO to do what my site needs.
Thanks so much for replying. I did not see anything about ordering on the PRO page.
Thanks so much for replying. I did not see anything about ordering on the PRO page.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 10 months ago #54416
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: change display order of images? and remove filename..
The ordering options are located on the extension's settings.
Once you go PRO you can use our ticketing system.
Once you go PRO you can use our ticketing system.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Bigjohn
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
10 years 10 months ago #54417
by Bigjohn
Replied by Bigjohn on topic Re: change display order of images? and remove filename..
I'm disappointed :(
guess I should have asked - but now i see you cannot, in the pro version, SELECT the order (i.e. arrange the images) - rather, you have to rename them and then select 'alphabetical' to get them to display ... not what I was hoping for.
guess I should have asked - but now i see you cannot, in the pro version, SELECT the order (i.e. arrange the images) - rather, you have to rename them and then select 'alphabetical' to get them to display ... not what I was hoping for.
Please Log in or Create an account to join the conversation.
- Yiota
- Visitor
10 years 10 months ago #54418
by Yiota
Replied by Yiota on topic Re: change display order of images? and remove filename..
I'm sorry about that. That is how ordering is working. If there is anything else you need for SIG Pro please open a ticket through our JoomlaWorks Ticket Support System here: www.joomlaworks.net/dashboard
Please Log in or Create an account to join the conversation.
- Matthew Cowan
- Offline
- New Member
Less
More
- Posts: 4
10 years 5 months ago #55606
by Matthew Cowan
Replied by Matthew Cowan on topic change display order of images? and remove filename..
I added a way to change the names of the images myself.
Edit in administrator/components/com_sigpro/controllers/gallery.php, in public function save(), you will see a bunch of set state statements...simply add
Then, in administrator/components/com_sigpro/models/gallery.php, around line 176, in public function save(), you will see a bunch of get state statements...simply add
In the same function (we're still in administrator/components/com_sigpro/models/gallery.php), around line 188, you'll see a foreach loop...change the foreach loop to this:
And finally, in administrator/com_sigpro/views/gallery/tmpl/default.php, around line 118, you'll see the spot where you can edit the image descript. and title...add this between them (new code surrounded by /*addthis*/):
You should now be able to edit file names from the backend, and thus re-order the image gallery when ordering is set to alphabetical :)
Edit in administrator/components/com_sigpro/controllers/gallery.php, in public function save(), you will see a bunch of set state statements...simply add
$model->setState('newfilenames', $newfilenames);
Then, in administrator/components/com_sigpro/models/gallery.php, around line 176, in public function save(), you will see a bunch of get state statements...simply add
$model->getState('newfilenames');
In the same function (we're still in administrator/components/com_sigpro/models/gallery.php), around line 188, you'll see a foreach loop...change the foreach loop to this:
foreach ($files as $key => $file)
{
if ($newfilenames[$key] != $file) {
// rename the file
rename($path.'/'.$folder.'/'.$file, $path.'/'.$folder.'/'.$newfilenames[$key]);
//make sure $file gets replaced so that labels.txt gets written correctly....
$file = $newfilenames[$key];
}
if (JFile::exists($path.'/'.$folder.'/'.$file))
{
$labels .= $file.'|'.$titles[$key].'|'.$descriptions[$key]."\n";
}
}
And finally, in administrator/com_sigpro/views/gallery/tmpl/default.php, around line 118, you'll see the spot where you can edit the image descript. and title...add this between them (new code surrounded by /*addthis*/):
<label><?php echo JText::_('COM_SIGPRO_TITLE'); ?></label>
<input type="text" name="titles[]" value="<?php echo $image->title; ?>" />
/*addthis*/
<label>Filename</label>
<input type="text" name="newfilenames[]" value="<?php echo $image->name; ?>" />
/*addthis*/
<label><?php echo JText::_('COM_SIGPRO_DESCRIPTION'); ?></label>
<textarea rows="5" cols="30" name="descriptions[]"><?php echo $image->description; ?></textarea>
You should now be able to edit file names from the backend, and thus re-order the image gallery when ordering is set to alphabetical :)
Please Log in or Create an account to join the conversation.
- hristo
- Offline
- New Member
Less
More
- Posts: 11
10 years 1 day ago - 10 years 1 day ago #134334
by hristo
Replied by hristo on topic change display order of images? and remove filename..
Hi. This last post didn't work /mby its old and there have been updates/ but it was very helpfull. I'm not a coder, but with some luck and most by guessing I got sucsess. I made it possible to change pics name.. Also when upload new pics in empty gallery they are named 01.jpg 02.jpg and etc. Then if u upload new pics in same gallery it checks the number of files in DIR and also checks the max number of file in DIR and starts the new uploaded image count from the biggest+1 of these two.. i did this to prevent overwriting of images.. if some pics are deleted, or some pics have text names.. couse u can change them with A, B, C if u want...
Here are my changes: /make backup.. i'm not PRO and can't guarantee/
Edit in administrator/components/com_sigpro/controllers/gallery.php, in public function save(), you will see a bunch of set state statements...add lines
Then, in administrator/components/com_sigpro/models/gallery.php, around line 114, in public function upload(), before the line $result = JFile::upload($file, $path.'/'.$folder.'/'.JFile::makeSafe($filename)); add this:Important.. only for uploading JPG pictures.. ned some changes if u want to upload diferent types of images.
In same file some lines down is public function save().. here in function add:
and also some lines down replace the whole foreach ($files as $key => $file) with:
In administrator/com_sigpro/views/gallery/tmpl/default.php, you'll see the spot where you can edit the image descript. and title...add this over title field:I use pathinfo to get rid of .jpg and so i cant accidently delete image type which removes it from gallery - we add this .jpg in public save function.
And finaly in same file.. some lines down.. we need to ad the Filename field also for the fresh uploaded pics. Again over title field add thisHere i could not remove .jpg from file name, but i didnt try much because if u refresh page or hit save button it removes .jpg and then u can easyly rearenge files....
Many thanks to Matthew Cowan
Sorry if my english or code language is bad!
Hope i didnt forgot some line :) .. ..
And agan i'm not a coder, and there are mby lots of mistakes.. so make backups befor u try it.. or if u can rewrite it and post it here.. it works for me great for the moment :)
Ops.. i found BUG.. reordering not working corectly.. Pictures was overriding one another.. it was logical :) so I add unique random key to file name separated by "-" so i can extract and show from filename only the number infront. Code is fixed.. .
Here are my changes: /make backup.. i'm not PRO and can't guarantee/
Edit in administrator/components/com_sigpro/controllers/gallery.php, in public function save(), you will see a bunch of set state statements...add lines
$newfilenames = JRequest::getVar('newfilenames');
$model->setState('newfilenames', $newfilenames);
Then, in administrator/components/com_sigpro/models/gallery.php, around line 114, in public function upload(), before the line $result = JFile::upload($file, $path.'/'.$folder.'/'.JFile::makeSafe($filename)); add this:
$max = 0;
$directory = $path.'/'.$folder.'/';
if (($dir = opendir($directory)) !== false)
{
while (($filenam = readdir($dir)) !== false)
{
$int = intval(basename($filenam));
if ($int > $max)
{
$max= $int;
}
}
closedir($dir);
}
$filecount = count(glob($directory . "*"));
$filename = $max + 1;
if ($filecount>$filename ) {$filename = $filecount;}
if(strlen($filename)==1){$filename="0".$filename;}
$filename .=".jpg";
In same file some lines down is public function save().. here in function add:
$newfilenames= $this->getState('newfilenames');
and also some lines down replace the whole foreach ($files as $key => $file) with:
foreach ($files as $key => $file){
if ($newfilenames[$key] != strtok(pathinfo($file, PATHINFO_FILENAME), '-') ) {
if(strlen($newfilenames[$key])==1){$newfilenames[$key]="0".$newfilenames[$key];}
$character_array = array_merge(range(a, z), range(0, 9));
$string = "";
for($i = 0; $i < 6; $i++) {
$string .= $character_array[rand(0, (count($character_array) - 1))];
}
$newfilenames[$key] .= "-" .$string;
rename($path.'/'.$folder.'/'.$file, $path.'/'.$folder.'/'.$newfilenames[$key].'.jpg' );
}
}
In administrator/com_sigpro/views/gallery/tmpl/default.php, you'll see the spot where you can edit the image descript. and title...add this over title field:
<label>Filename</label>
<input type="text" name="newfilenames[]" value="<?php echo intval(strtok(pathinfo($image->name, PATHINFO_FILENAME), '-'));
And finaly in same file.. some lines down.. we need to ad the Filename field also for the fresh uploaded pics. Again over title field add this
<label>Filename</label>
<input type="text" class="sigProFilename" name="newfilenames[]" value=""/>
Many thanks to Matthew Cowan
Sorry if my english or code language is bad!
Hope i didnt forgot some line :) .. ..
And agan i'm not a coder, and there are mby lots of mistakes.. so make backups befor u try it.. or if u can rewrite it and post it here.. it works for me great for the moment :)
Ops.. i found BUG.. reordering not working corectly.. Pictures was overriding one another.. it was logical :) so I add unique random key to file name separated by "-" so i can extract and show from filename only the number infront. Code is fixed.. .
Last edit: 10 years 1 day ago by hristo.
Please Log in or Create an account to join the conversation.
- Forum
- Free Joomla Extensions & Templates
- Simple Image Gallery
- change display order of images? and remove filename..