You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server

General site updates, TODO list and discussion

b/Website Talk Started by Dream of Omnimaga, November 12, 2014, 07:18:29 AM

Previous topic - Next topic

0 Members and 150 Guests are viewing this topic.

u/Dream of Omnimaga February 10, 2017, 05:24:38 PM
That wap thing was made for old 90's phones
u/p2 February 12, 2017, 11:42:17 PM
that stuff was outdated even before I was born...  <_<

but still I like the idea of having a special mobile site without images :)
even tho it's probably pretty uncool to kill any css  :ninja:
u/Dream of Omnimaga February 13, 2017, 03:01:35 AM
It uses some minimal CSS actually. I guess overall our current mobile theme can do the job, even though it has some bugs. I can't wait to see what SMF 2.1 has in store in terms of responsiveness.
u/p2 February 13, 2017, 10:12:02 AM
I was trying to change the title of my reply to Topic #87 when I realized that the current name was already 2 letters OVER the regular maximum title length (I guess you guys modded the database there again).
Could we maybe change the max length globally?
It should be a rather simple config file in clear text, @Sorunome should know where to look for it (hopefully) :)
u/Sorunome February 13, 2017, 10:14:51 AM
Quote from: p2 on February 13, 2017, 10:12:02 AM
I was trying to change the title of my reply to Topic #87 when I realized that the current name was already 2 letters OVER the regular maximum title length (I guess you guys modded the database there again).
Could we maybe change the max length globally?
It should be a rather simple config file in clear text, @Sorunome should know where to look for it (hopefully) :)
You will probably have to also modify the DB to allow more chars for that column in VARCHAR, and these limits are usually hardcoded into SMF but rather simple to find.
u/Dream of Omnimaga February 13, 2017, 05:37:25 PM
Yeah we didn't change anything, but maybe something happened when editing. The lenght can be altered IIRC, as demonstrated on Omni once, but it might glitch out.

Also I updated the front page description of the site to include more platforms and more release examples
u/Yuki February 13, 2017, 09:38:24 PM
You can edit the max length in the HTML, I think the PHP makes no check on that until it's thrown in the SQL.
u/Dream of Omnimaga February 14, 2017, 12:15:59 AM
Ah ok. I remember when this was attempted on Omni, some HTML tags were not parsed properly everywhere, though.

EDIT: I installed a mod to allow searching for single characters words. Now C programmers should be able to search for C SDK-related posts. However, to prevent server overload, I increased the search limit to 5 seconds instead of 2 (I'll set it to 10 if I notice any lag). Thanks @MateoConLechuga for notifying me of the issue
Last Edit: February 14, 2017, 03:22:00 AM by DJ Omnimaga
u/p2 February 16, 2017, 05:08:10 PM
We should fix the mail notification thingy :)

QuoteHello p2!

DJ Omnimaga mentioned you in the post "Juju, you have been mentioned at a post in CodeWalrus", you can view the post at *link*

Regards,
CodeWalrus
u/Dream of Omnimaga February 18, 2017, 12:08:37 AM
We can't. I notified the author about the issue, to no avail (it appears he hasn't updated the mod since 2014). Unless someone in our team knows enough PHP/SMF modding to do it? Or maybe Soru could help? :P

http://www.simplemachines.org/community/index.php?topic=522005.msg3748982#msg3748982

When I brought that post back up, I got told that the mod was last modified in May 2014, and since the bug was reported in Sept 2014, it's unlikely this mod will ever get updated again.


Thankfully, SMF 2.1 probably has this feature by default.
Last Edit: February 18, 2017, 12:10:53 AM by DJ Omnimaga
u/Sorunome February 18, 2017, 12:26:19 AM
file Mentions.php
Find

function mentions_process_store(array $mentions, $id_post, $subject, $approved = true)
{
        global $smcFunc, $txt, $user_info, $scripturl;

        foreach ($mentions as $mention)
        {
                // Store this quickly
                $smcFunc['db_insert']('replace',
                        '{db_prefix}log_mentions',
                        array('id_post' => 'int', 'id_member' => 'int', 'id_mentioned' => 'int', 'time' => 'int'),
                        array($id_post, $user_info['id'], $mention['id'], time()),
                        array('id_post', 'id_member', 'id_mentioned')
                );

                if (!empty($mention['email_mentions']) && $approved)
                {
                        $replacements = array(
                                'POSTNAME' => $subject,
                                'MENTIONNAME' => $mention['real_name'],
                                'MEMBERNAME' => $user_info['name'],
                                'POSTLINK' => $scripturl . '?msg=' . $id_post,
                        );

                        loadLanguage('Mentions');

                        $subject = str_replace(array_keys($replacements), array_values($replacements), $txt['mentions_subject']);
                        $body = str_replace(array_keys($replacements), array_values($replacements), $txt['mentions_body']);
                        sendmail($mention['email_address'], $subject, $body);
                }

                if ($approved)
                        updateMemberData($mention['id'], array('unread_mentions' => $mention['unread_mentions'] + 1));
        }
}


replace with


function mentions_process_store(array $mentions, $id_post, $subject, $approved = true)
{
        global $smcFunc, $txt, $user_info, $scripturl;

        foreach ($mentions as $mention)
        {
                // Store this quickly
                $smcFunc['db_insert']('replace',
                        '{db_prefix}log_mentions',
                        array('id_post' => 'int', 'id_member' => 'int', 'id_mentioned' => 'int', 'time' => 'int'),
                        array($id_post, $user_info['id'], $mention['id'], time()),
                        array('id_post', 'id_member', 'id_mentioned')
                );

                if (!empty($mention['email_mentions']) && $approved)
                {
                        $replacements = array(
                                'POSTNAME' => $subject,
                                'MENTIONNAME' => $mention['real_name'],
                                'MEMBERNAME' => $user_info['name'],
                                'POSTLINK' => $scripturl . '?msg=' . $id_post,
                        );

                        loadLanguage('Mentions');

                        $subject_email = str_replace(array_keys($replacements), array_values($replacements), $txt['mentions_subject']);
                        $body = str_replace(array_keys($replacements), array_values($replacements), $txt['mentions_body']);
                        sendmail($mention['email_address'], $subject_email, $body);
                }

                if ($approved)
                        updateMemberData($mention['id'], array('unread_mentions' => $mention['unread_mentions'] + 1));
        }
}



EDIT: the spaces are because i copypasted out of nano :P

EDIT2: Disclaimer: I didn't test this but the fix is IMO so obvious that it shouldn't need testing :P Just a variable name collision with the variable $subject

EDIT3: the modified lines are line 261 and 263
Last Edit: February 18, 2017, 12:33:14 AM by Sorunome
u/Dream of Omnimaga February 18, 2017, 05:23:14 AM
Hm we might want to uninstall the mod and apply this change to the mod itself before reinstalled the updated version, though, so we avoid editing the SMF code directly. Thanks for the fix, though. Do you plan to cross-post this in the SMF Mentions thread on the official support site?
u/Sorunome February 18, 2017, 11:04:18 AM
Since the changed file is a file the mod only added itself it still uninstalls clean.

I do not plan on posting it there because i'm lazy >.>
u/novenary February 18, 2017, 11:09:20 AM
I've applied it and it seems to be working fine. Thanks.
u/aetios February 18, 2017, 11:23:54 AM
Sorunome for prez, lol. Fixes more issues in a night than all of us in a year :P
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal