mirror of
https://github.com/e107inc/e107.git
synced 2025-07-28 18:30:53 +02:00
News eURL mod rewrite profile - ready for test
This commit is contained in:
@@ -1,17 +1,9 @@
|
||||
<?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)
|
||||
* 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 $
|
||||
* News shortcode batch
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
@@ -259,7 +251,7 @@ SC_BEGIN NEWSIMAGE
|
||||
global $e107;
|
||||
$news_item = getcachedvars('current_news_item');
|
||||
$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_BEGIN STICKY_ICON
|
||||
@@ -282,7 +274,7 @@ $param = getcachedvars('current_news_param');
|
||||
$category_icon = $e107->tp->parseTemplate('{NEWSHEADER}', FALSE, $news_shortcodes);
|
||||
if (!$category_icon) return '';
|
||||
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_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");
|
||||
$ix = new news;
|
||||
|
||||
@@ -76,10 +82,10 @@ $nbr_cols = (defined("NEWSCAT_COLS")) ? NEWSCAT_COLS : $nbr_cols;
|
||||
extract($row3);
|
||||
|
||||
$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";
|
||||
$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 .= "\n<td style='".NEWSCAT_CELL."; width:$wid%;'>\n";
|
||||
|
Reference in New Issue
Block a user