1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-26 01:11:28 +02:00

Tagwords e_url profile implemented (SEF URLs),minor fixes, news items (rewrites) linked proper now

This commit is contained in:
secretr
2009-09-25 20:13:12 +00:00
parent 0ff4c515f3
commit b6590e63d4
9 changed files with 97 additions and 30 deletions

View File

@@ -9,9 +9,9 @@
* 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_ $
* $Revision: 1.3 $
* $Date: 2009-09-25 20:13:12 $
* $Author: secretr $
*
*/
@@ -19,9 +19,9 @@ if (!defined('e107_INIT')) { exit; }
if (is_readable(THEME."tagwords_css.php"))
{
$src = THEME."tagwords_css.php";
$src = THEME_ABS."tagwords_css.php";
} else {
$src = e_PLUGIN."tagwords/tagwords_css.php";
$src = e_PLUGIN_ABS."tagwords/tagwords_css.php";
}
echo "<link rel='stylesheet' href='".$src."' type='text/css' />\n";

View File

@@ -0,0 +1,33 @@
<?php
/*
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: main.php,v 1.1 2009-09-25 20:13:12 secretr Exp $
*
* eURL configuration script
*/
if (!defined('e107_INIT')) { exit; }
require_once(e_HANDLER.'news_class.php');
define('TAGWORDS_REWRITE', true);
function url_tagwords_main($parms = array())
{
//$base = e_HTTP.$sefbase.$parms['action'];
$base = e_HTTP.(e107::getPref('tagwords_sefbase') ? e107::getPref('tagwords_sefbase').'/' : 'tagwords/');
return $base.urlencode(varset($parms['q']));
}
function parse_url_tagwords_main($request)
{
$request = urldecode($request);
parse_str($request, $request);
if(isset($request['q']))
{
return array('q' => $request['q']);
}
return $request;
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<urlprofile>
<title>{LAN_EURL_MODREWR_TITLE}</title>
<description>{LAN_EURL_MODREWR_DESCR}</description>
</urlprofile>

View File

@@ -0,0 +1,24 @@
<?php
/*
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: main.php,v 1.1 2009-09-25 20:13:12 secretr Exp $
*
* eURL configuration script
*/
if (!defined('e107_INIT')) { exit; }
define('TAGWORDS_REWRITE', false);
function url_tagwords_main($parms = array())
{
$base = e_PLUGIN_ABS.'tagwords/tagwords.php';
if(isset($parms['q'])) return $base.'?q='.urlencode(varset($parms['q']));
return $base;
}
function parse_url_tagwords_main($request)
{
parse_str($request, $parsed);
return $parsed;
}

View File

@@ -22,16 +22,18 @@ class e_tagwords_news
{
$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']);
return "<a href='".$url."'>".$this->e107->tp->toHTML($this->row['news_title'], TRUE, '')."</a>";
}
function getRecord($id)
{
$this->row = '';
$qry = "SELECT n.*
//FIXME - only if news mod rewrite is on
$qry = "SELECT n.*, nr.*
FROM #news as n
LEFT JOIN #news_rewrite AS nr ON n.news_id=nr.news_rewrite_source AND nr.news_rewrite_type=1
WHERE n.news_id='{$id}'
AND n.news_start < ".time()."
AND (n.news_end=0 || n.news_end>".time().")

View File

@@ -9,15 +9,17 @@
* 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_ $
* $Revision: 1.3 $
* $Date: 2009-09-25 20:13:12 $
* $Author: secretr $
*
*/
require_once('../../class2.php');
if (!defined('e107_INIT')) { exit; }
$_GET = e107::getUrl()->parseRequest('tagwords', 'main', e_QUERY);
require_once(HEADERF);
require_once(e_PLUGIN."tagwords/tagwords_class.php");
@@ -25,7 +27,7 @@ $tag = new tagwords();
if(varsettrue($tag->pref['tagwords_class']) && !check_class($tag->pref['tagwords_class']) )
{
header("location:".e_BASE); exit;
header("location:".SITEURL); exit;
}
if(varsettrue($_GET['q']))

View File

@@ -9,9 +9,9 @@
* Tagwords Class
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/tagwords_class.php,v $
* $Revision: 1.5 $
* $Date: 2009-05-04 13:39:37 $
* $Author: bugrain $
* $Revision: 1.6 $
* $Date: 2009-09-25 20:13:12 $
* $Author: secretr $
*
*/
@@ -270,11 +270,12 @@ class tagwords
function createTagWordLink($word, $class='')
{
$word = trim($word);
$qry = $this->e107->tp->toDB($word);
$qry = str_replace(' ', '+', $qry);
/*$qry = $this->e107->tp->toDB($word);
$qry = str_replace(' ', '+', $qry);*/
$url = e107::getUrl()->createTagwords('q='.$word);
$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>";
return "<a href='".$url."' ".$class." title=''>".$word."</a>";
}
/*

View File

@@ -9,9 +9,9 @@
* Tagwords Shortcodes
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/tagwords_shortcodes.php,v $
* $Revision: 1.6 $
* $Date: 2009-07-21 10:21:20 $
* $Author: marj_nl_fr $
* $Revision: 1.7 $
* $Date: 2009-09-25 20:13:12 $
* $Author: secretr $
*
*/
if (!defined('e107_INIT')) { exit; }
@@ -61,7 +61,7 @@ class tagwords_shortcodes
$id = 'tagwords_searchform_menu';
return "
<form id='".$id."' method='get' action='".e_PLUGIN."tagwords/tagwords.php'>
<form id='".$id."' method='get' action='".e_PLUGIN_ABS."tagwords/tagwords.php'>
<div>
<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."' />
@@ -76,7 +76,7 @@ class tagwords_shortcodes
}
$id = 'tagwords_searchform';
return "
<form id='".$id."' method='get' action='".e_PLUGIN."tagwords/tagwords.php'>
<form id='".$id."' method='get' action='".e_PLUGIN_ABS."tagwords/tagwords.php'>
<div>
<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."' />
@@ -108,10 +108,10 @@ class tagwords_shortcodes
switch($sc_mode)
{
case 'menu':
return "<a href='".e_PLUGIN."tagwords/tagwords.php'>".LAN_TAG_MENU_1."</a>";
return "<a href='".e107::getUrl()->createTagwords()."'>".LAN_TAG_MENU_1."</a>";
break;
case 'home':
return "<a href='".e_PLUGIN."tagwords/tagwords.php'>".LAN_TAG_7."</a>";
return "<a href='".e107::getUrl()->createTagwords()."'>".LAN_TAG_7."</a>";
break;
default:
if(method_exists($tag->area, 'getLink'))

View File

@@ -9,9 +9,9 @@
* Tagwords Template
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/tagwords/tagwords_template.php,v $
* $Revision: 1.4 $
* $Date: 2009-07-21 08:27:23 $
* $Author: e107coders $
* $Revision: 1.5 $
* $Date: 2009-09-25 20:13:12 $
* $Author: secretr $
*
*/
@@ -54,10 +54,10 @@ $TEMPLATE_TAGWORDS['link_end'] = "</ul></div>";
//##### options --------------------------------------------------
$TEMPLATE_TAGWORDS['options'] = "
<form id='dataform' name='dataform' method='get' action='".e_PLUGIN."tagwords/tagwords.php'>
<form id='plugin-tagwords-form' method='get' action='".e_PLUGIN_ABS."tagwords/tagwords.php'>
{TAG_SEARCH}
</form>
<form id='dataform' name='dataform' method='get' action='".e_PLUGIN."tagwords/tagwords.php'>
<form id='dataform' name='dataform' method='get' action='".e_PLUGIN_ABS."tagwords/tagwords.php'>
<div style='line-height:150%; padding-bottom:10px;'>
{TAG_TYPE} {TAG_SORT} {TAG_AREA} {TAG_BUTTON}
</div>