Advertisement:

Author Topic: Content of the latest posts  (Read 28442 times)

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
Content of the latest posts
« on: May 26, 2010, 01:15:53 AM »
Link to Mod

Content of the latest posts

ABOUT...

Content of the latest posts, 2.3.2
© 2010-2015 by davidhs
© Russian language 2010-2011 by Bugo


This work is licensed under a Creative Commons Attribution 3.0 Unported License.

DESCRIPTION

The MOD ContentOfLatestPosts can show in any post on the forum a list with the content of the latest posts. The content to be displayed is sorted by date and grouped by board. It is also defined by several parameters:
  • Header: BBC of header of the list. Can be used the following variables:
    • {TITLE} - Title of list.
    • {TYPE} - Content type.
    • {BOARDURL} - URL to forum folder.
    • {SCRIPTURL} - Web address of forum.
    • {IMAGES_URL} - URL to the images folder in the users current theme.
    • {DEFAULT_IMAGES_URL} - URL to the images folder in the default theme.
    After replaced the variables, if text begins with "http://" is supposed to be the URL of an image.
  • Content type: Can show the content of the post (post text and attachments; the default option), only the text, only the subject or only some information in the post (attachments, links, eLinks or images).
  • Group posts: Results can be grouped by board, by first character of subject or not grouped. Default are grouped by board.
  • Letters of group (if posts are grouped by first character of subject): The groups used are: symbols, numbers and one group for each letter of the language alphabet of the forum. For other alphabets must be write all letters (or combinations of characters) comma separated.
  • Grouping ignoring the subject prefix (if posts are grouped by first character of subject): Prefix of subject which will not be take into account when grouping posts. If there are several prefixes comma separating them. Default prefix is not defined.
  • Show boards (if posts are not grouped by board): Indicates if are displayed boards. Default is displayed.
  • Show subject (if content type is not subject): Indicates if is displayed subject of posts. Default is displayed.
  • Show poster: Indicates if is displayed poster of posts. Default is displayed.
  • Show content (if content type is not all, post or subject): Indicates if is displayed content of posts. Default is displayed.
  • Links to boards: Boards to which belongs each content is show in a navigation tree. May have link to all boards (the default option), only to last level or to none.
  • Boards: Posts consulted may belong to the current board (the board of post which shows the list; the default option), any board (except board of deleted posts), a single board or several boards.
  • Include child boards: Indicates if are consulted posts of child boards and until level. Default is not included.
  • Order by: Content can be order by descending date or ascending subject. Default is descending date.
  • Maximum number of posts by group: Indicates the maximum number of posts shown by group. Default is unlimited.
  • Maximum number of posts by topic: Indicates the maximum number of posts shown by topic. Default is unlimited.
  • Maximum age: Indicates the maximum number of days old of the content. Default is 0 days (shows only content posted today).
  • Only unread posts: Posts consulted can be all (the default option), only recent unread topics, all unread topics or only updated topics.
  • Date consulted: The age can be calculated with the creation date (the default option) or the last modification date of post. If content of posts often be corrected, it may be best to use the last modification date.
  • Sticky topics: Indicates if the content is searched in all topics (the default option), only in sticky topics or only in non-sticky topics.
  • Locked topics: Indicates if the content is searched in all topics (the default option), only in locked topics or only in unlocked topics.
  • First post of topic: Indicates if the content is searched on the first post of topics (the default option) or not.
  • Replies of topic: Indicates if the content is searched on the replies of topics (the default option) or not.
  • Posts without subject prefix: Subject prefix of post where the content is not searched. Default prefix is not defined.

Can be created an index of topics using at least these parameters:
  • Group posts: By first character of subject.
  • Show subject: Yes.
  • Show content: No.
  • Order by: Ascending subject.
  • Maximum age: 999999999.
  • Only unread posts: No.
  • First post of topic: Yes.
  • Replies of topic: No.

Administration panel

In administration panel can set the default value for each parameter.

Can also create predefined lists, each with its parameters and header BBC.

    

BBC tag

To display a list of content of the latest posts you have to write the BBC tag:

Code: [Select]
[contentlatest predefined=... type=... group=... boards_link=... boards=... child_boards=... number_by_group=... number_by_topic=... age=... unread=... date=... sticky=... locked=...]text[/contentlatest]
Attributes, all optional, are:
  • predefined: Predefined list number.
  • type: Type of content. Permitted values: all (all), post (post), subject (subject), attachment (attachments), link (links), elink (eLinks), image (images).
  • group: Group posts. Permitted values: no (no), board (by board), character (by first character of the subject).
  • boards_link: Links to boards. Permitted values: all (yes, all), parent (yes, only last level), no (no).
  • boards: Boards. Permitted values: current (current board), all (all), comma separated boards numbers.
  • child_boards: Include child boards. Permitted values: 0 (not include), number (maximum level to be included), all (all levels).
  • number_by_group: Maximum number of posts by group. Permitted values: 0 (unlimited), number (maximum number).
  • number_by_topic: Maximum number of posts by topic. Permitted values: 0 (unlimited), number (maximum number).
  • age: Maximum age in days.
  • unread: Only unread posts. Permitted values: no (no), new (recent unread topics), all (all unread topics), replies (updated topics).
  • date: Date consulted. Permitted values: create (creation date), modify (last modification date).
  • sticky: Sticky topics. Permitted values: all (all topics), yes (only sticky topics), no (only not-sticky topics).
  • locked: Locked topics. Permitted values: all (all topics), yes (only locked topics), no (only unlocked topics).

For all other parameters of list there is no attribute in BBC. If any attribute not exists the value used is the value of predefined list or, if not exists, the default value, both defined in the administration panel.

The text between contentlatest begin and end tags will replaces the {TITLE} variable in the header of the list, if exists. Can be used the variables {TYPE}, {BOARDURL}, {SCRIPTURL}, {IMAGES_URL} and {DEFAULT_IMAGES_URL} (like in header).

Appearance of the list

By default the list has the style of current theme, but can be changed in the file style.css (series SMF 1.1.x) or css/index.css (series SMF 2.0.x) of theme copying the CSS rules of the block

Code: [Select]
/* BEGIN MOD ContentOfLatestPosts */
...
/* END MOD ContentOfLatestPosts */

before of the block and editing.

EXAMPLES

A list of each type:

    

    

    


An index of topics:


SMF COMPATIBILITY

  • SMF 1.1 to 1.1.21.
  • SMF 2.0 to 2.0.15.

LANGUAGES

  • english, english_british.
  • russian (incomplete).
  • spanish, spanish_es, spanish_latin.

If you want help translating it into other languages, you can add the translation in http://www.simplemachines.org/community/index.php?topic=383432.0

DOWNLOAD

Link to MOD

MANUAL INSTALLATION

See http://wiki.simplemachines.org/smf/Manual_installation_of_mods

SUPPORT AND COMMENTS

In English: http://www.simplemachines.org/community/index.php?topic=383432.0
In Spanish: http://www.simplemachines.org/community/index.php?topic=378552.0

CHANGE LOG

Code: [Select]
Legend:   ! Fixed   + Added   - Removed   * Changed   @ Note

2.3.2   2014-10-08
------------------
+ SMF 1.1.x: Implemented a generic form of displaying lists, similar to SMF 2.0.x.
+ SMF compatibility: 1.1.20 and 2.0.9.

2.3.1   2014-06-24
------------------
! Use HTML entities in ISO-8859-1 languages.
! Help.
+ Functions to get/update/delete data check the parameters before using them.
* Big multi-line text input fields are wider.
* Submit buttons have shortcut key to get focus.
+ SMF compatibility: 2.0.8.

2.3     2014-01-27
------------------
+ Upgrade code to the configuration variables from versions 2.1-2.2 to 2.3.
+ Field in administration panel to indicate if is consulted first post of topics.
+ Field in administration panel to indicate if are consulted replies of topics.
+ Field in administration panel to indicate if are not consulted posts with subject prefix.
+ SMF compatibility: 2.0.7.

2.2     2013-12-21
------------------
! Error in source code.
! SMF 2.0.x: Functions of administration area must return settings variables for the Quick Search of the Administration Center.
+ SMF 2.0.x: The Quick Search of the Administration Center look for in settings variables of MOD.
! If posts are grouped by the first character of the subject and there are more than one list in a topic, links "Go to..." not work.
+ Variable in header of list to insert URL to forum folder.
* Reorganization of the fields in the administration panel.

2.1     2013-10-31
------------------
! There was a PHP error when the list of predefined lists was empty.
+ Upgrade code to the configuration variables from version 2.0.x to 2.1.
+ Possibility of grouping post by the first character of the subject.
* Rename value "yes" to "board" (by board) in BBC attribute "group" (group posts). "yes" is still supported for backward compatibility.
+ Value "character" (by first character of the subject) in BBC attribute "group" (group posts).
+ Field in administration panel to indicate the letters of group (if posts are grouped by first character of subject).
+ Field in administration panel to indicate the subject prefix which will not be take into account when grouping posts (if posts are grouped by first character of subject).
+ Field in administration panel to indicate if show boards (if posts are not grouped by board).
+ Field in administration panel to indicate if show subject (if content type is not subject).
+ Field in administration panel to indicate if show poster.
+ Field in administration panel to indicate if show content (if content type is not all, post or subject).
+ Field in administration panel to indicate the posts order.
@ The BBC has many attributes and can not be added more.
* Navigation tree of boards is placed before subject.
+ SMF compatibility: 1.1.19 and 2.0.6.

2.0.1   2013-10-18
------------------
! SMF 2.0.x: Tab duplicate in settings area.

2.0     2013-10-17
------------------
@ This work is licensed under a Creative Commons Attribution 3.0 Unported License http://creativecommons.org/licenses/by/3.0/
! SMF 2.0.x: Integration hooks functions parameters must be passed by reference.
! Attached images resizable did not expand if were repeated in a topic.
+ Upgrade code to the configuration variables from version 1.x to 2.0.
* Allows to create any number of predefined lists in the administration panel.
+ Variable in header of list to insert web address of forum.
+ Variable in header of list to insert url to the images folder in the users current theme.
+ Variable in header of list to insert url to the images folder in the default theme.
+ Value "current" (current board) in BBC attribute "boards" (boards).
- Value "all" (unlimited) in BBC attributes "number_by_group" (maximum number of posts by group) and "number_by_topic" (maximum number of posts by topic). It is still supported for backward compatibility.
+ SMF compatibility: 2.0.5.

1.2.2   2013-04-10
------------------
+ SMF compatibility: 1.1.18.
+ SMF compatibility: 2.0.4.
- SMF compatibility: Support to obsolete series 1.0.x and Beta and RC versions.

1.2.1   2012-12-22
------------------
+ SMF compatibility: 1.0.23.
+ SMF compatibility: 1.1.17.
+ SMF compatibility: 2.0.3.

1.2     2012-04-08
------------------
+ Field in administration panel and BBC attribute to indicate if results are grouped by board or not.
+ Field in administration panel and BBC attribute to indicate the maximum number of posts shown by group.
+ Field in administration panel and BBC attribute to indicate the maximum number of posts shown by topic.
+ Field in administration panel and BBC attribute to indicate if are consulted only unread posts.
+ Redirect to administration panel after install.

1.1.4   2011-12-24
------------------
+ SMF compatibility: 1.0.22.
+ SMF compatibility: 1.1.16.
+ SMF compatibility: 2.0.2.

1.1.3   2011-09-20
------------------
! Use of integration hook integrate_modify_modifications in SMF 2.0.
+ SMF compatibility: 1.1.15.
+ SMF compatibility: 2.0.1.

1.1.2   2011-06-22
------------------
! Maximum age in days is not rounded.
+ SMF compatibility: 1.1.14.
+ SMF compatibility: 2.0.
* Uses integration hooks in SMF 2.0 RC4 and next.

1.1.1   2011-02-15
------------------
! Small adjustments to each version of SMF.
+ SMF compatibility: 1.0 RC1 to RC2 and 1.0 to 1.0.21.
+ SMF compatibility: 1.1 Beta 3 Public, RC1 to RC3 and 1.1 to 1.1.13.
+ SMF compatibility: 2.0 Beta 3.1 Public and RC5.

1.1     2010-12-21
------------------
+ Field in administration panel to write a description of each list (default and predefined).
+ Field in administration panel to write a text to display if have not content.
+ Field in administration panel and BBC attribute to indicate if are consulted posts of child boards and until level.
+ Languages: russian, russian-utf8, thanks to Bugo.

1.0.2   2010-11-07
------------------
+ SMF compatibility: 2.0 Beta 4, RC1 to RC1.2 and RC4.
+ Languages: english_british, english_british-utf8 (copy of english).
+ Languages: spanish, spanish-utf8 (copy of spanish_es).
* Regular expression of links is used by SMF 2.0 RC4.

1.0.1   2010-05-28
------------------
! In administration panel, value of "BBC of the header" fields could not have tags with attributes quoted.

1.0     2010-05-26
------------------
+ Administration panel and BBC tag.
+ SMF compatibility: 2.0 RC2 to RC3.
+ Languages: english, english-utf8, spanish_es, spanish_es-utf8, spanish_latin, spanish_latin-utf8.
« Last Edit: May 24, 2015, 06:55:12 AM by Illori »

Offline Kreator

  • Jr. Member
  • **
  • Posts: 225
  • Gender: Male
    • Anim8orWorld on Facebook
    • Anim8orWorld
Re: Content of the latest posts, 1.0 (SMF 2.0 RC2, 2.0 RC3)
« Reply #1 on: May 27, 2010, 06:23:58 PM »
Hmm, I assume you stick the bbc code into a post... only I just get the bbc tag returned each time I post it, as follows

[contentlatest predefined=all type=all boards=all boards_link=all age=60 date=modify sticky=all locked=all]LATEST CONTENT[/contentlatest]


so whats happening? checked that there is a bb code for contentlatest in ACP

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
Re: Content of the latest posts, 1.0 (SMF 2.0 RC2, 2.0 RC3)
« Reply #2 on: May 28, 2010, 06:00:50 AM »
This happens because the value of the parameter "predefined" is wrong (only can take 1 to 5).
Parameters, all optional, are:
  • predefined: Predefined list number. Permitted values: 1 to 5.
[...]

But in your case does not have to use this parameter. Write only:
Code: [Select]
[contentlatest type=all boards=all boards_link=all age=60 date=modify sticky=all locked=all]LATEST CONTENT[/contentlatest]Because the default values of the pameters this is equivalent:
Code: [Select]
[contentlatest boards=all age=60 date=modify]LATEST CONTENT[/contentlatest]Both shows list of all posts (text and attachment of each post), in all boards, with link in all navegation tree, modified in the last 60 days, sticky or non-sticky, and locked or unlocked.

Use the parameter "predefined" only in you define a predefined list in administration panel.
« Last Edit: May 28, 2010, 06:06:36 AM by davidhs »

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
Re: Content of the latest posts, 1.0.1 (SMF 2.0 RC2, 2.0 RC3)
« Reply #3 on: May 28, 2010, 07:24:22 AM »
New version:

Code: [Select]
Legend:   ! Fixed   + Added   - Removed   * Changed   @ Note

1.0.1   2010-05-28
------------------
! In administration panel, value of "BBCode of the header" fields could not have tags with parameters quoted.


Offline Bruno36

  • Full Member
  • ***
  • Posts: 570
  • Gender: Male
    • Scooter Chinois 4T
Re: Content of the latest posts, 1.0.1 (SMF 2.0 RC2, 2.0 RC3)
« Reply #5 on: May 29, 2010, 01:56:58 PM »
I do not understand how this mod works :o
Bruno36 the French
SMF 2.0.9

Offline Kreator

  • Jr. Member
  • **
  • Posts: 225
  • Gender: Male
    • Anim8orWorld on Facebook
    • Anim8orWorld
Re: Content of the latest posts, 1.0.1 (SMF 2.0 RC2, 2.0 RC3)
« Reply #6 on: May 29, 2010, 04:44:28 PM »
Sorry it still does not work , I still just get the bbc code coming back in preview or even when I post,


If I`m using predefined say 1, then should I be adding boards and other stuff ? surely they have been predefined in the first place


Code: [Select]
[contentlatest predefined=1 type=all boards=all boards_link=all age=create date=all sticky=all locked=all]text[/contentlatest]
should it not just be this:

Code: [Select]
[contentlatest predefined=1]text[/contentlatest]
« Last Edit: May 29, 2010, 04:56:23 PM by Kreator »

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
Re: Content of the latest posts, 1.0.1 (SMF 2.0 RC2, 2.0 RC3)
« Reply #7 on: May 29, 2010, 07:30:56 PM »
I do not understand how this mod works :o

Sorry, my English is not very good and I can not explain better :( . In the first post I explained what this MOD can do (basically, list the latest content posted on the forum).

If you tell me an example of list you need to do, I write the BBCode for your example.

If someone who speaks English well can explain it better, I would appreciate. ;)




Sorry it still does not work , I still just get the bbc code coming back in preview or even when I post,

If I`m using predefined say 1, then should I be adding boards and other stuff ?

If you define the predefined list 1 in section "Administration Center > Modification Settings > Content of the latest posts > Predefined content list", you have something like this:

Quote
Define predefined list 1 [X] (CHECKED)
Content type: All (post and attachment)
Boards: EMPTY (CURRENT BOARD)
Links to boards: Yes, all
Maximum age: 0 days
Date consulted: Create date
Sticky topics: All
Locked topics: All
BBCode of the header: ANYTHING
Correct?

These values of parameters of predefined list 1 are the default values of parameters if you write
Code: [Select]
[contentlatest predefined=1]text[/contentlatest](the values used are:
Quote
Content type: All (post and attachment)
Boards: EMPTY (CURRENT BOARD)
Links to boards: Yes, all
Maximum age: 0 days
Date consulted: Create date
Sticky topics: All
Locked topics: All
)

If you write in BBCode more parameters, the values used for these parameters are the values write in BBCode, not values in administration panel. For example, if you write
Code: [Select]
[contentlatest predefined=1 boards=65,66]text[/contentlatest]this use the values of predefined list 1 except boards who use the value 65,66:
Quote
Content type: All (post and attachment)
Boards: 65,66
Links to boards: Yes, all
Maximum age: 0 days
Date consulted: Create date
Sticky topics: All
Locked topics: All

Code: [Select]
[contentlatest predefined=1 type=all boards=all boards_link=all age=create date=all sticky=all locked=all]text[/contentlatest]
The value of parameter "age" should be an integer (number of days), not "create". "create" is a value valid of parameter "date". The correct BBCode is
Code: [Select]
[contentlatest predefined=1 type=all boards=all boards_link=all age=10 date=create sticky=all locked=all]text[/contentlatest]
« Last Edit: May 29, 2010, 07:35:01 PM by davidhs »

Offline Kreator

  • Jr. Member
  • **
  • Posts: 225
  • Gender: Male
    • Anim8orWorld on Facebook
    • Anim8orWorld
Re: Content of the latest posts, 1.0.1 (SMF 2.0 RC2, 2.0 RC3)
« Reply #8 on: May 31, 2010, 08:27:30 AM »
Finally got it to work, phew!! Now I`ve got to find a good reason for using it!.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
Re: Content of the latest posts, 1.0.2 (SMF 2.0 Beta 4 and RC1 to RC4)
« Reply #9 on: November 13, 2010, 09:15:45 AM »
New version:

Code: [Select]
1.0.2   2010-11-07
------------------
+ SMF compatibility: Adds 2.0 Beta 4, RC1 to RC1.2 and RC4.
+ Languages: Adds english_british, english_british-utf8 (copy of english).
+ Languages: Adds spanish, spanish-utf8 (copy of spanish_es).
* Regular expression of links is used by SMF 2.0 RC4.

Offline Patriiick

  • Semi-Newbie
  • *
  • Posts: 30
  • Gender: Male
    • AcadNETwork
Re: Content of the latest posts, 1.0.2 (SMF 2.0 Beta 4 and RC1 to RC4)
« Reply #10 on: November 28, 2010, 12:57:00 PM »
Can someone clearly say what this MOD does?  ;D
webmaster AcadNETwork

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
Re: Content of the latest posts, 1.0.2 (SMF 2.0 Beta 4 and RC1 to RC4)
« Reply #11 on: November 30, 2010, 05:56:33 AM »
Makes a list with the latest content posted on the forum.

Offline Bugo

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,453
  • Gender: Male
    • dragomano on GitHub
    • @dragomano on Twitter
    • Russian translations for SMF mods
Re: Content of the latest posts, 1.0.2 (SMF 2.0 Beta 4 and RC1 to RC4)
« Reply #12 on: December 20, 2010, 12:54:39 AM »
Russian translation (please don't merge content of these files into one) :)

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
Re: Content of the latest posts, 1.0.2 (SMF 2.0 Beta 4 and RC1 to RC4)
« Reply #13 on: December 20, 2010, 10:23:42 AM »
Russian translation (please don't merge content of these files into one) :)
Thanks!! Do not worry, I put each language-encoding in different files ;)

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
Re: Content of the latest posts, 1.1 (SMF 2.0 Beta 4 and RC1 to RC4)
« Reply #14 on: December 21, 2010, 02:10:50 PM »
New version:

Code: [Select]
1.1   2010-12-21
------------------
+ Field in Administration panel to write a description of each list (default and predefined).
+ Field in Administration panel to write a text to display if have not content.
+ Field in Administration panel and BBCode parameter to indicate if are consulted posts of child boards and untill level.
+ Languages: Adds russian, russian-utf8, thanks to Bugo.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
Re: Content of the latest posts, 1.1.1 (SMF 1.0*-1.0.21, 1.1*-1.1.13, 2.0*-RC5)
« Reply #15 on: February 16, 2011, 08:24:32 AM »
New version:

Code: [Select]
1.1.1   2011-02-15
------------------
! Small adjustments to each version of SMF.
+ SMF compatibility: Adds 1.0 RC1 to RC2 and 1.0 to 1.0.21.
+ SMF compatibility: Adds 1.1 Beta 3 Public, RC1 to RC3 and 1.1 to 1.1.13.
+ SMF compatibility: Adds 2.0 Beta 3.1 Public and RC5.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
New version:

Code: [Select]
1.1.2   2011-06-22
------------------
! Maximum age in days is not rounded.
+ SMF compatibility: Adds 1.1.14.
+ SMF compatibility: Adds 2.0.
* Uses integration hooks in SMF 2.0 RC4 and next.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
Re: Content of the latest posts, 1.1.3 (SMF 1.0*-1.0.21, 1.1*-1.1.15, 2.0*-2.0.1)
« Reply #17 on: September 22, 2011, 12:56:51 PM »
New version:

Code: [Select]
1.1.3   2011-09-20
------------------
! Use of integration hook integrate_modify_modifications in SMF 2.0.
+ SMF compatibility: Adds 1.1.15.
+ SMF compatibility: Adds 2.0.1.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
New version:
Code: [Select]
1.1.4   2011-12-24
------------------
+ SMF compatibility: Adds 1.0.22.
+ SMF compatibility: Adds 1.1.16.
+ SMF compatibility: Adds 2.0.2.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 936
  • Gender: Male
New version:
Code: [Select]
1.2     2012-04-08
------------------
+ Field in Administration panel and BBCode parameter to indicate if results are grouped by board or not.
+ Field in Administration panel and BBCode parameter to indicate the maximum number of posts shown by group.
+ Field in Administration panel and BBCode parameter to indicate the maximum number of posts shown by topic.
+ Field in Administration panel and BBCode parameter to indicate if are consulted only unread posts.
+ Redirect to Administration panel after install.