DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: Smallads

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:Christian Bülter
Changed:2012-12-10T17:46:45
Email:buelter@kennziffer.com
Info 2:
Info 3:
Info 4:

EXT: Smallads

Extension Key: ke_smallads

Copyright 2005-2012, Christian Buelter, < buelter@kennziffer.com >

Revised for version 1.3.0

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

EXT: Smallads 1

Introduction 1

Installation 2

Styling 3

Backend module 3

Configuration 3

Form Code 6

Categories 10

Defining sub-categories 10

Administration 11

More options 11

Known problems 11

To-Do list 11

Changelog 11

Introduction

Website users can publish smallads, browse and search them.

Features

  • Auto fill-in: If a website user inserts a new smallad and she or he is logged in, her or his userdata will be inserted (phone, email, user id).
  • Editable smallads: Frontend users may come back later and edit their own smallads or delete them.
  • Editor review: If you want, new smallads can be hidden, until an editor reviews them.
  • Email notification: Mails are sent to the user and to the editor each time a smallad is inserted.
  • Categories: You can use different categories. Each smallad can have two categories. The second category can have a sub-category which changes dynamically. For example: First category: Buy, Sell. Second category: Clothing, Books. Sub-category: Shoes [Clothing], Trousers [Clothing]; Novels [Books], Comics [Books]
  • Use sysfolders: As the smallads are stored in pages (sysfolders), you can also have completely different instances of the plugin in your website by using different sysfolders.
  • Images: The use of images in smallads is supported. Frontend users may upload images.
  • Backend module: There is also a backend module allowing you to export, unhide or delete a large number of smallads at once.
  • Multi language: english, german, french, finnish, netherlands, greek.

Live Demo

You can see a working installation at http://www.ms- verlag.de/KORALLE_Kleinanzeigen_lesen.187.0.html (german language). This example does not include the sub-category.

Here is an example using the sub-category-feature: http://www.tourenfahrer.de/index.php?id=1643

Screenshots

img-1 img-2

Installation

Get the extension ke_smallads from the extension repository and install it.

Go to your template and include the static typoscript code from the extension.

img-3

Create a page and insert a insert a content element “general plugin” and select “Smallads” afterwards.

Select the mode “show smallads”.

Create a sysfolder (called for example “Smallads data”) and use it as startingpoint for your plugin.

img-4

Create a second page, insert the plugin again, and select the mode “show form for a new smallad”. Use the same startingpoint. On this page, users will be able to insert new smallads.NOTE: In TYPO3 CMS before version 6.0 the field “startingpoint” is called “Record Storage Page” and can be found in the “Behaviour” tab:

img-5

That's all you have to do to get the extension running.

Edit smallads in the frontend

If you want that Frontend Users can edit or delete the ads they have submitted, create a third page, for example “Edit smallads”.

Restrict the access to logged in frontend users. Only they will be able to edit smallads. Insert the plugin and choose the mode “Let FE Users edit/delete their smallads”. Use your smallads sysfolder as starting point.

If now a logged in frontend user creates a smallad and after that opens the page “Edit smallads”, he will get a list with his own smallads and can edit or delete each smallad. Of course, only unhidden smallads will be shown.

More modes

There are two more modes you may want to use:

  • “show teaser” shows only a few smallads (3 per default, randomly selected) and only the titles with a link to the main smallads page.
  • “show short linked search results” shows search results in a short layout with a link. The short linked search results only appear when you use the search function. This mode is useful if you use the Typo3 -Standard-Search (not indexed search). Then you can put the plugin on the same page as the standard search and the Smallads will be searched, too.

Styling

There's no HTML template. Edit ke_smallads.css to fit your layout.In the folder typo3conf/ext/ke_smallads/ (or typo3/ext/ke_smallads/) you find a css file with all the css used in the plugin. Copy it to your template folder (e. g. fileadmin/template/), modify it to suit your needs and include it in your typoscript template, for example:page.includeCSS.smallads_css = fileadmin/ke_smallads.cssIf you just want to use the standard css file, you can also add this line to your typoscript template and leave the file where it is (assuming that “page” is you main page object):page.includeCSS.smallads_css = EXT:ke_smallads/example/ke_smallads.css

Backend module

There is a backend module, too. This gives you the possibility to export the smallads in order to use them in other applications. Please use the List-module to administrate the smallads.

The field “comment”, which shows up in the backend in each smallad, is just for backend use. You may for example add something about the user (invoice address, ...). This will show up when you use the backend module to export the smallads.

Configuration

There is some static typoscript code provided with the plugin. Please have a look at the file

typo3conf/ext/ke_smallads/pi1/static/setup.txt

If you want to modify it in your template, just do it like this, for example:

plugin.tx_kesmallads_pi1.teaserNum = 5

((Unknown Property))

a

b

c

default

listOrder

a

listOrder

b

Order (you may use these values: crdate, title, endtime, cat, uid)

c

crdate

listOrderDescFlag

a

listOrderDescFlag

b

Descending Flag, set if you want the order to be descending instead of ascending

c

1

teaserView.results_at_a_time

a

teaserView.results_at_a_time

b

Number of Teaser-Smallads in Teaser-View

c

3

displaySubmitDate

a

displaySubmitDate

b

Show submit date in List view?

c

1

listView.mode

a

listView.mode

b

List view Mode, if not set by the Plugin (piVars[mode]), this value is used. See also section “More options”.

c

0

submitDateFormat

a

submitDateFormat

b

Format for displaying the submit date (using the php function "date")

c

d.m.Y

notifyEmailEditor

a

notifyEmailEditor

b

Notify the editor of new smallads?

You can configure the mail like this:

plugin.tx_kesmallads_pi1.notifyEmailEditor = 1

plugin.tx_kesmallads_pi1.notifyEmailEditor {subject = [SMALLAD] New SmalladtoEmail =body = A new smallad has been submitted.|Category: %s|Title: %s|Text: %sfromName = Smallads ExtensionfromEmail =}

The “|” stands for linebreak.

c

0

NotifyEmailEditorOnUpdate

a

NotifyEmailEditorOnUpdate

b

Notify the editor of updated smallads?

You can configure the mail like this:

plugin.tx_kesmallads_pi1.notifyEmailEditorOnUpdate = 1

plugin.tx_kesmallads_pi1.notifyEmailEditorOnUpdate {subject = [SMALLAD] New SmalladtoEmail = [insert an email address ...]body = A new smallad has been submitted.|Category: %s|Title: %s|Text: %sfromName = Smallads ExtensionfromEmail = [insert an email address ...]}

The “|” stands for linebreak.

c

0

notifyEmailUser

a

notifyEmailUser

b

Send an Email to the smallad submitter when he adds an new ad?

You can configure the mail like this:

plugin.tx_kesmallads_pi1.notifyEmailUser = 1

plugin.tx_kesmallads_pi1.notifyEmailUser {subject = Your Smalladbody = Thank you. Your smallad has been submitted.|Category: %s|Title: %s|Text: %sfromName = [insert a name ...]fromEmail = [insert an email address ...]}

The “|” stands for linebreak.

c

0

notifyEmailUserOnUpdate

a

notifyEmailUserOnUpdate

b

Send an Email to the smallad submitter when he has updated an ad?

You can configure the mail like this:

plugin.tx_kesmallads_pi1.notifyEmailUserOnUpdate = 1

plugin.tx_kesmallads_pi1.notifyEmailUserOnUpdate {subject = Your Smalladbody = Thank you. Your smallad has been updated.|Category: %s|Title: %s|Text: %sfromName = [insert a name ...]fromEmail = [insert an email address ...]}

The “|” stands for linebreak.

c

0

linktextTeaserShowAll.value

a

linktextTeaserShowAll.value

b

Linktext for the teaser function of the plugin (TEXT Content Element)

You can overwrite this value with different language values like this:

linktextTeaserShowAll.lang.de = Alle Kleinanzeigen zeigen

c

newadCreated.value

a

newadCreated.value

b

output text when a new smallad was created (TEXT Content Element)

You can overwrite this value with different language values (see above).

c

hideNewAds

a

hideNewAds

b

Should a new ad be hidden at first? Then you have to unhide them manually...

c

1

hideUpdatedAds

a

hideUpdatedAds

b

Should an updated ad be hidden at first? Then you have to unhide them manually...

c

1

markNewAdsAsReviewed

a

markNewAdsAsReviewed

b

Should new ads marked as "reviewed", which means "OK"? This is only important, if you want to use the “export” functions of the backend module. These functions work only with “reviewed” ads.

c

0

showModeSelector

a

showModeSelector

b

Should a mode selector (for selecting the categories) be displayed?

c

1

listView.results_at_a_time

a

listView.results_at_a_time

b

Configures the Listview

c

10

listView.maxPages

a

listView.maxPages

b

Configures the Listview

c

10

noImageAvailable

a

noImageAvailable

b

Path to a "no image available"-image. You can add an image that is displayed, when no image was uploaded by the user.

fx. fileadmin/noimage.jpg

c

markNewSmalladsAsCommercial

a

markNewSmalladsAsCommercial

b

There is “commercial” / “non-commercial” flag for use in the backend. Here you can define if new smallads should be marked as “commercial”.

Right now, it is only used for one purpose: When you export smallads, the export function in the backend module appends a string to mark it as commercial/non-commercial. You can edit that strings in the file ke_smallads/mod1/locallang.php.

By default, those strings are empty:

'appendToCommercialSmallads' => ''

'appendToNonCommercialSmallads' => ''

c

0

ContentMaxChars

a

ContentMaxChars

b

How many Chars are allowed for the content field? If set to zero, no check is done.

c

0

checkCharactersLeftWhileTyping

a

checkCharactersLeftWhileTyping

b

If checkCharactersLeftWhileTyping is set to 1 and ContentMaxChars is > 0, there's a hint below the content-field: “You have … characters left.”

c

1

ContentTooManyCharsMessage.value

a

ContentTooManyCharsMessage.value

b

Output text when there are too many chars in the content-field (TEXT Content Element).

You can overwrite this value with different language values (see above).

c

uploadChmod

a

uploadChmod

b

Tries to change the permissions of the uploaded images. If your web server is configured very strict and you can't enlarge the images because of insufficient permissions, set this to 644.

c

phoneOrEmailHasToBeFilledOut

a

phoneOrEmailHasToBeFilledOut

b

To use this feature, set phone and email to “not required”, unset the email validation and instead set phoneOrEmailHasToBeFilledOut = 1. Example:

plugin.tx_kesmallads_pi1 {

phoneOrEmailHasToBeFilledOut = 1

smalladForm.dataArray.30.required = 0

smalladForm.dataArray.40.required = 0

smalladForm.dataArray.40.specialEval =

}

c

0

The TYPO3 form content element is used to render the form for smallads. It is defined in

typo3conf/ext/ke_smallads/pi1/static/setup.txt

You can modfiy it for example like this:

Example: Changing a lable

plugin.tx_kesmallads_pi1.smalladForm.dataArray.10.label.lang.de = Kategorie

Example: Adding a category

plugin.tx_kesmallads_pi1.smalladForm.dataArray.10.valueArray.40 {

label = Another category

label.lang.de = Noch eine Kategore

value = another

}

Userfields

You can also use the user defined fields user1 to user9. The values are stored comma-separated in the database. These are not in the standard typoscript code. Use them like this, e. g. to ask the user if he is over eighteen:

plugin.tx_kesmallads_pi1.smalladForm.dataArray {

26.type = user1=select

26.label = Age

26.label.lang.de = Alter

26.valueArray {

10.label = I'm over 18

10.label.lang.de = Ich bin über 18

10.value = ueber18

20.label = I'm under 18

20.label.lang.de = Ich bin unter 18

20.value = unter 18}

}

Important: In order make the edit-function work properly, you have to use the numbers one after another. That means, if you need to user- Fields, use “user1” and “user2”, not “user1” and “user3” for example. Also, the edit function only works with the field-types input and select .

Duration

Uses may define, how many days their ad should stay online. However, if you don't want to let the FE user take this choice, just delete the fields responsible for that function. For example, insert in you typoscript template:

# Delete the duration fields

plugin.tx_kesmallads_pi1.smalladForm.dataArray.60 >

plugin.tx_kesmallads_pi1.smalladForm.dataArray.61 >

Form Code

Please have a look at the file typo3conf/ext/ke_smallads/pi1/static/setup.txt.

You'll find the “smalladForm” configuration there. This is the default form configuration

You may overwrite it in your typoscript setup.

Categories and sub-categories

There are two category-types: first and second category. Please have a look at the “form code” above for how to define them. The second category may have a sub-category. Categories will only be shown in the frontend-filter, if there is at least one smallad for that category.

How not to use the second category and the sub-categories

If you don't want to use the second categorie, put this into your typoscript setup:

plugin.tx_kesmallads_pi1.smalladForm.dataArray.12 >

If you don't want to use sub-categories, you may disable them like this:

plugin.tx_kesmallads_pi1.smalladForm.dataArray.14 >

Defining sub-categories

This is how to define the sub-categories:

plugin.tx_kesmallads_pi1.cat3 {

1 = TEXT

1.value = Green Apples

1.lang.de = Grüne Äpfel

1.belongsTo = apples

2 = TEXT

2.value = Red Apples

2.lang.de = Rote Äpfel

2.belongsTo = apples

3 = TEXT

3.value = Small Bananas

3.lang.de = Kleine Bananen

3.belongsTo = bananas

4 = TEXT

4.value = Big Bananas

4.lang.de = Große Bananen

4.belongsTo = bananas

5 = TEXT

5.value = Strawberries

5.lang.de = Erdbeeren

5.belongsTo = strawberries

}

Multi-category selection

Since version 1.2.0 there is the possibility to select more than one category.

The selection is done by checkboxes.

You enable the feature by putting this into your typoscript template:

plugin.tx_kesmallads_pi1.modeSelectorType = checkbox

And this is how it looks:

img-6

Administration

To administrate smallads, use the Web->List module and the new module Web->Smallads. You have to select the sysfolder where you stored the smallads.

You have to unhide smallads manually, if you set hideNewAds.

There is also a field called “reviewed”. You may check this field and then later unhide all reviewed smallads at once using the backend module. This is useful, if you want to review the smallads from immediately after they are submitted, but publish all smallads at one time and not one after another. To do so, use the module Web->Smallads.

With Web->Smallads, you can also delete all unhidden smallads at once or export reviewed smallads into a large list, with or without connected user data. Remember, these functions work only with “reviewed” smallads. If you want to use this functions, but don't need the “reviewed” functionality, just set the option “markNewAdsAsReviewed”. So every new smallad is marked as “reviewed” from the beginning and may use the backend module to administrate them.

Create a menu for categories

How to display each category on a single page (and use that pages to generate a typoscript menu):

  • Create a page for each category (in a standard installation, these are: All, For Sale, Wanted, Miscellaneous).
  • Create an ext. template on each page, in that template select the category to display, set the “mode selector” top “buttons” and disable the mode selector, for example this is the typoscript setup code for the “For Sale” page (where “1” ist the number of the category to show)

plugin.tx_kesmallads_pi1 {

modeSelectorType = buttons

showModeSelector = 0

# show category 1

listView.mode = 1

}

Insert a smallads plugin “listview”.

Known problems

If you have problems with your website running under utf-8 and the special chars (umlauts) are not displayed correctly, try to copy and paste the hole setup.txt into your Typoscript SETUP-Template.

Changelog

Version 1.2.0 (2012/12)

made compatible with TYPO3 CMS 4.7 and 6.0, removed calls to deprecated functions

Version 1.2.0 (2010/09) [version number was not updated]

  • updated the manual
  • New feature: send mail to a usergroup (not only single user). See typoscript setup. Thanks to Walter Kruml.
  • Removed some options from RTE.
  • Added greek translation. Thanks to Stefanos Karasavvidis.
  • New feature: multi-category selection. Thanks for sponsoring toenorMedia GmbH & Co.KG.

Version 1.1.3 (2010/06)

  • New feature: check characters left in content-field dynamically while typing (“You have 123 characters left.”). Uses javascript. TS-option: checkCharactersLeftWhileTyping.
  • New feature: Either phone number or email address has to be filled out.
  • Bugfix: “iscommercial” was non saved to database, therefore it was alwas empty.
  • added "back" function if an error appears
  • fixed pagebrowser (“pagefloat = center”)
  • fixed javascript for confirmation of deletion of a smallad

Version 1.1.0 (2009/05)

  • New feature: Two new categories, (Category 2 and Category 3), where Category 3 depends on the selection of Category 2 (the second category can have a sub-category which changes dynamically). Thanks to Reiner H. Nitschke Verlags GmbH for sponsoring the new dynamic category feature.
  • In the list view, there are new filter options. Only the categories for wich smallads exist appear in these filters.
  • Removing tags from submitted fields. The content field (and all the others of course) is not a RTE field in the frontend, so it is consequent to not allow the user to submit HTML. Although, the backend field ist still a RTE field. This is for historical reasons.
  • Searchbox and mode selector don't disappear anymore after submitting a search word or selecting a mode/category.
  • New TS-Option: ContentAndTitleMaxChars

Version 1.0.4 (2008/04)

  • Bug fix: Chmod for uploaded images did not work correctly. On some servers the uploaded image could not be enlarged.
  • Added some french translation.

Version 1.0.2 (2007/03)

  • removed “htmlentities”-command when a new smallad is inserted, so german umlaute get stored correctly
  • minor changes to the documentation

Version 1.0.1 (2006/11)

new configuration option listView.mode (see “More options”)

Version 1.0.0 (2006/10)

  • New feature: Logged in users may now edit their own smallads or delete them.
  • New feature: Users may now set the time for the smallad until it disappears (in days).
  • The order of the smallads in the list view can now be set via typoscript.
  • An error message is displayed in the frontend if no static template is included.
  • The form for a new smallad is now rendered without tables to provide accessibility. You may have to adjust your css. If you want the old table layout, just have look into the setup.txt in the extension folder (you have to uncomment some lines there).
  • If linebreaks are used in the “content”-field, they are now shown in the frontend.
  • In the backend module there is now a new mode “export all smallads”.
  • Added new languages: finnish, netherlands

img-7 EXT: Smallads - 10