1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Module: WF-Links |
4
|
|
|
* Version: v1.0.3 |
5
|
|
|
* Release Date: 21 June 2005 |
6
|
|
|
* Developer: John N |
7
|
|
|
* Team: WF-Projects |
8
|
|
|
* Licence: GNU |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
//require_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php'; |
12
|
|
|
|
13
|
|
|
use Xmf\Request; |
14
|
|
|
use XoopsModules\News\NewsStory; |
|
|
|
|
15
|
|
|
|
16
|
|
|
$story = new NewsStory(); |
17
|
|
|
$story->setUid($xoopsUser->uid()); |
18
|
|
|
$story->setPublished(time()); |
19
|
|
|
$story->setExpired(0); |
20
|
|
|
$story->setType('admin'); |
21
|
|
|
$story->setHostname(getenv('REMOTE_ADDR')); |
22
|
|
|
$story->setApproved(1); |
23
|
|
|
$topicid = Request::getInt('newstopicid', 0, 'REQUEST'); |
24
|
|
|
$story->setTopicId($topicid); |
25
|
|
|
$story->setTitle($title); |
26
|
|
|
$_linkid = (isset($lid) && $lid > 0) ? $lid : $newid; |
27
|
|
|
$_link = $_REQUEST['descriptionb'] . '<br><div><a href=' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlelink.php?cid=' . $cid . '&lid=' . $_linkid . '>' . $title . '</a></div>'; |
28
|
|
|
|
29
|
|
|
$description = $myts->addSlashes(trim($_link)); |
30
|
|
|
$story->setHometext($description); |
31
|
|
|
$story->setBodytext(''); |
32
|
|
|
$nohtml = empty($nohtml) ? 0 : 1; |
33
|
|
|
$nosmiley = empty($nosmiley) ? 0 : 1; |
34
|
|
|
$story->setNohtml($nohtml); |
35
|
|
|
$story->setNosmiley($nosmiley); |
36
|
|
|
$story->store(); |
37
|
|
|
/** @var \XoopsNotificationHandler $notificationHandler */ |
38
|
|
|
$notificationHandler = xoops_getHandler('notification'); |
39
|
|
|
|
40
|
|
|
$tags = []; |
41
|
|
|
$tags['STORY_NAME'] = $story->title(); |
42
|
|
|
/** @var \XoopsModuleHandler $moduleHandler */ |
43
|
|
|
$moduleHandler = xoops_getHandler('module'); |
44
|
|
|
$newsModule = $moduleHandler->getByDirname('news'); |
45
|
|
|
$tags['STORY_URL'] = XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid(); |
46
|
|
|
if (!empty($isnew)) { |
47
|
|
|
$notificationHandler->triggerEvent('story', $story->storyid(), 'approve', $tags); |
48
|
|
|
} |
49
|
|
|
$notificationHandler->triggerEvent('global', 0, 'new_story', $tags); |
50
|
|
|
unset($xoopsModule); |
51
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths