mirror of
https://github.com/e107inc/e107.git
synced 2025-06-08 20:21:13 +02:00
News eURL mod rewrite profile - ready for test
This commit is contained in:
parent
e37dfcb1dc
commit
926e754a84
@ -9,7 +9,7 @@ RewriteRule ^news/?$ news.php
|
|||||||
#item, default, cat actions
|
#item, default, cat actions
|
||||||
RewriteRule ^news/([a-z]+)-([0-9]+)-([0-9]+)(\.html)?$ news.php?$1.$2.$3 [L]
|
RewriteRule ^news/([a-z]+)-([0-9]+)-([0-9]+)(\.html)?$ news.php?$1.$2.$3 [L]
|
||||||
#extend, cat, list actions
|
#extend, cat, list actions
|
||||||
RewriteRule ^news/([a-z]+)-([0-9]+)(\.html)?$ news.php?.$1.$2 [L]
|
RewriteRule ^news/([a-z]+)-([0-9]+)(\.html)?$ news.php?$1.$2 [L]
|
||||||
|
|
||||||
#ErrorDocument 400 /error.php?400
|
#ErrorDocument 400 /error.php?400
|
||||||
#ErrorDocument 401 /error.php?401
|
#ErrorDocument 401 /error.php?401
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||||
|
* $Id: main.php,v 1.2 2008-12-03 12:38:08 secretr Exp $
|
||||||
|
*
|
||||||
|
* eURL configuration script
|
||||||
|
*/
|
||||||
function url_news_main($parms)
|
function url_news_main($parms)
|
||||||
{
|
{
|
||||||
$base = e_HTTP.'news/'.$parms['action'];
|
$base = e_HTTP.'news/'.$parms['action'];
|
||||||
@ -15,7 +20,7 @@ function url_news_main($parms)
|
|||||||
return $base.'-'.varsettrue($parms['value'],'0').'.html';
|
return $base.'-'.varsettrue($parms['value'],'0').'.html';
|
||||||
case 'item':
|
case 'item':
|
||||||
case 'default':
|
case 'default':
|
||||||
return $base."-{$parms['value1']}-{$parms['value2']}.html";
|
return $base."-{$parms['value1']}-".varset($parms['value2'], '0').".html";
|
||||||
case 'nextprev':
|
case 'nextprev':
|
||||||
return e_HTTP."news/{$parms['to_action']}-{$parms['subaction']}-[FROM].html";
|
return e_HTTP."news/{$parms['to_action']}-{$parms['subaction']}-[FROM].html";
|
||||||
|
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||||
|
* $Id: main.php,v 1.3 2008-12-03 12:38:07 secretr Exp $
|
||||||
|
*
|
||||||
|
* eURL configuration script
|
||||||
|
*/
|
||||||
function url_news_main($parms)
|
function url_news_main($parms)
|
||||||
{
|
{
|
||||||
$base = e_HTTP.'news.php?'.$parms['action'];
|
$base = e_HTTP.'news.php?'.$parms['action'];
|
||||||
@ -15,7 +20,7 @@ function url_news_main($parms)
|
|||||||
return $base.'.'.varsettrue($parms['value'],'0');
|
return $base.'.'.varsettrue($parms['value'],'0');
|
||||||
case 'item':
|
case 'item':
|
||||||
case 'default':
|
case 'default':
|
||||||
return $base.".{$parms['value1']}.{$parms['value2']}";
|
return $base.".{$parms['value1']}.".varset($parms['value2'], '0');
|
||||||
case 'nextprev':
|
case 'nextprev':
|
||||||
return e_HTTP."news.php?{$parms['to_action']}.{$parms['subaction']}.[FROM]";
|
return e_HTTP."news.php?{$parms['to_action']}.{$parms['subaction']}.[FROM]";
|
||||||
|
|
||||||
|
@ -1,17 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* e107 website system
|
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||||
|
* $Id: news_shortcodes.php,v 1.14 2008-12-03 12:38:07 secretr Exp $
|
||||||
*
|
*
|
||||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
* News shortcode batch
|
||||||
* Released under the terms and conditions of the
|
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
||||||
*
|
|
||||||
* News Shortcode Batch
|
|
||||||
*
|
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/news_shortcodes.php,v $
|
|
||||||
* $Revision: 1.13 $
|
|
||||||
* $Date: 2008-12-02 23:44:19 $
|
|
||||||
* $Author: secretr $
|
|
||||||
*/
|
*/
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
include_once(e_HANDLER.'shortcode_handler.php');
|
include_once(e_HANDLER.'shortcode_handler.php');
|
||||||
@ -259,7 +251,7 @@ SC_BEGIN NEWSIMAGE
|
|||||||
global $e107;
|
global $e107;
|
||||||
$news_item = getcachedvars('current_news_item');
|
$news_item = getcachedvars('current_news_item');
|
||||||
$param = getcachedvars('current_news_param');
|
$param = getcachedvars('current_news_param');
|
||||||
return (isset($news_item['news_thumbnail']) && $news_item['news_thumbnail']) ? "<a href='".$e107->url->getUrl('core:news', 'main', "action=item&value1={$news_item['news_id']}&value1={$news_item['news_category']}")."'><img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$news_item['news_thumbnail']."' alt='' style='".$param['thumbnail']."' /></a>" : "";
|
return (isset($news_item['news_thumbnail']) && $news_item['news_thumbnail']) ? "<a href='".$e107->url->getUrl('core:news', 'main', "action=item&value1={$news_item['news_id']}&value2={$news_item['news_category']}")."'><img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$news_item['news_thumbnail']."' alt='' style='".$param['thumbnail']."' /></a>" : "";
|
||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
SC_BEGIN STICKY_ICON
|
SC_BEGIN STICKY_ICON
|
||||||
@ -282,7 +274,7 @@ $param = getcachedvars('current_news_param');
|
|||||||
$category_icon = $e107->tp->parseTemplate('{NEWSHEADER}', FALSE, $news_shortcodes);
|
$category_icon = $e107->tp->parseTemplate('{NEWSHEADER}', FALSE, $news_shortcodes);
|
||||||
if (!$category_icon) return '';
|
if (!$category_icon) return '';
|
||||||
if($param['caticon'] == ""){$param['caticon'] = "border:0px";}
|
if($param['caticon'] == ""){$param['caticon'] = "border:0px";}
|
||||||
return "<a href='".$e107->url->getUrl('core:news', 'main', "action=cat&value{$news_item['news_category']}")."'><img style='".$param['caticon']."' src='".$category_icon."' alt='' /></a>";
|
return "<a href='".$e107->url->getUrl('core:news', 'main', "action=cat&value={$news_item['news_category']}")."'><img style='".$param['caticon']."' src='".$category_icon."' alt='' /></a>";
|
||||||
SC_END
|
SC_END
|
||||||
|
|
||||||
SC_BEGIN TRACKBACK
|
SC_BEGIN TRACKBACK
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
global $sql,$pref,$tp,$NEWSCAT,$NEWSCAT_ITEM;
|
/*
|
||||||
|
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||||
|
* $Id: news_categories.sc,v 1.3 2008-12-03 12:38:08 secretr Exp $
|
||||||
|
*
|
||||||
|
* News Categories shortcode
|
||||||
|
*/
|
||||||
|
global $e107, $sql,$pref,$tp,$NEWSCAT,$NEWSCAT_ITEM;
|
||||||
require_once(e_HANDLER."news_class.php");
|
require_once(e_HANDLER."news_class.php");
|
||||||
$ix = new news;
|
$ix = new news;
|
||||||
|
|
||||||
@ -76,10 +82,10 @@ $nbr_cols = (defined("NEWSCAT_COLS")) ? NEWSCAT_COLS : $nbr_cols;
|
|||||||
extract($row3);
|
extract($row3);
|
||||||
|
|
||||||
$search[0] = "/\{NEWSCATICON\}(.*?)/si";
|
$search[0] = "/\{NEWSCATICON\}(.*?)/si";
|
||||||
$replace[0] = ($category_icon) ? "<a href='".e_BASE."news.php?cat.".$category_id."'><img src='".e_IMAGE."icons/".$category_icon."' alt='' style='".$param['caticon']."' /></a>" : "";
|
$replace[0] = ($category_icon) ? "<a href='".$e107->url->getUrl('core:news', 'main', 'action=cat&value='.$category_id)."'><img src='".e_IMAGE_ABS."icons/".$category_icon."' alt='' style='".$param['caticon']."' /></a>" : "";
|
||||||
|
|
||||||
$search[1] = "/\{NEWSCATEGORY\}(.*?)/si";
|
$search[1] = "/\{NEWSCATEGORY\}(.*?)/si";
|
||||||
$replace[1] = ($category_name) ? "<a href='".e_BASE."news.php?cat.".$category_id."' style='".$param['catlink']."' >".$tp->toHTML($category_name,TRUE,"defs")."</a>" : "";
|
$replace[1] = ($category_name) ? "<a href='".$e107->url->getUrl('core:news', 'main', 'action=cat&value='.$category_id)."' style='".$param['catlink']."' >".$tp->toHTML($category_name,TRUE,"defs")."</a>" : "";
|
||||||
|
|
||||||
$text3 .= ($t % $nbr_cols == 0) ? "<tr>" : "";
|
$text3 .= ($t % $nbr_cols == 0) ? "<tr>" : "";
|
||||||
$text3 .= "\n<td style='".NEWSCAT_CELL."; width:$wid%;'>\n";
|
$text3 .= "\n<td style='".NEWSCAT_CELL."; width:$wid%;'>\n";
|
||||||
|
@ -1,20 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
+ ----------------------------------------------------------------------------+
|
* e107 website system
|
||||||
| e107 website system
|
*
|
||||||
|
|
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||||
| ©Steve Dunstan 2001-2002
|
* Released under the terms and conditions of the
|
||||||
| http://e107.org
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
| jalist@e107.org
|
*
|
||||||
|
|
* Alternate News
|
||||||
| Released under the terms and conditions of the
|
*
|
||||||
| GNU General Public License (http://gnu.org).
|
* $Source: /cvs_backup/e107_0.8/e107_plugins/alt_news/alt_news.php,v $
|
||||||
|
|
* $Revision: 1.2 $
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/alt_news/alt_news.php,v $
|
* $Date: 2008-12-03 12:38:08 $
|
||||||
| $Revision: 1.1.1.1 $
|
* $Author: secretr $
|
||||||
| $Date: 2006-12-02 04:34:44 $
|
|
||||||
| $Author: mcfly_e107 $
|
|
||||||
+----------------------------------------------------------------------------+
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
27
news.php
27
news.php
@ -1,20 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
+ ----------------------------------------------------------------------------+
|
* e107 website system
|
||||||
| e107 website system
|
*
|
||||||
|
|
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||||
| ©Steve Dunstan 2001-2002
|
* Released under the terms and conditions of the
|
||||||
| http://e107.org
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
| jalist@e107.org
|
*
|
||||||
|
|
* News frontend
|
||||||
| Released under the terms and conditions of the
|
*
|
||||||
| GNU General Public License (http://gnu.org).
|
* $Source: /cvs_backup/e107_0.8/news.php,v $
|
||||||
|
|
* $Revision: 1.15 $
|
||||||
| $Source: /cvs_backup/e107_0.8/news.php,v $
|
* $Date: 2008-12-03 12:38:07 $
|
||||||
| $Revision: 1.14 $
|
* $Author: secretr $
|
||||||
| $Date: 2008-12-02 23:44:19 $
|
|
||||||
| $Author: secretr $
|
|
||||||
+----------------------------------------------------------------------------+
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once("class2.php");
|
require_once("class2.php");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user