mirror of
https://github.com/e107inc/e107.git
synced 2025-04-20 20:51:53 +02:00
tagwords updated use $e107 object
This commit is contained in:
parent
b576d1bbe5
commit
77053d2e54
@ -1,21 +1,20 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| ©Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/admin_tagwords_config.php,v $
|
||||
| $Revision: 1.1 $
|
||||
| $Date: 2008-12-29 20:51:07 $
|
||||
| $Author: lisa_ $
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Tagwords Admin
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/admin_tagwords_config.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-01-17 22:46:37 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
require_once("../../class2.php");
|
||||
if (!getperms("P"))
|
||||
{
|
||||
@ -23,12 +22,8 @@ if (!getperms("P"))
|
||||
exit ;
|
||||
}
|
||||
require_once(e_ADMIN."auth.php");
|
||||
|
||||
require_once(e_HANDLER."userclass_class.php");
|
||||
|
||||
e107_require_once(e_HANDLER.'arraystorage_class.php');
|
||||
$eArrayStorage = new ArrayData();
|
||||
|
||||
require_once(e_PLUGIN."tagwords/tagwords_class.php");
|
||||
$tag = new tagwords();
|
||||
|
||||
|
@ -1,20 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| ©Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/e_event.php,v $
|
||||
| $Revision: 1.1 $
|
||||
| $Date: 2008-12-29 20:51:07 $
|
||||
| $Author: lisa_ $
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Tagwords Event Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/e_event.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-01-17 22:46:37 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
@ -1,21 +1,20 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/e_meta.php,v $
|
||||
| $Revision: 1.1 $
|
||||
| $Date: 2008-12-29 20:51:07 $
|
||||
| $Author: lisa_ $
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Tagwords Meta Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/e_meta.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-01-17 22:46:37 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
if (is_readable(THEME."tagwords_css.php"))
|
||||
|
@ -6,6 +6,8 @@ class e_tagwords_download
|
||||
{
|
||||
function e_tagwords_download()
|
||||
{
|
||||
$this->e107 = e107::getInstance();
|
||||
|
||||
$this->settings = array();
|
||||
|
||||
$this->settings['plugin'] = "";
|
||||
@ -16,28 +18,25 @@ class e_tagwords_download
|
||||
|
||||
function getLink($id)
|
||||
{
|
||||
global $tp;
|
||||
if($this->row=='')
|
||||
{
|
||||
$this->row = $this->getRecord($id);
|
||||
}
|
||||
$url = e_BASE."download.php?view.".$this->row['download_id'];
|
||||
return "<a href='".$url."'>".$tp->toHTML($this->row['download_name'], TRUE, '')."</a>";
|
||||
return "<a href='".$url."'>".$this->e107->tp->toHTML($this->row['download_name'], TRUE, '')."</a>";
|
||||
}
|
||||
|
||||
function getRecord($id)
|
||||
{
|
||||
global $sql;
|
||||
|
||||
$this->row = '';
|
||||
|
||||
|
||||
$qry = "SELECT d.*
|
||||
FROM #download as d
|
||||
WHERE d.download_id='{$id}' AND d.download_class REGEXP '".e_CLASS_REGEXP."' ";
|
||||
|
||||
if($sql->db_Select_gen($qry))
|
||||
|
||||
if($this->e107->sql->db_Select_gen($qry))
|
||||
{
|
||||
$this->row=$sql->db_Fetch();
|
||||
$this->row=$this->e107->sql->db_Fetch();
|
||||
}
|
||||
return $this->row;
|
||||
}
|
||||
|
@ -6,6 +6,8 @@ class e_tagwords_news
|
||||
{
|
||||
function e_tagwords_news()
|
||||
{
|
||||
$this->e107 = e107::getInstance();
|
||||
|
||||
$this->settings = array();
|
||||
|
||||
$this->settings['plugin'] = "";
|
||||
@ -16,20 +18,18 @@ class e_tagwords_news
|
||||
|
||||
function getLink($id)
|
||||
{
|
||||
global $tp;
|
||||
if(empty($this->row))
|
||||
{
|
||||
$this->row = $this->getRecord($id);
|
||||
}
|
||||
$url = e_BASE."news.php?item.".$this->row['news_id'];
|
||||
return "<a href='".$url."'>".$tp->toHTML($this->row['news_title'], TRUE, '')."</a>";
|
||||
return "<a href='".$url."'>".$this->e107->tp->toHTML($this->row['news_title'], TRUE, '')."</a>";
|
||||
}
|
||||
|
||||
function getRecord($id)
|
||||
{
|
||||
global $sql;
|
||||
|
||||
$this->row = '';
|
||||
|
||||
$qry = "SELECT n.*
|
||||
FROM #news as n
|
||||
WHERE n.news_id='{$id}'
|
||||
@ -37,9 +37,9 @@ class e_tagwords_news
|
||||
AND (n.news_end=0 || n.news_end>".time().")
|
||||
AND n.news_class REGEXP '".e_CLASS_REGEXP."' ";
|
||||
|
||||
if($sql->db_Select_gen($qry))
|
||||
if($this->e107->sql->db_Select_gen($qry))
|
||||
{
|
||||
$this->row=$sql->db_Fetch();
|
||||
$this->row=$this->e107->sql->db_Fetch();
|
||||
}
|
||||
return $this->row;
|
||||
}
|
||||
|
@ -6,6 +6,8 @@ class e_tagwords_page
|
||||
{
|
||||
function e_tagwords_page()
|
||||
{
|
||||
$this->e107 = e107::getInstance();
|
||||
|
||||
$this->settings = array();
|
||||
|
||||
$this->settings['plugin'] = "";
|
||||
@ -16,28 +18,25 @@ class e_tagwords_page
|
||||
|
||||
function getLink($id)
|
||||
{
|
||||
global $tp;
|
||||
if($this->row=='')
|
||||
{
|
||||
$this->row = $this->getRecord($id);
|
||||
}
|
||||
$url = e_BASE."page.php?".$this->row['page_id'];
|
||||
return "<a href='".$url."'>".$tp->toHTML($this->row['page_title'], TRUE, '')."</a>";
|
||||
return "<a href='".$url."'>".$this->e107->tp->toHTML($this->row['page_title'], TRUE, '')."</a>";
|
||||
}
|
||||
|
||||
function getRecord($id)
|
||||
{
|
||||
global $sql;
|
||||
|
||||
$this->row = '';
|
||||
|
||||
|
||||
$qry = "SELECT p.*, u.user_id, u.user_name FROM #page AS p
|
||||
LEFT JOIN #user AS u ON p.page_author = u.user_id
|
||||
WHERE p.page_id='{$id}' AND p.page_class IN (".USERCLASS_LIST.") ";
|
||||
|
||||
if($sql->db_Select_gen($qry))
|
||||
|
||||
if($this->e107->sql->db_Select_gen($qry))
|
||||
{
|
||||
$this->row=$sql->db_Fetch();
|
||||
$this->row=$this->e107->sql->db_Fetch();
|
||||
}
|
||||
return $this->row;
|
||||
}
|
||||
|
@ -1,20 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| ©Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/tagwords.php,v $
|
||||
| $Revision: 1.1 $
|
||||
| $Date: 2008-12-29 20:51:07 $
|
||||
| $Author: lisa_ $
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Tagwords Page
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/tagwords.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-01-17 22:46:37 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
require_once('../../class2.php');
|
||||
|
@ -1,20 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| ©Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/tagwords_class.php,v $
|
||||
| $Revision: 1.1 $
|
||||
| $Date: 2008-12-29 20:51:07 $
|
||||
| $Author: lisa_ $
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 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: 1.2 $
|
||||
* $Date: 2009-01-17 22:46:37 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
if(!defined("TAG_TEXTAREA_COLS")){ define("TAG_TEXTAREA_COLS", "70"); }
|
||||
@ -41,15 +39,15 @@ class tagwords
|
||||
*/
|
||||
function tagwords()
|
||||
{
|
||||
global $pref, $tp, $TEMPLATE_TAGWORDS, $tagwords_shortcodes;
|
||||
global $pref, $TEMPLATE_TAGWORDS, $tagwords_shortcodes;
|
||||
|
||||
$this->tp = $tp;
|
||||
$this->e107 = e107::getInstance();
|
||||
|
||||
//language
|
||||
include_lan(e_PLUGIN."tagwords/languages/".e_LANGUAGE.".php");
|
||||
|
||||
//shortcodes
|
||||
require_once(e_PLUGIN.'tagwords/tagwords_shortcodes.php');
|
||||
require_once(e_PLUGIN.'tagwords/tagwords_shortcodes_class.php');
|
||||
$this->shortcodes = $tagwords_shortcodes;
|
||||
|
||||
//template
|
||||
@ -159,10 +157,10 @@ class tagwords
|
||||
$this->word = false;
|
||||
if( $ret = $this->getRecords($tag_type, $tag_itemid) )
|
||||
{
|
||||
$this->word = $this->tp->toForm($ret);
|
||||
$this->word = $this->e107->tp->toForm($ret);
|
||||
}
|
||||
$caption = $this->tp->parseTemplate($this->template['caption'], FALSE, $this->shortcodes);
|
||||
$text = $this->tp->parseTemplate($this->template['form'], FALSE, $this->shortcodes);
|
||||
$caption = $this->e107->tp->parseTemplate($this->template['caption'], true, $this->shortcodes);
|
||||
$text = $this->e107->tp->parseTemplate($this->template['form'], true, $this->shortcodes);
|
||||
return array('caption'=>$caption, 'text'=>$text);
|
||||
}
|
||||
|
||||
@ -174,13 +172,13 @@ class tagwords
|
||||
* @param boolean $link return hyperlink to taglist on words
|
||||
* @return array $ret array of tagwords
|
||||
*/
|
||||
function getRecords($tag_type='', $tag_itemid='', $returnwordsonly=FALSE, $link=TRUE)
|
||||
function getRecords($tag_type='', $tag_itemid='', $returnwordsonly=false, $link=true)
|
||||
{
|
||||
$sqlgr = new db;
|
||||
|
||||
$qry = "
|
||||
SELECT tag_word FROM #".$this->table."
|
||||
WHERE tag_type='".$this->tp->toDB($tag_type)."'
|
||||
WHERE tag_type='".$this->e107->tp->toDB($tag_type)."'
|
||||
AND tag_itemid='".intval($tag_itemid)."'
|
||||
ORDER BY tag_word ";
|
||||
|
||||
@ -196,7 +194,7 @@ class tagwords
|
||||
$arr = array();
|
||||
foreach($ret as $word)
|
||||
{
|
||||
$word = $this->tp->toHTML($word,TRUE,'no_hook, emotes_off');
|
||||
$word = $this->e107->tp->toHTML($word,true,'no_hook, emotes_off');
|
||||
$arr[] = ($link ? trim($this->createTagWordLink($word)) : $word);
|
||||
}
|
||||
return implode($this->pref['tagwords_word_seperator'], $arr);
|
||||
@ -272,9 +270,9 @@ class tagwords
|
||||
function createTagWordLink($word, $class='')
|
||||
{
|
||||
$word = trim($word);
|
||||
$qry = $this->tp->toDB($word);
|
||||
$qry = $this->e107->tp->toDB($word);
|
||||
$qry = str_replace(' ', '+', $qry);
|
||||
$word = $this->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)."'" : "");
|
||||
return "<a href='".e_PLUGIN."tagwords/tagwords.php?q=".$qry."' ".$class." title=''>".$word."</a> ";
|
||||
}
|
||||
@ -288,14 +286,12 @@ class tagwords
|
||||
*/
|
||||
function dbTagWords($tag_type='', $tag_itemid='', $tag_word='')
|
||||
{
|
||||
global $sql;
|
||||
|
||||
//prepare data
|
||||
$tag_type = $this->tp->toDB($tag_type);
|
||||
$tag_type = $this->e107->tp->toDB($tag_type);
|
||||
$tag_itemid = intval($tag_itemid);
|
||||
|
||||
//get existing word records
|
||||
$existing_array = $this->getRecords($tag_type, $tag_itemid, FALSE);
|
||||
$existing_array = $this->getRecords($tag_type, $tag_itemid, false);
|
||||
$existing = explode("\n", $existing_array);
|
||||
|
||||
//create array of new posted words
|
||||
@ -306,8 +302,8 @@ class tagwords
|
||||
foreach($delete_diff as $word)
|
||||
{
|
||||
$word = trim($word);
|
||||
$word = $this->tp->toDB($word);
|
||||
$sql->db_Delete($this->table, "tag_type='".$tag_type."' AND tag_itemid='".$tag_itemid."' AND tag_word='".$word."'");
|
||||
$word = $this->e107->tp->toDB($word);
|
||||
$this->e107->sql->db_Delete($this->table, "tag_type='".$tag_type."' AND tag_itemid='".$tag_itemid."' AND tag_word='".$word."'");
|
||||
}
|
||||
|
||||
//insert the differences (insert what has been added)
|
||||
@ -315,8 +311,13 @@ class tagwords
|
||||
foreach($insert_diff as $word)
|
||||
{
|
||||
$word = trim($word);
|
||||
$word = $this->tp->toDB($word);
|
||||
$sql->db_Insert($this->table, "'0', '".$tag_type."', '".$tag_itemid."', '".$word."' ");
|
||||
$word = $this->e107->tp->toDB($word);
|
||||
$args = array();
|
||||
$args['tag_id'] = 0;
|
||||
$args['tag_type'] = $tag_type;
|
||||
$args['tag_itemid'] = $tag_itemid;
|
||||
$args['tag_word'] = $word;
|
||||
$this->e107->sql->db_Insert($this->table, $args);
|
||||
}
|
||||
return "<br />".LAN_TAG_3;
|
||||
}
|
||||
@ -327,9 +328,8 @@ class tagwords
|
||||
* @param string $tag_itemid itemid
|
||||
*/
|
||||
function dbDelete($tag_type='', $tag_itemid='')
|
||||
{
|
||||
global $sql;
|
||||
$sql->db_Delete($this->table, "tag_type='".$tag_type."' AND tag_itemid='".$tag_itemid."' ");
|
||||
{
|
||||
$this->e107->sql->db_Delete($this->table, "tag_type='".$tag_type."' AND tag_itemid='".$tag_itemid."' ");
|
||||
}
|
||||
|
||||
/*
|
||||
@ -339,8 +339,6 @@ class tagwords
|
||||
*/
|
||||
function getAllTagWords($tagarea='')
|
||||
{
|
||||
global $sql;
|
||||
|
||||
$tag_type='';
|
||||
|
||||
$allowed = $this->getAllowedAreas();
|
||||
@ -383,13 +381,13 @@ class tagwords
|
||||
WHERE tag_word!='' ".$typeqry."
|
||||
GROUP BY tag_word HAVING COUNT(tag_word)>=".intval($this->pref['tagwords_min'])." ".$menuqry." ";
|
||||
|
||||
if($sql->db_Select_gen($qry))
|
||||
if($this->e107->sql->db_Select_gen($qry))
|
||||
{
|
||||
$ret=array();
|
||||
while($row=$sql->db_Fetch())
|
||||
while($row=$this->e107->sql->db_Fetch())
|
||||
{
|
||||
$word = trim($row['tag_word']);
|
||||
$word = $this->tp->toHTML($word,TRUE,'no_hook, emotes_off');
|
||||
$word = $this->e107->tp->toHTML($word,true,'no_hook, emotes_off');
|
||||
$ret[$word] = $row['number'];
|
||||
}
|
||||
return $ret;
|
||||
@ -504,8 +502,7 @@ class tagwords
|
||||
break;
|
||||
case 'ns':
|
||||
default:
|
||||
global $ns;
|
||||
$ns->tablerender($caption, "<div style='text-align:center'><b>".$message."</b></div>");
|
||||
$this->e107->ns->tablerender($caption, "<div style='text-align:center'><b>".$message."</b></div>");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -517,9 +514,7 @@ class tagwords
|
||||
*/
|
||||
function TagRender()
|
||||
{
|
||||
global $ns;
|
||||
|
||||
$type = FALSE;
|
||||
$type = false;
|
||||
|
||||
//decide whether to show the taglist or the tagcloud
|
||||
|
||||
@ -549,13 +544,13 @@ class tagwords
|
||||
//show the taglist or tagcloud
|
||||
if($type=='list')
|
||||
{
|
||||
$text = $this->tp->parseTemplate($this->template['cloudlist'], FALSE, $this->shortcodes);
|
||||
$ns->tablerender(LAN_TAG_17, $text);
|
||||
$text = $this->e107->tp->parseTemplate($this->template['cloudlist'], true, $this->shortcodes);
|
||||
$this->e107->ns->tablerender(LAN_TAG_17, $text);
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = $this->tp->parseTemplate($this->template['cloud'], FALSE, $this->shortcodes);
|
||||
$ns->tablerender(LAN_TAG_16, $text);
|
||||
$text = $this->e107->tp->parseTemplate($this->template['cloud'], true, $this->shortcodes);
|
||||
$this->e107->ns->tablerender(LAN_TAG_16, $text);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -568,17 +563,16 @@ class tagwords
|
||||
*/
|
||||
function getRecordsByTag($word='')
|
||||
{
|
||||
global $sql;
|
||||
$typeqry = '';
|
||||
$allowed = $this->getAllowedAreas();
|
||||
if(count($allowed)>0)
|
||||
{
|
||||
$typeqry = " AND tag_type IN ('".implode("','", $allowed)."') ";
|
||||
}
|
||||
if($sql->db_Select_gen("SELECT tag_type, tag_itemid FROM #".$this->table." WHERE tag_word REGEXP('".$this->tp->toDB($word)."') ".$typeqry." "))
|
||||
if($this->e107->sql->db_Select_gen("SELECT tag_type, tag_itemid FROM #".$this->table." WHERE tag_word REGEXP('".$this->e107->tp->toDB($word)."') ".$typeqry." "))
|
||||
{
|
||||
$ret = array();
|
||||
while($row=$sql->db_Fetch())
|
||||
while($row=$this->e107->sql->db_Fetch())
|
||||
{
|
||||
$ret[$row['tag_type']][] = $row['tag_itemid'];
|
||||
}
|
||||
@ -593,7 +587,7 @@ class tagwords
|
||||
*/
|
||||
function TagSearchResults()
|
||||
{
|
||||
global $sql, $ns, $row;
|
||||
global $row;
|
||||
|
||||
//the full search query + every single word in the query will be used to search
|
||||
$_GET['q'] = str_replace('+', ' ', $_GET['q']);
|
||||
@ -635,7 +629,7 @@ class tagwords
|
||||
|
||||
$this->num = count($records, 1) - count($records);
|
||||
|
||||
$text = $this->tp->parseTemplate($this->template['intro'], FALSE, $this->shortcodes);
|
||||
$text = $this->e107->tp->parseTemplate($this->template['intro'], true, $this->shortcodes);
|
||||
|
||||
foreach($records as $type=>$ids)
|
||||
{
|
||||
@ -646,7 +640,7 @@ class tagwords
|
||||
$this->area = $this->$ins;
|
||||
|
||||
//area (news, content, ...)
|
||||
$text .= $this->tp->parseTemplate($this->template['area'], FALSE, $this->shortcodes);
|
||||
$text .= $this->e107->tp->parseTemplate($this->template['area'], true, $this->shortcodes);
|
||||
|
||||
//records for found related tagword
|
||||
$text .= $this->template['link_start'];
|
||||
@ -656,13 +650,13 @@ class tagwords
|
||||
if(method_exists($this->area, 'getRecord'))
|
||||
{
|
||||
$this->area->getRecord($this->id);
|
||||
$text .= $this->tp->parseTemplate($this->template['link_item'], FALSE, $this->shortcodes);
|
||||
$text .= $this->e107->tp->parseTemplate($this->template['link_item'], true, $this->shortcodes);
|
||||
}
|
||||
}
|
||||
$text .= $this->template['link_end'];
|
||||
}
|
||||
}
|
||||
$ns->tablerender(LAN_TAG_1, $text);
|
||||
$this->e107->ns->tablerender(LAN_TAG_1, $text);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -673,8 +667,6 @@ class tagwords
|
||||
*/
|
||||
function TagCloud($mode='')
|
||||
{
|
||||
global $sql;
|
||||
|
||||
if($mode=='menu')
|
||||
{
|
||||
$t_start = $this->template['menu_cloud_start'];
|
||||
@ -722,7 +714,7 @@ class tagwords
|
||||
$class = ceil($min_size + (($value - $min_qty) * $step));
|
||||
$this->word = $this->createTagWordLink($key, $class);
|
||||
$this->number = $value;
|
||||
$text .= $this->tp->parseTemplate($t_item, FALSE, $this->shortcodes);
|
||||
$text .= $this->e107->tp->parseTemplate($t_item, true, $this->shortcodes);
|
||||
}
|
||||
$text .= $t_end;
|
||||
return $text;
|
||||
@ -734,8 +726,6 @@ class tagwords
|
||||
*/
|
||||
function TagCloudList()
|
||||
{
|
||||
global $sql;
|
||||
|
||||
$tags = $this->getAllTagWords();
|
||||
$tags = $this->TagSort($tags);
|
||||
if(!is_array($tags))
|
||||
@ -744,11 +734,11 @@ class tagwords
|
||||
}
|
||||
|
||||
$text = $this->template['cloudlist_start'];
|
||||
foreach ($tags as $key => $value)
|
||||
foreach($tags as $key => $value)
|
||||
{
|
||||
$this->word = $this->createTagWordLink($key);
|
||||
$this->number = $value;
|
||||
$text .= $this->tp->parseTemplate($this->template['cloudlist_item'], FALSE, $this->shortcodes);
|
||||
$text .= $this->e107->tp->parseTemplate($this->template['cloudlist_item'], true, $this->shortcodes);
|
||||
}
|
||||
$text .= $this->template['cloudlist_end'];
|
||||
return $text;
|
||||
@ -794,18 +784,16 @@ class tagwords
|
||||
*/
|
||||
function get_prefs()
|
||||
{
|
||||
global $sql, $eArrayStorage;
|
||||
|
||||
$num_rows = $sql->db_Select_gen("SELECT * FROM #core WHERE e107_name='".$this->table."' ");
|
||||
$num_rows = $this->e107->sql->db_Select_gen("SELECT * FROM #core WHERE e107_name='".$this->table."' ");
|
||||
if($num_rows == 0)
|
||||
{
|
||||
$p = $this->default_prefs();
|
||||
$tmp = $eArrayStorage->WriteArray($p);
|
||||
$sql->db_Insert("core", "'".$this->table."', '{$tmp}' ");
|
||||
$sql->db_Select_gen("SELECT * FROM #core WHERE e107_name='".$this->table."' ");
|
||||
$tmp = $this->e107->arrayStorage->WriteArray($p);
|
||||
$this->e107->sql->db_Insert("core", "'".$this->table."', '{$tmp}' ");
|
||||
$this->e107->sql->db_Select_gen("SELECT * FROM #core WHERE e107_name='".$this->table."' ");
|
||||
}
|
||||
$row = $sql->db_Fetch();
|
||||
$p = $eArrayStorage->ReadArray($row['e107_value']);
|
||||
$row = $this->e107->sql->db_Fetch();
|
||||
$p = $this->e107->arrayStorage->ReadArray($row['e107_value']);
|
||||
|
||||
//validation
|
||||
if(!array_key_exists('tagwords_activeareas', $p))
|
||||
@ -821,33 +809,31 @@ class tagwords
|
||||
*/
|
||||
function update_prefs()
|
||||
{
|
||||
global $sql, $eArrayStorage;
|
||||
|
||||
$num_rows = $sql->db_Select_gen("SELECT * FROM #core WHERE e107_name='".$this->table."' ");
|
||||
$num_rows = $this->e107->sql->db_Select_gen("SELECT * FROM #core WHERE e107_name='".$this->table."' ");
|
||||
if ($num_rows == 0)
|
||||
{
|
||||
$p = $this->default_prefs();
|
||||
$tmp = $eArrayStorage->WriteArray($p);
|
||||
$sql->db_Insert("core", "'".$this->table."', '{$tmp}' ");
|
||||
$tmp = $this->e107->arrayStorage->WriteArray($p);
|
||||
$this->e107->sql->db_Insert("core", "'".$this->table."', '{$tmp}' ");
|
||||
}
|
||||
else
|
||||
{
|
||||
$row = $sql->db_Fetch();
|
||||
$row = $this->e107->sql->db_Fetch();
|
||||
|
||||
//assign new preferences
|
||||
foreach($_POST as $k => $v)
|
||||
{
|
||||
if(preg_match("#^tagwords_#",$k))
|
||||
{
|
||||
$tagwords_pref[$k] = $this->tp->toDB($v);
|
||||
$tagwords_pref[$k] = $this->e107->tp->toDB($v);
|
||||
}
|
||||
}
|
||||
$this->pref = $tagwords_pref;
|
||||
|
||||
//create new array of preferences
|
||||
$tmp = $eArrayStorage->WriteArray($tagwords_pref);
|
||||
$tmp = $this->e107->arrayStorage->WriteArray($tagwords_pref);
|
||||
|
||||
$sql->db_Update("core", "e107_value = '{$tmp}' WHERE e107_name = '".$this->table."' ");
|
||||
$this->e107->sql->db_Update("core", "e107_value = '{$tmp}' WHERE e107_name = '".$this->table."' ");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -858,11 +844,11 @@ class tagwords
|
||||
*/
|
||||
function validate()
|
||||
{
|
||||
global $sql, $sql2;
|
||||
global $sql2;
|
||||
|
||||
if($sql->db_Select_gen("SELECT * FROM #".$this->table." GROUP BY tag_type, tag_itemid ORDER BY tag_id"))
|
||||
if($this->e107->sql->db_Select_gen("SELECT * FROM #".$this->table." GROUP BY tag_type, tag_itemid ORDER BY tag_id"))
|
||||
{
|
||||
while($row=$sql->db_Fetch())
|
||||
while($row=$this->e107->sql->db_Fetch())
|
||||
{
|
||||
if(array_key_exists($row['tag_type'], $this->mapper))
|
||||
{
|
||||
@ -882,12 +868,10 @@ class tagwords
|
||||
*/
|
||||
function tagwords_options()
|
||||
{
|
||||
global $ns;
|
||||
|
||||
$this->validate();
|
||||
|
||||
$text = $this->tp->parseTemplate($this->template['admin_options'], FALSE, $this->shortcodes);
|
||||
$ns->tablerender(LAN_TAG_OPT_1, $text);
|
||||
$text = $this->e107->tp->parseTemplate($this->template['admin_options'], true, $this->shortcodes);
|
||||
$this->e107->ns->tablerender(LAN_TAG_OPT_1, $text);
|
||||
}
|
||||
|
||||
} //end class
|
||||
|
@ -1,24 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| ©Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/tagwords_menu.php,v $
|
||||
| $Revision: 1.1 $
|
||||
| $Date: 2008-12-29 20:51:07 $
|
||||
| $Author: lisa_ $
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Tagwords Menu
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/tagwords_menu.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-01-17 22:46:37 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
global $tag;
|
||||
|
||||
$e107 = e107::getInstance();
|
||||
|
||||
require_once(e_PLUGIN."tagwords/tagwords_class.php");
|
||||
$tag = new tagwords();
|
||||
|
||||
@ -27,8 +27,8 @@ if(varsettrue($tag->pref['tagwords_class']) && !check_class($tag->pref['tagwords
|
||||
return;
|
||||
}
|
||||
|
||||
$text = $tp->parseTemplate($tag->template['menu_cloud'], FALSE, $tag->shortcodes);
|
||||
$text = $e107->tp->parseTemplate($tag->template['menu_cloud'], true, $tag->shortcodes);
|
||||
$caption = ($tag->pref['tagwords_menu_caption'] ? $tag->pref['tagwords_menu_caption'] : LAN_TAG_16);
|
||||
$ns->tablerender($caption, $text);
|
||||
$e107->ns->tablerender($caption, $text);
|
||||
|
||||
?>
|
@ -1,348 +1,408 @@
|
||||
<?php
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
$tagwords_shortcodes = $tp->e_sc->parse_scbatch(__FILE__);
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 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: 1.2 $
|
||||
* $Date: 2009-01-17 22:46:37 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
SC_BEGIN TAG_SEARCH
|
||||
global $tp, $tag;
|
||||
|
||||
$value = (isset($_GET['q']) ? $tp->toForm($_GET['q']) : '');
|
||||
switch($sc_mode)
|
||||
{
|
||||
case 'menu':
|
||||
if(varsettrue($tag->pref['tagwords_menu_view_search'])!=1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
$id = 'tagwords_searchform_menu';
|
||||
|
||||
return "
|
||||
<form id='".$id."' name='".$id."' method='get' action='".e_PLUGIN."tagwords/tagwords.php'>
|
||||
<input class='tbox' style='width:100px;' type='text' name='q' size='35' value='".$value."' maxlength='50' />
|
||||
<input class='button' type='submit' name='se' value='".LAN_TAG_SEARCH_2."' />
|
||||
</form>";
|
||||
break;
|
||||
|
||||
case 'search':
|
||||
if(varsettrue($tag->pref['tagwords_view_search'])!=1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
$id = 'tagwords_searchform';
|
||||
return "
|
||||
<form id='".$id."' name='".$id."' method='get' action='".e_PLUGIN."tagwords/tagwords.php'>
|
||||
<input class='tbox' style='width:100px;' type='text' name='q' size='35' value='".$value."' maxlength='50' />
|
||||
<input class='button' type='submit' name='s' value='".LAN_TAG_SEARCH_2."' />
|
||||
</form>";
|
||||
break;
|
||||
|
||||
default:
|
||||
if(varsettrue($tag->pref['tagwords_view_search'])!=1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
return "
|
||||
<input class='tbox' style='width:100px;' type='text' name='q' size='35' value='".$value."' maxlength='50' />
|
||||
<input class='button' type='submit' name='s' value='".LAN_TAG_SEARCH_2."' />";
|
||||
break;
|
||||
}
|
||||
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_AREA_HEADING
|
||||
global $tag;
|
||||
return varsettrue($tag->area->settings['caption']);
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_LINK
|
||||
global $tag;
|
||||
switch($sc_mode)
|
||||
{
|
||||
case 'menu':
|
||||
return "<a href='".e_PLUGIN."tagwords/tagwords.php'>".LAN_TAG_MENU_1."</a>";
|
||||
break;
|
||||
case 'home':
|
||||
return "<a href='".e_PLUGIN."tagwords/tagwords.php'>".LAN_TAG_7."</a>";
|
||||
break;
|
||||
default:
|
||||
if(method_exists($tag->area, 'getLink'))
|
||||
{
|
||||
return $tag->area->getLink($tag->id);
|
||||
}
|
||||
break;
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_CLOUD
|
||||
global $tag;
|
||||
switch($sc_mode)
|
||||
{
|
||||
case 'menu':
|
||||
return $tag->TagCloud('menu');
|
||||
break;
|
||||
case 'list':
|
||||
return $tag->TagCloudList();
|
||||
break;
|
||||
default:
|
||||
return $tag->TagCloud();
|
||||
break;
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_WORD
|
||||
global $tag, $tp;
|
||||
switch($sc_mode)
|
||||
{
|
||||
case 'result':
|
||||
return "<b>".$tag->num."</b> ".($tag->num==1 ? LAN_TAG_8 : LAN_TAG_9)." '<b>".$tp->toHTML($_GET['q'],TRUE)."</b>'";
|
||||
break;
|
||||
case 'form':
|
||||
default:
|
||||
return $tag->word;
|
||||
break;
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_NUMBER
|
||||
global $tag;
|
||||
switch($sc_mode)
|
||||
{
|
||||
case 'list':
|
||||
return $tag->number;
|
||||
break;
|
||||
case 'menu':
|
||||
if(varsettrue($tag->pref['tagwords_menu_view_freq'])==1)
|
||||
{
|
||||
return $tag->number;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if(varsettrue($tag->pref['tagwords_view_freq'])==1)
|
||||
{
|
||||
return $tag->number;
|
||||
}
|
||||
break;
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_SORT
|
||||
global $tag;
|
||||
|
||||
$sort=FALSE;
|
||||
if(varsettrue($tag->pref['tagwords_view_sort'])==1)
|
||||
{
|
||||
$s = varset($_GET['sort'],'');
|
||||
switch($s)
|
||||
{
|
||||
case 'alpha':
|
||||
$sel = 'alpha';
|
||||
break;
|
||||
case 'freq':
|
||||
$sel = 'freq';
|
||||
break;
|
||||
default:
|
||||
$sel = '';
|
||||
break;
|
||||
}
|
||||
|
||||
$text = "
|
||||
<select id='sort' name='sort' class='tbox'>
|
||||
<option value=''>".LAN_TAG_19."</option>
|
||||
<option value='alpha' ".($sel=='alpha' ? "selected='selected'" : '')." >".LAN_TAG_10."</option>
|
||||
<option value='freq' ".($sel=='freq' ? "selected='selected'" : '')." >".LAN_TAG_11."</option>
|
||||
</select>";
|
||||
return $text;
|
||||
}
|
||||
return;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_TYPE
|
||||
global $tag;
|
||||
|
||||
$type=FALSE;
|
||||
if(varsettrue($tag->pref['tagwords_view_style'])==1)
|
||||
{
|
||||
$t = varset($_GET['type'],'');
|
||||
switch($t)
|
||||
{
|
||||
case 'cloud':
|
||||
$sel = 'cloud';
|
||||
break;
|
||||
case 'list':
|
||||
$sel = 'list';
|
||||
break;
|
||||
default:
|
||||
$sel = '';
|
||||
break;
|
||||
}
|
||||
|
||||
$text = "
|
||||
<select id='type' name='type' class='tbox'>
|
||||
<option value=''>".LAN_TAG_20."</option>
|
||||
<option value='cloud' ".($sel=='cloud' ? "selected='selected'" : '')." >".LAN_TAG_13."</option>
|
||||
<option value='list' ".($sel=='list' ? "selected='selected'" : '')." >".LAN_TAG_12."</option>
|
||||
</select>";
|
||||
return $text;
|
||||
}
|
||||
return;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_AREA
|
||||
global $tag;
|
||||
if(varsettrue($tag->pref['tagwords_view_area'])==1)
|
||||
{
|
||||
$text = "
|
||||
<select id='area' name='area' class='tbox'>
|
||||
<option value='' >".LAN_TAG_15."</option>";
|
||||
foreach($tag->tagwords as $area)
|
||||
{
|
||||
if(array_key_exists($area,$tag->pref['tagwords_activeareas']))
|
||||
{
|
||||
$name = "e_tagwords_{$area}";
|
||||
$selected = (varsettrue($_GET['area'])==$area ? "selected=selected" : '');
|
||||
$text .= "<option value='".$area."' ".$selected." >".$tag->$name->settings['caption']."</option>";
|
||||
}
|
||||
}
|
||||
$text .= "
|
||||
</select>";
|
||||
return $text;
|
||||
}
|
||||
return;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_BUTTON
|
||||
return "<input class='button' type='submit' name='so' value='".LAN_TAG_SEARCH_3."' />";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_OPTIONS
|
||||
global $tp, $tag;
|
||||
if( varsettrue($tag->pref['tagwords_view_search'])==1 || varsettrue($tag->pref['tagwords_view_sort'])==1 || varsettrue($tag->pref['tagwords_view_style'])==1 || varsettrue($tag->pref['tagwords_view_area'])==1 )
|
||||
{
|
||||
return $tp->parseTemplate($tag->template['options'], FALSE, $tag->shortcodes);
|
||||
}
|
||||
SC_END
|
||||
|
||||
//##### ADMIN OPTIONS -------------------------
|
||||
|
||||
SC_BEGIN TAG_OPT_MIN
|
||||
global $tag;
|
||||
$id = ($sc_mode=='menu' ? 'tagwords_menu_min' : 'tagwords_min');
|
||||
return "<input class='tbox' type='text' id='".$id."' name='".$id."' value='".$tag->pref[$id]."' size='3' maxlength='3' />";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_OPT_CLASS
|
||||
global $tag;
|
||||
$id = 'tagwords_class';
|
||||
return r_userclass($id,$tag->pref[$id],"","admin,public,guest,nobody,member,classes");
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_OPT_DEFAULT_SORT
|
||||
global $tag;
|
||||
$id = ($sc_mode=='menu' ? 'tagwords_menu_default_sort' : 'tagwords_default_sort');
|
||||
return "<label><input type='radio' name='".$id."' value='1' ".($tag->pref[$id] ? "checked='checked'" : "")." /> ".LAN_TAG_OPT_5."</label>
|
||||
<label><input type='radio' name='".$id."' value='0' ".($tag->pref[$id] ? "" : "checked='checked'")." /> ".LAN_TAG_OPT_6."</label>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_OPT_DEFAULT_STYLE
|
||||
global $tag;
|
||||
$id = 'tagwords_default_style';
|
||||
return "<label><input type='radio' name='".$id."' value='1' ".($tag->pref[$id] ? "checked='checked'" : "")." /> ".LAN_TAG_OPT_8."</label>
|
||||
<label><input type='radio' name='".$id."' value='0' ".($tag->pref[$id] ? "" : "checked='checked'")." /> ".LAN_TAG_OPT_9."</label>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_OPT_VIEW_SORT
|
||||
global $tag;
|
||||
$id = 'tagwords_view_sort';
|
||||
$sel = ($tag->pref[$id] ? "checked='checked'" : "");
|
||||
return "
|
||||
<label for='".$id."'>
|
||||
<input type='checkbox' name='".$id."' id='".$id."' value='1' ".$sel." /> ".LAN_TAG_OPT_12."
|
||||
</label>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_OPT_VIEW_STYLE
|
||||
global $tag;
|
||||
$id = 'tagwords_view_style';
|
||||
$sel = ($tag->pref[$id] ? "checked='checked'" : "");
|
||||
return "
|
||||
<label for='".$id."'>
|
||||
<input type='checkbox' name='".$id."' id='".$id."' value='1' ".$sel." /> ".LAN_TAG_OPT_13."
|
||||
</label>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_OPT_VIEW_AREA
|
||||
global $tag;
|
||||
$id = 'tagwords_view_area';
|
||||
$sel = ($tag->pref[$id] ? "checked='checked'" : "");
|
||||
return "
|
||||
<label for='".$id."'>
|
||||
<input type='checkbox' name='".$id."' id='".$id."' value='1' ".$sel." /> ".LAN_TAG_OPT_14."
|
||||
</label>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_OPT_VIEW_SEARCH
|
||||
global $tag;
|
||||
$id = ($sc_mode=='menu' ? 'tagwords_menu_view_search' : 'tagwords_view_search');
|
||||
$sel = ($tag->pref[$id] ? "checked='checked'" : "");
|
||||
return "
|
||||
<label for='".$id."'>
|
||||
<input type='checkbox' name='".$id."' id='".$id."' value='1' ".$sel." /> ".LAN_TAG_OPT_19."
|
||||
</label>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_OPT_VIEW_FREQ
|
||||
global $tag;
|
||||
if($sc_mode=='menu')
|
||||
{
|
||||
$id = 'tagwords_menu_view_freq';
|
||||
}
|
||||
else
|
||||
{
|
||||
$id = 'tagwords_view_freq';
|
||||
}
|
||||
$sel = ($tag->pref[$id] ? "checked='checked'" : "");
|
||||
return "
|
||||
<label for='".$id."'>
|
||||
<input type='checkbox' name='".$id."' id='".$id."' value='1' ".$sel." /> ".LAN_TAG_OPT_20."
|
||||
</label>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_OPT_CAPTION
|
||||
global $tp, $tag;
|
||||
$id = 'tagwords_menu_caption';
|
||||
return "<input class='tbox' type='text' id='".$id."' name='".$id."' value='".$tp->toForm($tag->pref[$id],"","defs")."' size='30' maxlength='100' />";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_OPT_SEPERATOR
|
||||
global $tp, $tag;
|
||||
$id = 'tagwords_word_seperator';
|
||||
return "<input class='tbox' type='text' id='".$id."' name='".$id."' value='".$tp->toForm($tag->pref[$id])."' size='3' maxlength='10' />";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_OPT_ACTIVEAREAS
|
||||
global $tag;
|
||||
$id = 'tagwords_activeareas';
|
||||
$text = "";
|
||||
foreach($tag->tagwords as $area)
|
||||
{
|
||||
$sel = (array_key_exists($area,$tag->pref[$id]) ? "checked='checked'" : '');
|
||||
$name = "e_tagwords_{$area}";
|
||||
|
||||
$text .= "
|
||||
<label for='".$id."[".$area."]'>
|
||||
<input type='checkbox' name='".$id."[".$area."]' id='".$id."[".$area."]' value='1' ".$sel." />
|
||||
".$tag->$name->settings['caption']."
|
||||
</label><br />";
|
||||
|
||||
}
|
||||
return $text;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TAG_OPT_BUTTON
|
||||
return "<input class='button' type='submit' name='updatesettings' value='".LAN_UPDATE."' />";
|
||||
SC_END
|
||||
|
||||
/*
|
||||
$codes = array(
|
||||
'tag_search', 'tag_area_heading', 'tag_link', 'tag_cloud', 'tag_word', 'tag_number', 'tag_sort', 'tag_type', 'tag_area', 'tag_button', 'tag_options', 'tag_opt_min', 'tag_opt_class', 'tag_opt_default_sort', 'tag_opt_default_style', 'tag_opt_view_sort', 'tag_opt_view_style', 'tag_opt_view_area', 'tag_opt_view_search', 'tag_opt_view_freq', 'tag_opt_caption', 'tag_opt_seperator', 'tag_opt_activeareas', 'tag_opt_button'
|
||||
);
|
||||
*/
|
||||
|
||||
$codes = array();
|
||||
$tmp = get_class_methods('tagwords_shortcodes');
|
||||
foreach($tmp as $c)
|
||||
{
|
||||
if(strpos($c, 'get_') === 0)
|
||||
{
|
||||
$codes[] = substr($c, 4);
|
||||
}
|
||||
}
|
||||
register_shortcode('tagwords_shortcodes', $codes);
|
||||
|
||||
initShortcodeClass('tagwords_shortcodes');
|
||||
|
||||
class tagwords_shortcodes
|
||||
{
|
||||
var $e107;
|
||||
|
||||
function tagwords_shortcodes()
|
||||
{
|
||||
$this->e107 = e107::getInstance();
|
||||
}
|
||||
|
||||
function get_tag_search($parm, $sc_mode)
|
||||
{
|
||||
global $tag;
|
||||
|
||||
$value = (isset($_GET['q']) ? $this->e107->tp->toForm($_GET['q']) : '');
|
||||
switch($sc_mode)
|
||||
{
|
||||
case 'menu':
|
||||
if(varsettrue($tag->pref['tagwords_menu_view_search'])!=1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
$id = 'tagwords_searchform_menu';
|
||||
|
||||
return "
|
||||
<form id='".$id."' name='".$id."' method='get' action='".e_PLUGIN."tagwords/tagwords.php'>
|
||||
<input class='tbox' style='width:100px;' type='text' name='q' size='35' value='".$value."' maxlength='50' />
|
||||
<input class='button' type='submit' name='se' value='".LAN_TAG_SEARCH_2."' />
|
||||
</form>";
|
||||
break;
|
||||
|
||||
case 'search':
|
||||
if(varsettrue($tag->pref['tagwords_view_search'])!=1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
$id = 'tagwords_searchform';
|
||||
return "
|
||||
<form id='".$id."' name='".$id."' method='get' action='".e_PLUGIN."tagwords/tagwords.php'>
|
||||
<input class='tbox' style='width:100px;' type='text' name='q' size='35' value='".$value."' maxlength='50' />
|
||||
<input class='button' type='submit' name='s' value='".LAN_TAG_SEARCH_2."' />
|
||||
</form>";
|
||||
break;
|
||||
|
||||
default:
|
||||
if(varsettrue($tag->pref['tagwords_view_search'])!=1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
return "
|
||||
<input class='tbox' style='width:100px;' type='text' name='q' size='35' value='".$value."' maxlength='50' />
|
||||
<input class='button' type='submit' name='s' value='".LAN_TAG_SEARCH_2."' />";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function get_tag_area_heading()
|
||||
{
|
||||
global $tag;
|
||||
return varsettrue($tag->area->settings['caption']);
|
||||
}
|
||||
|
||||
function get_tag_link($parm, $sc_mode)
|
||||
{
|
||||
global $tag;
|
||||
switch($sc_mode)
|
||||
{
|
||||
case 'menu':
|
||||
return "<a href='".e_PLUGIN."tagwords/tagwords.php'>".LAN_TAG_MENU_1."</a>";
|
||||
break;
|
||||
case 'home':
|
||||
return "<a href='".e_PLUGIN."tagwords/tagwords.php'>".LAN_TAG_7."</a>";
|
||||
break;
|
||||
default:
|
||||
if(method_exists($tag->area, 'getLink'))
|
||||
{
|
||||
return $tag->area->getLink($tag->id);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function get_tag_cloud($parm, $sc_mode)
|
||||
{
|
||||
global $tag;
|
||||
switch($sc_mode)
|
||||
{
|
||||
case 'menu':
|
||||
return $tag->TagCloud('menu');
|
||||
break;
|
||||
case 'list':
|
||||
return $tag->TagCloudList();
|
||||
break;
|
||||
default:
|
||||
return $tag->TagCloud();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function get_tag_word($parm, $sc_mode)
|
||||
{
|
||||
global $tag;
|
||||
switch($sc_mode)
|
||||
{
|
||||
case 'result':
|
||||
return "<b>".$tag->num."</b> ".($tag->num==1 ? LAN_TAG_8 : LAN_TAG_9)." '<b>".$this->e107->tp->toHTML($_GET['q'],true)."</b>'";
|
||||
break;
|
||||
case 'form':
|
||||
default:
|
||||
return $tag->word;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function get_tag_number($parm, $sc_mode)
|
||||
{
|
||||
global $tag;
|
||||
switch($sc_mode)
|
||||
{
|
||||
case 'list':
|
||||
return $tag->number;
|
||||
break;
|
||||
case 'menu':
|
||||
if(varsettrue($tag->pref['tagwords_menu_view_freq'])==1)
|
||||
{
|
||||
return $tag->number;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if(varsettrue($tag->pref['tagwords_view_freq'])==1)
|
||||
{
|
||||
return $tag->number;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function get_tag_sort()
|
||||
{
|
||||
global $tag;
|
||||
|
||||
if(varsettrue($tag->pref['tagwords_view_sort'])==1)
|
||||
{
|
||||
$s = varset($_GET['sort'],'');
|
||||
switch($s)
|
||||
{
|
||||
case 'alpha':
|
||||
$sel = 'alpha';
|
||||
break;
|
||||
case 'freq':
|
||||
$sel = 'freq';
|
||||
break;
|
||||
default:
|
||||
$sel = '';
|
||||
break;
|
||||
}
|
||||
|
||||
$text = "
|
||||
<select id='sort' name='sort' class='tbox'>
|
||||
<option value=''>".LAN_TAG_19."</option>
|
||||
<option value='alpha' ".($sel=='alpha' ? "selected='selected'" : '')." >".LAN_TAG_10."</option>
|
||||
<option value='freq' ".($sel=='freq' ? "selected='selected'" : '')." >".LAN_TAG_11."</option>
|
||||
</select>";
|
||||
return $text;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
function get_tag_type()
|
||||
{
|
||||
global $tag;
|
||||
|
||||
if(varsettrue($tag->pref['tagwords_view_style'])==1)
|
||||
{
|
||||
$t = varset($_GET['type'],'');
|
||||
switch($t)
|
||||
{
|
||||
case 'cloud':
|
||||
$sel = 'cloud';
|
||||
break;
|
||||
case 'list':
|
||||
$sel = 'list';
|
||||
break;
|
||||
default:
|
||||
$sel = '';
|
||||
break;
|
||||
}
|
||||
|
||||
$text = "
|
||||
<select id='type' name='type' class='tbox'>
|
||||
<option value=''>".LAN_TAG_20."</option>
|
||||
<option value='cloud' ".($sel=='cloud' ? "selected='selected'" : '')." >".LAN_TAG_13."</option>
|
||||
<option value='list' ".($sel=='list' ? "selected='selected'" : '')." >".LAN_TAG_12."</option>
|
||||
</select>";
|
||||
return $text;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
function get_tag_area()
|
||||
{
|
||||
global $tag;
|
||||
if(varsettrue($tag->pref['tagwords_view_area'])==1)
|
||||
{
|
||||
$text = "
|
||||
<select id='area' name='area' class='tbox'>
|
||||
<option value='' >".LAN_TAG_15."</option>";
|
||||
foreach($tag->tagwords as $area)
|
||||
{
|
||||
if(array_key_exists($area,$tag->pref['tagwords_activeareas']))
|
||||
{
|
||||
$name = "e_tagwords_{$area}";
|
||||
$selected = (varsettrue($_GET['area'])==$area ? "selected=selected" : '');
|
||||
$text .= "<option value='".$area."' ".$selected." >".$tag->$name->settings['caption']."</option>";
|
||||
}
|
||||
}
|
||||
$text .= "
|
||||
</select>";
|
||||
return $text;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
function get_tag_button()
|
||||
{
|
||||
return "<input class='button' type='submit' name='so' value='".LAN_TAG_SEARCH_3."' />";
|
||||
}
|
||||
|
||||
function get_tag_options()
|
||||
{
|
||||
global $tag;
|
||||
if( varsettrue($tag->pref['tagwords_view_search'])==1 || varsettrue($tag->pref['tagwords_view_sort'])==1 || varsettrue($tag->pref['tagwords_view_style'])==1 || varsettrue($tag->pref['tagwords_view_area'])==1 )
|
||||
{
|
||||
return $this->e107->tp->parseTemplate($tag->template['options'], true, $tag->shortcodes);
|
||||
}
|
||||
}
|
||||
|
||||
//##### ADMIN OPTIONS -------------------------
|
||||
|
||||
function get_tag_opt_min($parm, $sc_mode)
|
||||
{
|
||||
global $tag;
|
||||
$id = ($sc_mode=='menu' ? 'tagwords_menu_min' : 'tagwords_min');
|
||||
return "<input class='tbox' type='text' id='".$id."' name='".$id."' value='".$tag->pref[$id]."' size='3' maxlength='3' />";
|
||||
}
|
||||
|
||||
function get_tag_opt_class()
|
||||
{
|
||||
global $tag;
|
||||
$id = 'tagwords_class';
|
||||
return r_userclass($id,$tag->pref[$id],"","admin,public,guest,nobody,member,classes");
|
||||
}
|
||||
|
||||
function get_tag_opt_default_sort($parm, $sc_mode)
|
||||
{
|
||||
global $tag;
|
||||
$id = ($sc_mode=='menu' ? 'tagwords_menu_default_sort' : 'tagwords_default_sort');
|
||||
return "<label><input type='radio' name='".$id."' value='1' ".($tag->pref[$id] ? "checked='checked'" : "")." /> ".LAN_TAG_OPT_5."</label>
|
||||
<label><input type='radio' name='".$id."' value='0' ".($tag->pref[$id] ? "" : "checked='checked'")." /> ".LAN_TAG_OPT_6."</label>";
|
||||
}
|
||||
|
||||
function get_tag_opt_default_style()
|
||||
{
|
||||
global $tag;
|
||||
$id = 'tagwords_default_style';
|
||||
return "<label><input type='radio' name='".$id."' value='1' ".($tag->pref[$id] ? "checked='checked'" : "")." /> ".LAN_TAG_OPT_8."</label>
|
||||
<label><input type='radio' name='".$id."' value='0' ".($tag->pref[$id] ? "" : "checked='checked'")." /> ".LAN_TAG_OPT_9."</label>";
|
||||
}
|
||||
|
||||
function get_tag_opt_view_sort()
|
||||
{
|
||||
global $tag;
|
||||
$id = 'tagwords_view_sort';
|
||||
$sel = ($tag->pref[$id] ? "checked='checked'" : "");
|
||||
return "
|
||||
<label for='".$id."'>
|
||||
<input type='checkbox' name='".$id."' id='".$id."' value='1' ".$sel." /> ".LAN_TAG_OPT_12."
|
||||
</label>";
|
||||
}
|
||||
|
||||
function get_tag_opt_view_style()
|
||||
{
|
||||
global $tag;
|
||||
$id = 'tagwords_view_style';
|
||||
$sel = ($tag->pref[$id] ? "checked='checked'" : "");
|
||||
return "
|
||||
<label for='".$id."'>
|
||||
<input type='checkbox' name='".$id."' id='".$id."' value='1' ".$sel." /> ".LAN_TAG_OPT_13."
|
||||
</label>";
|
||||
}
|
||||
|
||||
function get_tag_opt_view_area()
|
||||
{
|
||||
global $tag;
|
||||
$id = 'tagwords_view_area';
|
||||
$sel = ($tag->pref[$id] ? "checked='checked'" : "");
|
||||
return "
|
||||
<label for='".$id."'>
|
||||
<input type='checkbox' name='".$id."' id='".$id."' value='1' ".$sel." /> ".LAN_TAG_OPT_14."
|
||||
</label>";
|
||||
}
|
||||
|
||||
function get_tag_opt_view_search($parm, $sc_mode)
|
||||
{
|
||||
global $tag;
|
||||
$id = ($sc_mode=='menu' ? 'tagwords_menu_view_search' : 'tagwords_view_search');
|
||||
$sel = ($tag->pref[$id] ? "checked='checked'" : "");
|
||||
return "
|
||||
<label for='".$id."'>
|
||||
<input type='checkbox' name='".$id."' id='".$id."' value='1' ".$sel." /> ".LAN_TAG_OPT_19."
|
||||
</label>";
|
||||
}
|
||||
|
||||
function get_tag_opt_view_freq($parm, $sc_mode)
|
||||
{
|
||||
global $tag;
|
||||
if($sc_mode=='menu')
|
||||
{
|
||||
$id = 'tagwords_menu_view_freq';
|
||||
}
|
||||
else
|
||||
{
|
||||
$id = 'tagwords_view_freq';
|
||||
}
|
||||
$sel = ($tag->pref[$id] ? "checked='checked'" : "");
|
||||
return "
|
||||
<label for='".$id."'>
|
||||
<input type='checkbox' name='".$id."' id='".$id."' value='1' ".$sel." /> ".LAN_TAG_OPT_20."
|
||||
</label>";
|
||||
}
|
||||
|
||||
function get_tag_opt_caption()
|
||||
{
|
||||
global $tag;
|
||||
$id = 'tagwords_menu_caption';
|
||||
return "<input class='tbox' type='text' id='".$id."' name='".$id."' value='".$this->e107->tp->toForm($tag->pref[$id],"","defs")."' size='30' maxlength='100' />";
|
||||
}
|
||||
|
||||
function get_tag_opt_seperator()
|
||||
{
|
||||
global $tag;
|
||||
$id = 'tagwords_word_seperator';
|
||||
return "<input class='tbox' type='text' id='".$id."' name='".$id."' value='".$this->e107->tp->toForm($tag->pref[$id])."' size='3' maxlength='10' />";
|
||||
}
|
||||
|
||||
function get_tag_opt_activeareas()
|
||||
{
|
||||
global $tag;
|
||||
$id = 'tagwords_activeareas';
|
||||
$text = "";
|
||||
foreach($tag->tagwords as $area)
|
||||
{
|
||||
$sel = (array_key_exists($area,$tag->pref[$id]) ? "checked='checked'" : '');
|
||||
$name = "e_tagwords_{$area}";
|
||||
|
||||
$text .= "
|
||||
<label for='".$id."[".$area."]'>
|
||||
<input type='checkbox' name='".$id."[".$area."]' id='".$id."[".$area."]' value='1' ".$sel." />
|
||||
".$tag->$name->settings['caption']."
|
||||
</label><br />";
|
||||
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
||||
function get_tag_opt_button()
|
||||
{
|
||||
return "<input class='button' type='submit' name='updatesettings' value='".LAN_UPDATE."' />";
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
@ -1,20 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| ©Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/tagwords_template.php,v $
|
||||
| $Revision: 1.1 $
|
||||
| $Date: 2008-12-29 20:51:07 $
|
||||
| $Author: lisa_ $
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Tagwords Template
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/tagwords_template.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-01-17 22:46:37 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
@ -200,17 +198,5 @@ $TEMPLATE_TAGWORDS['admin_options'] = "
|
||||
</tr>
|
||||
</table>
|
||||
</form>";
|
||||
/*
|
||||
<tr>
|
||||
<td class='forumheader3'>".LAN_TAG_OPT_26."</td>
|
||||
<td class='forumheader3'>
|
||||
{TAG_OPT_VIEW_SORT} ".LAN_TAG_OPT_12."<br />
|
||||
{TAG_OPT_VIEW_STYLE} ".LAN_TAG_OPT_13."<br />
|
||||
{TAG_OPT_VIEW_AREA} ".LAN_TAG_OPT_14."<br />
|
||||
{TAG_OPT_VIEW_SEARCH} ".LAN_TAG_OPT_19."<br />
|
||||
{TAG_OPT_VIEW_FREQ} ".LAN_TAG_OPT_20."<br />
|
||||
</td>
|
||||
</tr>
|
||||
*/
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user