mirror of
https://github.com/e107inc/e107.git
synced 2025-08-19 04:41:53 +02:00
More News work, front-end started (rewrites are BROKEN), work in progres
This commit is contained in:
@@ -116,6 +116,7 @@
|
||||
<core name='newsposts'>10</core>
|
||||
<core name='newsposts_archive'>0</core>
|
||||
<core name='newsposts_archive_title'></core>
|
||||
<core name='news_sefbase'>news</core>
|
||||
<core name='noLanguageSubs'>0</core>
|
||||
<core name='null'></core>
|
||||
<core name='old_np'>0</core>
|
||||
|
@@ -1,33 +1,50 @@
|
||||
<?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 $
|
||||
* $Id: main.php,v 1.3 2009-09-13 16:37:18 secretr Exp $
|
||||
*
|
||||
* eURL configuration script
|
||||
*/
|
||||
function url_news_main($parms)
|
||||
{
|
||||
$base = e_HTTP.'news/'.$parms['action'];
|
||||
//$base = e_HTTP.$sefbase.$parms['action'];
|
||||
$base = e_HTTP.(e107::getPref('news_sefbase') ? e107::getPref('news_sefbase').'/' : '');
|
||||
switch ($parms['action'])
|
||||
{
|
||||
//Main news page
|
||||
case 'all':
|
||||
return $base;
|
||||
break;
|
||||
|
||||
//Category List
|
||||
case 'cat':
|
||||
case 'extend':
|
||||
case 'list'://TODO - find out what are list params
|
||||
case 'month': //TODO - find out what are month params
|
||||
case 'day': //TODO - find out what are day params
|
||||
return $base.'-'.varsettrue($parms['value'],'0').'.html';
|
||||
return $base.varsettrue($parms['sef'], $parms['action'].'/'.$parms['id']).(varsettrue($parms['page']) ? '/'.$parms['page'] : '');
|
||||
break;
|
||||
|
||||
//Item page
|
||||
case 'item':
|
||||
case 'extend':
|
||||
return $base.varsettrue($parms['sef'], $parms['action'].'/'.$parms['id']);
|
||||
break;
|
||||
|
||||
//Category List default (no category ID)
|
||||
case 'default':
|
||||
return $base."-{$parms['value1']}-".varset($parms['value2'], '0').".html";
|
||||
return $base."default/{$parms['value1']}-".varset($parms['value2'], '0');
|
||||
break;
|
||||
|
||||
//Category List by date/month
|
||||
case 'month':
|
||||
case 'day':
|
||||
return $base.$parms['action'].'/'.varsettrue($parms['value'],'0');
|
||||
break;
|
||||
|
||||
case 'nextprev':
|
||||
return e_HTTP."news/{$parms['to_action']}-{$parms['subaction']}-[FROM].html";
|
||||
return e_HTTP."news/{$parms['to_action']}/{$parms['subaction']}/[FROM].html";
|
||||
|
||||
default:
|
||||
return false;
|
||||
return $base;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@@ -1,7 +1,7 @@
|
||||
<?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 $
|
||||
* $Id: main.php,v 1.4 2009-09-13 16:37:17 secretr Exp $
|
||||
*
|
||||
* eURL configuration script
|
||||
*/
|
||||
@@ -10,24 +10,40 @@ function url_news_main($parms)
|
||||
$base = e_HTTP.'news.php?'.$parms['action'];
|
||||
switch ($parms['action'])
|
||||
{
|
||||
//Main news page
|
||||
case 'all':
|
||||
return $base;
|
||||
break;
|
||||
|
||||
//Category List
|
||||
case 'cat':
|
||||
case 'extend':
|
||||
case 'list'://TODO - find out what are list params
|
||||
case 'month': //TODO - find out what are month params
|
||||
case 'day': //TODO - find out what are day params
|
||||
return $base.'.'.varsettrue($parms['value'],'0');
|
||||
return $base.'.'.varsettrue($parms['id'],'0').(varsettrue($parms['page']) ? '.'.$parms['page'] : '');
|
||||
break;
|
||||
|
||||
//Item page
|
||||
case 'item':
|
||||
case 'extend':
|
||||
return $base.'.'.varsettrue($parms['id'],'0');
|
||||
break;
|
||||
|
||||
//Category List default (no category ID)
|
||||
case 'default':
|
||||
return $base.".{$parms['value1']}.".varset($parms['value2'], '0');
|
||||
break;
|
||||
|
||||
//Category List by date/month
|
||||
case 'month': //TODO - find out what are month params
|
||||
case 'day': //TODO - find out what are day params
|
||||
return $base.'-'.varsettrue($parms['id'],'0');
|
||||
break;
|
||||
|
||||
case 'nextprev':
|
||||
return e_HTTP."news.php?{$parms['to_action']}.{$parms['subaction']}.[FROM]";
|
||||
|
||||
default:
|
||||
return false;
|
||||
return e_HTTP.'news.php';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id: news_shortcodes.php,v 1.25 2009-08-24 08:34:55 secretr Exp $
|
||||
* $Id: news_shortcodes.php,v 1.26 2009-09-13 16:37:17 secretr Exp $
|
||||
*
|
||||
* News shortcode batch
|
||||
*/
|
||||
@@ -78,7 +78,7 @@ class news_shortcodes
|
||||
}
|
||||
if (!$category_icon) { return ''; }
|
||||
|
||||
return "<a href='".$this->e107->url->getUrl('core:news', 'main', 'action=cat&value='.$this->news_item['news_category'])."'><img style='".$this->param['caticon']."' src='".$category_icon."' alt='' /></a>";
|
||||
return "<a href='".$this->e107->url->getUrl('core:news', 'main', 'action=list&id='.$this->news_item['news_category'].'&sef='.$this->news_item['news_category_rewrite_string'])."'><img style='".$this->param['caticon']."' src='".$category_icon."' alt='' /></a>";
|
||||
}
|
||||
|
||||
function sc_newsauthor($parm)
|
||||
@@ -155,7 +155,7 @@ class news_shortcodes
|
||||
function sc_newscategory($parm)
|
||||
{
|
||||
$category_name = $this->e107->tp->toHTML($this->news_item['category_name'], FALSE ,'defs');
|
||||
return "<a class='".$GLOBALS['NEWS_CSSMODE']."_category' style='".(isset($this->param['catlink']) ? $this->param['catlink'] : "#")."' href='".$this->e107->url->getUrl('core:news', 'main', 'action=cat&value='.$this->news_item['news_category'])."'>".$category_name."</a>";
|
||||
return "<a class='".$GLOBALS['NEWS_CSSMODE']."_category' style='".(isset($this->param['catlink']) ? $this->param['catlink'] : "#")."' href='".$this->e107->url->getUrl('core:news', 'main', 'action=list&id='.$this->news_item['news_category'].'&sef='.$this->news_item['news_category_rewrite_string'])."'>".$category_name."</a>";
|
||||
}
|
||||
|
||||
function sc_newsdate($parm)
|
||||
@@ -247,7 +247,7 @@ class news_shortcodes
|
||||
}
|
||||
else
|
||||
{
|
||||
return $es1."<a href='".$this->e107->url->getUrl('core:news', 'main', 'action=extend&value='.$this->news_item['news_id'])."'>".EXTENDEDSTRING."</a>".$es2;
|
||||
return $es1."<a href='".$this->e107->url->getUrl('core:news', 'main', 'action=extend&id='.$this->news_item['news_id'].'&sef='.$this->news_item['news_rewrite_string'])."'>".EXTENDEDSTRING."</a>".$es2;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
@@ -276,14 +276,40 @@ class news_shortcodes
|
||||
return ($this->news_item['news_summary']) ? $this->news_item['news_summary'].'<br />' : '';
|
||||
}
|
||||
|
||||
function sc_newsthumbnail()
|
||||
function sc_newsthumbnail($parm = '')
|
||||
{
|
||||
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail']) ? "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=item&value1={$this->news_item['news_id']}&value2={$this->news_item['news_category']}")."'><img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail']."' alt='' style='".$this->param['thumbnail']."' /></a>" : '';
|
||||
switch($parm)
|
||||
{
|
||||
case 'src':
|
||||
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail'] ? e_IMAGE_ABS.$this->news_item['news_thumbnail'] : '');
|
||||
break;
|
||||
|
||||
case 'tag':
|
||||
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail'] ? "<img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail']."' alt='' style='".$this->param['thumbnail']."' />" : '');
|
||||
break;
|
||||
|
||||
default:
|
||||
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail']) ? "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=extend&id={$this->news_item['news_id']}&catid={$this->news_item['news_category']}&sef={$this->news_item['news_rewrite_string']}")."'><img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail']."' alt='' style='".$this->param['thumbnail']."' /></a>" : '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function sc_newsimage()
|
||||
function sc_newsimage($parm = '')
|
||||
{
|
||||
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail']) ? "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=item&value1={$this->news_item['news_id']}&value2={$this->news_item['news_category']}")."'><img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail']."' alt='' style='".$this->param['thumbnail']."' /></a>" : '';
|
||||
switch($parm)
|
||||
{
|
||||
case 'src':
|
||||
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail'] ? e_IMAGE_ABS.$this->news_item['news_thumbnail'] : '');
|
||||
break;
|
||||
|
||||
case 'tag':
|
||||
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail'] ? "<img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail']."' alt='' style='".$this->param['thumbnail']."' />" : '');
|
||||
break;
|
||||
|
||||
default:
|
||||
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail']) ? "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=extend&id={$this->news_item['news_id']}&catid={$this->news_item['news_category']}&sef={$this->news_item['news_rewrite_string']}")."'><img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail']."' alt='' style='".$this->param['thumbnail']."' /></a>" : '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function sc_sticky_icon()
|
||||
@@ -291,12 +317,18 @@ class news_shortcodes
|
||||
return $this->news_item['news_sticky'] ? $this->param['image_sticky'] : '';
|
||||
}
|
||||
|
||||
function sc_newstitlelink()
|
||||
function sc_newstitlelink($parm = '')
|
||||
{
|
||||
return "<a style='".(isset($this->param['itemlink']) ? $this->param['itemlink'] : 'null')."' href='".$this->e107->url->getUrl('core:news', 'main', "action=item&value1={$this->news_item['news_id']}&value2={$this->news_item['news_category']}")."'>".$this->news_item['news_title'].'</a>';
|
||||
parse_str($parm, $parms);
|
||||
$url = $this->e107->url->getUrl('core:news', 'main', "action=".vartrue($parms['action'], 'extend')."&id={$this->news_item['news_id']}&sef={$this->news_item['news_rewrite_string']}");
|
||||
if(isset($parms['href']))
|
||||
{
|
||||
return $url;
|
||||
}
|
||||
return "<a style='".(isset($this->param['itemlink']) ? $this->param['itemlink'] : 'null')."' href='{$url}'>".$this->news_item['news_title'].'</a>';
|
||||
}
|
||||
|
||||
function sc_newscaticon()
|
||||
function sc_newscaticon($parm = '')
|
||||
{
|
||||
$category_icon = str_replace('../', '', trim($this->news_item['category_icon']));
|
||||
if (!$category_icon) { return ''; }
|
||||
@@ -308,10 +340,24 @@ class news_shortcodes
|
||||
{
|
||||
$category_icon = e_IMAGE_ABS.'icons/'.$category_icon;
|
||||
}
|
||||
|
||||
|
||||
//TODO - remove inline styles
|
||||
if($this->param['caticon'] == ''){$this->param['caticon'] = 'border:0px';}
|
||||
//TODO use CSS class
|
||||
return "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=cat&value={$this->news_item['news_category']}")."'><img style='".$this->param['caticon']."' src='".$category_icon."' alt='' /></a>";
|
||||
|
||||
switch($parm)
|
||||
{
|
||||
case 'src':
|
||||
return $category_icon;
|
||||
break;
|
||||
|
||||
case 'tag':
|
||||
return "<img class='news_image' src='{$category_icon}' alt='' style='".$this->param['caticon']."' />";
|
||||
break;
|
||||
|
||||
default:
|
||||
return "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=list&id={$this->news_item['news_category']}&sef={$this->news_item['news_category_rewrite_string']}")."'><img style='".$this->param['caticon']."' src='".$category_icon."' alt='' /></a>";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function sc_newsinfo()
|
||||
|
Reference in New Issue
Block a user