Karma Description Mod

Started by Grek.Kamchatka, September 11, 2005, 11:48:26 PM

Previous topic - Next topic

TrueSatan

 In the Read Me when you install this mod it says:

QuoteDon't forget to BACKUP

It says this because the Karma.php file in the Source directory has to be changed to much...though it is also standard advice whem installing or uninstalling any mod or theme. Hopefully you will find a copy of the old Karma.php file on your server in the kdm_bak directory in the Source directory but if there is any problem with that you will need to replace the file with one from the SMF installation package and edit it if any other mods you use need to alter the file to work.

Webrunner

First let me start by saying i love this mod and so do the members of my forums.

But I have a problem together with the SEO4SMF mod.
Both mods are heavily used on our forum. Now seo4smf is creating database errors when non admin users are looking at the karmalog of another user.

Stangely this doesn't happen when administrators look at stats or users look at their own karma stats.

The database error i get is:

Database error: Unknown column 'PM' in 'where clause'
File: /home/path_to/html/forum/Sources/Subs-Seo4SMF.php
Line: 739


I am using smf 1.1.3 and the 0.2.9.8 of seo4smf and the lates version of the karma description mod/
The forum is busy (over 2 million posts, 100000 pageviews a day) so these database errors really are a pain in the ...

Could anyone please help me solve this?
There is a difference between knowing the path and walking the path.

=========================================
Vrouwen Power! | Sprintweb: No nonsense e-Business consultancy

Webrunner

I noticed that users own karma log isn't working and giving a blank page and database error when a karma was given from a PM.

There is a difference between knowing the path and walking the path.

=========================================
Vrouwen Power! | Sprintweb: No nonsense e-Business consultancy

Webrunner

Going step by step. 
SEO4SMF chokes on the "PM" value in the karmalog database. A function is called to retrieve an URL for the topic/message the karma was given in. This query errors because it gets a wrong parameter (PM).

I hope to find a solution but since i am not a programmer i need any help i can get!
There is a difference between knowing the path and walking the path.

=========================================
Vrouwen Power! | Sprintweb: No nonsense e-Business consultancy

ibexy

Am getting this error when I try to access the karma log:

Unknown column 'lk.Description' in 'field list'
File: /home/albert/public_html/naijaspora/forum/Sources/Viewkarma.php
Line: 91

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.3, while your database is at version 1.1.2. The above error might possibly go away if you execute the latest version of upgrade.php.

ibexy

Problem Solved:

Found it on this thread. Just ran the query

ALTER TABLE `YOURPREFIX_log_karma`
ADD `description` TEXT NOT NULL


http://www.simplemachines.org/community/index.php?topic=49088.340

Webrunner

Quote from: GC on February 21, 2007, 08:41:38 PM
Hello I have an error with this mod. Its not fixable by the maker of another mod that makes the error stand out. Whats wrong?

Error:
Database Error: Unknown column 'PM' in 'where clause'
File: /home/12985/public_html/forums/Sources/Subs-Seo4SMF.php
Line: 480


and that area is
if (isset($modSettings['seo4smf_split_char']))
$split_char=$modSettings['seo4smf_split_char'];
    else
$split_char="_";

$request = db_query("SELECT m.subject,b.name
      FROM {$db_prefix}messages as m left join {$db_prefix}boards as b on m.ID_BOARD=b.ID_BOARD where m.ID_TOPIC=".$topic_id." LIMIT 1", __FILE__, __LINE__);
list($subject,$board)=mysql_fetch_row($request);
mysql_free_result($request);


line 480 is
FROM {$db_prefix}messages as m left join {$db_prefix}boards as b on m.ID_BOARD=b.ID_BOARD where


should PM be there somewhere?

Seems i am not the only one with this problem :(
There is a difference between knowing the path and walking the path.

=========================================
Vrouwen Power! | Sprintweb: No nonsense e-Business consultancy

Bigguy

Are permissions and ownership set right on all files.

Quote from: Webrunner on August 20, 2007, 08:14:59 AM
I noticed that users own karma log isn't working and giving a blank page and database error when a karma was given from a PM.



SneakyWho_am_i

#768
Quote from: Webrunner on August 20, 2007, 11:16:47 AM
Quote from: GC on February 21, 2007, 08:41:38 PM
line 480 is
FROM {$db_prefix}messages as m left join {$db_prefix}boards as b on m.ID_BOARD=b.ID_BOARD where

should PM be there somewhere?

Strange. I have a forum with Seo4SMF and in my Subs file for it, that string is on a completely different line - and I'm running the same version.


NB ALL ALTERATIONS LISTED BELOW ARE IN Subs-Seo4SMF.php UNLESS OTHERWISE NOTED
IFF the permissions are all good, THEN see if this helps.... Find:
    $excluded_actions = array('search2', 'keepalive', 'diradmin', 'seo4smfsitemaps');

Replace:
    $excluded_actions = array('search2', 'modifykarma', 'pm', 'keepalive', 'diradmin', 'seo4smfsitemaps');

It won't be an end-all and cure-all. I'm going to install both mods on a test forum and try to replicate your error. I'm no expert on Seo4SMF and I don't even have the karma description mod installed (yet) but I've had issues with Seo4SMF before so I have a couple of ideas about what might be going wrong. My word is not gospel.

What is in the address bar when the error is displayed? (Oh... Minus the "sesc" bit of course...)

I get an error for this due to SQL syntax (although it's not important, this is just an example url):
http://sneakywhoami.com/testdrivesmf/index.php?action=modifykarma;sa=applaud;uid=2;f=inbox;start=0;;pm=1 [nofollow]

Ok. I installed Seo4SMF 2.9.9 with Karma Description Mod ver.2.3 on SMF 1.1.2 patched to 1.1.3
I now have both mods installed AND I can modify Karma BUT it's not asking me for a description...

I did this:
Quote
IFF the permissions are all good, THEN see if this helps.... Find in Subs-Seo4SMF.php:
    $excluded_actions = array('search2', 'keepalive', 'diradmin', 'seo4smfsitemaps');

Replace:
    $excluded_actions = array('search2', 'modifykarma', 'pm', 'keepalive', 'diradmin', 'seo4smfsitemaps');

Which produced an error because the Seo4SMF signs array is dodgey...

So I changed the line beginning with
    $signs = array("Re :", "Re:", "re:", "re :","~", "`", "!", "@", "#", "%body%quot;, "%", "^", "&", "*", "(", ")", "_", "+", "|", "\\", "=", "-", "{", "}", "[", "]", ":", "\"", ";", "'", "<", ">", "?", ",", ".", "/","°","º","","©","®","",

in Subs-Seo4SMF.php to read:
    $signs = array("Re :", "Re:", "re:", "re :","~", "`", "!", "@", "#", "%body%quot;, "%", "^", "&", "*", "(", ")", "_", "+", "|", "\\", "=", "-", "{", "}", "[", "]", ":", "\"", ";", "'", "<", ">", "?", ",", ".", "/","°","º","","©","®","","","","æ","","","","±","·","b,","¯");

And then I encountered a further error elsewhere and turned off some option (I don't know what it does!!!! Did I disable the Karma mod by doing it!?) in Karma.php:

I found (in Karma.php):
        // Users can change karma to only topic starter if you check this function
        if (!empty($modSettings['karmatopicstarter']))


And replaced with:
        // Users can change karma to only topic starter if you check this function
        if (empty($modSettings['karmatopicstarter']))



Why I don't know what it does? Well... The Karma Description Mod installed fine on the default template in English, but no descriptions if the checkbox functions appear in the admin panel. So i see a row of checkboxes without labels and have to guess at what they do for some reason.
The mod installed without errors so it's beyond me.

I'm not sure what effect my changes will have on your particular forum - your mileage may vary.
But it does allow me to have both mods installed AND modify karma. Which is a start, at least.

Webrunner

First you have to activate the comments, or they won't show up.

I know now where the problem is but i can's solve it.
The karma desc mod can show a link where the karma was given (what topic/post). This link is build up from a field from the karmalog table where the topic and message ID are saved of the message where you klik the "applaud" or "smite" link.
The problem arises when people give a karma from a Personal Message. Then the link value that is saved is "PM". This makes SEO4SMF choke when it tries to create the URL.

As a workaround i removed the ability to give karma in a Personal Message and removed all the records with "PM" in the link field.
This works now and the database errors don't appear anymore.

However this is not a real solution.
Hope this helps a bit.
There is a difference between knowing the path and walking the path.

=========================================
Vrouwen Power! | Sprintweb: No nonsense e-Business consultancy

Webrunner

And... thanks for your help! ;)
There is a difference between knowing the path and walking the path.

=========================================
Vrouwen Power! | Sprintweb: No nonsense e-Business consultancy

ragots

How do I reset all karmas to zéro ?

I installed this Mod. It's working fine. But now members would like me to reset all karma to zéro. Is there a way to do that ? I'm not too good at phpmyadmin, so please explain thoroughly.

Thank you for any help


qtime

Quote from: ragots on August 24, 2007, 04:30:25 PM
How do I reset all karmas to zéro ?

I installed this Mod. It's working fine. But now members would like me to reset all karma to zéro. Is there a way to do that ? I'm not too good at phpmyadmin, so please explain thoroughly.

Thank you for any help


go to the profile and click: Forum Profile Information
scroll down and here  you see Karma

ragots

#773
How to reset karma to all members to 0 for a new beginning


Thank you. I did it. I think it may help others wanting to reset karma for all members to 0.



You log to your phpmyadmin and you select your database:



First you go to phpmyadmin, you clck on SQL:






I the field you see, erase whatever you see there and type this:

QuoteUPDATE smf_members SET karmaGood = '0', karmaBad = '0';


here it is:








And you click go:











That's it.

qtime

oh sorry, I did not read it correctly.

burningboardroom

Can someone please explain how to use this with 1.1.3?  I've downloaded it and it says it was successful, but the mod is not showing up.

slackerpunk

Quote from: burningboardroom on August 28, 2007, 09:15:36 AM
Can someone please explain how to use this with 1.1.3?  I've downloaded it and it says it was successful, but the mod is not showing up.

check the user profile it should show up or you have to set it up first under Admin check Karma to enable the mod

ragots

The IN TOPIC link opens a new page, I'd like it not to open a new page. How do I do that ?

Which file do I change that to _target="_parent"  ?

ragots

Never mind. I found where. I looked in viewkarma.template.php and I changed all the target=_blank to target=_parent

Dem0n

I get the following error :

Warning: Unterminated comment starting line 328 in .../Themes/simplywhite/BoardIndex.template.php on line 328

Parse error: parse error, unexpected $ in .../Themes/simplywhite/BoardIndex.template.php on line 328

319: echo '
320: (<a href="', $scripturl, '?action=helpadmin;help=calendar_how_edit" onclick="return reqWin(this.href);">', $txt['calendar_how_edit'], '</a>)';
321: }
322: echo '
323: </span>
324: </td>
325: </tr>';
326: }
327:

328:

329: <br /><br />
330: <br />
331: <br /><br />
332: <br />


I tried removing the comment tag, and it just created another error. Any advice?

Advertisement: