FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups  Who is OnlineWho is Online   Join! (free) Join! (free)  
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  • Welcome
  • Guest

ADDRATING/KARMA Portal Component
Page 1, 2, 3, 4, 5, 6, 7, 8  Next
 
Post new topic   Reply to topic    myfreeforum.org Forum Index -> Portal components
View previous topic :: View next topic  
Author Message
myff admin
Site Admin
Site Admin
FLAG

Virtual Cash: 92900

Joined: 22 May 2005
Posts: 32204



Add Karma

rated by 281 members
Add Comment
Show Comments


online/offline
PostPosted: Thu Mar 08, 2007 8:57 am    Post subject: ADDRATING/KARMA Portal Component  Reply with quote

The ADDRATING component is commonly used for assigning a rating to users such as KARMA.

KARMA is predefined as a component and so does not need to be added into your portal OPTIONS tab unless you want to change the default settings. The default definition is:

[KARMA]
component=ADDRATING
max=5
self=1
allow=0
lastratingonly=0

These setting mean:
max - maximum rating, rating go from 1-max inclusive.
self - can you rate yourself 1-yes 0-no.
allow - who can rate people? 0-registered,1-MODS,2-ADMINS
lastratingonly - 0-show average rating 1-show last rating

For values to be recorded you need to define two XPROFILE fields in the XPROFILE tab.

For KARMA you would need:

[KARMA]
visible=all
access=admin
default=0

[KARMA_COUNT]
visible=all
access=admin
default=0

[KARMA_TOTAL]
visible=all
access=admin
default=0

the KARMA value will always be set to an integer, hence it can be translated to a rank image using for example in

viewtopic_body.tpl

<img src="ranks/Hearts/rankl{postrow.KARMA}.gif">

in profile_view_body.tpl it would be:

<img src="ranks/Hearts/rankl{KARMA}.gif">


The code for adding KARMA is a link of the form:

<a href="javascript:void(0)" onclick="window.open('addrating.php?userid={postrow.POSTER_ID}&amp;component=KARMA', '_addrating', 'resizable=yes,width=500,height=360')">Add Karma</a>

If you wanted to have such a link in profile_view_body.tpl it would be:

<a href="javascript:void(0)" onclick="window.open('addrating.php?userid={USER_ID}&amp;component=KARMA', '_addrating', 'resizable=yes,width=500,height=360')">Add Karma</a>
_________________

Family Friendly Shareware | | Web Design/Services | Free Forums


Last edited by myff admin on Thu Mar 08, 2007 6:29 pm; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
BookwormUK
Apprentice
Apprentice


Joined: 21 Jan 2007
Posts: 179



Add Karma

rated by 5 members
Add Comment
Show Comments

http://yorkshirefolk.myfineforum.org
online/offline
PostPosted: Thu Mar 08, 2007 9:06 am    Post subject: Reply with quote

i cant see the images but anyway, my question is
allow - who can rate people? 0-registered,1-MODS,2-ADMINS
would i need to put 0,1,2?? or will just 0 let everyone rate the user?
_________________
http://bookwormuk.myfastforum.org
http://yorkshirefolk.myfineforum.org
http://ukpeeps.myfastforum.org
Back to top
View user's profile Send private message Visit poster's website
myff admin
Site Admin
Site Admin
FLAG

Virtual Cash: 92900

Joined: 22 May 2005
Posts: 32204



Add Karma

rated by 281 members
Add Comment
Show Comments


online/offline
PostPosted: Thu Mar 08, 2007 9:09 am    Post subject: Reply with quote

Just 0 as MODs and ADMINs are also users.
_________________

Family Friendly Shareware | | Web Design/Services | Free Forums
Back to top
View user's profile Send private message Visit poster's website
BookwormUK
Apprentice
Apprentice


Joined: 21 Jan 2007
Posts: 179



Add Karma

rated by 5 members
Add Comment
Show Comments

http://yorkshirefolk.myfineforum.org
online/offline
PostPosted: Thu Mar 08, 2007 9:18 am    Post subject: Reply with quote

admin (no pm's please) wrote:
Just 0 as MODs and ADMINs are also users.
well thats what i thought but thought i'd better make sure
_________________
http://bookwormuk.myfastforum.org
http://yorkshirefolk.myfineforum.org
http://ukpeeps.myfastforum.org
Back to top
View user's profile Send private message Visit poster's website
BookwormUK
Apprentice
Apprentice


Joined: 21 Jan 2007
Posts: 179



Add Karma

rated by 5 members
Add Comment
Show Comments

http://yorkshirefolk.myfineforum.org
online/offline
PostPosted: Thu Mar 08, 2007 10:28 am    Post subject: Reply with quote

sorry to be a pain, do i have to upload the hearts or are they there automatically?
_________________
http://bookwormuk.myfastforum.org
http://yorkshirefolk.myfineforum.org
http://ukpeeps.myfastforum.org
Back to top
View user's profile Send private message Visit poster's website
myff admin
Site Admin
Site Admin
FLAG

Virtual Cash: 92900

Joined: 22 May 2005
Posts: 32204



Add Karma

rated by 281 members
Add Comment
Show Comments


online/offline
PostPosted: Thu Mar 08, 2007 10:31 am    Post subject: Reply with quote

Hearts are one of our sets of installed rank images. You could use any set that uses an integer in the range 0-5 in an otherwise consistent title.
_________________

Family Friendly Shareware | | Web Design/Services | Free Forums
Back to top
View user's profile Send private message Visit poster's website
symon
Moderator
Moderator
FLAG

Virtual Cash: 37350

Joined: 04 Sep 2005
Posts: 11952


Location: Surrey,England
Add Karma

rated by 92 members
Add Comment
Show Comments

http://howtodoit.myfreeforum.org/index.php
online/offline
PostPosted: Thu Mar 08, 2007 11:41 am    Post subject: Reply with quote

Walkthough done on

HOWTODOIT
_________________
Back to top
View user's profile Send private message Visit poster's website
myff admin
Site Admin
Site Admin
FLAG

Virtual Cash: 92900

Joined: 22 May 2005
Posts: 32204



Add Karma

rated by 281 members
Add Comment
Show Comments


online/offline
PostPosted: Thu Mar 08, 2007 11:52 am    Post subject: Reply with quote

One comment!

my code in viewtopic_body.tpl is:

Code:

<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}<br /><a href="javascript:void(0)" onclick="window.open('addrating.php?userid={postrow.POSTER_ID}&amp;component=KARMA', '_addrating', 'resizable=yes,width=500,height=360')">Add Karma</a><br/><img src="ranks/Hearts/rankl{postrow.KARMA}.gif"><br/>rated by {postrow.KARMA_COUNT} members<br/>
      <a href="javascript:void(0)" onclick="window.open('addcomment.php?userid={postrow.POSTER_ID}&amp;component=COMMENT', '_addcomment', 'resizable=yes,width=500,height=360')">Add Comment</a><br/>
      <a href="javascript:void(0)" onclick="window.open('showcomment.php?userid={postrow.POSTER_ID}&amp;component=COMMENT', '_showcomment', 'resizable=yes,width=500,height=360')">Show Comments</a><br/>

      </span></td>


Note the karma additions are within the "span" so that a nice style is applied.
_________________

Family Friendly Shareware | | Web Design/Services | Free Forums
Back to top
View user's profile Send private message Visit poster's website
symon
Moderator
Moderator
FLAG

Virtual Cash: 37350

Joined: 04 Sep 2005
Posts: 11952


Location: Surrey,England
Add Karma

rated by 92 members
Add Comment
Show Comments

http://howtodoit.myfreeforum.org/index.php
online/offline
PostPosted: Thu Mar 08, 2007 12:20 pm    Post subject: Reply with quote

Fixed now and i have slighted reworded it so it makes sense i hope.
_________________
Back to top
View user's profile Send private message Visit poster's website
symon
Moderator
Moderator
FLAG

Virtual Cash: 37350

Joined: 04 Sep 2005
Posts: 11952


Location: Surrey,England
Add Karma

rated by 92 members
Add Comment
Show Comments

http://howtodoit.myfreeforum.org/index.php
online/offline
PostPosted: Thu Mar 08, 2007 5:04 pm    Post subject: Reply with quote

How can you tell what you karma score is

Is it the more you get the hearts fill up
_________________
Back to top
View user's profile Send private message Visit poster's website
myff admin
Site Admin
Site Admin
FLAG

Virtual Cash: 92900

Joined: 22 May 2005
Posts: 32204



Add Karma

rated by 281 members
Add Comment
Show Comments


online/offline
PostPosted: Thu Mar 08, 2007 6:02 pm    Post subject: Reply with quote

There are two systems I have implemented and more of course could be if asked for.

1 - The rating is based on the average award.
2 - For things like warning systems, the rating is the last award.
_________________

Family Friendly Shareware | | Web Design/Services | Free Forums
Back to top
View user's profile Send private message Visit poster's website
symon
Moderator
Moderator
FLAG

Virtual Cash: 37350

Joined: 04 Sep 2005
Posts: 11952


Location: Surrey,England
Add Karma

rated by 92 members
Add Comment
Show Comments

http://howtodoit.myfreeforum.org/index.php
online/offline
PostPosted: Thu Mar 08, 2007 6:09 pm    Post subject: Reply with quote

admin (no pm's please) wrote:
There are two systems I have implemented and more of course could be if asked for.

1 - The rating is based on the average award.
2 - For things like warning systems, the rating is the last award.


I see but how do you check what your score is
_________________
Back to top
View user's profile Send private message Visit poster's website
myff admin
Site Admin
Site Admin
FLAG

Virtual Cash: 92900

Joined: 22 May 2005
Posts: 32204



Add Karma

rated by 281 members
Add Comment
Show Comments


online/offline
PostPosted: Thu Mar 08, 2007 6:20 pm    Post subject: Reply with quote

Not quite with you, as the ranks displayed shows the average and you can also see how many have ranked you, so is the total relevant for this method?
Maybe you want another method, where the KARMA would simply accumulate and it would not show an image but a number?
_________________

Family Friendly Shareware | | Web Design/Services | Free Forums
Back to top
View user's profile Send private message Visit poster's website
myff admin
Site Admin
Site Admin
FLAG

Virtual Cash: 92900

Joined: 22 May 2005
Posts: 32204



Add Karma

rated by 281 members
Add Comment
Show Comments


online/offline
PostPosted: Thu Mar 08, 2007 6:25 pm    Post subject: Reply with quote

Come to think if it, why don't I just populate KARMA_TOTAL with the total points and people can do as they feel!
_________________

Family Friendly Shareware | | Web Design/Services | Free Forums
Back to top
View user's profile Send private message Visit poster's website
CodyT07
Guru
Guru
FLAG

Virtual Cash: 4710

Joined: 22 Mar 2006
Posts: 3621


Location: Tennessee
Add Karma

rated by 23 members
Add Comment
Show Comments


online/offline
PostPosted: Thu Mar 08, 2007 6:51 pm    Post subject: Reply with quote

admin (no pm's please) wrote:
Come to think if it, why don't I just populate KARMA_TOTAL with the total points and people can do as they feel!

Possible to change the font in the comment screen? Reminds me of a messed up Sub portal installation.


_________________
"Great minds talk about ideas, mediocre minds talk about current events, small minds talk about other peoples"
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    myfreeforum.org Forum Index -> Portal components All times are GMT
Page 1, 2, 3, 4, 5, 6, 7, 8  Next
Page 1 of 8
 
 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Card File  Gallery  Forum Archive
Powered by phpBB © 2001, 2005 phpBB Group
Create your own free forum | Buy a domain to use with your forum