mirror of
https://github.com/e107inc/e107.git
synced 2025-01-16 20:28:28 +01:00
- Custom Pages: new fields for SEF string and meta data, admin validation and data control, front-end SEO (meta data), additional 'safe' URL config (for migrated installs); some new useful helper methods;
- More typography and layout control: new class based paragraph, heading, nobr, br and block bbcodes (awaiting new icons) - Overall improvements and stability fixes
This commit is contained in:
parent
50848a1fa3
commit
d5dc6bfe05
@ -8,10 +8,8 @@
|
||||
*
|
||||
* Custom Menus/Pages Administration
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/cpage.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
@ -134,6 +132,7 @@ else
|
||||
|
||||
require_once(e_ADMIN.'footer.php');
|
||||
|
||||
// FIXME - add page link to sitelinks is completely disabled as current implementation is not reliable (+ is obsolete and generates sql error)
|
||||
class page
|
||||
{
|
||||
var $fields;
|
||||
@ -223,7 +222,7 @@ class page
|
||||
foreach($pages as $pge)
|
||||
{
|
||||
$title_text = $pge['page_title'] ? $pge['page_title'] : ($pge['page_theme'] ? CUSLAN_43.$pge['page_theme'] : CUSLAN_44);
|
||||
$pge['page_title'] = "<a href='".($pge['page_theme'] ? e_ADMIN."menus.php" : e_BASE."page.php?{$pge['page_id']}" )."'>{$title_text}</a>";
|
||||
$pge['page_title'] = "<a href='".($pge['page_theme'] ? e_ADMIN."menus.php" : e107::getUrl()->create('page/view', $pge, 'allow=page_id,page_sef'))."'>{$title_text}</a>";
|
||||
$authorData = get_user_data($pge['page_author']);
|
||||
$pge['page_author'] = varset($authorData['user_name'], '?');
|
||||
|
||||
@ -274,10 +273,13 @@ class page
|
||||
|
||||
if ($sub_action == "edit" && !isset($_POST['preview']) && !isset($_POST['submit']))
|
||||
{
|
||||
$query = "SELECT p.*,l.link_name,m.menu_name FROM #page AS p
|
||||
LEFT JOIN #links AS l ON l.link_url='page.php?".$id."'
|
||||
|
||||
//$url = e107::getUrl()->sc('page/view', $row, 'allow=page_id,page_title,page_sef');
|
||||
//$query = "SELECT p.*,l.link_name,m.menu_name FROM #page AS p
|
||||
$query = "SELECT p.* FROM #page AS p
|
||||
LEFT JOIN #menus AS m ON m.menu_path='{$id}' WHERE p.page_id ='{$id}' LIMIT 1";
|
||||
|
||||
// FIXME - extremely bad
|
||||
//LEFT JOIN #links AS l ON l.link_url='".$url."'
|
||||
if ($sql->db_Select_gen($query))
|
||||
{
|
||||
$row = $sql->db_Fetch();
|
||||
@ -292,6 +294,7 @@ class page
|
||||
$edit = TRUE;
|
||||
// $menu_name = $tp->toForm($row['menu_name']);
|
||||
$menu_name = $tp->toForm($row['page_theme']);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -326,7 +329,8 @@ class page
|
||||
}
|
||||
else
|
||||
{
|
||||
$templates = e107::getLayouts('page');
|
||||
// fixed - last parameter (allinfo) should be false as getLayout method is returning non-usable formatted array
|
||||
$templates = e107::getLayouts('', 'page', 'front', '', false, false);
|
||||
|
||||
$text .= "
|
||||
<tr>
|
||||
@ -340,9 +344,36 @@ class page
|
||||
<td>".CUSLAN_8."</td>
|
||||
<td>".$frm->text('page_title', $page_title, 250)."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>".CUSLAN_9."</td>
|
||||
<td>
|
||||
";
|
||||
|
||||
if(!$mode)
|
||||
{
|
||||
$text .= "
|
||||
<tr>
|
||||
<td>".CUSLAN_3."</td>
|
||||
<td>".$frm->text('page_sef', $row['page_sef'], 250)."</td>
|
||||
</tr>
|
||||
";
|
||||
|
||||
$text .= "
|
||||
<tr>
|
||||
<td>".CUSLAN_32."</td>
|
||||
<td>".$frm->text('page_metakeys', $row['page_metakeys'], 250)."</td>
|
||||
</tr>
|
||||
";
|
||||
|
||||
$text .= "
|
||||
<tr>
|
||||
<td>".CUSLAN_11."</td>
|
||||
<td>".$frm->textarea('page_metadscr', $row['page_metadscr'], 10, 80, array(), 200)."</td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
|
||||
$text .= "
|
||||
<tr>
|
||||
<td>".CUSLAN_9."</td>
|
||||
<td>
|
||||
";
|
||||
|
||||
// require_once(e_HANDLER."ren_help.php");
|
||||
@ -410,13 +441,7 @@ class page
|
||||
<div class='field-help'>".CUSLAN_15."</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='label'>".CUSLAN_16."</td>
|
||||
<td class='control'>
|
||||
".$frm->text('page_link', $page_link, 50)."
|
||||
<div class='field-help'>".CUSLAN_17."</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class='label'>".CUSLAN_18."</td>
|
||||
|
||||
@ -426,6 +451,17 @@ class page
|
||||
</tr>
|
||||
";
|
||||
|
||||
/*
|
||||
<tr>
|
||||
<td class='label'>".CUSLAN_16."</td>
|
||||
<td class='control'>
|
||||
".$frm->text('page_link', $page_link, 50)."
|
||||
<div class='field-help'>".CUSLAN_17."</div>
|
||||
</td>
|
||||
</tr>
|
||||
**/
|
||||
|
||||
|
||||
//triggerHook
|
||||
$data = array('method'=>'form', 'table'=>'page', 'id'=>$id, 'plugin'=>'page', 'function'=>'createPage');
|
||||
$hooks = $e_event->triggerHook($data);
|
||||
@ -488,14 +524,60 @@ class page
|
||||
$page_text = $tp->toDB($_POST['data']);
|
||||
$pauthor = ($_POST['page_display_authordate_flag'] ? USERID : 0); // Ideally, this check should be done in the front-end.
|
||||
$update = 0; // Make sure some updates happen
|
||||
|
||||
$page_sef = '';
|
||||
$page_metad = '';
|
||||
$page_metak = '';
|
||||
if(!$type)
|
||||
{
|
||||
|
||||
if(!empty($_POST['page_sef']))
|
||||
{
|
||||
$page_sef = eHelper::secureSef($_POST['page_sef']);
|
||||
}
|
||||
|
||||
if(empty($page_sef))
|
||||
{
|
||||
$page_sef = eHelper::title2sef($_POST['page_title']);
|
||||
}
|
||||
|
||||
if(!empty($_POST['page_metadscr']))
|
||||
{
|
||||
$page_metad = $tp->toDB(eHelper::formatMetaDescription($_POST['page_metadscr']));
|
||||
}
|
||||
|
||||
if(!empty($_POST['page_metakeys']))
|
||||
{
|
||||
$page_metak = eHelper::formatMetaKeys($_POST['page_metakeys']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!$type && (!$page_title || !$page_sef))
|
||||
{
|
||||
e107::getMessage()->addError(CUSLAN_34, 'default', true);
|
||||
e107::getRedirect()->redirect(e_ADMIN_ABS.'cpage.php');
|
||||
}
|
||||
|
||||
if(!$type && $sql->db_Count('page', 'page_id', ($mode ? "page_id<>{$mode} AND " : '')."page_sef!={$page_sef}"))
|
||||
{
|
||||
e107::getMessage()->addError(CUSLAN_34, 'default', true);
|
||||
e107::getRedirect()->redirect(e_ADMIN_ABS.'cpage.php');
|
||||
}
|
||||
|
||||
if($type && empty($_POST['menu_name']))
|
||||
{
|
||||
e107::getMessage()->addError(CUSLAN_36, 'default', true);
|
||||
e107::getRedirect()->redirect(e_ADMIN_ABS.'cpage.php');
|
||||
}
|
||||
|
||||
if($mode)
|
||||
{ // Saving existing page/menu after edit
|
||||
// Don't think $_POST['page_ip_restrict'] is ever set.
|
||||
|
||||
|
||||
$menuname = ($type && vartrue($_POST['menu_name']) ? ", page_theme = '".$tp -> toDB($_POST['menu_name'])."'" : "");
|
||||
$status = $sql -> db_Update("page", "page_title='{$page_title}', page_text='{$page_text}', page_datestamp='".time()."', page_author='{$pauthor}', page_rating_flag='".intval($_POST['page_rating_flag'])."', page_comment_flag='".intval($_POST['page_comment_flag'])."', page_password='".$_POST['page_password']."', page_class='".$_POST['page_class']."', page_ip_restrict='".varset($_POST['page_ip_restrict'],'')."', page_template='".$_POST['page_template']."' {$menuname} WHERE page_id='{$mode}'") ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
||||
|
||||
$status = $sql -> db_Update("page", "page_title='{$page_title}', page_sef='{$page_sef}', page_metakeys='{$page_metak}', page_metadscr='{$page_metad}', page_text='{$page_text}', page_datestamp='".time()."', page_author='{$pauthor}', page_rating_flag='".intval($_POST['page_rating_flag'])."', page_comment_flag='".intval($_POST['page_comment_flag'])."', page_password='".$_POST['page_password']."', page_class='".$_POST['page_class']."', page_ip_restrict='".varset($_POST['page_ip_restrict'],'')."', page_template='".$_POST['page_template']."' {$menuname} WHERE page_id='{$mode}'") ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
||||
if ($status == E_MESSAGE_SUCCESS) $update++;
|
||||
|
||||
$mes = e107::getMessage();
|
||||
@ -521,37 +603,43 @@ class page
|
||||
}
|
||||
}
|
||||
|
||||
//$url = e107::getUrl()->sc('page/view', array('name' => $tp->post_toForm($_POST['page_title']), 'id' => $mode));
|
||||
/*
|
||||
if ($_POST['page_link'])
|
||||
{
|
||||
if ($sql->db_Select("links", "link_id", "link_url='page.php?".$mode."' && link_name!='".$tp->toDB($_POST['page_link'])."'"))
|
||||
// FIXME extremely ugly, just join on created link ID by new field page_link
|
||||
if ($sql->db_Select("links", "link_id", "link_url='".$url."' && link_name!='".$tp->toDB($_POST['page_link'])."'"))
|
||||
{
|
||||
$sql->db_Update("links", "link_name='".$tp->toDB($_POST['page_link'])."' WHERE link_url='page.php?".$mode."'");
|
||||
$sql->db_Update("links", "link_name='".$tp->toDB($_POST['page_link'])."' WHERE link_url='".$url."'");
|
||||
$update++;
|
||||
$e107cache->clear("sitelinks");
|
||||
}
|
||||
else if (!$sql->db_Select("links", "link_id", "link_url='page.php?".$mode."'"))
|
||||
else if (!$sql->db_Select("links", "link_id", "link_url='".$url."'"))
|
||||
{
|
||||
$sql->db_Insert("links", "0, '".$tp->toDB($_POST['page_link'])."', 'page.php?".$mode."', '', '', 1, 0, 0, 0, ".$_POST['page_class']);
|
||||
$sql->db_Insert("links", "0, '".$tp->toDB($_POST['page_link'])."', '".$url."', '', '', 1, 0, 0, 0, ".$_POST['page_class']);
|
||||
$update++;
|
||||
$e107cache->clear("sitelinks");
|
||||
}
|
||||
} else {
|
||||
if ($sql->db_Select("links", "link_id", "link_url='page.php?".$mode."'"))
|
||||
if ($sql->db_Select("links", "link_id", "link_url='".$url."'"))
|
||||
{
|
||||
$sql->db_Delete("links", "link_url='page.php?".$mode."'");
|
||||
$sql->db_Delete("links", "link_url='".$url."'");
|
||||
$update++;
|
||||
$e107cache->clear("sitelinks");
|
||||
}
|
||||
}
|
||||
}*/
|
||||
admin_update($update, 'update', LAN_UPDATED, false, false); // Display result of update
|
||||
}
|
||||
else
|
||||
{ // New page/menu
|
||||
$menuname = ($type ? $tp->toDB($_POST['menu_name']) : "");
|
||||
$addMsg = ($type ? CUSLAN_51 : CUSLAN_27);
|
||||
|
||||
|
||||
$info = array(
|
||||
'page_title' => $page_title,
|
||||
'page_sef' => $page_sef,
|
||||
'page_metakeys' => $page_metak,
|
||||
'page_metadscr' => $page_metad,
|
||||
'page_text' => $page_text,
|
||||
'page_author' => $pauthor,
|
||||
'page_datestamp' => time(),
|
||||
@ -579,16 +667,17 @@ class page
|
||||
admin_update($sql->db_Insert('menus', $info), 'insert', CUSLAN_52, LAN_CREATED_FAILED, false);
|
||||
}
|
||||
|
||||
if(vartrue($_POST['page_link']))
|
||||
/*if(vartrue($_POST['page_link']))
|
||||
{
|
||||
$link = 'page.php?'.$pid;
|
||||
//$link = 'page.php?'.$pid;
|
||||
$url = e107::getUrl()->sc('page/view', array('name' => $tp->post_toForm($_POST['page_title']), 'id' => $pid));
|
||||
if (!$sql->db_Select("links", "link_id", "link_name='".$tp->toDB($_POST['page_link'])."'"))
|
||||
{
|
||||
$linkname = $tp->toDB($_POST['page_link']);
|
||||
$sql->db_Insert("links", "0, '{$linkname}', '{$link}', '', '', 1, 0, 0, 0, ".$_POST['page_class']);
|
||||
$sql->db_Insert("links", "0, '{$linkname}', '{$url}', '', '', 1, 0, 0, 0, ".$_POST['page_class']);
|
||||
$e107cache->clear("sitelinks");
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
$data = array('method'=>'create', 'table'=>'page', 'id'=>$pid, 'plugin'=>'page', 'function'=>'submitPage');
|
||||
$this->message = $e_event->triggerHook($data);
|
||||
@ -598,16 +687,22 @@ class page
|
||||
function delete_page($del_id)
|
||||
{
|
||||
global $sql, $e107cache, $admin_log, $e_event;
|
||||
//if(!$sql->db_Select('page', '*', "page_id={$del_id}")) return;
|
||||
//$row = $sql->db_Fetch();
|
||||
|
||||
admin_update($sql->db_Delete("page", "page_id='{$del_id}' "), 'delete', CUSLAN_28, false, false);
|
||||
$sql->db_Delete('menus', "menu_path='$del_id'");
|
||||
$e107cache->clear_sys('menus_');
|
||||
$admin_log->log_event('CPAGE_03','ID: '.$del_id,E_LOG_INFORMATIVE,'');
|
||||
if ($sql->db_Select('links', 'link_id', "link_url='page.php?".$del_id."'"))
|
||||
|
||||
/*$url = e107::getUrl()->sc('page/view', $row, 'allow=page_id,page_title,page_sef');
|
||||
if ($row['page_theme'] && $sql->db_Select('links', 'link_id', "link_url='".$url."'"))
|
||||
{
|
||||
$sql->db_Delete('links', "link_url='page.php?".$del_id."'");
|
||||
$tmp = $sql->db_Fetch();
|
||||
$sql->db_Delete('links', "link_id=".$tmp['link_id']);
|
||||
$e107cache->clear('sitelinks');
|
||||
}
|
||||
|
||||
*/
|
||||
$data = array('method'=>'delete', 'table'=>'page', 'id'=>$del_id, 'plugin'=>'page', 'function'=>'delete_page');
|
||||
$this->message = $e_event->triggerHook($data);
|
||||
}
|
||||
|
@ -735,7 +735,7 @@ if ($e107_popup != 1)
|
||||
function admin_update($update, $type = 'update', $success = false, $failed = false, $output = true)
|
||||
{
|
||||
require_once (e_HANDLER."message_handler.php");
|
||||
$emessage = &eMessage::getInstance();
|
||||
$emessage = e107::getMessage();
|
||||
|
||||
if (($type == 'update' && $update) || ($type == 'insert' && $update !== false))
|
||||
{
|
||||
|
@ -363,6 +363,9 @@ CREATE TABLE online (
|
||||
CREATE TABLE page (
|
||||
page_id int(10) unsigned NOT NULL auto_increment,
|
||||
page_title varchar(250) NOT NULL default '',
|
||||
page_sef varchar (250) NOT NUL default '',
|
||||
page_metakeys varchar (250) NOT NUL default '',
|
||||
page_metadscr mediumtext NOT NULL,
|
||||
page_text mediumtext NOT NULL,
|
||||
page_author int(10) unsigned NOT NULL default '0',
|
||||
page_datestamp int(10) unsigned NOT NULL default '0',
|
||||
|
@ -1343,7 +1343,7 @@ class users
|
||||
break;
|
||||
|
||||
case 'user_name':
|
||||
return "<a href='".$e107->url->getUrl('user/profile/view', 'name='.$row['user_name'].'&id='.$row['user_id'])."'>{$row['user_name']}</a>";
|
||||
return "<a href='".$e107->url->create('user/profile/view', 'name='.$row['user_name'].'&id='.$row['user_id'])."'>{$row['user_name']}</a>";
|
||||
break;
|
||||
|
||||
case 'user_perms': //TODO display link to popup window with editable perms.
|
||||
|
1
e107_core/bbcodes/_br.bb
Normal file
1
e107_core/bbcodes/_br.bb
Normal file
@ -0,0 +1 @@
|
||||
return '<br />';
|
62
e107_core/bbcodes/bb_block.php
Normal file
62
e107_core/bbcodes/bb_block.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id$
|
||||
*
|
||||
* DIV block bbcode
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
/**
|
||||
* Div HTML blocks handling
|
||||
*
|
||||
* [block=class=xxx&style=xxx&id=xxx]$content[/block]
|
||||
* [block=xxx]$content[/block] equals to [block=class=xxx]$content[/block]
|
||||
* If $content is missing, HTML comment will be used - '<!-- -->'
|
||||
*/
|
||||
class bb_block extends e_bb_base
|
||||
{
|
||||
/**
|
||||
* Called prior to save
|
||||
*
|
||||
*/
|
||||
function toDB($code_text, $parm)
|
||||
{
|
||||
// just for now
|
||||
if(!ADMIN) return $code_text; // TODO - pref
|
||||
|
||||
// transform to class, equal sign at 0 position is not well formed parm string
|
||||
if($parm && !strpos($parm, '=')) $parm = 'class='.$parm;
|
||||
$parms = eHelper::scParams($parm);
|
||||
$safe = array();
|
||||
|
||||
if(varsettrue($parms['class'])) $safe['class'] = eHelper::secureClassAttr($parms['class']);
|
||||
if(varsettrue($parms['id'])) $safe['id'] = eHelper::secureIdAttr($parms['id']);
|
||||
if(varsettrue($parms['style'])) $safe['style'] = eHelper::secureStyleAttr($parms['style']);
|
||||
if($safe)
|
||||
{
|
||||
return '[block='.eHelper::buildAttr($safe).']'.$code_text.'[/block]';
|
||||
}
|
||||
return '[block]'.$code_text.'[/block]';
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate youtube bbcode into the appropriate HTML
|
||||
*/
|
||||
function toHTML($code_text, $parm)
|
||||
{
|
||||
// transform to class, equal sign at 0 position is not well formed parm string
|
||||
if($parm && !strpos($parm, '=')) $parm = 'class='.$parm;
|
||||
$parms = eHelper::scParams($parm);
|
||||
|
||||
$class = varsettrue($parms['class']) ? ' class="'.eHelper::secureClassAttr($parms['class']).'"' : '';
|
||||
if(!$class) $class = ' class="bbcode"';
|
||||
|
||||
$id = varsettrue($parms['id']) ? ' id='.eHelper::secureIdAttr($parms['id']) : '';
|
||||
$style = varsettrue($parms['style']) ? ' style="'.eHelper::secureStyleAttr($parms['style']).'"' : '';
|
||||
|
||||
if(empty($code_text)) $code_text = '<!-- -->';
|
||||
return '<div'.$id.$class.$style.'>'.$code_text.'</div>';
|
||||
}
|
||||
}
|
76
e107_core/bbcodes/bb_h.php
Normal file
76
e107_core/bbcodes/bb_h.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id$
|
||||
*
|
||||
* Heading bb code
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
/**
|
||||
* Basic usage [h=2]text[/h]
|
||||
* The same [h]text[/h] as heading number defaults to '2'
|
||||
* Advanced usage [h=2|class=className&id=element-id&style=some: style; and: moresStyle]text[/h]
|
||||
* 'class' defaults to 'bbcode' (if left empty)
|
||||
*/
|
||||
class bb_h extends e_bb_base
|
||||
{
|
||||
/**
|
||||
* Called prior to save
|
||||
* Sanitize and re-assemble the bbcode
|
||||
*/
|
||||
function toDB($code_text, $parm)
|
||||
{
|
||||
$code_text = trim($code_text);
|
||||
if(empty($code_text)) return '';
|
||||
|
||||
$bparms = eHelper::scDualParams($parm);
|
||||
|
||||
$h = $bparms[1] ? intval($bparms[1]) : 2;
|
||||
$parms = $bparms[2];
|
||||
unset($bparms);
|
||||
|
||||
if(vartrue($parms['class']))
|
||||
{
|
||||
$safe['class'] = eHelper::secureClassAttr($parms['class']);
|
||||
}
|
||||
if(vartrue($parms['id']))
|
||||
{
|
||||
$safe['id'] = eHelper::secureIdAttr($parms['id']);
|
||||
}
|
||||
if(vartrue($parms['style']))
|
||||
{
|
||||
$safe['style'] = eHelper::secureStyleAttr($parms['style']);
|
||||
}
|
||||
if($safe)
|
||||
{
|
||||
return '[h='.$h.'|'.eHelper::buildAttr($safe).']'.$code_text.'[/h]';
|
||||
}
|
||||
return '[h='.$h.']'.$code_text.'[/h]';
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Translate to <h*> tag
|
||||
*/
|
||||
function toHTML($code_text, $parm)
|
||||
{
|
||||
$code_text = trim($code_text);
|
||||
if(empty($code_text)) return '';
|
||||
$bparms = eHelper::scDualParams($parm);
|
||||
|
||||
$h = 'h'.($bparms[1] ? intval($bparms[1]) : 2);
|
||||
$parms = $bparms[2];
|
||||
unset($bparms);
|
||||
|
||||
$class = varsettrue($parms['class']) ? ' class="'.eHelper::secureClassAttr($parms['class']).'"' : '';
|
||||
if(!$class) $class = ' class="bbcode"';
|
||||
|
||||
$id = varsettrue($parms['id']) ? ' id='.eHelper::secureIdAttr($parms['id']) : '';
|
||||
$style = varsettrue($parms['style']) ? ' style="'.eHelper::secureStyleAttr($parms['style']).'"' : '';
|
||||
|
||||
return "<{$h}{$id}{$class}{$style}>".$code_text."</{$h}>";
|
||||
}
|
||||
}
|
35
e107_core/bbcodes/bb_nobr.php
Normal file
35
e107_core/bbcodes/bb_nobr.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id$
|
||||
*
|
||||
* Strip HTML new lines bbcode
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
/**
|
||||
* Does nothing when saving in DB
|
||||
* Removes new lines produced by nl2br when translating to HTML
|
||||
*/
|
||||
class bb_nobr extends e_bb_base
|
||||
{
|
||||
private $_nobrRegEx = '#[^\w\s\-]#';
|
||||
|
||||
/**
|
||||
* Called prior to save
|
||||
* Re-assemble the bbcode
|
||||
*/
|
||||
function toDB($code_text, $parm)
|
||||
{
|
||||
return '[nobr]'.$code_text.'[/nobr]';
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip new lines
|
||||
*/
|
||||
function toHTML($code_text, $parm)
|
||||
{
|
||||
return str_replace(E_NL, "\n", trim($code_text));
|
||||
}
|
||||
}
|
71
e107_core/bbcodes/bb_p.php
Normal file
71
e107_core/bbcodes/bb_p.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id$
|
||||
*
|
||||
* Paragraph bbcode
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
/**
|
||||
* Basic usage [p=CSS-className]text[/p]
|
||||
* Advanced usage [p=class=className&id=element-id&style=some: style; and: moresStyle]text[/p]
|
||||
* 'class' defaults to 'bbcode' (if left empty)
|
||||
*/
|
||||
class bb_p extends e_bb_base
|
||||
{
|
||||
/**
|
||||
* Called prior to save
|
||||
* Sanitize and re-assemble the bbcode
|
||||
*/
|
||||
function toDB($code_text, $parm)
|
||||
{
|
||||
$code_text = trim($code_text);
|
||||
if(empty($code_text)) return '';
|
||||
|
||||
if($parm && !strpos($parm, '=')) $parm = 'class='.$parm;
|
||||
|
||||
$parms = eHelper::scParams($parm);
|
||||
$safe = array();
|
||||
|
||||
if(vartrue($parms['class']))
|
||||
{
|
||||
$safe['class'] = eHelper::secureClassAttr($parms['class']);
|
||||
}
|
||||
if(vartrue($parms['id']))
|
||||
{
|
||||
$safe['id'] = eHelper::secureIdAttr($parms['id']);
|
||||
}
|
||||
if(vartrue($parms['style']))
|
||||
{
|
||||
$safe['style'] = eHelper::secureStyleAttr($parms['style']);
|
||||
}
|
||||
if($safe)
|
||||
{
|
||||
return '[p='.eHelper::buildAttr($safe).']'.$code_text.'[/p]';
|
||||
}
|
||||
return '[p]'.$code_text.'[/p]';
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Translate to <p> tag
|
||||
*/
|
||||
function toHTML($code_text, $parm)
|
||||
{
|
||||
if($parm && !strpos($parm, '=')) $parm = 'class='.$parm;
|
||||
$code_text = trim($code_text);
|
||||
|
||||
$parms = eHelper::scParams($parm);
|
||||
|
||||
$class = varsettrue($parms['class']) ? ' class="'.eHelper::secureClassAttr($parms['class']).'"' : '';
|
||||
if(!$class) $class = ' class="bbcode"';
|
||||
|
||||
$id = varsettrue($parms['id']) ? ' id="'.eHelper::secureIdAttr($parms['id']).'"' : '';
|
||||
$style = varsettrue($parms['style']) ? ' style="'.eHelper::secureStyleAttr($parms['style']).'"' : '';
|
||||
|
||||
return "<p{$id}{$class}{$style}>".$code_text.'</p>';
|
||||
}
|
||||
}
|
@ -17,7 +17,8 @@
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_ren_help.php');
|
||||
//include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_ren_help.php');
|
||||
e107::coreLan('ren_help');
|
||||
|
||||
$codes = array('bb', 'bb_help', 'bb_preimagedir');
|
||||
register_shortcode('bbcode_shortcodes', $codes);
|
||||
@ -54,9 +55,12 @@ class bbcode_shortcodes
|
||||
|
||||
$bbcode['newpage'] = array($bbcode_func,"[newpage]", LANHELP_34, "newpage.png");
|
||||
$bbcode['link'] = array('addinput',"[link=".LANHELP_35."][/link]", LANHELP_23,"link.png");
|
||||
$bbcode['h'] = array($bbcode_func,"[h][/h]", LANHELP_50,"heading.png"); // FIXME bbcode icon
|
||||
$bbcode['p'] = array($bbcode_func,"[p][/p]", LANHELP_49,"paragraph.png"); // FIXME bbcode icon
|
||||
$bbcode['b'] = array($bbcode_func,"[b][/b]", LANHELP_24,"bold.png");
|
||||
$bbcode['i'] = array($bbcode_func,"[i][/i]", LANHELP_25,"italic.png");
|
||||
$bbcode['u'] = array($bbcode_func,"[u][/u]", LANHELP_26,"underline.png");
|
||||
$bbcode['justify'] = array($bbcode_func,"[justify][/justify]", LANHELP_53,"center.png"); // FIXME bbcode icon
|
||||
$bbcode['center'] = array($bbcode_func,"[center][/center]", LANHELP_28,"center.png");
|
||||
$bbcode['left'] = array($bbcode_func,"[left][/left]", LANHELP_29,"left.png");
|
||||
$bbcode['right'] = array($bbcode_func,"[right][/right]", LANHELP_30,"right.png");
|
||||
@ -67,6 +71,10 @@ class bbcode_shortcodes
|
||||
$bbcode['flash'] = array($bbcode_func,"[flash=width,height][/flash]", LANHELP_47,"flash.png");
|
||||
$bbcode['youtube'] = array($bbcode_func,"[youtube][/youtube]", LANHELP_48,"youtube.png");
|
||||
$bbcode['sanitised'] = array('', '', '');
|
||||
|
||||
$bbcode['nobr'] = array($bbcode_func,"[nobr][/nobr]", LANHELP_51, "nobr.png"); // FIXME bbcode icon
|
||||
$bbcode['br'] = array($bbcode_func,"[br]", LANHELP_52, "br.png"); // FIXME bbcode icon
|
||||
$bbcode['block'] = array($bbcode_func,"[block][/block]", LANHELP_54,"block.png"); // FIXME bbcode icon, interactive interface, theme hooks
|
||||
|
||||
$bbcode['fontsize'] = array("expandit","size_selector_".$rand, LANHELP_22,"fontsize.png","Size_Select",'size_selector_'.$rand);
|
||||
$bbcode['fontcol'] = array("expandit","col_selector_".$rand, LANHELP_21,"fontcol.png","Color_Select",'col_selector_'.$rand);
|
||||
|
87
e107_core/url/page/sef_noid_url.php
Normal file
87
e107_core/url/page/sef_noid_url.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id$
|
||||
*
|
||||
* Custom page routing config
|
||||
*/
|
||||
class core_page_sef_noid_url extends eUrlConfig
|
||||
{
|
||||
public function config()
|
||||
{
|
||||
return array(
|
||||
|
||||
'config' => array(
|
||||
'allowMain' => true,
|
||||
'legacy' => '{e_BASE}page.php', // [optional] default empty; if it's a legacy module (no single entry point support) - URL to the entry point script
|
||||
'format' => 'path', // get|path - notify core for the current URL format, if set to 'get' rules will be ignored
|
||||
'defaultRoute' => 'view/index',// [optional] default empty; route (no leading module) used when module is found with no additional controller/action information e.g. /news/
|
||||
'urlSuffix' => '', // [optional] default empty; string to append to the URL (e.g. .html)
|
||||
|
||||
'mapVars' => array(
|
||||
'page_id' => 'id',
|
||||
'page_sef' => 'name',
|
||||
),
|
||||
|
||||
'allowVars' => array(
|
||||
'page',
|
||||
),
|
||||
),
|
||||
|
||||
'rules' => array(
|
||||
|
||||
### using only title for pages is risky enough (empty sef for old DB's)
|
||||
'<name:{secure}>' => array('view/index', 'allowVars' => false, 'legacyQuery' => '{name}.{page}', 'parseCallback' => 'itemIdByTitle'),
|
||||
|
||||
### page list
|
||||
'/' => array('list/index', 'legacyQuery' => '', ),
|
||||
) // rule set array
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Admin callback
|
||||
* Language file not loaded as all language data is inside the lan_eurl.php (loaded by default on administration URL page)
|
||||
*/
|
||||
public function admin()
|
||||
{
|
||||
// static may be used for performance
|
||||
static $admin = array(
|
||||
'labels' => array(
|
||||
'name' => LAN_EURL_CORE_PAGE, // Module name
|
||||
'label' => LAN_EURL_PAGE_SEFNOID_LABEL, // Current profile name
|
||||
'description' => LAN_EURL_PAGE_SEFNOID_DESCR, //
|
||||
),
|
||||
'form' => array(), // Under construction - additional configuration options
|
||||
'callbacks' => array(), // Under construction - could be used for e.g. URL generator functionallity
|
||||
);
|
||||
|
||||
return $admin;
|
||||
}
|
||||
|
||||
### CUSTOM METHODS ###
|
||||
|
||||
/**
|
||||
* view/item by name callback
|
||||
* @param eRequest $request
|
||||
*/
|
||||
public function itemIdByTitle(eRequest $request)
|
||||
{
|
||||
$name = $request->getRequestParam('name');
|
||||
if(($id = $request->getRequestParam('id')))
|
||||
{
|
||||
$request->setRequestParam('name', $id);
|
||||
return;
|
||||
}
|
||||
elseif(!$name || is_numeric($name)) return;
|
||||
|
||||
$sql = e107::getDb('url');
|
||||
$name = e107::getParser()->toDB($name);
|
||||
if($sql->db_Select('page', 'page_id', "page_theme='' AND page_sef='{$name}'"))
|
||||
{
|
||||
$name = $sql->db_Fetch();
|
||||
$request->setRequestParam('name', $name['page_id']);
|
||||
}
|
||||
else $request->setRequestParam('name', 0);
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
* Copyright (C) e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id$
|
||||
*
|
||||
* User routing config
|
||||
* Custom page routing config
|
||||
*/
|
||||
class core_page_sef_url extends eUrlConfig
|
||||
{
|
||||
@ -13,35 +13,26 @@ class core_page_sef_url extends eUrlConfig
|
||||
|
||||
'config' => array(
|
||||
'allowMain' => true,
|
||||
'noSingleEntry' => false, // [optional] default false; disallow this module to be shown via single entry point when this config is used
|
||||
'legacy' => '{e_BASE}page.php', // [optional] default empty; if it's a legacy module (no single entry point support) - URL to the entry point script
|
||||
'format' => 'path', // get|path - notify core for the current URL format, if set to 'get' rules will be ignored
|
||||
'selfParse' => false, // [optional] default false; use only this->parse() method, no core routine URL parsing
|
||||
'selfCreate' => false, // [optional] default false; use only this->create() method, no core routine URL creating
|
||||
'defaultRoute' => 'view/index',// [optional] default empty; route (no leading module) used when module is found with no additional controller/action information e.g. /news/
|
||||
'errorRoute' => '', // [optional] default empty; route (no leading module) used when module is found but no inner route is matched, leave empty to force error 404 page
|
||||
'urlSuffix' => '', // [optional] default empty; string to append to the URL (e.g. .html)
|
||||
|
||||
'mapVars' => array(
|
||||
'page_id' => 'id',
|
||||
'page_title' => 'name',
|
||||
'page_sef' => 'name',
|
||||
),
|
||||
|
||||
'allowVars' => array(
|
||||
'page', 'id',
|
||||
'page',
|
||||
),
|
||||
),
|
||||
|
||||
'rules' => array(
|
||||
### using only title for pages is risky enough (non-unique title, possible bad characters)
|
||||
//'<name:{secure}>' => array('view/index', 'allowVars' => array('name'),'legacyQuery' => '{name}.{page}', 'parseCallback' => 'itemIdByTitle'),
|
||||
'<id:{number}>/<name:{secure}>' => array('view/index', 'legacyQuery' => '{id}.{page}', ),
|
||||
|
||||
### fallback when assembling method don't know the title of the page - build by ID only
|
||||
'<id:{number}>' => array('view/index', 'legacyQuery' => '{id}.{page}', ),
|
||||
'<id:{number}>/<name:{sefsecureOptional}>' => array('view/index', 'legacyQuery' => '{id}.{page}', ),
|
||||
|
||||
### page list
|
||||
'list' => array('list/index', 'legacyQuery' => '', ),
|
||||
'/' => array('list/index', 'legacyQuery' => '', ),
|
||||
) // rule set array
|
||||
);
|
||||
@ -66,34 +57,4 @@ class core_page_sef_url extends eUrlConfig
|
||||
|
||||
return $admin;
|
||||
}
|
||||
|
||||
### CUSTOM METHODS ###
|
||||
|
||||
/**
|
||||
* view/item by name callback
|
||||
* @param eRequest $request
|
||||
*/
|
||||
public function itemIdByTitle(eRequest $request)
|
||||
{
|
||||
$name = $request->getRequestParam('name');
|
||||
if(($id = $request->getRequestParam('id')))
|
||||
{
|
||||
$request->setRequestParam('name', $id);
|
||||
return;
|
||||
}
|
||||
elseif(!$name) return;
|
||||
elseif(is_numeric($name))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$sql = e107::getDb('url');
|
||||
$name = e107::getParser()->toDB($name);var_dump($name);
|
||||
if($sql->db_Select('page', 'page_id', "page_theme='' AND page_title='{$name}'")) // TODO - it'll be page_sef (new) field
|
||||
{
|
||||
$name = $sql->db_Fetch();
|
||||
$request->setRequestParam('name', $name['page_id']);
|
||||
}
|
||||
else $request->setRequestParam('name', 0);
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Copyright (C) e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id$
|
||||
*
|
||||
* Page routing config
|
||||
* Custom page routing config
|
||||
*/
|
||||
class core_page_url extends eUrlConfig
|
||||
{
|
||||
|
@ -1897,7 +1897,6 @@ class eRouter
|
||||
$urlSuffix = $this->urlSuffix;
|
||||
if(isset($config['urlSuffix'])) $urlSuffix = $config['urlSuffix'];
|
||||
}
|
||||
// TODO - main module - don't include it in the return URL
|
||||
|
||||
// Create by config callback
|
||||
if(vartrue($config['selfCreate']))
|
||||
@ -1952,7 +1951,7 @@ class eRouter
|
||||
$rules = $this->getRules($module);
|
||||
if($format !== self::FORMAT_GET && !empty($rules))
|
||||
{
|
||||
foreach ($rules as $rule)
|
||||
foreach ($rules as $k => $rule)
|
||||
{
|
||||
if (($url = $rule->createUrl($this, array($route[1], $route[2]), $params, $options)) !== false) return $base.rtrim(($this->isMainModule($module) ? '' : $alias.'/').$url, '/').$anc;
|
||||
}
|
||||
@ -2231,13 +2230,13 @@ class eUrlRule
|
||||
public $regexTemplates = array(
|
||||
'az' => '[A-Za-z]+', // NOTE - it won't match non-latin word characters!
|
||||
'alphanum' => '[\w\pL]+',
|
||||
'sefsecure' => '[\w\pL.\-\s!,]+',
|
||||
'sefsecure' => '[\w\pL\s\-+.,]+',
|
||||
'secure' => '[^\/\'"\\<%]+',
|
||||
'number' => '[\d]+',
|
||||
'username' => '[\w\pL.\-\s!,]+', // TODO - should equal to username pattern, sync it
|
||||
'azOptional' => '[A-Za-z]{0,}',
|
||||
'alphanumOptional' => '[\w\pL]{0,}',
|
||||
'sefsecureOptional' => '[\w\pL.\-\s!,]{0,}',
|
||||
'sefsecureOptional' => '[\w\pL\s\-+.,]{0,}',
|
||||
'secureOptional' => '[^\/\'"\\<%]{0,}',
|
||||
'numberOptional' => '[\d]{0,}',
|
||||
'usernameOptional' => '[\w\pL.\-\s!,]{0,}', // TODO - should equal to username pattern, sync it
|
||||
@ -3758,6 +3757,114 @@ class eResponse
|
||||
*/
|
||||
class eHelper
|
||||
{
|
||||
protected static $_classRegEx = '#[^\w\s\-]#';
|
||||
protected static $_idRegEx = '#[^\w\-]#';
|
||||
protected static $_styleRegEx = '#[^\w\s\-\.;:!]#';
|
||||
|
||||
public static function secureClassAttr($string)
|
||||
{
|
||||
return preg_replace(self::$_classRegEx, '', $string);
|
||||
}
|
||||
|
||||
public static function secureIdAttr($string)
|
||||
{
|
||||
return preg_replace(self::$_idRegEx, '', $string);
|
||||
}
|
||||
|
||||
public static function secureStyleAttr($string)
|
||||
{
|
||||
return preg_replace(self::$_styleRegEx, '', $string);
|
||||
}
|
||||
|
||||
public static function buildAttr($safeArray)
|
||||
{
|
||||
return http_build_query($safeArray, null, '&');
|
||||
}
|
||||
|
||||
public static function formatMetaTitle($title)
|
||||
{
|
||||
$title = trim(str_replace(array('"', "'"), '', strip_tags(e107::getParser()->toHTML($title, TRUE))));
|
||||
return trim(preg_replace('/[\s,]+/', ',', str_replace('_', ' ', $title)));
|
||||
}
|
||||
|
||||
public static function secureSef($sef)
|
||||
{
|
||||
return trim(preg_replace('/[^\w\pL\s\-+.,]+/u', '', strip_tags(e107::getParser()->toHTML($sef, TRUE))));
|
||||
}
|
||||
|
||||
public static function formatMetaKeys($keywordString)
|
||||
{
|
||||
$keywordString = preg_replace('/[^\w\pL\s\-.,+]/u', '', strip_tags(e107::getParser()->toHTML($keywordString, TRUE)));
|
||||
return trim(preg_replace('/[\s,]+/', ',', str_replace('_', ' ', $keywordString)));
|
||||
}
|
||||
|
||||
public static function formatMetaDescription($descrString)
|
||||
{
|
||||
$descrString = preg_replace('/[\r]*\n[\r]*/', ' ', trim(str_replace(array('"', "'"), '', strip_tags(e107::getParser()->toHTML($descrString, TRUE)))));
|
||||
return trim(preg_replace('/[\s]+/', ' ', str_replace('_', ' ', $descrString)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert title to valid SEF URL string
|
||||
* Type ending with 'l' stands for 'to lowercase', ending with 'c' - 'to camel case'
|
||||
* @param string $title
|
||||
* @param string $type dashl|dashc|dash|underscorel|underscorec|underscore|plusl|plusc|plus|none
|
||||
*/
|
||||
public static function title2sef($title, $type = null)
|
||||
{
|
||||
$title = preg_replace('/[^\w\pL\s.,]/u', '', strip_tags(e107::getParser()->toHTML($title, TRUE)));
|
||||
$title = trim(preg_replace('/[\s]+/', ' ', str_replace('_', ' ', $title)));
|
||||
|
||||
if(null === $type)
|
||||
{
|
||||
$type = 'none'; // FIXME - site preference
|
||||
}
|
||||
$tp = e107::getParser();
|
||||
switch ($type)
|
||||
{
|
||||
case 'dashl': //dasherize, to lower case
|
||||
return self::dasherize($tp->ustrtolower($title));
|
||||
break;
|
||||
|
||||
case 'dashc': //dasherize, camel case
|
||||
return self::dasherize(self::camelize($title, true, ' '));
|
||||
break;
|
||||
|
||||
case 'dash': //dasherize
|
||||
return self::dasherize($title);
|
||||
break;
|
||||
|
||||
case 'underscorel': ///underscore, to lower case
|
||||
return self::underscore($tp->ustrtolower($title));
|
||||
break;
|
||||
|
||||
case 'underscorec': ///underscore, camel case
|
||||
return self::underscore(self::camelize($title, true, ' '));
|
||||
break;
|
||||
|
||||
case 'underscore': ///underscore
|
||||
return self::underscore($title);
|
||||
break;
|
||||
|
||||
case 'plusl': ///plus separator, to lower case
|
||||
return str_replace(' ', '+', $tp->ustrtolower($title));
|
||||
break;
|
||||
|
||||
case 'plusc': ///plus separator, to lower case
|
||||
return str_replace(' ', '+', self::camelize($title, true, ' '));
|
||||
break;
|
||||
|
||||
case 'plus': ///plus separator
|
||||
return str_replace(' ', '+', $title);
|
||||
break;
|
||||
|
||||
case 'none':
|
||||
default:
|
||||
return $title;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a memory value formatted helpfully
|
||||
* $dp overrides the number of decimal places displayed - realistically, only 0..3 are sensible
|
||||
@ -3807,7 +3914,7 @@ class eHelper
|
||||
// clever recursion o.O
|
||||
if($all) return self::camelize('-'.$str, false, $space);
|
||||
|
||||
$tmp = explode('-', str_replace('_', '-', strtolower($str)));
|
||||
$tmp = explode('-', str_replace(array('_', ' '), '-', e107::getParser()->ustrtolower($str)));
|
||||
return trim(implode($space, array_map('ucfirst', $tmp)), $space);
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,8 @@ class e_bbcode
|
||||
'url', 'quote', 'left', 'right',
|
||||
'b', 'justify', 'file', 'stream',
|
||||
'textarea', 'list', 'php', 'time',
|
||||
'spoiler', 'hide', 'youtube', 'sanitised'
|
||||
'spoiler', 'hide', 'youtube', 'sanitised',
|
||||
'p', 'h', 'nobr', 'block',
|
||||
);
|
||||
|
||||
foreach($core_bb as $c)
|
||||
|
BIN
e107_images/bbcode/block.png
Normal file
BIN
e107_images/bbcode/block.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
BIN
e107_images/bbcode/br.png
Normal file
BIN
e107_images/bbcode/br.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
BIN
e107_images/bbcode/heading.png
Normal file
BIN
e107_images/bbcode/heading.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
BIN
e107_images/bbcode/nobr.png
Normal file
BIN
e107_images/bbcode/nobr.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
BIN
e107_images/bbcode/paragraph.png
Normal file
BIN
e107_images/bbcode/paragraph.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 693 B |
@ -8,14 +8,14 @@
|
||||
*/
|
||||
define("CUSLAN_1", "Title");
|
||||
define("CUSLAN_2", "Type");
|
||||
// define("CUSLAN_3", "Options");
|
||||
define("CUSLAN_3", "Search engine friendly string");
|
||||
define("CUSLAN_4", "Delete this item?");
|
||||
define("CUSLAN_5", "Existing Pages");
|
||||
define("CUSLAN_7", "Menu Name");
|
||||
define("CUSLAN_8", "Title / Caption");
|
||||
define("CUSLAN_9", "Text");
|
||||
define("CUSLAN_10", "Allow page to be rated");
|
||||
// define("CUSLAN_11", "Front page");
|
||||
define("CUSLAN_11", "Meta description");
|
||||
define("CUSLAN_12", "Create page");
|
||||
define("CUSLAN_13", "Allow comments");
|
||||
define("CUSLAN_14", "Password protect page");
|
||||
@ -36,11 +36,11 @@ define("CUSLAN_28", "Page deleted");
|
||||
define("CUSLAN_29", "List pages if no page selected");
|
||||
define("CUSLAN_30", "Expiry time for cookie (in seconds)");
|
||||
define("CUSLAN_31", "Create menu");
|
||||
// define("CUSLAN_32", "Convert old pages/menus");
|
||||
define("CUSLAN_32", "Meta keywords");
|
||||
define("CUSLAN_33", "Page Options");
|
||||
//define("CUSLAN_34", "Beginning conversion");
|
||||
//define("CUSLAN_35", "Finished custom page update - updated");
|
||||
//define("CUSLAN_36", "To set your preferences for each page, please return to front page and edit the pages.");
|
||||
define("CUSLAN_34", "Title and SEF string are required fields. Page wasn't saved.");
|
||||
define("CUSLAN_35", "SEF string should be unique for every page. Page wasn't saved.");
|
||||
define("CUSLAN_36", "Menu name is required field and can't be left empty. Menu wasn't saved.");
|
||||
//define("CUSLAN_37", "Custom Page Update");
|
||||
//define("CUSLAN_38", "on");
|
||||
//define("CUSLAN_39", "off");
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Copyright (C) e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
@ -80,8 +80,10 @@ define("LAN_EURL_USER_REWRITE_DESCR", "Search engine and user friendly URLs. <br
|
||||
define("LAN_EURL_CORE_PAGE", "Custom Pages");
|
||||
define("LAN_EURL_PAGE_DEFAULT_LABEL", "Default");
|
||||
define("LAN_EURL_PAGE_DEFAULT_DESCR", "Legacy direct URLs. Example: http://yoursite.com/page.php?1");
|
||||
define("LAN_EURL_PAGE_SEF_LABEL", "User Friendly URLs");
|
||||
define("LAN_EURL_PAGE_SEF_DESCR", "Search engine and user friendly URLs. <br />Example: http://yoursite.com/page/Page-Name");
|
||||
define("LAN_EURL_PAGE_SEF_LABEL", "User Friendly URLs with ID (safe)");
|
||||
define("LAN_EURL_PAGE_SEF_DESCR", "Search engine and user friendly URLs. <br />Example: http://yoursite.com/page/1/Page-Name");
|
||||
define("LAN_EURL_PAGE_SEFNOID_LABEL", "User Friendly URLs without ID (not suitable for old DB's)");
|
||||
define("LAN_EURL_PAGE_SEFNOID_DESCR", "Search engine and user friendly URLs. <br />Example: http://yoursite.com/page/Page-Name");
|
||||
|
||||
// Search
|
||||
define("LAN_EURL_CORE_SEARCH", "Search");
|
||||
|
@ -1,14 +1,11 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system - Language File.
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_ren_help.php,v $
|
||||
| $Revision$
|
||||
| $Date$
|
||||
| $Author$
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* Copyright (C) e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id$
|
||||
*
|
||||
* BBcode language file
|
||||
*
|
||||
*/
|
||||
define("LANHELP_1", "Black");
|
||||
define("LANHELP_2", "Blue");
|
||||
define("LANHELP_3", "Brown");
|
||||
@ -64,5 +61,9 @@ define("LANHELP_46", "* No files found in: ");
|
||||
|
||||
define("LANHELP_47", "Insert flash: [flash=width,height]http://www.example.com/file.swf[/flash]");
|
||||
define("LANHELP_48", "YouTube video: [youtube=tiny|small|medium|big|huge|width,height]6kYjxJmk0wc[/youtube]");
|
||||
|
||||
?>
|
||||
define("LANHELP_49", "Paragraph: [p=class name]Paragraph text[/p]");
|
||||
define("LANHELP_50", "Heading: for H2 [h]Heading text[/h] or [h=2]Heading text[/h]");
|
||||
define("LANHELP_51", "Disable HTML new lines for enclosed text: [nobr]text[/nobr]");
|
||||
define("LANHELP_52", "New line (HTML): [br]");
|
||||
define("LANHELP_53", "Justify align: [justify]This text will be justified[/justify]");
|
||||
define("LANHELP_54", "HTML block (div tag): [block]Your content[/block]");
|
@ -462,6 +462,7 @@ label { cursor: pointer; }
|
||||
div.bbarea.large, .tbox.large, .helpbox.large { width: 95% !important; }
|
||||
div.bbarea.medium, .tbox.medium, .helpbox.medium { width: 60% !important; }
|
||||
div.bbarea.small, .tbox.small, .helpbox.small { width: 250px !important; }
|
||||
.remainingCharacters { margin: 0px; padding: 0px; }
|
||||
|
||||
|
||||
.check-block { /* see administration newspost.php */
|
||||
@ -819,4 +820,18 @@ h2.caption { font-size: 200%; font-weight:bold; }
|
||||
/** Custom Pages Front-end **/
|
||||
.cpage-nav { padding: 5px; margin: 0px 5px 10px 10px; }
|
||||
a.cpage-np { font-size: 14px; }
|
||||
a.cpage-np.current { text-decoration: none; }
|
||||
a.cpage-np.current { text-decoration: none; }
|
||||
|
||||
/******** bbcodes && typgoraphy */
|
||||
p { }
|
||||
p.bbcode { margin: 10px 0px; text-indent: 15px; } /* override if requried */
|
||||
p.bbcode:first-letter { font-weight: bold; text-transform: uppercase }
|
||||
|
||||
h1, h2, h3, h4, h5, h6 { margin: 10px 0px; text-indent: 15px; }
|
||||
h1 { margin: 15px 0px; font-size: 16px; }
|
||||
h2 { font-size: 14px; }
|
||||
h3 { font-size: 12px; }
|
||||
|
||||
h1.bbcode, h2.bbcode, h3.bbcode, h4.bbcode, h5.bbcode, h6.bbcode { }/* override if requried */
|
||||
|
||||
div.bbcode { margin: 15px 0px; clear: both; } /* layout control via bbcodes */
|
||||
|
@ -2,25 +2,21 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Copyright (C) e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_themes/templates/bbcode_template.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
// How to register your own BBcode button.
|
||||
// Uncomment the 2 commented lines below to see it in action. (only applies to the user area)
|
||||
|
||||
// $register_bb['blank'] = array("", "[blank][/blank]","Blank example helper text",e_IMAGE."bbcode/template.png");
|
||||
|
||||
// Simplified default bbcode bar - removed P, H, BR and NOBR bbcodes
|
||||
$BBCODE_TEMPLATE = "
|
||||
{BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=center}{BB=left}{BB=right}
|
||||
{BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=justify}{BB=center}{BB=left}{BB=right}
|
||||
{BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes}{BB=youtube}
|
||||
<div class='field-spacer'><!-- --></div>
|
||||
";
|
||||
@ -35,8 +31,8 @@ $BBCODE_TEMPLATE_SUBMITNEWS = "
|
||||
|
||||
{BB_HELP}
|
||||
<div class='field-spacer'><!-- --></div>
|
||||
{BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=center}{BB=left}{BB=right}
|
||||
{BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes}{BB=flash}{BB=youtube}
|
||||
{BB=link}{BB=h}{BB=p}{BB=b}{BB=i}{BB=u}{BB=img}{BB=justify}{BB=center}{BB=left}{BB=right}
|
||||
{BB=bq}{BB=code}{BB=list}{BB=block}{BB=nobr}{BB=br}{BB=fontcol}{BB=fontsize}{BB=emotes}{BB=flash}{BB=youtube}
|
||||
<div class='field-spacer'><!-- --></div>
|
||||
";
|
||||
|
||||
@ -46,8 +42,8 @@ $BBCODE_TEMPLATE_SUBMITNEWS = "
|
||||
$BBCODE_TEMPLATE_ADMIN = "
|
||||
{BB_HELP=admin}
|
||||
<div class='field-spacer'><!-- --></div>
|
||||
{BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=center}{BB=left}
|
||||
{BB=right}{BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes}
|
||||
{BB=link}{BB=h}{BB=p}{BB=b}{BB=i}{BB=u}{BB=img}{BB=justify}{BB=center}{BB=left}
|
||||
{BB=right}{BB=bq}{BB=code}{BB=list}{BB=block}{BB=nobr}{BB=br}{BB=fontcol}{BB=fontsize}{BB=emotes}
|
||||
{BB_PREIMAGEDIR}
|
||||
{BB=preimage}{BB=prefile}{BB=flash}{BB=youtube}
|
||||
<div class='field-spacer'><!-- --></div>
|
||||
@ -56,8 +52,8 @@ $BBCODE_TEMPLATE_ADMIN = "
|
||||
$BBCODE_TEMPLATE_MAILOUT = "
|
||||
{BB_HELP=admin}
|
||||
<div class='field-spacer'><!-- --></div>
|
||||
{BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=center}{BB=left}
|
||||
{BB=right}{BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes}
|
||||
{BB=link}{BB=h}{BB=p}{BB=b}{BB=i}{BB=u}{BB=img}{BB=justify}{BB=center}{BB=left}
|
||||
{BB=right}{BB=bq}{BB=code}{BB=list}{BB=block}{BB=nobr}{BB=br}{BB=fontcol}{BB=fontsize}{BB=emotes}
|
||||
{BB_PREIMAGEDIR}
|
||||
{BB=preimage}{BB=prefile}{BB=flash}{BB=shortcode}
|
||||
<div class='field-spacer'><!-- --></div>
|
||||
@ -68,8 +64,8 @@ $BBCODE_TEMPLATE_MAILOUT = "
|
||||
$BBCODE_TEMPLATE_NEWSPOST = "
|
||||
{BB_HELP=$mode}
|
||||
<div class='field-spacer'><!-- --></div>
|
||||
{BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=center}{BB=left}
|
||||
{BB=right}{BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes}
|
||||
{BB=link}{BB=h}{BB=p}{BB=b}{BB=i}{BB=u}{BB=img}{BB=justify}{BB=center}{BB=left}
|
||||
{BB=right}{BB=bq}{BB=code}{BB=list}{BB=block}{BB=nobr}{BB=br}{BB=fontcol}{BB=fontsize}{BB=emotes}
|
||||
{BB_PREIMAGEDIR=news}
|
||||
{BB=preimage}{BB=prefile}{BB=flash}{BB=youtube}
|
||||
<div class='field-spacer'><!-- --></div>
|
||||
@ -79,8 +75,8 @@ $BBCODE_TEMPLATE_CPAGE = "
|
||||
{BB_HELP}
|
||||
<div class='field-spacer'><!-- --></div>
|
||||
{BB=newpage}
|
||||
{BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=center}{BB=left}{BB=right}
|
||||
{BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes}
|
||||
{BB=link}{BB=h}{BB=p}{BB=b}{BB=i}{BB=u}{BB=img}{BB=justify}{BB=center}{BB=left}{BB=right}
|
||||
{BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=block}{BB=nobr}{BB=br}{BB=fontsize}{BB=emotes}
|
||||
{BB_PREIMAGEDIR=page}
|
||||
{BB=preimage}{BB=prefile}{BB=flash}{BB=youtube}
|
||||
<div class='field-spacer'><!-- --></div>
|
||||
|
19
page.php
19
page.php
@ -117,10 +117,10 @@ class pageClass
|
||||
$pageArray = $sql->db_getList();
|
||||
foreach($pageArray as $page)
|
||||
{
|
||||
$url = e107::getUrl()->create('page/view', $page, 'allow=page_id,page_title,page_sef');
|
||||
$url = e107::getUrl()->create('page/view', $page, 'allow=page_id,page_sef');
|
||||
$text .= $this->bullet." <a href='".$url."'>".$page['page_title']."</a><br />";
|
||||
}
|
||||
e107::getParser()->tablerender(LAN_PAGE_11, $text,"cpage_list");
|
||||
e107::getRender()->tablerender(LAN_PAGE_11, $text,"cpage_list");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -194,8 +194,9 @@ class pageClass
|
||||
|
||||
$this->batch->setParserVars(new e_vars($ret))->setScVar('page', $this->page);
|
||||
|
||||
define('e_PAGETITLE', $ret['title']);
|
||||
|
||||
define('e_PAGETITLE', eHelper::formatMetaTitle($ret['title']));
|
||||
define('META_DESCRIPTION', $this->page['page_metadscr']);
|
||||
define('META_KEYWORDS', $this->page['page_metakeys']);
|
||||
//return $ret;
|
||||
}
|
||||
|
||||
@ -207,9 +208,11 @@ class pageClass
|
||||
{
|
||||
$this->cacheData = array();
|
||||
$this->cacheData['PAGE'] = $cacheData;
|
||||
list($pagetitle, $comment_flag) = explode("^",$e107cache->retrieve($this->cacheTitleString));
|
||||
list($pagetitle, $comment_flag, $meta_keys, $meta_dscr) = explode("^^^",$e107cache->retrieve($this->cacheTitleString), 4);
|
||||
$this->cacheData['TITLE'] = $pagetitle;
|
||||
$this->cacheData['COMMENT_FLAG'] = $comment_flag;
|
||||
$this->cacheData['META_KEYS'] = $meta_keys;
|
||||
$this->cacheData['META_DSCR'] = $meta_dscr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,7 +220,7 @@ class pageClass
|
||||
{
|
||||
$e107cache = e107::getCache();
|
||||
$e107cache->set($this->cacheString, $data);
|
||||
$e107cache->set($this->cacheTitleString, $title."^".$this->page['page_comment_flag']);
|
||||
$e107cache->set($this->cacheTitleString, $title."^^^".$this->page['page_comment_flag']."^^^".$this->page['page_metakeys']."^^^".$this->page['page_metadscr']);
|
||||
}
|
||||
|
||||
|
||||
@ -229,7 +232,9 @@ class pageClass
|
||||
$vars = new e_vars(array('comments' => $this->pageComment(true)));
|
||||
$comments = e107::getScBatch('page')->setParserVars($vars)->cpagecomments();
|
||||
}
|
||||
define('e_PAGETITLE', $this->cacheData['TITLE']);
|
||||
define('e_PAGETITLE', eHelper::formatMetaTitle($this->cacheData['TITLE']));
|
||||
define('META_DESCRIPTION', $this->cacheData['META_DSCR']);
|
||||
define('META_KEYWORDS', $this->cacheData['META_KEYS']);
|
||||
if($this->debug)
|
||||
{
|
||||
echo "<b>Reading page from cache</b><br />";
|
||||
|
Loading…
x
Reference in New Issue
Block a user