vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   PHP file to alphabetize your smilies (https://vborg.vbsupport.ru/showthread.php?t=197591)

aciurczak 11-29-2008 04:18 PM

PHP file to alphabetize your smilies
 
1 Attachment(s)
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.../Babycha-a.gif

For anyone wanting to use this, see the file in this post, https://vborg.vbsupport.ru/showpost....6&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 [DATE]1420152915[/DATE] at [TIME]1420152915[/TIME] ---------------

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

1 Attachment(s)
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 [DATE]1420157011[/DATE] at [TIME]1420157011[/TIME] ---------------

Quote:

Originally Posted by ozzy47 (Post 2529974)
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)

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. :)


All times are GMT. The time now is 04:57 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01242 seconds
  • Memory Usage 1,763KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (29)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete