I Love PHPMaker

... because it gets even more powerful and flexible!!

  • About
  • Terms and Conditions
  • Membership Options
  • Sitemap
  • Downloads
    • PHPMaker Extensions Download
    • PHPMaker Projects Download
    • PHP Report Maker Extensions Download
I Love PHPMaker » PHPMaker Extensions » How to Show Announcement that Supports for Multi-Language and Auto-Publish in Web Applications that Generated by PHPMaker 10.0.4
How to fix the Image Displaying Issues in Internet Explorer (IE) for Web Applications that Generated by PHPMaker 10.0.4
Search and Pagination Panel Now Support for Mobile Responsive Design!

February 6, 2014

How to Show Announcement that Supports for Multi-Language and Auto-Publish in Web Applications that Generated by PHPMaker 10.0.4

Almost all web applications need to show announcement to the users, especially if the information is urgent and need to be displayed immediately. Some of the announcements are need to be displayed based on the certain language and also for the certain duration of dates.

The question is, how can we display the announcement that supports for Multi-Language based on the current selected language and Auto-Publish based on the certain range of dates? As we know, implementing the multi-languages content including publishing them for the certain duration of dates in a web application was never easy. Hey, no worries! Now you can simply display it easily by using MasinoFixedWidthSite10 extension. I just updated the extension including the demo project file so that you can implement it into your own PHPMaker project easily and quickly.

Demo Project File

In the demo project file, you can see how we can manage the announcement records that separated in the announcement table, especially while you (as Admin) are inserting or updating the announcement records. We just need to add few lines of code into Row_Inserting and Row_Updating server events to handle some possibilities. The rest of it has been handled nicely by MasinoFixedWidthSite10 extension. You can download the complete project file which has included this feature from this link, and follow this article: Step by Step to Implement Masino Extensions in a New Project of PHPMaker 10 if you want to implement it into your new project.

Extensions Advanced Settings

By default, this feature is disabled in MasinoFixedWidthSite10 extension. In other words, if this feature is disabled, then the languages table is used instead. Please note that if you use languages table, then it only has the ability to display the announcement in multi-language and only one record for one language, but not to display the announcement based on the duration of dates. So, if you want to enable multi-language and auto-publish for the announcement and also you want to manage many announcement for one language, then simply enable SeparatedAnnouncementTable and define the table name from AnnouncementTable under the Advanced Settings of MasinoFixedWidthSite10 extension. By using the announcement table, now you can set the certain announcement published based on the certain date duration and it also supports for multi-language. Please note that you must create a new table named announcement (you can change this table name from the Advanced Settings of the extension).

New Table

If you want to create the announcement table without using the complete demo project file above, then make sure you have already created the following new table in your database:

DROP TABLE IF EXISTS `announcement`;
CREATE TABLE `announcement` (
  `Announcement_ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `Is_Active` enum('N','Y') NOT NULL DEFAULT 'N',
  `Topic` varchar(50) NOT NULL,
  `Message` mediumtext NOT NULL,
  `Date_LastUpdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `Language` char(2) NOT NULL DEFAULT 'en',
  `Auto_Publish` enum('Y','N') DEFAULT 'N',
  `Date_Start` datetime DEFAULT NULL,
  `Date_End` datetime DEFAULT NULL,
  `Date_Created` datetime DEFAULT NULL,
  `Created_By` varchar(200) DEFAULT NULL,
  `Translated_ID` int(11) DEFAULT NULL,
  PRIMARY KEY (`Announcement_ID`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;

Of course, you may manage the announcement records by generating the table above and enhance the related field, for example, set Language as lookup field to the languages table.

The Challenges

The challenge of implementing this feature is how we can handle the possibility of the intersection dates among the announcement records. Of course, we must not allowing there are more than one record in the same language which have the intersection of duration dates, since if that happened, then it will cause the collision while displaying some announcement records at that time. On the other side, we must allow more than one record in the different language which will have the same duration dates, since this is important in order to implement the multi-language announcement properly. See what I mean? 🙂

Not only that, we have to handle also how to make the relationship among the announcement records so that they can be implemented as the multi-language content. Let's say after we inserted a new announcement record in English, then we need to translate the content into the other language(s). For this purpose, we can simply use Copy record feature. But, how can we make the relationship among those records? We need to handle the duration dates for those records must be the same, right? Again, no worries! I have successfully handled it nicely from the demo project above. 🙂

Demo Link

Want to see the demo? Simply click on this link, and then login using username admin and password master to manage the announcement records. To see the announcement in action, then make sure you have enabled Show Announcement by clicking this link.

Download

Download the Demo project and the extension files from here.

Article by Masino Sinaga / PHPMaker Extensions / announcements, MasinoFixedWidthSite10, multi language, PHPMaker 10.0.4, Row_Inserting, Row_Updating, Server Events 8 Comments

How to fix the Image Displaying Issues in Internet Explorer (IE) for Web Applications that Generated by PHPMaker 10.0.4
Search and Pagination Panel Now Support for Mobile Responsive Design!

Comments

  1. Huelya Yaman says

    February 17, 2014 at 7:57 pm

    Hello Masino,

    is there a Chance to find a tip for just implementing the Language FormRow into the Header Row? This is all i Need. I don`t want a big solution like an Extension for that.
    Besides that .. i love ilovephpmaker.com!

    Log in to Reply
    • Masino Sinaga says

      February 19, 2014 at 1:43 pm

      Hi Huelya,

      Yes. You may customize the PHPMaker template instead. See the related code in “template.php” file. Please read “Customizing Template” in the help file for more information.

      In addition, you may also read the articles that related to how to customize the template under Customize Template menu in this site.

      Thanks for loving ilovephpmaker.com. 🙂

      Log in to Reply
  2. Ahmad Ibrahim says

    April 5, 2014 at 12:12 am

    View, Edit, Copy, Delete have been disappeared at my script after doing steps to install FixedWidthSite extension. Any feedback for this neccessary? Thanks before.

    Log in to Reply
    • Masino Sinaga says

      April 6, 2014 at 12:18 pm

      Make sure you have downloaded and enabled ALL the Masino Extensions for PHPMaker version 10 and then regenerate all the script files again.

      Log in to Reply
  3. Ahmad Ibrahim says

    April 5, 2014 at 12:14 am

    Announcement doesn’t appear at my script after activating it, why?

    Log in to Reply
    • Masino Sinaga says

      April 6, 2014 at 12:24 pm

      1. Make sure you have added the records into “announcement” table which have the valid duration time with today so that it will be displayed properly.

      2. Make sure the value of “Show_Announcement” field in “settings” table has been changed become “Y”.

      3. It is recommended for your to try PHPMaker 10.0.5 Demo Project Files by yourself in your local computer. Also, try to play with this demo project to see it in action and compare it with your demo project file above.

      Log in to Reply
  4. Ahmad Ibrahim says

    April 5, 2014 at 12:27 am

    Fatal error: Call to undefined method stdClass::SaveProfileToDatabase() in D:\xampp\htdocs\women\logout.php on line 193
    Appears when click logout link, why?

    Log in to Reply
    • Masino Sinaga says

      April 6, 2014 at 12:29 pm

      Make sure you have downloaded and enabled ALL the Masino Extensions for PHPMaker version 10 and then regenerate all the script files again.

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • A New PHPMaker 2020 Project File Is Released
  • PHPMaker 2020 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2020 Is Released!
  • Inventory Stock Management Project, Why Should You Have It?
  • A New PHPMaker 2019 Project File Is Released!
  • PHPMaker 2019 Demo Project File Is Released!
  • Masino Extensions for PHPMaker 2019 Is Released!
  • A New PHPMaker 2018 Project File Is Released!
  • PHPMaker 2018 Demo Project File Is Released!
  • Masino Extensions for PHPMaker 2018 Is Released!

Search

Recent Comments

  • Masino Sinaga on Masino Extensions for PHPMaker 2019 Is Released!
  • Masino Sinaga on Masino Extensions for PHPMaker 2019 Is Released!
  • Brien Devine on Masino Extensions for PHPMaker 2019 Is Released!
  • Brien Devine on Masino Extensions for PHPMaker 2019 Is Released!
  • Masino Sinaga on Masino Extensions for PHPMaker 2019 Is Released!

Demo Website

  • Demo of I Love PHPMaker 2020 (MasinoExtensions).
  • Indonesia Post Offices.
  • Stock Inventory Management.
  • Demo of PHPMaker + PHP Report Maker

Another Demo

The following template are not available in this site (must be purchased separately)

  • PHPMaker v2018 Horizontal Vertical Template.
  • PHPMaker v2017 Horizontal Vertical Template.

Demo Explanation

Stock Inventory Management is the good project for your reference, since it uses the real example in the real world. Many useful features you can use from this project, such as how to add the Thousand and Decimal separator character, and also how to calculate multiple row in Grid-Add when End-Users are entering data into the Grid-Add mode.

Categories

  • Customize Template (103)
  • General (3)
  • PHP Report Maker (17)
  • PHP Report Maker Extensions (2)
  • PHPMaker Extensions (76)
  • Tips and Trick (72)

Articles based on version

  • PHPMaker 2020
  • PHPMaker 2019
  • PHPMaker 2018
  • PHPMaker 2017.0.7
  • PHPMaker 12.0.7
  • PHPMaker 11.0.6
  • PHPMaker 10.0.5
  • PHPMaker 9.2.0
  • PHPMaker 8.0.3
  • PHP Report Maker 12

(c) I Love PHPMaker 2010 - 2019 by Masino Sinaga | WordPress | Log in | Back to top