What do I change to get a higher Smiley limit? Fixing it myself

Started by tpgames, July 17, 2016, 08:59:27 PM

Previous topic - Next topic

tpgames

Question What php file and which line do I change? Thanks!

Note: 1. I am fully aware that "mods" are preferred. I do not intend to upgrade my SMF forum until PHP requires me to. At that time, I'll make a new theme as the one I use won't work.
2. I am aware of the server load. I only have at most 2 people who ever see the same page at the same time. I'm not concerned.

I did try a search for 1500, but that wasn't the right think to search for. Am I searching for a kb limit instead? Thanks!

My final Smiley count is 3268. And no one is really interested in helping me with getting that many smileys allowed. My ex-programmar who is still my friend, refuses to learn php. :P This is why I am going to attempt to fix it myself. I'm installing a 2nd SMF forum. Thanks again!

Extra:
I did try Kunena forums (Joomla crap) but I couldn't even get the forum to stop insisting that all text must be black by default - and that was after changing every single CSS link in what seemed like millions of pages. Joomla is redundant upon redudant it seemed.  We only use Joomla for the Book Library feature. Oxwall's forum was so stupid (I do mean that it lacked so many features that it was dumbed down) making SMF a necessity. Yabb I know made changes that I didn't like... but the other problem is that if I use SMF, then I can have 2 forums themed identically, which would be too hard if used Yabb. 


tpgames

I am looking in the Subs.php file. Nothing in the code says "limit" of number of smileys to me.
I found this... and was wondering what the "480" means? Also, I am not finding any part of the code that looks like I could change it to get an upper limit for number of smileys. Thanks!

Note: I am rereading this thread as well http://www.simplemachines.org/community/index.php?topic=529231.msg3756269#msg3756269

// Use the default smileys if it is disabled. (better for "portability" of smileys.)
if (empty($modSettings['smiley_enable']))
{
$smileysfrom = array('>:D', ':D', '::)', '>:(', ':))', ':)', ';)', ';D', ':(', ':o', '8)', ':P', '???', ':-[', ':-X', ':-*', ':\'(', ':-\\', '^-^', 'O0', 'C:-)', '0:)');
$smileysto = array('evil.gif', 'cheesy.gif', 'rolleyes.gif', 'angry.gif', 'laugh.gif', 'smiley.gif', 'wink.gif', 'grin.gif', 'sad.gif', 'shocked.gif', 'cool.gif', 'tongue.gif', 'huh.gif', 'embarrassed.gif', 'lipsrsealed.gif', 'kiss.gif', 'cry.gif', 'undecided.gif', 'azn.gif', 'afro.gif', 'police.gif', 'angel.gif');
$smileysdescs = array('', $txt['icon_cheesy'], $txt['icon_rolleyes'], $txt['icon_angry'], '', $txt['icon_smiley'], $txt['icon_wink'], $txt['icon_grin'], $txt['icon_sad'], $txt['icon_shocked'], $txt['icon_cool'], $txt['icon_tongue'], $txt['icon_huh'], $txt['icon_embarrassed'], $txt['icon_lips'], $txt['icon_kiss'], $txt['icon_cry'], $txt['icon_undecided'], '', '', '', '');
}
else
{
// Load the smileys in reverse order by length so they don't get parsed wrong.
if (($temp = cache_get_data('parsing_smileys', 480)) == null)
{
$result = $smcFunc['db_query']('', '
SELECT code, filename, description
FROM {db_prefix}smileys',
array(
)
);


UPDATE:
After rereading that thread I linked to, I've decided that the only real work around is to have TWO new SMF forums. We have around 1600 Smileys in the Foreign Language department alone!

Feel free to close this thread if you wish, as I really do think that changing any code to allow  3268 smileys would break the forum anyway.

Arantor

The 480 is the number of seconds to cache the smiley data for, so it doesn't have to hit the database every single time.

The limit in question is part of PHP itself. The only way you're changing that is to modify PHP's own source code and recompile it, something you're not doing on anything less than a VPS and building from source I s hairy.

Or you completely and totally rebuild how smileys are parsed out to not use regular expressions. This is, still, not as simple as you were insisting.

nend

It is doable but maybe not the way you would want it.

Say for instance you can do a range. This way you wouldn't have to run the expression. If the code is outside the range then it is invalid. I would then suggest making the file name as the code. You would have to do a little rewriting in Subs.php and GenericControls.template.php to get this working.

Example would equal 0002.ext.
[smiley]0002[/smiley]

This is similar to what I do here.
http://custom.simplemachines.org/mods/index.php?mod=4099

Another way is you can read the folders. Say for each page you have a folder. So ./Smileys/1/smile.png would be on page 1 and ./Smileys/2/smileonpage2.png would be on page 2 and so on. Maybe your BBC would look like this.
[smiley=001-smiley.png]

Just think a little outside the box.  ;)

Arantor

He wants to use smileys so he can tie it into the tabbed smileys mod.

He also insisted, repeatedly, that I was an idiot because it clearly is just changing a limit from 1500, which implies he didn't understand the topic I posted (linked to above) as to why there is a limit in the first place.

Doing it via BBC is an interesting idea, wouldn't play nicely with WYSIWYG, though. Also makes it hard to rearrange things and configure them since there wouldn't be a nice interface for it.

nend

I don't get the idea of a ton of smileys either. The coding would take some time, then depending on the choice, that could take quite some time getting the image files arranged so they would be somewhat useful. Just too much time to waste on a mediocre feature.

There are better things on the horizon. Now if every OS vendor can play nicely, I didn't thinks so, not in my lifetime. Maybe not so bleak as I think, Windoze wants to be Linux. Windoze wants to be what Windoze can not be. Ranting here, I really don't like Windoze.

Arantor

Well, SMF already has all the tooling it needs, with the relevant mod, anyway. And I can even see the use case for it.

I object mostly to the insults that were thrown about at the time, insinuating that this should be simple, even after I spent time sitting down and explaining why there is a problem, at the regular expression level. (The smiley limit in SMF is solely because of an underlying limit in the PCRE library.) I find it hard to be sympathetic to people who don't seem to care that there are mathematical laws at work that cannot be just arbitrarily changed.

tpgames

Quote from: Arantor on July 18, 2016, 01:19:27 AM
He wants to use smileys so he can tie it into the tabbed smileys mod.

He also insisted, repeatedly, that I was an idiot because it clearly is just changing a limit from 1500, which implies he didn't understand the topic I posted (linked to above) as to why there is a limit in the first place.


Notice my update. What I didn't explain clearly enough was that by rereading that link, I now do understand how difficult it is. That is why I am going with 3 forums. 1 forum for Asian languages, 1 forum for the other languages, and then the original forum. I was in error about the code, and I apologize for that! I am used to "stupid code" that just puts in arbitrary limits. SMF clearly does NOT use "stupid code". lol

Tabbed Smileys I gave up on because I'd have to rewrite the mod to get it to actually work. My theme breaks Tabbed Smileys. No biggie. I came up with a better idea, which we prefer. I'm posting the smileys in separate topics. That way we can just have up the smiley and code for the topic we need. Its easier.

I decided that having 3 forums would be faster in the long run when I thought about what I wanted to be doing in 5 years - due to SMFs upgrades may break anything I do, will break my theme and lastly because they are working on PHP 7 - which could break things even further. lol


tpgames

My friend came up with a solution.  Its so simple I'm kicking myself.  :D A specific photo site does this, so I should have thought of this ages ago1 And what makes this so brilliant is that as I learn Japanese, I can keep making more Kanji. :D I will never have a smiley limit again. And, the server load won't be that bad either.

1. Create a HTML page inside of a new folder.
2. Add the following code for each smiley you want.

<img src="http://www.yourwebsite.com/smileyfolder/smiley1.gif"> <br>
[img]http://www.yourwebsite.com/smileyfolder/smiley1.gif[/img]


3. Post the link on a smiley post to the HTML page. Users simply choose which smiley they want and copy the

[img]http://www.yourwebsite.com/smileyfolder/smiley1.gif[/img]


Advertisement: