PDA

View Full Version : PHP file to alphabetize your smilies


aciurczak
11-29-2008, 04:18 PM
If your board has a bunch of smilies that you added over time, keeping them in order can be a real pain in the ass. Makes sense to alphabetize them. But it's a real pain in the ass to do it manually with the display order field. This php file does the work for you, after you run it your smilies displayorder will be in alpha order from the smilie titles.

Upload file to the includes/cron directory, and set up a scheduled task. Keep the task marked inactive.

filename that the task calls will be: ./includes/cron/alphasmilies.php

Then just go to scheduled task, click run, and your smilies are now in alpha order, and the displayorder increments by 10 so there's plenty of space to add more smilies later in the right spot, if you want to sort a few manually.

Also, this keeps categories intact, so if you have multiple smilie categories, this will sort them within each category, but will not group all smilies into a single category.

Firyou
04-05-2014, 03:51 AM
I get an error for this. Any one have something to similar to this?

aciurczak
04-05-2014, 04:19 AM
I'm still using this from time to time if I add smilies; still seems to work fine with 3.8.7. What error are you seeing when you run it?

CAG CheechDogg
01-01-2015, 08:04 PM
ozzy my Man ..would this work on vB4?

ozzy47
01-01-2015, 08:13 PM
Yes, I just tried it and it seemed to work correctly. But I would try it on a test site first to ensure you get the desired results.

http://www.myfriendsspace.com/images/smilies/smiles/Babycha-a.gif

For anyone wanting to use this, see the file in this post, https://vborg.vbsupport.ru/showpost.php?p=2529966&postcount=21

CAG CheechDogg
01-01-2015, 08:43 PM
Ok good stuff my man ...thanks ...

ozzy47
01-01-2015, 08:45 PM
Not a problem, glad to help. :)

CAG CheechDogg
01-01-2015, 08:54 PM
I got the following error when running the task:



--------------- Added 1420152915 at 1420152915 ---------------

The table should be "cagisf_smilie" ......

ozzy47
01-01-2015, 08:59 PM
Try this file. Remember test site first. :)

CAG CheechDogg
01-01-2015, 09:04 PM
I got this now:

ozzy47
01-01-2015, 09:06 PM
Ok once again. Remember test site first. :)

CAG CheechDogg
01-01-2015, 09:14 PM
Nope still same error :)

ozzy47
01-01-2015, 09:17 PM
Well it is a bit different, the space is now gone. Try this one. Remember test site first. :)

CAG CheechDogg
01-01-2015, 09:21 PM
Nope..back to the 1st error: :p

ozzy47
01-01-2015, 09:24 PM
Strange wonder why I am not getting no errors. How about this one. Remember test site first. :)

CAG CheechDogg
01-01-2015, 09:27 PM
Lol !!! Now I got this one ...

ozzy47
01-01-2015, 09:30 PM
Well that is probably due to the previous attempts. but at least we are getting closer. So try this one.

CAG CheechDogg
01-01-2015, 09:33 PM
No problem my Man ....here it goes:

ozzy47
01-01-2015, 09:35 PM
I swear I think I know what I am doing. :p Try again.

CAG CheechDogg
01-01-2015, 09:41 PM
WOOOOHOOOOO !!!! YOOOO-IZA-DA' MAN !!!!

That did it lol ......

Only one thing lol ... when it re-arranged the smilies it started the first one with (4400) instead of (1) and ended the last one with (8780) .....

Any reason why it doesn't start it with (1) Senor ozzy?

ozzy47
01-01-2015, 09:46 PM
Well we are not through yet. Now you have to load this file up, just incase you ever run it again.

Yeah it keeps the original smiles numbers, but this just alphabetizes them. It does not change the number assigned to them. If it were to do that, I think if you had a smile in a post, and it's ID was 456, by changing the ID number, might just change the smile in the post.

CAG CheechDogg
01-01-2015, 09:58 PM
Ah ok ..so I can run the task now with this last one and be good to go? or more steps? :p

ozzy47
01-01-2015, 09:59 PM
Yeah you can run it again with the last file just to see if you get any errors, but it won't actually change anything really, as it is already done.

CAG CheechDogg
01-01-2015, 10:02 PM
This is what I am talking about ozzy ...the display order number starts with 4400 instead of 1

https://vborg.vbsupport.ru/external/2015/01/33.jpg

--------------- Added 1420157011 at 1420157011 ---------------

Yeah you can run it again with the last file just to see if you get any errors, but it won't actually change anything really, as it is already done.

Ok good stuff my Man ..once again thank you !!!

ozzy47
01-01-2015, 10:05 PM
Yeah I know, as I said, this just alphabetizes them, it does not change the ID number of the smile in the DB. That is unique to each smile as you import them into the DB.

I see no reason to even attempt to change that either, as that is only viewable in the ACP. :)

CAG CheechDogg
01-01-2015, 10:07 PM
Ok good stuff .... muahaha!!!!

Is there anything available already that can search for smilies by name or a "my favorite" smilies for v4? I am looking and I see nothing for v4 ...

ozzy47
01-01-2015, 10:09 PM
Perhaps this mod, [DBTech] vBEditorTabs v1 (vB4) (https://vborg.vbsupport.ru/showthread.php?t=282451)

vBEditorTabs is an editor add-on, allowing administrators and users the ability to create custom tabs below the editor for categorizing smilies, with the potential to add further content in future releases. The tabs integrate smoothly with vBulletin's editor, are powered via jQuery, and there is no limit to the number of tabs you can have, as they wrap under each other and still function normally.

vBEditorTabs is currently only compatible with vB4.1.4 and higher (CKEditor).

CAG CheechDogg
01-01-2015, 10:15 PM
If it didn't require the copyright notification I would use a lot more of the DB mods ... but I rather not get into that because DB's mods are good stuff ... thank you though ozzy once again !!!

ozzy47
01-01-2015, 10:20 PM
I understand that. I sent you a pm. :)