From 161588af1e10424a68241c3389f90e17450382d6 Mon Sep 17 00:00:00 2001 From: secretr Date: Fri, 2 Dec 2011 19:26:30 +0000 Subject: [PATCH] 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. --- .../tagwords/section/e_tagwords_news.php | 6 +++--- e107_plugins/tagwords/tagwords.php | 7 +++---- e107_plugins/tagwords/tagwords_class.php | 10 ++++------ e107_plugins/tagwords/tagwords_shortcodes.php | 20 +++++++++++-------- e107_plugins/tagwords/tagwords_template.php | 4 ++-- 5 files changed, 24 insertions(+), 23 deletions(-) diff --git a/e107_plugins/tagwords/section/e_tagwords_news.php b/e107_plugins/tagwords/section/e_tagwords_news.php index 510b38ce0..00237e50b 100644 --- a/e107_plugins/tagwords/section/e_tagwords_news.php +++ b/e107_plugins/tagwords/section/e_tagwords_news.php @@ -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 "".$this->e107->tp->toHTML($this->row['news_title'], TRUE, '').""; } @@ -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().") diff --git a/e107_plugins/tagwords/tagwords.php b/e107_plugins/tagwords/tagwords.php index dee5e4de0..7bee31196 100644 --- a/e107_plugins/tagwords/tagwords.php +++ b/e107_plugins/tagwords/tagwords.php @@ -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; diff --git a/e107_plugins/tagwords/tagwords_class.php b/e107_plugins/tagwords/tagwords_class.php index 4707ac6e6..5cb54fe1c 100644 --- a/e107_plugins/tagwords/tagwords_class.php +++ b/e107_plugins/tagwords/tagwords_class.php @@ -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 "".$word.""; diff --git a/e107_plugins/tagwords/tagwords_shortcodes.php b/e107_plugins/tagwords/tagwords_shortcodes.php index d3c1fe85f..ea1ce394f 100644 --- a/e107_plugins/tagwords/tagwords_shortcodes.php +++ b/e107_plugins/tagwords/tagwords_shortcodes.php @@ -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 "".LAN_TAG_MENU_1.""; + return "".LAN_TAG_MENU_1.""; break; case 'home': - return "".LAN_TAG_7.""; + return "".LAN_TAG_7.""; break; default: if(method_exists($tag->area, 'getLink')) @@ -265,7 +263,9 @@ class tagwords_shortcodes function sc_tag_button() { - return ""; + if(varsettrue($tag->pref['tagwords_view_sort']) || varsettrue($tag->pref['tagwords_view_style']) || varsettrue($tag->pref['tagwords_view_area'])) + return ""; + 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) diff --git a/e107_plugins/tagwords/tagwords_template.php b/e107_plugins/tagwords/tagwords_template.php index c2cf1f49c..7f5065dee 100644 --- a/e107_plugins/tagwords/tagwords_template.php +++ b/e107_plugins/tagwords/tagwords_template.php @@ -54,10 +54,10 @@ $TEMPLATE_TAGWORDS['link_end'] = ""; //##### options -------------------------------------------------- $TEMPLATE_TAGWORDS['options'] = " -
+ {TAG_SEARCH}
-
+
{TAG_TYPE} {TAG_SORT} {TAG_AREA} {TAG_BUTTON}