Skip to content

Commit

Permalink
Yoda
Browse files Browse the repository at this point in the history
  • Loading branch information
mambax7 committed Sep 25, 2017
1 parent ee62182 commit c7739b5
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 74 deletions.
6 changes: 3 additions & 3 deletions brokenlink.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
$broken['id'] = $broke_arr['reportid'];
$broken['reporter'] = XoopsUserUtility::getUnameFromId($broke_arr['sender']);
$broken['date'] = formatTimestamp($broke_arr['date'], $xoopsModuleConfig['dateformat']);
$broken['acknowledged'] = ($broke_arr['acknowledged'] == 1) ? _YES : _NO;
$broken['confirmed'] = ($broke_arr['confirmed'] == 1) ? _YES : _NO;
$broken['acknowledged'] = (1 == $broke_arr['acknowledged']) ? _YES : _NO;
$broken['confirmed'] = (1 == $broke_arr['confirmed']) ? _YES : _NO;
$xoopsTpl->assign('broken', $broken);
$xoopsTpl->assign('brokenreport', true);
} else {
Expand All @@ -120,7 +120,7 @@
$link['title'] = $wfmyts->htmlSpecialCharsStrip($link_arr['title']);
$time = ($link_arr['published'] > 0) ? $link_arr['published'] : $link_arr['updated'];
$link['updated'] = formatTimestamp($time, $xoopsModuleConfig['dateformat']);
$is_updated = ($link_arr['updated'] != 0) ? _MD_WFL_UPDATEDON : _MD_WFL_SUBMITDATE;
$is_updated = (0 != $link_arr['updated']) ? _MD_WFL_UPDATEDON : _MD_WFL_SUBMITDATE;
$link['publisher'] = XoopsUserUtility::getUnameFromId($link_arr['submitter']);

$xoopsTpl->assign('link_id', $lid);
Expand Down
14 changes: 7 additions & 7 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
$chcount = 1;
$subcategories = '';
foreach ($arr as $ele) {
if (WflinksUtility::checkGroups($ele['cid']) === true) {
if ($xoopsModuleConfig['subcats'] == 1) {
if (true === WflinksUtility::checkGroups($ele['cid'])) {
if (1 == $xoopsModuleConfig['subcats']) {
$chtitle = $wfmyts->htmlSpecialCharsStrip($ele['title']);
if ($chcount > 5) {
$subcategories .= '...';
Expand All @@ -86,7 +86,7 @@
// This code is copyright WF-Projects
// Using this code without our permission or removing this code voids the license agreement
$_image = $myrow['imgurl'] ? urldecode($myrow['imgurl']) : '';
if ($_image !== '' && $xoopsModuleConfig['usethumbs']) {
if ('' !== $_image && $xoopsModuleConfig['usethumbs']) {
$_thumb_image = new WfThumbsNails($_image, $xoopsModuleConfig['catimage'], 'thumbs');
if ($_thumb_image) {
$_thumb_image->setUseThumbs(1);
Expand All @@ -95,7 +95,7 @@
}
}
$imgurl = "{$xoopsModuleConfig['catimage']}/$_image";
if (empty($_image) || $_image === '') {
if (empty($_image) || '' === $_image) {
$imgurl = $indicator['image'];
}
// End
Expand Down Expand Up @@ -124,7 +124,7 @@
$xoopsTpl->assign('module_dir', $xoopsModule->getVar('dirname'));

// Screenshots display
if (isset($xoopsModuleConfig['screenshot']) && $xoopsModuleConfig['screenshot'] == 1) {
if (isset($xoopsModuleConfig['screenshot']) && 1 == $xoopsModuleConfig['screenshot']) {
$xoopsTpl->assign('shots_dir', $xoopsModuleConfig['screenshots']);
$xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']);
$xoopsTpl->assign('shotheight', $xoopsModuleConfig['shotheight']);
Expand All @@ -137,7 +137,7 @@
$sql = $xoopsDB->query('SELECT lastlinksyn, lastlinkstotal FROM ' . $xoopsDB->prefix('wflinks_indexpage'));
$lastlinks = $xoopsDB->fetchArray($sql);

if ($lastlinks['lastlinksyn'] == 1 && $lastlinks['lastlinkstotal'] > 0) {
if (1 == $lastlinks['lastlinksyn'] && $lastlinks['lastlinkstotal'] > 0) {
$result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('wflinks_links') . ' WHERE published > 0
AND published <= ' . $time . '
AND (expired = 0 OR expired > ' . $time . ')
Expand All @@ -146,7 +146,7 @@
list($count) = $xoopsDB->fetchRow($result);

$count = (($count > $lastlinks['lastlinkstotal'])
&& ($lastlinks['lastlinkstotal'] != 0)) ? $lastlinks['lastlinkstotal'] : $count;
&& (0 != $lastlinks['lastlinkstotal'])) ? $lastlinks['lastlinkstotal'] : $count;
$limit = (($start + $xoopsModuleConfig['perpage']) > $count) ? ($count - $start) : $xoopsModuleConfig['perpage'];

$result = $xoopsDB->query('SELECT * FROM ' . $xoopsDB->prefix('wflinks_links') . ' WHERE published > 0
Expand Down
6 changes: 3 additions & 3 deletions newlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

if (isset($_GET['newlinkshowdays'])) {
$newlinkshowdays = (int)$_GET['newlinkshowdays'] ?: 7;
if ($newlinkshowdays != 7) {
if ($newlinkshowdays != 14) {
if ($newlinkshowdays != 30) {
if (7 != $newlinkshowdays) {
if (14 != $newlinkshowdays) {
if (30 != $newlinkshowdays) {
redirect_header('newlist.php?newlinkshowdays=7', 5, _MD_WFL_STOPIT . '<br><img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/images/icon/security.png">');
}
}
Expand Down
14 changes: 7 additions & 7 deletions print.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$lid = (int)$lid;

$error_message = _MD_WFL_NOITEMSELECTED;
if ($lid == 0) {
if (0 == $lid) {
redirect_header('javascript:history.go(-1)', 1, $error_message);
}

Expand Down Expand Up @@ -66,33 +66,33 @@
$email = printemailcnvrt($myrow['email']);
$country = WflinksUtility::getCountryName($myrow['country']);

if ($street1 === '' || $town === '' || $xoopsModuleConfig['useaddress'] == 0) {
if ('' === $street1 || '' === $town || 0 == $xoopsModuleConfig['useaddress']) {
$print['addryn'] = 0;
} else {
$print['addryn'] = 1;
$address = wfl_address($street1, $town, $state, $zip, $country);
$print['address'] = '<b>' . _MD_WFL_ADDRESS . '</b><br>' . wfl_address($street1, $street2, $town, $state, $zip, $country) . '<br>' . $country;
if ($tel === '') {
if ('' === $tel) {
$print['tel'] = '';
} else {
$print['tel'] = '<br>' . '<img src="' . XOOPS_URL . '/modules/' . $moduleDirName . '/assets/images/icon/telephone.png" title="" alt="" align="absmiddle">&nbsp;' . $tel;
}
if ($mobile === '') {
if ('' === $mobile) {
$print['mobile'] = '';
} else {
$print['mobile'] = '<br>' . '<img src="' . XOOPS_URL . '/modules/' . $moduleDirName . '/assets/images/icon/phone.png" title="" alt="" align="absmiddle">&nbsp;' . $mobile;
}
if ($voip === '') {
if ('' === $voip) {
$print['voip'] = '';
} else {
$print['voip'] = '<br>' . '<img src="' . XOOPS_URL . '/modules/' . $moduleDirName . '/assets/images/icon/voip.png" title="" alt="" align="absmiddle">&nbsp;' . $voip;
}
if ($fax === '') {
if ('' === $fax) {
$print['fax'] = '';
} else {
$print['fax'] = '<br>' . '<img src="' . XOOPS_URL . '/modules/' . $moduleDirName . '/assets/images/icon/fax.png" title="" alt="" align="absmiddle">&nbsp;' . $fax;
}
if ($email === '') {
if ('' === $email) {
$print['email'] = '';
} else {
$print['email'] = '<br>' . '<img src="' . XOOPS_URL . '/modules/' . $moduleDirName . '/assets/images/icon/email.png" title="" alt="" align="absmiddle">&nbsp;' . $email;
Expand Down
4 changes: 2 additions & 2 deletions ratelink.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
$ip = getenv('REMOTE_ADDR');
$ratinguser = (!is_object($xoopsUser)) ? 0 : $xoopsUser->getVar('uid');

if ($ratinguser != 0) {
if (0 != $ratinguser) {
$result = $xoopsDB->query('SELECT cid, submitter FROM ' . $xoopsDB->prefix('wflinks_links') . ' WHERE lid=' . $lid);
while (list($cid, $ratinguserDB) = $xoopsDB->fetchRow($result)) {
if ($ratinguserDB == $ratinguser) {
Expand Down Expand Up @@ -59,7 +59,7 @@
$cid = (int)$cid;
$rating = (int)$rating;
// Check if Rating is Null
if ($rating == '--') {
if ('--' == $rating) {
redirect_header('ratelink.php?cid=' . $cid . '&amp;lid=' . $lid, 4, _MD_WFL_NORATING);
}
// All is well. Add to Line Item Rate to DB.
Expand Down
36 changes: 18 additions & 18 deletions singlelink.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
. '))';
list($count) = $xoopsDB->fetchRow($xoopsDB->query($sql2));

if ($count == 0 && WflinksUtility::checkGroups($cid = 0) === false) {
if (0 == $count && false === WflinksUtility::checkGroups($cid = 0)) {
redirect_header('index.php', 1, _MD_WFL_MUSTREGFIRST);
}

Expand Down Expand Up @@ -82,62 +82,62 @@
$vat = $link_arr['vat'];
$country = WflinksUtility::getCountryName($link_arr['country']);

if ($street1 === '' || $town === '' || $xoopsModuleConfig['useaddress'] == 0) {
if ('' === $street1 || '' === $town || 0 == $xoopsModuleConfig['useaddress']) {
$link['addryn'] = 0;
} else {
$link['addryn'] = 1;
$link['address'] = '<br>' . wfl_address($street1, $street2, $town, $state, $zip, $country) . '<br>' . $country;
}

if ($xoopsModuleConfig['useaddress'] == 1) {
if (1 == $xoopsModuleConfig['useaddress']) {
$link['addryn'] = 1;

if ($link_arr['tel'] === true) {
if (true === $link_arr['tel']) {
$link['tel'] = '<br>' . '<img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/images/icon/telephone.png" title="' . _MD_WFL_TELEPHONE . '" alt="' . _MD_WFL_TELEPHONE . '" align="absmiddle">&nbsp;' . $tel;
}

if ($link_arr['mobile'] === true) {
if (true === $link_arr['mobile']) {
$link['mobile'] = '<br>' . '<img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/images/icon/phone.png" title="' . _MD_WFL_MOBILE . '" alt="' . _MD_WFL_MOBILE . '" align="absmiddle">&nbsp;' . $mobile;
}

if ($link_arr['voip'] === true) {
if (true === $link_arr['voip']) {
$link['voip'] = '<br>' . '<img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/images/icon/voip.png" title="' . _MD_WFL_VOIP . '" alt="' . _MD_WFL_VOIP . '" align="absmiddle">&nbsp;' . $voip;
}

if ($link_arr['fax'] === true) {
if (true === $link_arr['fax']) {
$link['fax'] = '<br>' . '<img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/images/icon/fax.png" title="' . _MD_WFL_FAX . '" alt="' . _MD_WFL_FAX . '" align="absmiddle">&nbsp;' . $fax;
}

if ($link_arr['email'] === true) {
if (true === $link_arr['email']) {
$link['email'] = '<br>' . '<img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/images/icon/email.png" title="' . _MD_WFL_EMAIL . '" alt="' . _MD_WFL_EMAIL . '" align="absmiddle">&nbsp;' . $email;
}

if ($link_arr['vat'] === true) {
if (true === $link_arr['vat']) {
$link['vat'] = '<br>' . _MD_WFL_VAT . ':&nbsp;' . $vat;
}
}

if ($link_arr['street1'] === true || $link_arr['tel'] === true || $link_arr['mobile'] === true || $link_arr['fax'] === true
|| $link_arr['email'] === true) {
if (true === $link_arr['street1'] || true === $link_arr['tel'] || true === $link_arr['mobile'] || true === $link_arr['fax']
|| true === $link_arr['email']) {
$xoopsTpl->assign('contactdetails', '<b>' . _MD_WFL_ADDRESS . '</b>');
$xoopsTpl->assign('vcard', '<br>' . '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/class/vcard.php?lid=' . $link_arr['lid'] . '"><img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/images/icon/vcard.png" title="vCard" alt="vCard"></a>');
}

// Maps
if ($xoopsModuleConfig['useaddress'] == 1) {
if (1 == $xoopsModuleConfig['useaddress']) {
$googlemap = $link_arr['googlemap'];
$yahoomap = $link_arr['yahoomap'];
$mslivemap = $link_arr['multimap'];

if ($link_arr['googlemap'] === true) {
if (true === $link_arr['googlemap']) {
$link['googlemap'] = '<a href="' . $googlemap . '" target="_blank"><img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/images/icon/google_map.png" alt="' . _MD_WFL_GETMAP . '" title="' . _MD_WFL_GETMAP . '" align="absmiddle"></a>&nbsp;';
}

if ($link_arr['yahoomap'] === true) {
if (true === $link_arr['yahoomap']) {
$link['yahoomap'] = '<a href="' . $yahoomap . '" target="_blank"><img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/images/icon/yahoo_map.png" alt="' . _MD_WFL_GETMAP . '" title="' . _MD_WFL_GETMAP . '" align="absmiddle"></a>&nbsp;';
}

if ($link_arr['multimap'] === true) {
if (true === $link_arr['multimap']) {
$link['multimap'] = '<a href="' . $multimap . '" target="_blank"><img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/images/icon/multimap.png" alt="' . _MD_WFL_GETMAP . '" title="' . _MD_WFL_GETMAP . '" align="absmiddle"></a>';
}
}
Expand Down Expand Up @@ -178,7 +178,7 @@
require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/linkloadinfo.php';

$xoopsTpl->assign('show_screenshot', false);
if (isset($xoopsModuleConfig['screenshot']) && $xoopsModuleConfig['screenshot'] == 1) {
if (isset($xoopsModuleConfig['screenshot']) && 1 == $xoopsModuleConfig['screenshot']) {
$xoopsTpl->assign('shots_dir', $xoopsModuleConfig['screenshots']);
$xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']);
$xoopsTpl->assign('shotheight', $xoopsModuleConfig['shotheight']);
Expand All @@ -201,11 +201,11 @@
}

// Copyright notice
if (isset($xoopsModuleConfig['copyright']) && $xoopsModuleConfig['copyright'] == 1) {
if (isset($xoopsModuleConfig['copyright']) && 1 == $xoopsModuleConfig['copyright']) {
$xoopsTpl->assign('lang_copyright', '' . $link['title'] . ' &copy; ' . _MD_WFL_COPYRIGHT . ' ' . formatTimestamp(time(), 'Y') . " - <a href='" . XOOPS_URL . "'>" . $xoopsConfig['sitename'] . '</a>');
}

if (isset($xoopsModuleConfig['otherlinks']) && $xoopsModuleConfig['otherlinks'] == 1) {
if (isset($xoopsModuleConfig['otherlinks']) && 1 == $xoopsModuleConfig['otherlinks']) {
$xoopsTpl->assign('other_links', '' . '<b>' . _MD_WFL_OTHERBYUID . '</b>' . $link['submitter'] . '<br>');
}

Expand Down
30 changes: 15 additions & 15 deletions submit.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
$cid = (int)$cid;
$lid = (int)$lid;

if (WflinksUtility::checkGroups($cid, 'WFLinkSubPerm') === false) {
if (false === WflinksUtility::checkGroups($cid, 'WFLinkSubPerm')) {
redirect_header('index.php', 1, _MD_WFL_NOPERMISSIONTOPOST);
}

if (WflinksUtility::checkGroups($cid, 'WFLinkSubPerm') === true) {
if (true === WflinksUtility::checkGroups($cid, 'WFLinkSubPerm')) {
if (WflinksUtility::cleanRequestVars($_REQUEST, 'submit', 0)) {
if (WflinksUtility::checkGroups($cid, 'WFLinkSubPerm') === false) {
if (false === WflinksUtility::checkGroups($cid, 'WFLinkSubPerm')) {
redirect_header('index.php', 1, _MD_WFL_NOPERMISSIONTOPOST);
}

Expand All @@ -48,9 +48,9 @@
}

if ($xoopsModuleConfig['useaddress']) {
$googlemap = ($_POST['googlemap'] !== 'http://maps.google.com') ? $wfmyts->addSlashes($_POST['googlemap']) : '';
$yahoomap = ($_POST['yahoomap'] !== 'http://maps.yahoo.com') ? $wfmyts->addSlashes($_POST['yahoomap']) : '';
$multimap = ($_POST['multimap'] !== 'http://www.multimap.com') ? $wfmyts->addSlashes($_POST['multimap']) : '';
$googlemap = ('http://maps.google.com' !== $_POST['googlemap']) ? $wfmyts->addSlashes($_POST['googlemap']) : '';
$yahoomap = ('http://maps.yahoo.com' !== $_POST['yahoomap']) ? $wfmyts->addSlashes($_POST['yahoomap']) : '';
$multimap = ('http://www.multimap.com' !== $_POST['multimap']) ? $wfmyts->addSlashes($_POST['multimap']) : '';
$street1 = $wfmyts->addSlashes(ltrim($_REQUEST['street1']));
$street2 = $wfmyts->addSlashes(ltrim($_REQUEST['street2']));
$town = $wfmyts->addSlashes(ltrim($_REQUEST['town']));
Expand All @@ -72,11 +72,11 @@
$publishdate = 0;
$ipaddress = $_SERVER['REMOTE_ADDR'];

if ($lid == 0) {
if (0 == $lid) {
$status = 0;
$publishdate = 0;
$message = _MD_WFL_THANKSFORINFO;
if (WflinksUtility::checkGroups($cid, 'WFLinkAutoApp') === true) {
if (true === WflinksUtility::checkGroups($cid, 'WFLinkAutoApp')) {
$publishdate = time();
$status = 1;
$message = _MD_WFL_ISAPPROVED;
Expand All @@ -96,7 +96,7 @@
$newid = $GLOBALS['xoopsDB']->getInsertId();

// Add item_tag to Tag-module
if ($lid == 0) {
if (0 == $lid) {
$tagupdate = WflinksUtility::updateTag($newid, $item_tag);
} else {
$tagupdate = WflinksUtility::updateTag($lid, $item_tag);
Expand All @@ -115,7 +115,7 @@

$tags['CATEGORY_NAME'] = $row['title'];
$tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $cid;
if (WflinksUtility::checkGroups($cid, 'WFLinkAutoApp') === true) {
if (true === WflinksUtility::checkGroups($cid, 'WFLinkAutoApp')) {
$notificationHandler->triggerEvent('global', 0, 'new_link', $tags);
$notificationHandler->triggerEvent('category', $cid, 'new_link', $tags);
redirect_header('index.php', 2, _MD_WFL_ISAPPROVED);
Expand All @@ -130,7 +130,7 @@
redirect_header('index.php', 2, _MD_WFL_THANKSFORINFO);
}
} else {
if ($approve == 1 || WflinksUtility::checkGroups($cid, 'WFLinkAutoApp') === true) {
if (1 == $approve || true === WflinksUtility::checkGroups($cid, 'WFLinkAutoApp')) {
$updated = time();
$sql = 'UPDATE '
. $xoopsDB->prefix('wflinks_links')
Expand Down Expand Up @@ -190,7 +190,7 @@
$approve = WflinksUtility::cleanRequestVars($_REQUEST, 'approve', 0);

//Show disclaimer
if (!isset($_GET['agree']) && $xoopsModuleConfig['showdisclaimer'] && $approve == 0) {
if (!isset($_GET['agree']) && $xoopsModuleConfig['showdisclaimer'] && 0 == $approve) {
$GLOBALS['xoopsOption']['template_main'] = 'wflinks_disclaimer.tpl';
include XOOPS_ROOT_PATH . '/header.php';

Expand Down Expand Up @@ -267,7 +267,7 @@
$sql = 'SELECT * FROM ' . $xoopsDB->prefix('wflinks_cat') . ' ORDER BY title';
$result = $xoopsDB->query($sql);
while ($myrow = $xoopsDB->fetchArray($result)) {
if (WflinksUtility::checkGroups($myrow['cid'], 'WFLinkSubPerm') === true) {
if (true === WflinksUtility::checkGroups($myrow['cid'], 'WFLinkSubPerm')) {
$submitcats[$myrow['cid']] = $myrow['title'];
}
}
Expand Down Expand Up @@ -374,11 +374,11 @@
} else {
$sform->addElement(new XoopsFormHidden('notifypub', 0));
}
if ($lid > 0 && WflinksUtility::checkGroups($cid, 'WFLinkAppPerm') === true) {
if ($lid > 0 && true === WflinksUtility::checkGroups($cid, 'WFLinkAppPerm')) {
$approve_checkbox = new XoopsFormCheckBox('', 'approve', $approve);
$approve_checkbox->addOption(1, _MD_WFL_APPROVE);
$option_tray->addElement($approve_checkbox);
} elseif (WflinksUtility::checkGroups($cid, 'WFLinkAutoApp') === true) {
} elseif (true === WflinksUtility::checkGroups($cid, 'WFLinkAutoApp')) {
$sform->addElement(new XoopsFormHidden('approve', 1));
} else {
$sform->addElement(new XoopsFormHidden('approve', 0));
Expand Down
2 changes: 1 addition & 1 deletion topten.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

$e = 0;
while (list($cid, $ctitle) = $xoopsDB->fetchRow($result)) {
if (WflinksUtility::checkGroups($cid) === true) {
if (true === WflinksUtility::checkGroups($cid)) {
$query = 'SELECT lid, cid, title, hits, rating, votes FROM ' . $xoopsDB->prefix('wflinks_links') . ' WHERE published > 0 AND published <= ' . time() . ' AND (expired = 0 OR expired > ' . time() . ') AND offline = 0 AND (cid=' . (int)$cid;
$links = $mytree->getAllChildId($cid);
foreach ($links as $link) {
Expand Down
Loading

0 comments on commit c7739b5

Please sign in to comment.