mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
Fixes #3009 new e_gsitemap addon.
This commit is contained in:
@@ -75,6 +75,7 @@ class e_plugin
|
|||||||
'e_upload',
|
'e_upload',
|
||||||
'e_user',
|
'e_user',
|
||||||
'e_library', // For third-party libraries are defined by plugins/themes.
|
'e_library', // For third-party libraries are defined by plugins/themes.
|
||||||
|
'e_gsitemap',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@@ -1067,6 +1068,7 @@ class e107plugin
|
|||||||
'e_upload',
|
'e_upload',
|
||||||
'e_user',
|
'e_user',
|
||||||
'e_library', // For third-party libraries are defined by plugins/themes.
|
'e_library', // For third-party libraries are defined by plugins/themes.
|
||||||
|
'e_gsitemap',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
41
e107_plugins/forum/e_gsitemap.php
Normal file
41
e107_plugins/forum/e_gsitemap.php
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* e107 website system
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008-2018 e107 Inc (e107.org)
|
||||||
|
* Released under the terms and conditions of the
|
||||||
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
|
*
|
||||||
|
* gSitemap addon
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
// v2.x Standard
|
||||||
|
class forum_gsitemap // plugin-folder + '_rss'
|
||||||
|
{
|
||||||
|
|
||||||
|
function import()
|
||||||
|
{
|
||||||
|
$import = array();
|
||||||
|
|
||||||
|
$sql = e107::getDb();
|
||||||
|
|
||||||
|
$data = $sql->retrieve("forum", "*", "forum_parent!='0' ORDER BY forum_order ASC", true);
|
||||||
|
|
||||||
|
foreach($data as $row)
|
||||||
|
{
|
||||||
|
$import[] = array(
|
||||||
|
'name' => $row['forum_name'],
|
||||||
|
'url' => e107::url('forum','forum',$row, array('mode'=>'full')), // ('forum/forum/view', $row['forum_id']),
|
||||||
|
'type' => LAN_PLUGIN_FORUM_NAME
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $import;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@@ -18,7 +18,7 @@ if(!getperms("P") || !e107::isInstalled('gsitemap'))
|
|||||||
require_once(e_ADMIN."auth.php");
|
require_once(e_ADMIN."auth.php");
|
||||||
require_once(e_HANDLER."userclass_class.php");
|
require_once(e_HANDLER."userclass_class.php");
|
||||||
|
|
||||||
e107::lan('gsitemap',e_LANGUAGE."_admin_gsitemap.php");
|
e107::lan('gsitemap',true);
|
||||||
|
|
||||||
$gsm = new gsitemap;
|
$gsm = new gsitemap;
|
||||||
|
|
||||||
@@ -381,44 +381,27 @@ class gsitemap
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* forums ... */
|
/* Plugins.. - currently: forums ... */
|
||||||
if(e107::isInstalled('forum'))
|
$addons = e107::getAddonConfig('e_gsitemap', null, 'import');
|
||||||
|
|
||||||
|
foreach($addons as $plug => $config)
|
||||||
{
|
{
|
||||||
$sql -> select("forum", "*", "forum_parent!='0' ORDER BY forum_order ASC");
|
|
||||||
$nfArray = $sql -> db_getList();
|
foreach($config as $row)
|
||||||
foreach($nfArray as $row)
|
|
||||||
{
|
{
|
||||||
if(!in_array($row['forum_name'], $existing))
|
if(!in_array($row['name'], $existing))
|
||||||
{
|
{
|
||||||
$importArray[] = array('name' => $row['forum_name'], 'url' => e107::getUrl()->create('forum/forum/view', $row['forum_id']), 'type' => "Forum");
|
$importArray[] = $row;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* DEPRECATED content pages ...
|
$editArray = $_POST;
|
||||||
if(e107::isInstalled('content'))
|
|
||||||
{
|
|
||||||
$sql -> select("pcontent", "content_id, content_heading", "LEFT(content_parent,1) = '0' ORDER BY content_heading");
|
|
||||||
$nfArray = $sql -> db_getList();
|
|
||||||
foreach($nfArray as $row)
|
|
||||||
{
|
|
||||||
$sql2 -> select("pcontent", "content_id, content_heading", "content_parent = '".$row['content_id']."' AND content_refer != 'sa' ORDER BY content_heading");
|
|
||||||
$nfArray2 = $sql2 -> db_getList();
|
|
||||||
foreach($nfArray2 as $row2)
|
|
||||||
{
|
|
||||||
if(!$sql -> select("gsitemap", "*", "gsitemap_name='".$row2['content_heading']."' "))
|
|
||||||
{
|
|
||||||
$importArray[] = array('name' => $row2['content_heading'], 'url' => $PLUGINS_DIRECTORY."content/content.php?content.".$row2['content_id'], 'type' => $row['content_heading']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
$text = "
|
$text = "
|
||||||
<form action='".e_SELF."' id='form' method='post'>
|
<form action='".e_SELF."' id='form' method='post'>
|
||||||
<table class='table adminlist'>
|
<table class='table adminlist table-striped table-condensed'>
|
||||||
<colgroup>
|
<colgroup>
|
||||||
<col class='center' style='width:5%;' />
|
<col class='center' style='width:5%;' />
|
||||||
<col style='width:15%' />
|
<col style='width:15%' />
|
||||||
@@ -427,21 +410,22 @@ class gsitemap
|
|||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td>".GSLAN_2."</td>
|
<th class='center'>".GSLAN_2."</th>
|
||||||
<td>".LAN_TYPE."</td>
|
<th>".LAN_TYPE."</th>
|
||||||
<td>".LAN_NAME."</td>
|
<th>".LAN_NAME."</th>
|
||||||
<td>".LAN_URL."</td>
|
<th>".LAN_URL."</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
";
|
";
|
||||||
|
|
||||||
foreach($importArray as $ia)
|
foreach($importArray as $k=>$ia)
|
||||||
{
|
{
|
||||||
|
$id = 'gs-'.$k;
|
||||||
$text .= "
|
$text .= "
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type='checkbox' name='importid[]' value='".$ia['name']."^".$ia['url']."^".$ia['type']."' /></td>
|
<td class='center'><input id='".$id."' type='checkbox' name='importid[]' value='".$ia['name']."^".$ia['url']."^".$ia['type']."' /></td>
|
||||||
<td>".$ia['type']."</td>
|
<td><label for='".$id."'>".$ia['type']."</label></td>
|
||||||
<td>".$ia['name']."</td>
|
<td>".$ia['name']."</td>
|
||||||
<td><span class='smalltext'>".str_replace(SITEURL,"",$ia['url'])."</span></td>
|
<td><span class='smalltext'>".str_replace(SITEURL,"",$ia['url'])."</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -451,17 +435,16 @@ class gsitemap
|
|||||||
$text .= "
|
$text .= "
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan='4' class='center'>
|
<td colspan='4' class='center'>
|
||||||
<div> ".GSLAN_8." ".GSLAN_9." : <select class='tbox' name='import_priority' >\n";
|
<div class='buttons-bar'> ".GSLAN_8." ".GSLAN_9." : <select class='tbox' name='import_priority' >\n";
|
||||||
|
|
||||||
for ($i=0.1; $i<1.0; $i=$i+0.1)
|
for ($i=0.1; $i<1.0; $i=$i+0.1)
|
||||||
{
|
{
|
||||||
$sel = (vartrue($editArray['gsitemap_priority']) == number_format($i,1))? "selected='selected'" : "";
|
$sel = (vartrue($editArray['gsitemap_priority']) == number_format($i,1))? "selected='selected'" : "";
|
||||||
$text .= "<option value='".number_format($i,1)."' $sel>".number_format($i,1)."</option>\n";
|
$text .= "<option value='".number_format($i,1)."' $sel>".number_format($i,1)."</option>\n";
|
||||||
};
|
}
|
||||||
|
|
||||||
$text.="</select> ".GSLAN_10."
|
$text.="</select> ".GSLAN_10."
|
||||||
|
|
||||||
|
|
||||||
<select class='tbox' name='import_freq' >\n";
|
<select class='tbox' name='import_freq' >\n";
|
||||||
foreach($this->freq_list as $k=>$fq)
|
foreach($this->freq_list as $k=>$fq)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user