Modules: xNews v1.67 BETA - News Module goes Clonable

Posted by: dnprossiOn 2010/3/7 16:00:00 12518 reads
xNews v1.67 BETA - Clonable & UTF-8 compliant

I needed a cloanable news module and one that worked correctly with xlanguage and UTF-8 so I decided to start a new news branch.

I had to decide on two ways to face the problem. One was that i could write a cloner file with a long list of files to be parsed and renamed in every needed spot and the other to use an automatic parser of files that only changes prefixes and a few file names like the clone file in Oledrion. The first was disregarded only because at every code modification one has to keep track of every single change and update the cloner file by hand, in the second case nothing has to be done all prefixes are parsed removing conflicts between cloned modules. Its fast and reliable. Below are some of the changes I made.

Called module xNews to keep original News module as is. No overwriting.

!!!! IMPORTANT !!!! Please upgrade your News module to 1.64-5-6 before installing xNews if you have intention to import data from original - it has not been tested on previous versions.

!!!! IMPORTANT !!!! Importing original News module 1.64-5-6 data - On install xNews activates import button only if xNews stories table is empty therefore if you want to import data you should do this right after install and before doing anything else - Import will not work from clones. You can still work creating and adding news to clones without touching xNews data until you decide to import original news data.

I have tested the module on linux - Apache 2 - php 5 -mysql 5 - xoops 2.4.x - 2.5.x working fine.
Has to be tested on Windows.

Download here.

- New News clonable, UTF-8 only branch
- Complete 2.4.x and 2.5.0 alpha 2 compatability
- Modified all files and code for multiple news module install and easy cloning
- Fixed all language prefixes to:
- _AM_NW_ for admin
- _MA_NW_ for main
- _MI_NW_ for modinfo
- _MB_NW_ for blocks
- Other languages can be added after canging incomplete prefixes on standard news modules and adding the last added lines language defines using notepad++, geany - search/replace functions.
- Removed all &xxx html encoding characters from languages
- italian
- Removed FPDF (no good for utf-8)
- Repositioned tcpdf (pdf directory) to xoopsroot/Frameworks/tcpdf
- Updated tcpdf to tcpdf 4.8.026
- Fixed tcpdf_config $k_path_url that was trunkated (even though not giving any errors)
- Fixed pdf makepdf.php to work with UTF-8 and x-language
- Added Cloner Menu Item in Admin
- Used clone.php code in oledrion as base source
- Changed news_ function prefix to nw_
- Cloner will:
- change all _NW_ language prefix's to New Prefix
- change all function nw_ prefix's to New Prefix
- create new directory
- Reused unused header.php for news directory, news url and module dir name defines
- Substituted all /module/news/ dir and url references with header.php defines
- Added permission setting on install
- Added data importer from normal news module automatic on install
- Changed Upgrade functionality so that also cloned news modules can be easily upraded
- Added a clonerdata table for original and cloned modules to read and write from.
- Needed for new install and upgrade control.
- Table will only be deleted when Original xNews module will
be uninstalled and only after all other clones have been uninstalled first.
- Added Install-Uninstall from cloner admin. Only from Original xNews module.
- Cloner Admin
menu from clones will be redirected to xNews module Admin
- Added News 1.64-5-6 module import function on xNews Clone Manager
- Added Latest News Block.