cnb / news_manager-getsimplecms Goto Github PK
View Code? Open in Web Editor NEWA blog/news plugin for GetSimple CMS - development extended version
A blog/news plugin for GetSimple CMS - development extended version
tablatronix's tip:
GetSimpleCMS/GetSimpleCMS@188f839#commitcomment-2447036
at least here:
functions.php
function nm_get_posts($all=false) {
...
$data = @getXML(NMPOSTCACHE);
foreach ($data->item as $item) {
and look for others.
nm_get_date()
does:
setlocale(LC_TIME, $NMLANG);
It's based on the name of the language file selected, so it can only work if there's a locale with exactly the same name (es_ES, nl_NL, etc.)
The correct way, with several optional charsets:
http://get-simple.info/wiki/plugins:tips#displaying_custom_and_localized_dates
There's a solution in darkblue's post 521
http://get-simple.info/forums/showthread.php?tid=1056&pid=28355#pid28355
It may be better to make this optional, as it requires 1 extra file read (or else find another way to do it).
Update and include documentation (especially sidebar functions usage) in the admin panel, or at least as a readme file.
jquery.validate js and the style for invalid dates are both inserted in all admin pages ('header' hook), while it's only used for editing posts in NM.
(not a big issue, but I'll change this while doing other changes...)
Insert "Edit this" type link in posts (frontend) if user logged in.
and/or
You can use urls like:
SITE/index.php?id=news&post=../pages/index
and the page is displayed as if it was a post.
Not a major issue, I believe. You can make it load any .xml file in the server, but only those having title and content fields will be displayed. It doesn't work with e.g. GetSimple user files.
Anyway better fixing this.
All NM pages (posts, archives, tag, ...) have the same meta description, the one of the GS page.
For now, just clear it if it's not the main page.
If we enter a post title with no a-z, 0-9 chars, or a title like "Привет мир", "#$%@!", "---", the post is saved as ".xml" and cannot be edited from the post list.
http://get-simple.info/forums/showthread.php?tid=3972&pid=30860#pid30860 - Oleg06:
create an additional field for a picture in the announcements
I had thought about leaving this for a plugin (once I insert some actions/filters).
Another possibility could be having an image field as a default, but not showing it unless it's enabled by a gsconfig or backend setting.
at least for post titles.
ref: a way to do it using the theme functions.php http://get-simple.info/forums/showthread.php?tid=1056&pid=14215#pid14215 (post 264)
http://get-simple.info/forums/showthread.php?tid=3972&pid=31535#pid31535
Right now if you don't select fancy URLs in NM, by default a post has an URL like:
SITE/index.php?id=news&post=title
I'm going to change this default permalink structure: NM will use the one defined in GS, so that you can have slightly better URLs without having to change the .htaccess file, like:
SITE/news/?post=title
SITE/news?post=title
(I'm using posts as an example, but this is also applicable to ?archive=, ?tag= ...)
Now my question to current NM users:
Is anyone interested in having a setting to force using old-style default permalinks, independent of the structure defined in GS? (maybe for existing sites that want to keep it because of SEO)
In bd5284d (for issue #34) there's a new bug:
double slash in url (news//post/title
) if NM fancy url's enabled.
(reported in http://get-simple.info/forums/showthread.php?tid=3972&pid=31724#pid31724)
http://get-simple.info/forums/showthread.php?tid=4192
cannot delete posts, edited ones are saved as duplicate.
There may be a problem with PHP's rename
function in Windows.
I don't know if it's with some Windows OS or depends on the PHP version.
Unlimited NM instances. Any GS page will be able to have it's own news/blog system.
I had already done my own quick tests. Not difficult for the frontend stuff, but must think about the backend (I have several ways in mind).
action 'sitemap-additem' is useless, since 3.1
GetSimpleCMS/GetSimpleCMS#363
Remove the hook if GS is 3.1, 3.1.1 or 3.1.2. We might gain some milliseconds.
Authenticated users can delete any file with .xml extension outside the posts folder by using urls like:
/admin/load.php?id=news_manager&delete=../pages/index
/admin/load.php?id=news_manager&delete=../users/username
...
Also path traversal possible in:
(Only for xml files)
like isue #8, but for links in the backend interface.
Just replace & by &
Like issue #5 , but for settings page.
Due to changes for issue #34 you can now have NM fancy urls (no ?post=
, etc.) combined with GS custom permalink structure, like:
%slug%/
(no parent)
%slug%
(no parent, no trailing slash)
...
Unfortunately the NM sample htaccess generator page doesn't use function nm_get_url
(instead it has this hardcoded as %parent%/%slug%/
), so it's not being correctly generated in some cases.
Right now there is lang/es_LA.php, and is not used when the GS language is es_ES
Will re-do from scratch.
Post 441:
http://get-simple.info/forums/showthread.php?tid=1056&pid=20737#pid20737
or
Post 520:
http://get-simple.info/forums/showthread.php?tid=1056&pid=28353#pid28353
(with some modifications, see post 522)
suggested by vincenzo:
http://get-simple.info/forums/showthread.php?tid=3972&pid=31106#pid31106
m-d-Y (American/old English date format) can be confusing, many countries use d-m-Y
Let's change to the less ambiguous Y-m-d (dateISO) format as default, but let the admin choose (maybe with a gsconfig setting)
This is only for editing posts.
(ref: post 526 http://get-simple.info/forums/showthread.php?tid=1056&pid=28905#pid28905)
In NM's admin panel, if you clic the "X" (on the right) to delete a post, a popup dialog asks for confirmation ("Delete post ...?"), then if you accept, the post is deleted and you get the message "The post has been deleted" and an "Undo" link.
Well, that's how it worked with GS 3.0. But since GS 3.1, you get the popup but NOT the message + undo. (Something has been changed in the way GS handles these things.)
This only happens in NM's main admin panel (list of posts), but not if you delete a post by first editing it, then click on the Delete link above (next to "Save post")
[...]
http://get-simple.info/forums/showthread.php?tid=1056&pid=31500#pid31500
If we create a post with a title like "Привет world", the post is saved with slug "-world" (a hyphen at the beginning)
Doesn't happen with a title like "Hey Привет" (slug is "hey", no hyphen at the end)
full post, short post, recent post, etc.
Add local copy of jquery validate
Bugfix release
c74f42d
function nm_get_posts
reads file /data/other/news_manager/posts.xml
every time it is called.
Just like GS does with Edit Page.
darkblue's post 520:
http://get-simple.info/forums/showthread.php?tid=1056&pid=28353#pid28353
A link to the &htaccess info page is displayed when you have just enabled fancy url's, then you never see it again.
Add link in settings page.
The post data xml file could be read before rendering anything in the frontend (fulll post view, post=slug) and stored in a global variable.
That global could then be used in:
Links with parameters generated by NM don't validate: "&" instead of "&"
(Post 442 http://get-simple.info/forums/showthread.php?tid=1056&pid=20871#pid20871 )
Possible fix in kate's post 447 ( http://get-simple.info/forums/showthread.php?tid=1056&pid=21149#pid21149 )
If it helps anyone for future reference, I managed to solve the validation problem by adding this line to the nm_get_url function:
............
$url = str_replace('&', '&', $url);
return $url;
............
In the admin panel the placeholder for filtering (displayed when the filter input field is empty) is displayed as "filter" (same lang string for the Folder button is used for this)
html tags should be removed.
Problems with accented/punctuated/... (non English) characters in Windows:
http://get-simple.info/forums/showthread.php?tid=683&pid=31910#pid31910
Check if OS is WIN to apply utf8_encode. (taken from mvlcek's ES code)
The link to documentation page in settings page is no longer valid.
Change it to NM forum topic for now.
It's in the language files (except Russian)
When you create a new post the cursor focus is set to the title field. That's ok.
However this also happens when you edit an existing post, even more, the title is selected. (So it's easy to accidentaly erase it by typing anything.)
An alternative could be focusing the content field instead, but I think it's better not to focus any editable field, or perhaps the Options link.
For main, default [, archive, tag, search] ...
nm_get_url
reads the page xml file (only to get the parent slug) every time it is called.
This happens many times, as it is often used all over the backend and frontend site.
Posts have no modified date / last updated field.
filemtime($file)
is used to display the post xml date when editing a post. But if you e.g. upload post files using ftp their dates will probably be changed.
It could be useful to have a lastupdate field (or lastmod, updated, ...)
I posted this some time ago:
Quick hack.
New classes .nm_post_1, .nm_post_2, etc. and nm_post_last
Only in main page (not used in archives, tags...)
http://get-simple.info/forums/showthread.php?tid=1056&pid=31153#pid31153
Make something like this? Or leave it for templating, addon plugins...
That's how GetSimple's page manager has it.
commit e558da4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.