GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   wordpress gallery image sorting, need help (https://gfy.com/showthread.php?t=1172219)

druid66 08-16-2015 06:16 AM

wordpress gallery image sorting, need help
 
hey guys,
i got this small problem which piss me incredibly.
let's say i got images named 01amateur 02amateur 03amateur etc..

MOTHERFUCKING "gallery" in wordpress sorts it's in completely random order (random order option is not ON ofc..) so in my 1st row i may as well have 05amateur and after it 02amateur etc..

is there any script that i could use or plugin which would sort all my sorted badly images posts according to names?

digitaldivas 08-16-2015 08:34 AM

most 3rd party plugins, sort by date or manually...

druid66 08-16-2015 09:48 AM

ok but it's not what i'm talking about.
if i'll have photos in standard wp gallery named 1.jpg 2.jpg 3.jpg etc.. i wan't those fucking photos to be displayed by this order not randomly.
i don't understand why it is fucked up by wordpress??

Colmike9 08-16-2015 09:52 AM

Yeah, that happens a lot and people just "fix" it by using another gallery plugin..
If the randomize button is unchecked in the gallery creation, try just dragging the images around in the order you want.

druid66 08-16-2015 10:02 AM

Quote:

Originally Posted by Colmike7 (Post 20552172)
Yeah, that happens a lot and people just "fix" it by using another gallery plugin..
If the randomize button is unchecked in the gallery creation, try just dragging the images around in the order you want.

tried but when i have to many photos and sometimes i have more than 15-20 photos it's lot's of additional, unneeded job (i'm i'm already doing lots of rly unneeded work on my sites..).

i don't want to use external plugin only to have my photos sorted properly, it should not be done this way.

any idea? any small php piece of code that once ran can sort it out in all posts?
should be doeable easily for some1 who know wp and php.
i'm offering free annual hardlink on my site to your (best if asian too) site just to thanks for help ;)

Colmike9 08-16-2015 12:21 PM

Let me wake up a bit and I'll try to help.

If you use Nextgen Gallery, you would go into nextgen-gallery/lib/ngg-db.php and change this:
$album->sortorder = serialize( $wpdb->get_col("SELECT gid FROM $wpdb->nggallery") );

to this:
$album->sortorder = serialize( $wpdb->get_col("SELECT gid FROM $wpdb->nggallery ORDER BY gid DESC") );
or:
$album->sortorder = serialize( $wpdb->get_col("SELECT gid FROM $wpdb->nggallery ORDER BY title DESC") );

I'm guessing it's the same problem with you where it's going by the image ID and not name, not sure why IDs are all mixed up, though.. :/

druid66 08-16-2015 12:51 PM

yes it's using ID's for photos but when i'm adding photos to gallery every single photo has it's own name with growing numbers so anyway it should be sorted as it.

i'm using CyberSeo plugin for harvesting photos from fhgs, i have also custom modified lightbox for displaying photos so if i'll use next gen gallery plugin or any other gallery plugin it will fuck up my theme (i've tried it already) that's why i'm sticking to wordpress built in gallery.

and thanks for trying, really appreciate.

Colmike9 08-16-2015 12:54 PM

Quote:

Originally Posted by druid66 (Post 20552302)
yes it's using ID's for photos but when i'm adding photos to gallery every single photo has it's own name with growing numbers so anyway it should be sorted as it.

i'm using CyberSeo plugin for harvesting photos from fhgs, i have also custom modified lightbox for displaying photos so if i'll use next gen gallery plugin or any other gallery plugin it will fuck up my theme (i've tried it already) that's why i'm sticking to wordpress built in gallery.

and thanks for trying, really appreciate.

Maybe CyberSEO would know? :upsidedow

druid66 08-16-2015 12:59 PM

think he's checking in most WP related topics here, but seriously - it should not be hard for some1 with small php knowledge to write some executable script run manually inside wp folder which will sort out all photos in posts, guess it's only hard for me cuz i'm html only skilled :(

hmm or maybe it could be hard actually? since in every post there are ids but not photo's names? damn it's just strikes me.. could be not doeable due to its nature.

Colmike9 08-16-2015 01:01 PM

Quote:

Originally Posted by druid66 (Post 20552308)
think he's checking in most WP related topics here, but seriously - it should not be hard for some1 with small php knowledge to write some executable script run manually inside wp folder which will sort out all photos in posts, guess it's only hard for me cuz i'm html only skilled :(

hmm or maybe it could be hard actually? since in every post there are ids but not photo's names? damn it's just strikes me.. could be not doeable due to its nature.

Show me the php file that manages your gallery and I'll fix it, col.mike7 a't yahoo do/t com

druid66 08-16-2015 01:04 PM

shit you got me here.. it's standard built in wordpress gallery function, don't even know which wordpress php file it's been related to :(

Colmike9 08-16-2015 01:14 PM

Quote:

Originally Posted by druid66 (Post 20552312)
shit you got me here.. it's standard built in wordpress gallery function, don't even know which wordpress php file it's been related to :(

It's probably media.php, then. I think I'll have a solution for you by the end of the night.

druid66 08-16-2015 02:21 PM

thanks a lot

fris 08-18-2015 03:53 AM

you can use the post_gallery hook to modify the output of the gallery, you could alter the default sort pattern.

druid66 08-18-2015 05:37 AM

thank you Fris ill google for this hood later today

just a punk 08-18-2015 05:55 AM

Quote:

Originally Posted by druid66 (Post 20551980)
hey guys,
i got this small problem which piss me incredibly.
let's say i got images named 01amateur 02amateur 03amateur etc..

MOTHERFUCKING "gallery" in wordpress sorts it's in completely random order (random order option is not ON ofc..) so in my 1st row i may as well have 05amateur and after it 02amateur etc..

is there any script that i could use or plugin which would sort all my sorted badly images posts according to names?

The Gallery Magic does it in a right way. It uses the standard WP gallery image numbering like this:

[gallery ids="729,732,731,720"]

Find more here: https://codex.wordpress.org/Gallery_Shortcode :2 cents:

The plugin works just like this:

Manual Mode

Add a new post or open the existing one and click the “Gallery Magic Shortcode” button (marked with a red square on the picture below).

http://www.cyberseo.net/image/img/gallery-magic-1.jpg

The “Gallery Magic” popup box will appear. Enter the URL of the HTML page which does contain a gallery you want to copy, then click the “Insert Gallery Magic Shortcode” button.

http://www.cyberseo.net/image/img/gallery-magic-2.jpg

Now simple save or update the post and Vualá, your gallery is here:

http://www.cyberseo.net/image/img/gallery-magic-4.jpg

Bunch Import Mode

This mode is very useful for importing a bunch of galleries from a plain text dump (e.g. CSV). Simple copy/paste your dump, set the formatting rules, adjust the post scheduler options and click the import button.

http://www.cyberseo.net/image/img/gallery-magic-5.jpg

fris 08-18-2015 08:00 AM

he wants to do it for already created ones.

Colmike9 08-18-2015 08:13 AM

Quote:

Originally Posted by fris (Post 20553786)
you can use the post_gallery hook to modify the output of the gallery, you could alter the default sort pattern.

Yep.
I forgot about this thread, my bad, but I think that hook is in media.php by default and is set to:
'order' => 'ASC',
'orderby' => 'menu_order ID',
ect.

druid66 08-18-2015 12:35 PM

ASC from ascending? why is it fucked up then?

fris 08-19-2015 09:54 AM

Quote:

Originally Posted by druid66 (Post 20554257)
ASC from ascending? why is it fucked up then?

you are looking to sort by filename?

so abc_file, bas_file, etc, etc with 1's as well?

StinkyPink 08-19-2015 10:00 AM

Not sure about your wordpress, but my wordpress allows me to drag and drop the pics in the order i want them... also after getting gallery code [gallery 1,2,3,4,5,6,7,8,9,10] you can change to [gallery 1,4,2,3,5,7,6,8,10,9] if you want.

No?

druid66 08-20-2015 05:28 AM

here's ids:

ids="14068,14067,14066,14065,14064,14063,14062,140 61,14060,14059,14058,14057,14056,14055,14054"

numbers looks ok, but, here's gallery:

Japanese gravure model Ayane Miura part 2/3 - Asian SexAsian Sex

if you hover mouse over thumbs you will notice that photos starts from 029 and going down but last photo is 030 and it should be 1st photo in case of this gallery.

this very gallery it is doesn't matter it just bumch of random photos but for some galleries it looking better if all are ascending (or descending) if gallery have continuous photos.

so again: ids are ok, photos are fucked up.

just a punk 08-20-2015 06:18 AM

Deleted 8char

StinkyPink 08-20-2015 06:25 AM

Quote:

Originally Posted by druid66 (Post 20556008)
here's ids:

ids="14068,14067,14066,14065,14064,14063,14062,140 61,14060,14059,14058,14057,14056,14055,14054"

numbers looks ok, but, here's gallery:

Japanese gravure model Ayane Miura part 2/3 - Asian SexAsian Sex

if you hover mouse over thumbs you will notice that photos starts from 029 and going down but last photo is 030 and it should be 1st photo in case of this gallery.

this very gallery it is doesn't matter it just bumch of random photos but for some galleries it looking better if all are ascending (or descending) if gallery have continuous photos.

so again: ids are ok, photos are fucked up.

Well right after I select my pics in default gallery in wordpress, it allows me to reverse order if I want, or even drag and drop each image in whichever order I see fit before inserting my gallery. I think it is the same screen to turn random on and off or select other functions of the gallery. Are you trying to eliminate this process? btw mine are just named 01 02 03 for now, just my personal preference.

druid66 08-20-2015 06:25 AM

edit 600 posts?
all id's are different?
most photos are fucked up and randomly displayed - no way i would browse 600 posts and sort out it manually, checking which photo should be in different position.

i need smth what would sort out real pic names and hopefully it will sort out ids in proper way.

druid66 08-20-2015 06:29 AM

Quote:

Originally Posted by StinkyPink (Post 20556059)
Well right after I select my pics in default gallery in wordpress, it allows me to reverse order if I want, or even drag and drop each image in whichever order I see fit before inserting my gallery. I think it is the same screen to turn random on and off or select other functions of the gallery. Are you trying to eliminate this process? btw mine are just named 01 02 03 for now, just my personal preference.

i know i can turn on/off random - i don't have it on ofc.
i know i can manually move photos but like i've said before it's time consuming and when i have 24-30 photos it's to much work, beside i have this problem on most of the posts so it's to late and to much manual labor.

fris 08-20-2015 06:47 AM

so how do you want them sorted? by filename alphabetically? 1-name 2-name etc?

druid66 08-20-2015 08:46 AM

yes Fris alphabetically would be best. my filenames are usually numbered correctly so it should work yet final results in wordpress are always mess ffs..

fris 08-20-2015 11:29 AM

Quote:

Originally Posted by druid66 (Post 20556198)
yes Fris alphabetically would be best. my filenames are usually numbered correctly so it should work yet final results in wordpress are always mess ffs..

just add orderby="title"

into the gallery shortcode

Code:

[gallery orderby="title" ids="291,102,31"]
etc

druid66 08-20-2015 02:25 PM

fuck me Fris you're WP God :pimp
thank you very much, WORKS!
now tell me how to add this line to all posts (if you know).

fris 08-20-2015 08:18 PM

Quote:

Originally Posted by druid66 (Post 20556482)
fuck me Fris you're WP God :pimp
thank you very much, WORKS!
now tell me how to add this line to all posts (if you know).

yes add this to your themes functions file

Code:

add_filter( 'shortcode_atts_gallery', 'gallery_sort_title');

function gallery_sort_title($atts) {
        $atts['orderby'] = 'title';
        return $atts;
}


JuicyBunny 08-21-2015 02:29 AM

Quote:

Originally Posted by druid66 (Post 20556060)
edit 600 posts?
all id's are different?
most photos are fucked up and randomly displayed - no way i would browse 600 posts and sort out it manually, checking which photo should be in different position.

i need smth what would sort out real pic names and hopefully it will sort out ids in proper way.

Not picking on you. Another issue is that many of the models are not who you say they are.
For example, a Maki Hojo post I checked has what looks like 3 different girls. 2 are not even close.

Need a better cataloging method for the scrapes or whatever. If that is already in place then your source has misidentified them.

druid66 08-21-2015 03:20 AM

Thank you Fris i owe you a promised link ;)
Thank you all guys for trying, you were great!

druid66 08-21-2015 03:24 AM

Quote:

Originally Posted by JuicyBunny (Post 20556856)
Not picking on you. Another issue is that many of the models are not who you say they are.
For example, a Maki Hojo post I checked has what looks like 3 different girls. 2 are not even close.

Need a better cataloging method for the scrapes or whatever. If that is already in place then your source has misidentified them.

can't find her. can you show me the post?

for av idols/gravure idols i'm using mostly very old content from scanners groups they rarely made mistakes with models i think, those guys were real fans.

as for tsunami-cash sites i'm using provided names.

but mistakes could happen ofc.


All times are GMT -7. The time now is 12:20 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123