[TYPO3-ect] taxonomies / categories in TYPO3

Franz Koch typo.removeformessage at fx-graefix.de
Wed Oct 10 15:20:49 CEST 2007


Hi Steffen,

>> exactly. I did something similar with a rating extension based on 
>> tt_rating, which itself takes care of the mm-relations to any db-table. So 
>> I'm able to provide rating functionality to ANY extension by either using 
>> TS (if the extension allows for custom markers or stdWrap somewhere) or 
>> with hooks. This is quite nice to use.
>>
>> --
>> Kind regards,
>> Franz
> 
> btw - which rating ext do you mention?

it's not in TER - it's a extension I created once based on tt_rating. I 
intended to make it more flexible and provide a better interface for 
configuration (different rating-methods or so) - but didn't find the 
time for it.

If you wanna have a look: 
http://projects.elements-net.de/T3X_user_rating-2_0_1-z.t3x

I'm not sure if I added a little TS help or not - it's been a while 
(about one years or longer). Probably the code quality isn't the best 
either, as it was one of my first TYPO3 things.

Here a example for usage with pure TS-setup copied from one of my older 
websites:
-----
temp.entry_rating >
temp.entry_rating < plugin.user_rating_pi1
temp.entry_rating = USER
temp.entry_rating {
	pid_list = 64
	#allowCaching = 0
	code = RESULT
	rateTable = tx_dam
	rateTableUid.field = entry_uid
	rateTableTitle.field = entry_title
	rateTableDescription.field = user_username
	rateTablePid >
	
	allowedUsers = fe_users
	allowedUserGroups = 3,5
	rateTableOwnerField = fe_user
	rateTableOwnerCompareField = uid
	
	renderObj = COA
	renderObj.stdWrap.wrap =  <div class="rateresult">|</div>
	renderObj {
		10 >
		10 = IMG_RESOURCE
		10.file = GIFBUILDER
		10.file {
			XY = [10.w]*{$plugin.user_rating_pi1.tileImg},[10.h]
			backColor = #A3ACBF
			transparentBackground = 1
			10 = IMAGE
			10 {
				file.import.cObject = IMG_RESOURCE
				file.import.cObject {
					file = {$plugin.user_rating_pi1.badImgFile}
					file {
						width = 
{$plugin.user_rating_pi1.ratingOutputWidth}/{$plugin.user_rating_pi1.tileImg}
						width.prioriCalc = 1
					}
				}
				tile = {$plugin.user_rating_pi1.tileImg},1
			}
			
		}
		
		10.stdWrap.wrap = <div class="bgbar" style="background-image:url('|'); 
width:{$plugin.user_rating_pi1.ratingOutputWidth}px;" 
title="Durchschnittlich ###RATING### Punkte bei ###VOTES### Bewertungen">
		
		20 < .10
		20.file.10.file.import.cObject.file = 
{$plugin.user_rating_pi1.goodImgFile}
		20.stdWrap.wrap = <span class="bar" style="background-image:url('|'); 
width:###RATING_WIDTH_PERCENT###%;">&nbsp;</span>
		
		22 = TEXT
		22.value = </div>

		25 = TEXT
		25.value = <strong class="hidden">Bewertung:</strong> 
<em>###RATING###</em>
		
		30 = TEXT
		30.value = ###RATING_MSG###
		30.required = 1
		30.wrap = <p class="small">|</p>
	}
	
	noRatingObj >
	noRatingObj = COA
	noRatingObj.10 < .renderObj.10
	noRatingObj.stdWrap < .renderObj.stdWrap
	noRatingObj {
		10.stdWrap.wrap = <div class="bgbar" style="background-image:url('|'); 
width:{$plugin.user_rating_pi1.ratingOutputWidth}px;" title="noch keine 
Bewertung">&nbsp;</div>
		20 = TEXT
		20.value = (###VOTES###/{$plugin.user_rating_pi1.minVotes})
	}
	
	minVotesObj < .noRatingObj
	minVotesObj {
		10.stdWrap.wrap = <div class="bgbar" style="background-image:url('|'); 
width:{$plugin.user_rating_pi1.ratingOutputWidth}px;" title="noch nicht 
ausreichend Bewertungen">&nbsp;</div>
		20.value = <span 
class="small">(###VOTES###/{$plugin.user_rating_pi1.minVotes})</span>
	}
}
-----

I also added some more features to it - like restrictions (who is 
allowed to rate), minimum votes that have to be reached before until a 
rating is shown or taken in to account (it doesn't make sense to show a 
rating of 10 points if only one has voted) and probably some other stuff 
I can't remember.

If I find some time I probably port it to lib/div, make it more flexible 
(maybe as basic rating/poll extension with extendable models and view) 
and finish it.
--
Kind regards,
Franz


More information about the TYPO3-team-extension-coordination mailing list