Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 25, 2012, 04:35:03 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Interested in joining the WebsiteBaker team?
For more Information read
here
or on our
new website
.
155511
Posts in
21712
Topics by
7738
Members
Latest Member:
chris85
WebsiteBaker Community Forum
English
Modules
(Moderator:
Argos
)
Revival: News vs. NewsArch
Pages: [
1
]
2
Go Down
Author
Topic: Revival: News vs. NewsArch (Read 2607 times)
Marcus70
Offline
Posts: 28
Revival: News vs. NewsArch
«
on:
August 22, 2009, 10:19:05 AM »
Hi at all,
some weeks ago I stumbled over a module called "NewsArch" which provided archive functionality to the standard News module. I really liked this module "NewsArc" and had a closer look on it and found out that it provided basically the same code as the "News" archive. Unfortunately the "NewsArc" module was designed for WB 2.6 and its development doesn't seem to be continued.
I thought it would be a good idea to give it one more chance. So I took the "standard News module" which is in the meantime provided as part of the WB and modified it a bit. The result is "News v2.9.0a" which is attached to this posting.
This module provides both; the standard news posting list as well as an archive mode, if wanted. You are able to switch the archive mode on or off in the backend. If archive mode is switched off the module only provides the basis functionality of the "News" module as it's known. By switching the archive mode on the module also provides the archive functionality as shown in the "NewsArc" module. The module starts up by displaying the "standard news postings list", but provides links to switch in archive mode to view all actual and archived posts. By clicking on the month and year of a time period you can filter the list of posts so that only posts of the selected time period are displayed.
I also added a field "sort order" to the backend which offers a high flexibility to the way you want to display your posts. The content of that "sort order" field is directly taken over to the SQL query string which makes it possible to sort the list how ever you want it sorted.
And, finally, I fixed a bug concerning the way of dealing groups. There was a bug which generated links to display a group like ".../posts/ example.php?p=5
?
g=1" which led to not displaying posts of a group as expected but to display all posts again.
There are still some things to do (that's why I provide the module as "alpha"
):
- there are new entries in the language files which need to be translated
- I still run into problems with that annoying "upgrade.php". I started a few years ago with PERL and are not familiar with PHP yet; so if someone wants to have a look on it - feel free
- Yes... and the documentation is still missing
Since an upgrade via "upgrade.php" still won't work installation is best done by uninstalling the former version of News (if available) and then install "News v2.9.0a" (which worked fine in my testing environment).
Feel free to instal the module for testing purposes - I would be glad to get a lot of feedback to improve the module!
Marcus
10/05/2009: Added link to latest version v2.91
10/13/2009: Added link to latest version v2.92
«
Last Edit: October 13, 2009, 08:18:26 PM by Marcus70
»
Logged
...man weiß nie, wie tief eine Pfütze ist, bevor man nicht hineingetreten ist... (Murphy's Law)
kweitzel
Forum administrator
Offline
Posts: 6975
Re: Revival: News vs. NewsArch
«
Reply #1 on:
August 22, 2009, 10:54:18 AM »
Hi anfaenger,
nice that somebody starts taking on support / development for "orphaned" modules.
@erpe: Also something for AMASP, isn't it?
cheers
Klaus
Logged
WebsiteBaker Org e.V. - for WebsiteBaker
erpe
Offline
Posts: 2077
Re: Revival: News vs. NewsArch
«
Reply #2 on:
August 22, 2009, 11:31:09 AM »
Yes Sir
Logged
stories about
be part of the Tutorials-Project
visit the jQuery-Showroom
Marcus70
Offline
Posts: 28
Re: Revival: News vs. NewsArch
«
Reply #3 on:
August 22, 2009, 12:45:10 PM »
Quote from: kweitzel on August 22, 2009, 10:54:18 AM
Hi anfaenger,
nice that somebody starts taking on support / development for "orphaned" modules.
@erpe: Also something for AMASP, isn't it?
cheers
Klaus
Hi kweitzel,
just to avoid misunderstandings: it was not my intention to supply support for the "NewsArch" module. I just took the idea of that module and implemented it (with new code - no "copy and paste"
) into the "News" module. So, what i did is some development for the "News" module - which I hope will make the outdatet module "NewsArch" unnecessary
cheers,
Marcus
Logged
...man weiß nie, wie tief eine Pfütze ist, bevor man nicht hineingetreten ist... (Murphy's Law)
Hrundi V. Bakshi
Offline
Posts: 6
Re: Revival: News vs. NewsArch
«
Reply #4 on:
September 20, 2009, 02:50:17 PM »
hi marcus,
just installed your module on my server to test it.
environment is: wb 2.8 stable, php version 5.2.9
after having some troubles while uninstalling the original news module (but that's a different story
), i finally could install your modified news module properly. it runs without problems, and no error messages appear.
changing the sort order works fine, but it only takes effect in the frontend. is it possible to have the same sort order displayed both in frontend AND backend, or would this cause conflicts with the archive-function?
greetings, reinhard
Logged
Marcus70
Offline
Posts: 28
Re: Revival: News vs. NewsArch
«
Reply #5 on:
September 30, 2009, 01:53:33 PM »
hi reinhard,
after spending hours of viewing (and understanding *g*) source code I can tell you the following:
the sort order in the backend is hard-coded; the sort-order is "by position" which means the entries are sorted in that order the entries are posted.
two lists are managed in the backend: the posts and the corresponding groups (if you have created any). the sort order of these lists is vice-versa (the last group entry is at the end, the last post entry is on top). changing the sort order is thereby a bit complicated and needs some coding, particularly of the php-files managing the sort-order in the db's.
In my opinion the expenditure to adapt a freehand sort-order in the backend would be too large and the "drag&drop"-functionality which I'm currently working on would be corrupted - since a drag&drop needs a fixed "anchor" to manage the sequence of the entries.
hope this helps
cheers,
Marcus
Logged
...man weiß nie, wie tief eine Pfütze ist, bevor man nicht hineingetreten ist... (Murphy's Law)
Marcus70
Offline
Posts: 28
Re: Revival: News vs. NewsArch
«
Reply #6 on:
October 05, 2009, 03:28:01 AM »
Hi everybody,
I just released News v2.91 (stable).
The most remarkable change in this version is that you can now "drag&drop" the posts entries as well as the group entries.
The latest version v2.91 is linked in
the first post of this thread
.
Complete changelist:
- Added "drag&drop" functionality to news posts and group entries
- added "precheck.php" to check against some basic requirements of the module (
this will not work under wb2.8.0 due to a bug [missing code - ticket #798] in a core file
)
- added help files in english and german
I still need help with all language files except german - so feel free...
Regards,
Marcus
Logged
...man weiß nie, wie tief eine Pfütze ist, bevor man nicht hineingetreten ist... (Murphy's Law)
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4884
Re: Revival: News vs. NewsArch
«
Reply #7 on:
October 05, 2009, 05:08:58 AM »
Hello,
it's a pitty that the upgrade funcion doesn't work.
Deleating all entries is no choice for me (on running projects).
Also the drag&drop doesn't work here. (Testet on Xampp)
However, this is a good idea. I like it.
Regards,
Stefek
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Marcus70
Offline
Posts: 28
Re: Revival: News vs. NewsArch
«
Reply #8 on:
October 05, 2009, 12:05:05 PM »
Hi stefek,
please could you give me a little more information? Which browser do you use? How did you install News v2.91? Did there show up any error messages?
By the way, I already took my focus on "upgrade.php" - work is in progress
Regards,
Marcus
Logged
...man weiß nie, wie tief eine Pfütze ist, bevor man nicht hineingetreten ist... (Murphy's Law)
Marcus70
Offline
Posts: 28
Re: Revival: News vs. NewsArch
«
Reply #9 on:
October 13, 2009, 08:32:16 PM »
Hi everybody,
I just released News v2.92 (stable).
In v2.92 an upgrade without loss of posts is supported.
Important note:
please refer to the included help files in the archive before upgrading, since you might otherwise loose your posted data!
The latest version v2.92 is linked in
the first post of this thread
.
Changelist v2.92:
- added upgrade support
- adapted help files
- fixed some small bugs
Changelist v2.91:
- added "drag&drop" functionality to news posts and group entries
- added "precheck.php" to check against some basic requirements of the module (
this will not work under wb2.8.0 due to a bug [missing code - ticket #798] in a core file
)
- added help files in english and german
The module ist tested on a local server (xampp) as well as on a web server with ie, firefox, safari, google chrome and opera. You can see the module live in a productivity environment at
http://fu-boxberg.de/pages/termine.php
.
I still need help with all language files except german - support would be very appreciated
Regards,
Marcus
«
Last Edit: October 15, 2009, 08:57:32 AM by Marcus70
»
Logged
...man weiß nie, wie tief eine Pfütze ist, bevor man nicht hineingetreten ist... (Murphy's Law)
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4884
Re: Revival: News vs. NewsArch
«
Reply #10 on:
January 26, 2010, 01:46:24 PM »
Hallo Marcus,
I tested your changes again and it works now.
I will give it a try on my current project.
I changed one thing in the
modify.php
in order to get the "help" Button in there instead of the hard-coded link (see screenshot)
I used
<?php echo $MENU['HELP']; ?>
which is part of the language file to make it multilanguage.
And I usead the BUTTON Element instead of the Anchor Link element <a link="">.
Give it a try and if you like it, apply those changes to your modification package.
BTW: the drag&drop is working very good. That's the main reason I will switch to this News Module.
Thanks for sharing.
Kind Regards,
Stefek
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Argos
Moderator
Offline
Posts: 2158
Re: Revival: News vs. NewsArch
«
Reply #11 on:
January 27, 2010, 03:16:36 PM »
Great work, thanks!
I tried upgrading (following the instructions in the Help) an existing news section on my test site, and it seemed to work fine. The extra functionn are added, the dragging works good, but after entering something in the Archive Header field and saving, I got the error "Unknown column 'archive_header' in 'field list'". And also the frontend doesn't work right, there are no items visible at all.
I will try a clean install now.
BTW: the sort order field is way too technical and not user friendly, you should really add some click-and-go options here.
«
Last Edit: January 27, 2010, 03:20:22 PM by Argos
»
Logged
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase:
http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Argos
Moderator
Offline
Posts: 2158
Re: Revival: News vs. NewsArch
«
Reply #12 on:
January 27, 2010, 03:26:03 PM »
According to your instructions for installing fresh, the regular News module should be uninstalled. However, this is not possible because it's a core module. So, what to do?
And why the dot in /media/.news ? That's unusual and a bit confusing because it resembles a CSS class.
Logged
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase:
http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4884
Re: Revival: News vs. NewsArch
«
Reply #13 on:
January 27, 2010, 03:27:17 PM »
Quote from: Argos on January 27, 2010, 03:16:36 PM
BTW: the sort order field is way too technical and not user friendly, you should really add some click-and-go options here.
Do you mean this, Jurgen?
=>
published_when DESC
in the settings?
I agree.
Should be an combobox. Otherwise its not easy to change the status.
Regards,
Stefek
BTW. I only tested with a clean/fresh install, no upgrade.
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Argos
Moderator
Offline
Posts: 2158
Re: Revival: News vs. NewsArch
«
Reply #14 on:
January 27, 2010, 03:31:20 PM »
Quote from: Stefek on January 27, 2010, 03:27:17 PM
Quote from: Argos on January 27, 2010, 03:16:36 PM
BTW: the sort order field is way too technical and not user friendly, you should really add some click-and-go options here.
Do you mean this, Jurgen?
=>
published_when DESC
in the settings?
I guess so, the field was empty, so I had no clue what to put there...
Logged
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase:
http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Argos
Moderator
Offline
Posts: 2158
Re: Revival: News vs. NewsArch
«
Reply #15 on:
January 27, 2010, 03:33:12 PM »
I just realized the reason for the dot in .news. It makes the folder hidden. Hmmm... I don't like hidden stuff.
Logged
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase:
http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4884
Re: Revival: News vs. NewsArch
«
Reply #16 on:
January 27, 2010, 03:35:35 PM »
Quote from: Argos on January 27, 2010, 03:33:12 PM
I just realized the reason for the dot in .news. It makes the folder hidden. Hmmm... I don't like hidden stuff.
I see...
Let's wait for the developers answer - I can imagine there is some reason behind it. I.e. for archiving the stuff without SEO conflicts.
I am curious what he will say.
Regards,
Stefek
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Waldschwein
Guest
Re: Revival: News vs. NewsArch
«
Reply #17 on:
January 27, 2010, 03:37:26 PM »
Quote from: Argos on January 27, 2010, 03:33:12 PM
I just realized the reason for the dot in .news. It makes the folder hidden. Hmmm... I don't like hidden stuff.
And it leads to some unexpected error / warnings that are not nice... This .news, especially when upgrading and not using /pages but another startlevel of them...
Yours Michael
Logged
Marcus70
Offline
Posts: 28
Re: Revival: News vs. NewsArch
«
Reply #18 on:
January 27, 2010, 04:41:59 PM »
Hello folks,
thanks for testing the module. Unfortunately I'm just knocked out by toothache, so please be a little bit patient until the doctor I'm trusting has the time to upgrade my tooth
(wich will hopefully be next week...)
Regards,
Marcus
Logged
...man weiß nie, wie tief eine Pfütze ist, bevor man nicht hineingetreten ist... (Murphy's Law)
hootie
Offline
Posts: 4
Re: Revival: News vs. NewsArch
«
Reply #19 on:
February 09, 2010, 10:03:38 PM »
Hello there!
I installed the module v2.92. The news function is still working - but I can´t change the settings from standard to extra functions.
Maybe I can´t see the forest because of the trees (ok, I´m german).
Where do I have to change the settings?
Thank you for your help!
Many greetings,
Markus
Logged
hootie
Offline
Posts: 4
Re: Revival: News vs. NewsArch
«
Reply #20 on:
February 16, 2010, 09:09:51 PM »
Hello again!
I solved my problem by reading the help file again...
Markus
Logged
Ugh_tC
Offline
Posts: 4
Re: Revival: News vs. NewsArch
«
Reply #21 on:
March 26, 2010, 11:21:14 AM »
Hi,
I'm not a php programmer so I don't understand what to change on this snippet to allow news posts to appear on the front page:
Code:
<?php
$group
=
0
;
$limit
=
10
;
$readmore
=
"more..."
;
$query
=
"SELECT * FROM "
.
TABLE_PREFIX
.
"mod_news_posts WHERE group_id =
$group
and active = 1 ORDER BY position DESC LIMIT 0, 10;"
;
if (
$group
<
1
) {
$query
=
"SELECT * FROM "
.
TABLE_PREFIX
.
"mod_news_posts WHERE active = 1 ORDER BY position DESC LIMIT 0, 10;"
;
}
global
$database
;
$result
=
$database
->
query
(
$query
);
$total
=
$result
->
numRows
();
if (
$total
>
1
) {
$data
=
$result
->
fetchRow
() ;
$data2
=
$result
->
fetchRow
() ;
echo
'<p><strong>'
.
$data
[
'title'
].
'</strong><br />'
.
$data
[
'content_short'
].
'<a href="'
.
WB_URL
.
PAGES_DIRECTORY
.
$data
[
'link'
].
PAGE_EXTENSION
.
'">'
.
$readmore
.
'</a></p>'
;
echo
'<p><strong>'
.
$data2
[
'title'
].
'</strong><br />'
.
$data2
[
'content_short'
].
'<a href="'
.
WB_URL
.
PAGES_DIRECTORY
.
$data2
[
'link'
].
PAGE_EXTENSION
.
'">'
.
$readmore
.
'</a></p>'
;
}
else {
echo
'<span>No News ....</span>'
;
}
?>
Any help much appreciated; and hopefully it will help other users of this excellent news module.
Tim
Logged
Ugh_tC
Offline
Posts: 4
Re: Revival: News vs. NewsArch
«
Reply #22 on:
March 26, 2010, 12:15:58 PM »
Doh, nevermind...
Works if you put in a new news piece - I only had a backdated one, so noting was showing.
Logged
snark
Guest
Re: Revival: News vs. NewsArch
«
Reply #23 on:
August 27, 2010, 11:54:31 AM »
I tried to put in pagination into this module (
pagination at the backend
)
but the sort order /drag n drop is not working correctly anymore
I think it ios somewhere in this part of the code
Code:
$t = time();
// Get total number of posts
$query_total_num = $database->query("SELECT post_id FROM ".TABLE_PREFIX."mod_news_posts
WHERE section_id = '$section_id'");
$total_num = $query_total_num->numRows();
// Work-out if we need to add limit code to sql
if($setting_posts_per_page != 0) {
$limit_sql = " LIMIT $position,$setting_posts_per_page";
} else {
$limit_sql = " ";
}
// Query posts (for this page)
$query_posts = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_posts
WHERE section_id = '$section_id'
ORDER BY position DESC".$limit_sql);
$num_posts = $query_posts->numRows();
I tried lots of things but all resulting in either a white page or the pagination to stop working
anyone knows a solution?
I attached the modify.php
Logged
Roych
Offline
Posts: 149
Re: Revival: News vs. NewsArch
«
Reply #24 on:
June 13, 2011, 08:44:23 AM »
Hello I tryed this module and it's working fine. How do I make the anynews module to work with it?
I tried:
Code:
if (function_exists('displayNewsItems')) {
displayNewsItems(
$group_id = 0,
$max_news_items = 10,
$max_news_length = -1,
$display_mode = 1,
$lang_id = 'auto',
$strip_tags = true,
$allowed_tags = '
',
$custom_placeholder = false,
$sort_by = 1,
$sort_order = 1,
$not_older_than = 0
);
}
But it does't work
Thank you!
R.
Logged
Pages: [
1
]
2
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> WebsiteBaker Website Showcase
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
=====> Modules / Extensions
===> Suggestions
===> Software bugs
=> Help & Support
=> Modules
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
=> jQuery
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
=> Archive (posts up to 2007)
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
=====> Module / Extensions
===> Vorschläge
===> Softwarefehler
===> Erfahrungs und Testberichte
=> Hilfe/Support
=> Module & Snippets
=> Templates & Design
=> Tutorials
=> jQuery
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...