mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01: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);
|
||||
}
|
||||
//$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>";
|
||||
}
|
||||
|
||||
@ -31,9 +31,9 @@ class e_tagwords_news
|
||||
{
|
||||
$this->row = '';
|
||||
//FIXME - only if news mod rewrite is on
|
||||
$qry = "SELECT n.*, nr.*
|
||||
$qry = "SELECT n.*, nc.*
|
||||
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}'
|
||||
AND n.news_start < ".time()."
|
||||
AND (n.news_end=0 || n.news_end>".time().")
|
||||
|
@ -15,16 +15,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
require_once('../../class2.php');
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
if(!defined('e107_INIT')) require_once('../../class2.php');
|
||||
|
||||
$_GET = e107::getUrl()->parseRequest('tagwords', 'main', e_QUERY);
|
||||
//$_GET = e107::getUrl()->parseRequest('tagwords', 'main', e_QUERY);
|
||||
|
||||
require_once(HEADERF);
|
||||
|
||||
require_once(e_PLUGIN."tagwords/tagwords_class.php");
|
||||
$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']) )
|
||||
{
|
||||
header("location:".SITEURL); exit;
|
||||
|
@ -2,16 +2,14 @@
|
||||
/*
|
||||
* 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
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Tagwords Class
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/tagwords_class.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
@ -272,7 +270,7 @@ class tagwords
|
||||
$word = trim($word);
|
||||
/*$qry = $this->e107->tp->toDB($word);
|
||||
$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');
|
||||
$class = ($class ? "class='tag".intval($class)."'" : "");
|
||||
return "<a href='".$url."' ".$class." title=''>".$word."</a>";
|
||||
|
@ -2,16 +2,14 @@
|
||||
/*
|
||||
* 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
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Tagwords Shortcodes
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/tagwords_shortcodes.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
@ -108,10 +106,10 @@ class tagwords_shortcodes
|
||||
switch($sc_mode)
|
||||
{
|
||||
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;
|
||||
case 'home':
|
||||
return "<a href='".e107::getUrl()->createTagwords()."'>".LAN_TAG_7."</a>";
|
||||
return "<a href='".e107::getUrl()->create('tagwords')."'>".LAN_TAG_7."</a>";
|
||||
break;
|
||||
default:
|
||||
if(method_exists($tag->area, 'getLink'))
|
||||
@ -265,7 +263,9 @@ class tagwords_shortcodes
|
||||
|
||||
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()
|
||||
@ -277,6 +277,10 @@ class tagwords_shortcodes
|
||||
}
|
||||
}
|
||||
|
||||
function sc_tag_url($parm)
|
||||
{
|
||||
return e107::getUrl()->create('tagwords', $parm);
|
||||
}
|
||||
//##### ADMIN OPTIONS -------------------------
|
||||
|
||||
function sc_tag_opt_min($parm, $sc_mode)
|
||||
|
@ -54,10 +54,10 @@ $TEMPLATE_TAGWORDS['link_end'] = "</ul></div>";
|
||||
//##### 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}
|
||||
</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;'>
|
||||
{TAG_TYPE} {TAG_SORT} {TAG_AREA} {TAG_BUTTON}
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user