improved: function.recently_updated.php (v1.1)

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
olaf_noehring

improved: function.recently_updated.php (v1.1)

Post by olaf_noehring »

Hi

I added a few more parameters, new now (of course can be used with old parameters and combined):

(optional) leadin='Last changed' - Text to show left of the modified date.
(optional) showtitle='true' - Shows the titleattribute if it exists as well (true|false).
(optional) css_class='some_name' - Warp a div tag with this class around the list.
(optional) dateformat='d.m.y h:m' - default is d.m.y h:m , use the format you whish (php -date- format)

rename the file to
function.recently_updated.php
and place it in the plugins folder (overwrite the old file)

Olaf

[gelöscht durch Administrator]
Last edited by olaf_noehring on Sat Oct 21, 2006 6:47 pm, edited 1 time in total.
Traill
Forum Members
Forum Members
Posts: 25
Joined: Sat Jul 07, 2007 2:22 pm

Re: improved: function.recently_updated.php (v1.1)

Post by Traill »

I noticed that a page that has been recently been updated does NOT appear in the list if you have not selected it as "Active in Menu"... is there any way around this? I don't want every single one of my pages available through my menu in order to have to make it appear in the list...

Any ideas welcome! Thanks :)
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: improved: function.recently_updated.php (v1.1)

Post by RonnyK »

For that you should change the function, as it now states:

Code: Select all

$q = "SELECT * FROM ".cms_db_prefix()."content WHERE (type='content' OR type='link')
AND default_content != 1 AND active = 1 AND show_in_menu = 1 
ORDER BY modified_date DESC LIMIT ".$number;
so both "active" and "show_in_menu" need to be set. If you just delete the part to make the pages visible as well.

Ronny
Traill
Forum Members
Forum Members
Posts: 25
Joined: Sat Jul 07, 2007 2:22 pm

Re: improved: function.recently_updated.php (v1.1)

Post by Traill »

That's excellent news! Thanks so much RonnyK - can I ask quickly how exactly do I change its function?
I've not done this before but once I've done this once I'll be able to play around with others... :)
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: improved: function.recently_updated.php (v1.1)

Post by RonnyK »

If you download the file mentioned in the earlier post, and rename it to .php (so remove the .txt at the end), you can just edit the code in a texteditor, notepad f.e.
After having changed the code, you can upload (FTP) it to the PLUGINS-folder of your CMS. That will overwrite the existing file. The new file is than active and usable.

Basically all modules are stored in folders that have the module-name under the folder Modules.
Tags are stored in the folder Plugins.

In both folders are a lot of .php files stored, that can be changed in an editor and the changed code can be uploaded back. I would backup the original function if I were you, so that you can set back the original if needed.

Ronny
Traill
Forum Members
Forum Members
Posts: 25
Joined: Sat Jul 07, 2007 2:22 pm

Re: improved: function.recently_updated.php (v1.1)

Post by Traill »

Brilliant. I used notepad and it's all sorted now, perfect.

Thanks so much mate, really appreciate your help! :)
Post Reply

Return to “Developers Discussion”