Skip to content

Commit

Permalink
Merge pull request #8 from mambax7/master
Browse files Browse the repository at this point in the history
updates
  • Loading branch information
mambax7 authored May 25, 2017
2 parents b236d1b + 3273a48 commit 786b6e6
Show file tree
Hide file tree
Showing 109 changed files with 5,475 additions and 4,808 deletions.
339 changes: 0 additions & 339 deletions LICENSE

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
## MyLinks module for [XOOPS CMS 2.5.8+](https://xoops.org)
[![Software License](https://img.shields.io/badge/license-GPL-brightgreen.svg?style=flat)](LICENSE)
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/XoopsModules25x/mylinks.svg?style=flat)](https://scrutinizer-ci.com/g/XoopsModules25x/mylinks/?branch=master)
[![Codacy Badge](https://api.codacy.com/project/badge/grade/2d27c0023ee54f0b9ba2b5d17a68b2a5)](https://www.codacy.com/app/XoopsModules25x/mylinks)
[![Codacy Badge](https://api.codacy.com/project/badge/grade/6ed3bd6222f84d2d8271019b78d2a6c9)](https://www.codacy.com/app/mambax7/mylinks_2/)
[![Code Climate](https://img.shields.io/codeclimate/github/XoopsModules25x/mylinks.svg?style=flat)](https://codeclimate.com/github/XoopsModules25x/mylinks)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/aacda134-0f78-4d73-997a-b37194cfd7c4/mini.png)](https://insight.sensiolabs.com/projects/aacda134-0f78-4d73-997a-b37194cfd7c4)
[![Latest Pre-Resease](https://img.shields.io/github/tag/XoopsModules25x/mylinks.svg?style=flat)](https://github.com/XoopsModules25x/mylinks/tags/)
[![Latest Version](https://img.shields.io/github/release/XoopsModules25x/mylinks.svg?style=flat)](https://github.com/XoopsModules25x/mylinks/releases/)

MyLinks module for [XOOPS CMS](http://xoops.org) is a XOOPS module that allows an administrator to create a series of website links. The module provides the ability for other users to submit sites for inclusion in the list which can be monitored by the administrator and then approved if desired.

[![Tutorial Available](http://xoops.org/images/tutorial-available-blue.svg)](https://www.gitbook.com/book/xoops/mylinks-tutorial/) Tutorial: see [here](https://www.gitbook.com/book/xoops/mylinks-tutorial/).
[![Tutorial Available](http://xoops.org/images/tutorial-available-blue.svg)](https://www.gitbook.com/book/xoops/mylinks-tutorial/) Tutorial: see [GitBook](https://www.gitbook.com/book/xoops/mylinks-tutorial/).
To contribute to the Tutorial, [fork it on GitHub](https://github.com/XoopsDocs/mylinks-tutorial)

[![Translations on Transifex](http://xoops.org/images/translations-transifex-blue.svg)](https://www.transifex.com/xoops)
Expand Down
18 changes: 8 additions & 10 deletions admin/about.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/**
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
Expand All @@ -8,14 +8,12 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* MyLinks module
*
* @copyright:: {@link http://sourceforge.net/projects/xoops/ The XOOPS Project}
* @license:: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
* @package:: mylinks
* @copyright :: {@link http://xoops.org/ XOOPS Project}
* @license :: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
* @package :: mylinks
* @subpackage:: admin
* @author:: XOOPS Module Dev Team
**/
* @author :: XOOPS Devolopment Team
*/
/**
* Display module information in Admin
*/
Expand All @@ -25,7 +23,7 @@

$aboutAdmin = new ModuleAdmin();

echo $aboutAdmin->addNavigation('about.php');
echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false);
echo $aboutAdmin->addNavigation(basename(__FILE__));
echo $aboutAdmin->renderAbout('[email protected]', false);

include __DIR__ . '/admin_footer.php';
25 changes: 9 additions & 16 deletions admin/admin_footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,14 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright:: {@link http://sourceforge.net/projects/xoops/ The XOOPS Project}
* @license:: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
* @package:: mylinks
* @copyright :: {@link http://xoops.org/ XOOPS Project}
* @license :: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
* @package :: mylinks
* @subpackage:: admin
* @since: 2.5.0
* @author:: XOOPS Module Dev Team
**/
echo "<div class='adminfooter'>\n"
. " <div class='txtcenter'>\n"
. " <a href='" . $GLOBALS['xoopsModule']->getInfo('author_website_url') . "' target='_blank'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='" . $GLOBALS['xoopsModule']->getInfo('author_website_name') . "' title='" . $GLOBALS['xoopsModule']->getInfo('author_website_name') . "'></a>\n"
. " </div>\n"
. " <div class='center smallsmall italic pad5'>\n"
. ' ' . _AM_MYLINKS_MAINTAINED_BY
. " <a class='tooltip' rel='external' href='http://" . $GLOBALS['xoopsModule']->getInfo('module_website_url') . "' "
. "title='" . _AM_MYLINKS_MAINTAINED_TITLE . "'>" . _AM_MYLINKS_MAINTAINED_TEXT . "</a>\n"
. " </div>\n"
. "</div>\n";
* @author :: XOOPS Development Team
**/
global $pathIcon32;

echo "<div class='adminfooter'>\n" . " <div style='text-align: center;'>\n" . " <a href='http://www.xoops.org' target='_blank'><img src=" . $pathIcon32 . "/xoopsmicrobutton.gif alt='XOOPS' title='XOOPS'></a>\n" . " </div>\n" . ' ' . _AM_MYLINKS_ADMIN_FOOTER . "\n" . '</div>';

xoops_cp_footer();
26 changes: 12 additions & 14 deletions admin/admin_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright:: The XOOPS Project http://sourceforge.net/projects/xoops/
* @license:: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
* @package:: mylinks
* @copyright :: {@link http://xoops.org/ XOOPS Project}
* @license :: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
* @package :: mylinks
* @subpackage:: admin
* @since:: 2.5.0
* @author:: Magic.Shao <[email protected]> - Susheng Yang <[email protected]>
**/
*/

$path = dirname(dirname(dirname(__DIR__)));
include_once $path . '/mainfile.php';
Expand All @@ -24,20 +22,20 @@

global $xoopsModule;

$thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname');
$thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname');
$thisModulePath = dirname(__DIR__);

// Load language files
xoops_loadLanguage('admin', $thisModuleDir);
xoops_loadLanguage('modinfo', $thisModuleDir);
xoops_loadLanguage('main', $thisModuleDir);

$pathIcon16 = '../'.$xoopsModule->getInfo('icons16');
$pathIcon32 = '../'.$xoopsModule->getInfo('icons32');
$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');

if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){
include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
}else{
redirect_header('../../../admin.php', 5, _AM_MODULEADMIN_MISSING, false);
}
if (file_exists($GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php'))) {
include_once $GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php');
} else {
redirect_header('../../../admin.php', 5, _AM_MODULEADMIN_MISSING, false);
}
31 changes: 15 additions & 16 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
*
* Xoops mylinks - a multicategory links module
*
* @copyright:: The XOOPS Project http://sourceforge.net/projects/xoops/
* @license:: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
* @package:: mylinks
* @copyright :: {@link http://xoops.org/ XOOPS Project}
* @license :: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
* @package :: mylinks
* @subpackage:: class
* @since:: unknown
* @author:: Thatware - http://thatware.org/
* @author :: Thatware - http://thatware.org/
*/
// ------------------------------------------------------------------------- //
// XOOPS - PHP Content Management System //
Expand All @@ -35,46 +34,46 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------- //

include 'admin_header.php';
include __DIR__ . '/admin_header.php';
xoops_cp_header();

$indexAdmin = new ModuleAdmin();

// Temporarily 'homeless' links (to be revised in admin.php breakup)
$result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mylinks_broken') . '');
list($totalBrokenLinks) = $xoopsDB->fetchRow($result);
if ( $totalBrokenLinks > 0 ) {
if ($totalBrokenLinks > 0) {
$totalBrokenLinks = "<span style='color: #ff0000; font-weight: bold'>{$totalBrokenLinks}</span>";
}
$result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mylinks_mod') . '');
list($totalModRequests) = $xoopsDB->fetchRow($result);
if ( $totalModRequests > 0 ) {
if ($totalModRequests > 0) {
$totalModRequests = "<span style='color: #ff0000; font-weight: bold'>{$totalModRequests}</span>";
}
$result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mylinks_links') . " WHERE status='0'");
list($totalNewLinks) = $xoopsDB->fetchRow($result);
if ( $totalNewLinks > 0 ) {
if ($totalNewLinks > 0) {
$totalNewLinks = "<span style='color: #ff0000; font-weight: bold'>{$totalNewLinks}</span>";
}
$result=$xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mylinks_links') . ' WHERE status>0');
$result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mylinks_links') . ' WHERE status>0');
list($activeLinks) = $xoopsDB->fetchRow($result);

$indexAdmin->addInfoBox(_MD_MYLINKS_WEBLINKSCONF);

if ( 0 == $totalNewLinks ) {
if (0 == $totalNewLinks) {
//$indexAdmin->addLineLabel(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_LINKSWAITING, $totalNewLinks, 'Green');
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_LINKSWAITING, $totalNewLinks, 'Green');
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_LINKSWAITING, $totalNewLinks, 'Green');
} else {
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_LINKSWAITING, $totalNewLinks, 'Red');
}

if ( 0 == $totalBrokenLinks ) {
if (0 == $totalBrokenLinks) {
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_BROKENREPORTS, $totalBrokenLinks, 'Green');
} else {
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_BROKENREPORTS, $totalBrokenLinks, 'Red');
}

if ( 0 == $totalModRequests ) {
if (0 == $totalModRequests) {
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_MODREQUESTS, $totalModRequests, 'Green');
} else {
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_MODREQUESTS, $totalModRequests, 'Red');
Expand All @@ -83,7 +82,7 @@
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_THEREARE, $activeLinks);
//------------------------------

echo $indexAdmin->addNavigation('index.php');
echo $indexAdmin->addNavigation(basename(__FILE__));
echo $indexAdmin->renderIndex();

include 'admin_footer.php';
include __DIR__ . '/admin_footer.php';
Loading

0 comments on commit 786b6e6

Please sign in to comment.