Archive for howtodoit.myfastforum.org 
 



       howtodoit.myfastforum.org Forum Index -> Add-on`s for your forum
Symon

Karma Mod

Please remember to use the Editor account before making any template changes

Second you must have all ready a template you can edit.

If you have not done this please read HOWTODOIT

Ok all that done you now goto Your admin panel --- 3. Styles --- Portal Settings

You will now see a screen that looks like this




If you do not already see a portal named KARMA then (if you do then IGNORE The Steps 1-5)

1.Click on the Blank box icon that looks like this

Now you see a screen like this





2.Add KARMA to the name

3.And then what you want in the Title.

4. Click Create New Portal

5. Now goto admin panel --- 3. Styles --- Edit Templates/Logos -- the template you wish to edit (EG myff_howtodoit1)--- Submit

Now look at the bottom in the area marked Choose Portal template File to Edit use the drop down bar and find[/b]

cms_karma.tpl

Now copy this code into that file

Code:
<script>
if ("{S_STATE}"=="rate")
{
   //document.write("here");
}
else if ("{S_STATE}"=="error")
{
   document.write("Error: {S_ERROR}");
}
else
{
   
   window.close();
   
}

</script>
<title>Rate This User</title>
<form action="{S_RATING_ACTION}" method="post" target="_top"  ">


<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
 
  <tr>
   <td class="row1"><table border="0" cellpadding="3" cellspacing="1" width="100%">
      
       
      
        <tr>
        <td>Rate user: {USERNAME}<td>
        </tr>
        <td>Previous Karma: {PREV_RATING}</td>
       </tr>
      <tr>
      <td>
      {RATINGS}
      </td>
      </tr>
      <tr>
      <td>
      <input type="submit" name="rate" class="mainoption" value="rate">
      </td>
      </tr>
      
      </table></td>
  </tr>
</table>

</form>


6. You now need to set up 3 profile fields



Go to your forum's Administration Panel ----- 2. General --- Profile Fields

6a.Now add KARMA And click Add Custom Profile Field

You will now see this screen



Fill out the details as shown in the image then click submit.

For ranks use a code like


Code:
ranks/Hearts/rankl{postrow.KARMA}.gif


You can change the rank to which image you want.

6b. KARMA_TOTAL




6c. KARMA_COUNT






Now click submit


7.You Can Change The bit below in bold in admin panel --- 3. Styles --- Portal Settings --- POPULAR to suit your forum by using the guide below


The Guide below is ONLY for those that wish to edit or move the code to a place not given in the drop down bar in the screen above.




Admin Panel --- Styles Admin---Edit Templates/Logos

Now by using the drop down bar select the template you wish to edit.

Now by using the drop down bar Titled

Choose Forum template/javascript/css File to Edit

Now find viewtopic_body.tpl
And add the following code where you wish it to show. So if you wish it to be under Location like i have on here then you find

Code:
{postrow.POSTER_FROM}
And add the code afterwards

So the code would look like below

Code:
<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"></span>


It is worth noting that if you put the code before
Code:
</span>
then it will be in the same style and size as location.

Now Submit and using the drop down bar again find profile_view_body.tpl:

Now again add the following code where you wish it too be.

Code:

<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><img src="ranks/Hearts/rankl{KARMA}.gif">


So say on here i wish it to be under Interest i would find

Code:
<td> <b><span class="gen">{INTERESTS}</span></b></td>


And add the code after so it would look something like this,

Code:
<tr>
        <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_INTERESTS}:</span></td>
        <td> <b><span class="gen">{INTERESTS}</b></td>
<tr><tr><td>
<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><img src="ranks/Hearts/rankl{KARMA}.gif"></span></td></tr>

Note how i added
Code:
<tr>
and
Code:
<td>
this was so it showed under interest and in its own table row so if you add the plain code and it doesn't show in line try adding them aswell.

It is worth noting that if you put the code before
Code:
</span>
then it will be in the same style and size as Interests.


Please note that i have included the hearts ranks as the image you can change this by simply changing the rank code
Code:
<img src="ranks/Hearts/rankl{KARMA}.gif">
and
Code:
<img src="ranks/Hearts/rankl{postrow.KARMA}.gif">
to one that suits you please remember it has to have the range of 0-5 so in other words its no good using a rank image with 10 hearts on it. You have to upload the images you wish to use do this by the standard method of uploading images to a template.

Ok now you are done and if done right should look like this.



png[/img]
Symon

To add the rated By X amount of people do the following

Add this code to viewtopic_body.tpl


Code:
 <br/> your message here{postrow.KARMA_COUNT} and here


So it could look like this


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/blinkredorange/rank{postrow.KARMA}.gif"> <br/> You have been rated {postrow.KARMA_TOTAL}<br/>
 You have been rated by {postrow.KARMA_COUNT} people<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></span>

       howtodoit.myfastforum.org Forum Index -> Add-on`s for your forum
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum