[BETA 4] Calendar Alerts MOD v0.0.4

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

User avatar
quahappy
Happy, not Quappy
Happy, not Quappy
Posts: 2266
Joined: Fri Oct 10, 2008 8:56 pm
Location: South Yorkshire, UK

This MOD is absolutely brilliant and being used constantly; especially for many notable global calendar dates/events. A couple of questions (in addition to above):

1. Allow BBCode. Would be extremely handy for [url] usage as could point members to a specific topic/post or another website.

2. I'd like to be able to display this MOD on my Portal page. Would I need to copy and paste the required Calendar Alerts MOD code to index.php into portal.php? And of course same for template file?

Thanks battye. :)
If you don't ask...
giardiniere
Greenhorn
Greenhorn
Posts: 1
Joined: Sat Mar 05, 2011 1:47 pm

Many thanks for this very useful mod.
Is it possible to notice by e-mail too?
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Sorry quahappy, I haven't had a chance to look at the Calendar Alerts MOD for a while. I'll look into your requests in all likelihood once the first beta of UQM is out (I might be able to help you with the portal question before then because it is more of a personalisation) :)

giardiniere, welcome to CMX :)
Like quahappy's personalisation request, I'll try and look into the email notification shortly as well (seeing it is not a feature I would actually implement into the MOD) :)
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
vova_ob
Greenhorn
Greenhorn
Posts: 1
Joined: Tue Jun 28, 2011 9:01 pm

Hi
help
how I can Parse BBCode and smilies in alert message ?

thanks))
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

vova_ob, sorry for the delayed reply. Typically bbCode and smilies complicate matters (more columns are required in the table, etc) so I probably won't include that feature.

v0.0.4 has just been released, including UMIL and a fix for a bug which has affected this MOD for a long time. I feel terrible about how long it has taken for this release to occur, this and another UQM release are always high on my list of priorities - time is always getting ahead of me though :(

The download link is at: http://www.cmxmods.net/downloads/Calend ... _Beta4.zip
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
victory1
Greenhorn
Greenhorn
Posts: 3
Joined: Sat Nov 27, 2010 10:15 am

This topic is close on phpBb.com so I was able to add parse bbcode and smilies to this mod. The only thing is you will get a general error due to the length of your alert if your message is too long so it's best to adjust it. I had to go my phpMyAdmin and adjust it since it will initially count all characters of your message like the below Example Message and with urls and bbcodes, they can be easily filled up with just a couple of links. So I changed my alert_text varchar to 800 to accommodate my message plus links.

Open:
roots/index.php

Find:

Code: Select all

$template->assign_block_vars('alerts', array(
Add Before:

Code: Select all

         $message = utf8_normalize_nfc($row['alert_text']);
         $uid = $bitfield = $options = '';
         $allow_bbcode = $allow_urls = $allow_smilies = true;
         generate_text_for_storage($message, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies);
         $row['alert_text'] = generate_text_for_display($message, $uid, $bitfield, $options);

Open:
roots/includes/ucp/ucp_alerts.php

Find:

Code: Select all

            $template->assign_block_vars('alerts', array(
            'U_ALERT'         => $row['alert_text'], 


Add Before:

Code: Select all

            $message = utf8_normalize_nfc($row['alert_text']);
            $uid = $bitfield = $options = '';
            $allow_bbcode = $allow_urls = $allow_smilies = true;
            generate_text_for_storage($message, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies);
            $row['alert_text'] = generate_text_for_display($message, $uid, $bitfield, $options);

Example Message:

Code: Select all

HOLIDAY LIGHTS / SNOW - You might have noticed the holiday lights and snow! When you hover over the lights with your mouse they smash. Be aware, there is a smashing sound. They are our holiday decoration for the month of December. You can turn off the lights/snow permanently in the User CP, choose Board preferences and click No for both options! For GUESTS - You can stop the snow temporally by clicking on Stop Snowing in the menu item. It will resume again when you maneuver to a new page. 
[br][/br]Feel free to share your thoughts: [url=http://www.sonyreaderboards.com/forums/viewtopic.php?f=28&t=2374]Go To Light Topic[/url] and [url=http://www.sonyreaderboards.com/forums/viewtopic.php?f=28&t=2389]Go To Snow Topic[/url]! Happy Holidays! :party:
Attachments
alertsparsebbcode.PNG
Floyd
Greenhorn
Greenhorn
Posts: 1
Joined: Tue Apr 24, 2012 6:20 am

Firstly, thanks ever so much for doing this mod and taking the time to help people out. Its appreciated.

I too, would like to do what Quahappy has asked, about putting it into a portal block, but I cant seem to get the code to work from the index_body.html or index.php file. It just returns blank when added to a custom html block etc.

I would also like to know where the css coding might be for this block, as my results are just a white background with red text ( but the ucp area is fine ). Do we have to hard code the mod, or can this pick up the css from our templates?

Also, is there a way to EDIT existing alerts, or do we have to delete them and re-add them?

Many thanks

Floyd.

quahappy wrote:This MOD is absolutely brilliant and being used constantly; especially for many notable global calendar dates/events. A couple of questions (in addition to above):

2. I'd like to be able to display this MOD on my Portal page. Would I need to copy and paste the required Calendar Alerts MOD code to index.php into portal.php? And of course same for template file?

Thanks battye. :)
Let me know if you sort it :)
Post Reply