Code Duplication    Length = 9-11 lines in 9 locations

admin/importdictionary.php 1 location

@@ 162-172 (lines=11) @@
159
                showerror('<br>' . _AM_LEXIKON_IMPORT_ERROR_IMPORT_TERM . ': <span style="color:red">entryID: ' . $entryID . '</span>: ' . $term . ' ...');
160
            }
161
            // update user posts count
162
            if ($ret1) {
163
                if ($uid) {
164
                    $memberHandler = xoops_getHandler('member');
165
                    $submitter     = $memberHandler->getUser($uid);
166
                    if (is_object($submitter)) {
167
                        $submitter->setVar('posts', $submitter->getVar('posts') + 1);
168
                        $res = $memberHandler->insertUser($submitter, true);
169
                        unset($submitter);
170
                    }
171
                }
172
            }
173
        }
174
    }
175
    /****

admin/category.php 1 location

@@ 342-350 (lines=9) @@
339
        ) {
340
            $newid = $xoopsDB->getInsertId();
341
            // Increment author's posts count (only if it's a new definition)
342
            if (is_object($xoopsUser) && empty($categoryID)) {
343
                $memberHandler = xoops_getHandler('member');
344
                $submitter     = $memberHandler->getUser($uid);
345
                if (is_object($submitter)) {
346
                    $submitter->setVar('posts', $submitter->getVar('posts') + 1);
347
                    $res = $memberHandler->insertUser($submitter, true);
348
                    unset($submitter);
349
                }
350
            }
351
            //notification
352
            if (!empty($xoopsModuleConfig['notification_enabled'])) {
353
                if ($newid == 0) {

admin/entry.php 1 location

@@ 411-419 (lines=9) @@
408
        ) {
409
            $newid = $xoopsDB->getInsertId();
410
            // Increment author's posts count (only if it's a new definition)
411
            if (is_object($xoopsUser) && empty($entryID)) {
412
                $memberHandler = xoops_getHandler('member');
413
                $submitter     = $memberHandler->getUser($uid);
414
                if (is_object($submitter)) {
415
                    $submitter->setVar('posts', $submitter->getVar('posts') + 1);
416
                    $res = $memberHandler->insertUser($submitter, true);
417
                    unset($submitter);
418
                }
419
            }
420
            // trigger Notification only if its a new definition
421
            if (!empty($xoopsModuleConfig['notification_enabled'])) {
422
                global $xoopsModule;

admin/importglossaire.php 1 location

@@ 146-156 (lines=11) @@
143
            showerror('<br>' . _AM_LEXIKON_IMPORT_ERROR_IMPORT_TERM . ': <span style="color:red">entryID: ' . $glo['id'] . '</span>: ' . $glo['nom'] . ' ...');
144
        }
145
        // update user posts count
146
        if ($ret1) {
147
            if ($uid) {
148
                $memberHandler = xoops_getHandler('member');
149
                $submitter     = $memberHandler->getUser($uid);
150
                if (is_object($submitter)) {
151
                    $submitter->setVar('posts', $submitter->getVar('posts') + 1);
152
                    $res = $memberHandler->insertUser($submitter, true);
153
                    unset($submitter);
154
                }
155
            }
156
        }
157
    }
158
159
    $sqlQuery = $xoopsDB->query('

admin/importwiwimod.php 1 location

@@ 162-172 (lines=11) @@
159
            showerror('<br>' . _AM_LEXIKON_IMPORT_ERROR_IMPORT_TERM . ': <span style="color:red">ID: ' . $wiwi['id'] . '</span>: ' . $wiwi['title'] . ' ...');
160
        }
161
        // update user posts count
162
        if ($ret1) {
163
            if ($uid) {
164
                $memberHandler = xoops_getHandler('member');
165
                $submitter     = $memberHandler->getUser($uid);
166
                if (is_object($submitter)) {
167
                    $submitter->setVar('posts', $submitter->getVar('posts') + 1);
168
                    $res = $memberHandler->insertUser($submitter, true);
169
                    unset($submitter);
170
                }
171
            }
172
        }
173
    }
174
175
    $sqlQuery = $xoopsDB->query('SELECT mid

admin/importwordbook.php 1 location

@@ 167-177 (lines=11) @@
164
                showerror('<br>' . _AM_LEXIKON_IMPORT_ERROR_IMPORT_TERM . ': <span style="color:red">entryID: ' . $entryID . '</span>: ' . $term . ' ...');
165
            }
166
            // update user posts count
167
            if ($ret1) {
168
                if ($uid) {
169
                    $memberHandler = xoops_getHandler('member');
170
                    $submitter     = $memberHandler->getUser($uid);
171
                    if (is_object($submitter)) {
172
                        $submitter->setVar('posts', $submitter->getVar('posts') + 1);
173
                        $res = $memberHandler->insertUser($submitter, true);
174
                        unset($submitter);
175
                    }
176
                }
177
            }
178
        }
179
    }
180

admin/importxwords.php 1 location

@@ 168-178 (lines=11) @@
165
                showerror('<br>' . _AM_LEXIKON_IMPORT_ERROR_IMPORT_TERM . ': <span style="color:red">entryID: ' . $entryID . '</span>: ' . $term . ' ...');
166
            }
167
            // update user posts count
168
            if ($ret1) {
169
                if ($uid) {
170
                    $memberHandler = xoops_getHandler('member');
171
                    $submitter     = $memberHandler->getUser($uid);
172
                    if (is_object($submitter)) {
173
                        $submitter->setVar('posts', $submitter->getVar('posts') + 1);
174
                        $res = $memberHandler->insertUser($submitter, true);
175
                        unset($submitter);
176
                    }
177
                }
178
            }
179
        }
180
    }
181

request.php 1 location

@@ 75-83 (lines=9) @@
72
                    . " (entryID, term, init, ref, url, uid, submit, datesub, html, smiley, xcodes, offline, notifypub, request ) VALUES ('', '$reqterm', '$init', '$ref', '$url', '$user', '$submit', '$date', '$html', '$smiley', '$xcodes', '$offline', '$notifypub', '$request' )");
73
    $newid = $xoopsDB->getInsertId();
74
    // Increment author's posts count
75
    if (is_object($xoopsUser) && !empty($user)) {
76
        $memberHandler = xoops_getHandler('member');
77
        $submitter     = $memberHandler->getUser($user);
78
        if (is_object($submitter)) {
79
            $submitter->setVar('posts', $submitter->getVar('posts') + 1);
80
            $res = $memberHandler->insertUser($submitter, true);
81
            unset($submitter);
82
        }
83
    }
84
    // trigger Notification
85
    if (!empty($xoopsModuleConfig['notification_enabled'])) {
86
        global $xoopsModule;

submit.php 1 location

@@ 149-157 (lines=9) @@
146
                                  . " (entryID, categoryID, term, init, definition, ref, url, uid, submit, datesub, html, smiley, xcodes, breaks, block, offline, notifypub ) VALUES ('', '$categoryID', '$term', '$init', '$definition', '$ref', '$url', '$uid', '$submit', '$datesub', '$html', '$smiley', '$xcodes', '$breaks','$block', '$offline', '$notifypub')");
147
        $newid  = $xoopsDB->getInsertId();
148
        // Increment author's posts count
149
        if (is_object($xoopsUser) && empty($entryID) && $autoapprove) {
150
            $memberHandler = xoops_getHandler('member');
151
            $submitter     = $memberHandler->getUser($uid);
152
            if (is_object($submitter)) {
153
                $submitter->setVar('posts', $submitter->getVar('posts') + 1);
154
                $res = $memberHandler->insertUser($submitter, true);
155
                unset($submitter);
156
            }
157
        }
158
        // trigger Notification
159
        if (!empty($xoopsModuleConfig['notification_enabled'])) {
160
            global $xoopsModule;