mirror of
https://github.com/e107inc/e107.git
synced 2025-05-05 19:55:21 +02:00
tagwords URL config - initial commit, work in progress; odd bug (PHP?) - require_once doesn't detect that class2 already included (for tagwords legacy entry point only) - fixed with e107_INIT detection, need investigation.
This commit is contained in:
parent
23223ac4aa
commit
161588af1e
@ -23,7 +23,7 @@ class e_tagwords_news
|
|||||||
$this->row = $this->getRecord($id);
|
$this->row = $this->getRecord($id);
|
||||||
}
|
}
|
||||||
//$url = e_BASE."news.php?item.".$this->row['news_id'];
|
//$url = e_BASE."news.php?item.".$this->row['news_id'];
|
||||||
$url = e107::getUrl()->createCoreNews('action=extend&id='.$this->row['news_id'].'&sef='.$this->row['news_rewrite_string']);
|
$url = e107::getUrl()->create('news/view/item', $this->row);
|
||||||
return "<a href='".$url."'>".$this->e107->tp->toHTML($this->row['news_title'], TRUE, '')."</a>";
|
return "<a href='".$url."'>".$this->e107->tp->toHTML($this->row['news_title'], TRUE, '')."</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,9 +31,9 @@ class e_tagwords_news
|
|||||||
{
|
{
|
||||||
$this->row = '';
|
$this->row = '';
|
||||||
//FIXME - only if news mod rewrite is on
|
//FIXME - only if news mod rewrite is on
|
||||||
$qry = "SELECT n.*, nr.*
|
$qry = "SELECT n.*, nc.*
|
||||||
FROM #news as n
|
FROM #news as n
|
||||||
LEFT JOIN #news_rewrite AS nr ON n.news_id=nr.news_rewrite_source AND nr.news_rewrite_type=1
|
LEFT JOIN #news_category AS nc ON n.news_category=nc.category_id
|
||||||
WHERE n.news_id='{$id}'
|
WHERE n.news_id='{$id}'
|
||||||
AND n.news_start < ".time()."
|
AND n.news_start < ".time()."
|
||||||
AND (n.news_end=0 || n.news_end>".time().")
|
AND (n.news_end=0 || n.news_end>".time().")
|
||||||
|
@ -15,16 +15,15 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once('../../class2.php');
|
if(!defined('e107_INIT')) require_once('../../class2.php');
|
||||||
if (!defined('e107_INIT')) { exit; }
|
|
||||||
|
|
||||||
$_GET = e107::getUrl()->parseRequest('tagwords', 'main', e_QUERY);
|
//$_GET = e107::getUrl()->parseRequest('tagwords', 'main', e_QUERY);
|
||||||
|
|
||||||
require_once(HEADERF);
|
require_once(HEADERF);
|
||||||
|
|
||||||
require_once(e_PLUGIN."tagwords/tagwords_class.php");
|
require_once(e_PLUGIN."tagwords/tagwords_class.php");
|
||||||
$tag = new tagwords();
|
$tag = new tagwords();
|
||||||
|
//echo e107::getUrl()->create('tagwords/search/area', 'area=news&q=something');
|
||||||
if(varsettrue($tag->pref['tagwords_class']) && !check_class($tag->pref['tagwords_class']) )
|
if(varsettrue($tag->pref['tagwords_class']) && !check_class($tag->pref['tagwords_class']) )
|
||||||
{
|
{
|
||||||
header("location:".SITEURL); exit;
|
header("location:".SITEURL); exit;
|
||||||
|
@ -2,16 +2,14 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
* Tagwords Class
|
* Tagwords Class
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/tagwords_class.php,v $
|
* $URL$
|
||||||
* $Revision$
|
* $Id$
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -272,7 +270,7 @@ class tagwords
|
|||||||
$word = trim($word);
|
$word = trim($word);
|
||||||
/*$qry = $this->e107->tp->toDB($word);
|
/*$qry = $this->e107->tp->toDB($word);
|
||||||
$qry = str_replace(' ', '+', $qry);*/
|
$qry = str_replace(' ', '+', $qry);*/
|
||||||
$url = e107::getUrl()->createTagwords('q='.$word);
|
$url = e107::getUrl()->create('tagwords/search', 'q='.$word);
|
||||||
$word = $this->e107->tp->toHTML($word,true,'no_hook, emotes_off');
|
$word = $this->e107->tp->toHTML($word,true,'no_hook, emotes_off');
|
||||||
$class = ($class ? "class='tag".intval($class)."'" : "");
|
$class = ($class ? "class='tag".intval($class)."'" : "");
|
||||||
return "<a href='".$url."' ".$class." title=''>".$word."</a>";
|
return "<a href='".$url."' ".$class." title=''>".$word."</a>";
|
||||||
|
@ -2,16 +2,14 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
* Tagwords Shortcodes
|
* Tagwords Shortcodes
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/tagwords_shortcodes.php,v $
|
* $URL$
|
||||||
* $Revision$
|
* $Id$
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
@ -108,10 +106,10 @@ class tagwords_shortcodes
|
|||||||
switch($sc_mode)
|
switch($sc_mode)
|
||||||
{
|
{
|
||||||
case 'menu':
|
case 'menu':
|
||||||
return "<a href='".e107::getUrl()->createTagwords()."'>".LAN_TAG_MENU_1."</a>";
|
return "<a href='".e107::getUrl()->create('tagwords')."'>".LAN_TAG_MENU_1."</a>";
|
||||||
break;
|
break;
|
||||||
case 'home':
|
case 'home':
|
||||||
return "<a href='".e107::getUrl()->createTagwords()."'>".LAN_TAG_7."</a>";
|
return "<a href='".e107::getUrl()->create('tagwords')."'>".LAN_TAG_7."</a>";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if(method_exists($tag->area, 'getLink'))
|
if(method_exists($tag->area, 'getLink'))
|
||||||
@ -265,7 +263,9 @@ class tagwords_shortcodes
|
|||||||
|
|
||||||
function sc_tag_button()
|
function sc_tag_button()
|
||||||
{
|
{
|
||||||
return "<input class='button' type='submit' name='so' value='".LAN_TAG_SEARCH_3."' />";
|
if(varsettrue($tag->pref['tagwords_view_sort']) || varsettrue($tag->pref['tagwords_view_style']) || varsettrue($tag->pref['tagwords_view_area']))
|
||||||
|
return "<input class='button' type='submit' name='so' value='".LAN_TAG_SEARCH_3."' />";
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_tag_options()
|
function sc_tag_options()
|
||||||
@ -277,6 +277,10 @@ class tagwords_shortcodes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sc_tag_url($parm)
|
||||||
|
{
|
||||||
|
return e107::getUrl()->create('tagwords', $parm);
|
||||||
|
}
|
||||||
//##### ADMIN OPTIONS -------------------------
|
//##### ADMIN OPTIONS -------------------------
|
||||||
|
|
||||||
function sc_tag_opt_min($parm, $sc_mode)
|
function sc_tag_opt_min($parm, $sc_mode)
|
||||||
|
@ -54,10 +54,10 @@ $TEMPLATE_TAGWORDS['link_end'] = "</ul></div>";
|
|||||||
//##### options --------------------------------------------------
|
//##### options --------------------------------------------------
|
||||||
|
|
||||||
$TEMPLATE_TAGWORDS['options'] = "
|
$TEMPLATE_TAGWORDS['options'] = "
|
||||||
<form id='plugin-tagwords-form' method='get' action='".e_PLUGIN_ABS."tagwords/tagwords.php'>
|
<form id='plugin-tagwords-form' method='get' action='{TAG_URL}'>
|
||||||
{TAG_SEARCH}
|
{TAG_SEARCH}
|
||||||
</form>
|
</form>
|
||||||
<form id='dataform' name='dataform' method='get' action='".e_PLUGIN_ABS."tagwords/tagwords.php'>
|
<form id='dataform' name='dataform' method='get' action='{TAG_URL}'>
|
||||||
<div style='line-height:150%; padding-bottom:10px;'>
|
<div style='line-height:150%; padding-bottom:10px;'>
|
||||||
{TAG_TYPE} {TAG_SORT} {TAG_AREA} {TAG_BUTTON}
|
{TAG_TYPE} {TAG_SORT} {TAG_AREA} {TAG_BUTTON}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user