11
BeautyBrains
Re: Top Posters Block not updating

Here is the code for the AMS mod, use ctrl+F (find) to find where to implement the following text in its submit.php

$notification_handler->subscribe('story', $story->storyid(), 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
}
}

// Increment author's posts count (only if it's a new AmsStory)
// First case, it's not an anonyous, the story is approved and it's a new story
if($uid && $approve && empty($storyid)) {
$tmpuser=new xoopsUser($uid);
$member_handler =& xoops_gethandler('member');
$member_handler->updateUserByField($tmpuser, 'posts', $tmpuser->getVar('posts') + 1);
}

// Second case, it's not an anonymous, the story is NOT approved and it's NOT a new story (typical when someone is approving a submited story)
if(is_object($xoopsUser) && $approve && !empty($storyid)) {
$storytemp = new NewsStory( $storyid );
if(!$storytemp->published() && $storytemp->uid()>0) { // the article has been submited but not approved
$tmpuser=new xoopsUser($storytemp->uid());
$member_handler =& xoops_gethandler('member');
$member_handler->updateUserByField($tmpuser, 'posts', $tmpuser->getVar('posts') + 1);
}
unset($storytemp);
}

// Manage upload(s)
A man without history is like a tree without roots. Marcus Garvey (1917) http://CaribbeanAncestry.com http://JamaicaGenealogy.com http://thephilosophizers.com Teach what you know and learn what you don't; stay open to all. 24/7

Login

Who's Online

1446 user(s) are online (221 user(s) are browsing Support Forums)


Members: 0


Guests: 1446


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits