mirror of
https://github.com/e107inc/e107.git
synced 2025-07-14 03:26:20 +02:00
Use new capability of check_class
This commit is contained in:
@ -12,64 +12,61 @@ $code_text = $tp -> toAttribute($code_text);
|
|||||||
|
|
||||||
if($parm)
|
if($parm)
|
||||||
{
|
{
|
||||||
$parm = preg_replace('#onerror *=#i','',$parm);
|
$parm = preg_replace('#onerror *=#i','',$parm);
|
||||||
$parm = str_replace("amp;", "&", $parm);
|
$parm = str_replace("amp;", "&", $parm);
|
||||||
parse_str($parm,$tmp);
|
parse_str($parm,$tmp);
|
||||||
foreach($tmp as $p => $v)
|
foreach($tmp as $p => $v)
|
||||||
{
|
{
|
||||||
$imgParms[$p]=$v;
|
$imgParms[$p]=$v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$parmStr="";
|
$parmStr="";
|
||||||
foreach($imgParms as $k => $v)
|
foreach($imgParms as $k => $v)
|
||||||
{
|
{
|
||||||
$parmStr .= $tp -> toAttribute($k)."='".$tp -> toAttribute($v)."' ";
|
$parmStr .= $tp -> toAttribute($k)."='".$tp -> toAttribute($v)."' ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if((strpos($code_text,'../') === FALSE) && file_exists(e_IMAGE."newspost_images/".$code_text))
|
if((strpos($code_text,'../') === FALSE) && file_exists(e_IMAGE."newspost_images/".$code_text))
|
||||||
{
|
{
|
||||||
$code_text = e_IMAGE."newspost_images/".$code_text;
|
$code_text = e_IMAGE."newspost_images/".$code_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$postID || $postID == 'admin')
|
if (!$postID || $postID == 'admin')
|
||||||
{
|
{
|
||||||
return "<img src='".$code_text."' {$parmStr} />";
|
return "<img src='".$code_text."' {$parmStr} />";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(strstr($postID,'class:'))
|
if(strstr($postID,'class:'))
|
||||||
|
{
|
||||||
|
$uc = substr($postID,6);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$uc = $postID;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($pref['image_post'])
|
||||||
|
{
|
||||||
|
if (check_class($pref['image_post_class'],'',$uc))
|
||||||
{
|
{
|
||||||
$uc = substr($postID,6);
|
return "<img src='".$code_text."' {$parmStr} />";
|
||||||
}
|
|
||||||
if ($pref['image_post'])
|
|
||||||
{
|
|
||||||
if(!isset($uc) || ($uc == ''))
|
|
||||||
{
|
|
||||||
if (!function_exists('e107_userGetuserclass'))
|
|
||||||
{
|
|
||||||
require_once(e_HANDLER.'user_func.php');
|
|
||||||
}
|
|
||||||
$uc = e107_userGetuserclass($postID);
|
|
||||||
}
|
|
||||||
if (check_class($pref['image_post_class'],$uc))
|
|
||||||
{
|
|
||||||
return "<img src='".$code_text."' {$parmStr} />";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return ($pref['image_post_disabled_method'] ? "[ image disabled ]" : "Image: $code_text");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($pref['image_post_disabled_method'])
|
return ($pref['image_post_disabled_method'] ? "[ image disabled ]" : "Image: $code_text");
|
||||||
{
|
|
||||||
return '[ image disabled ]';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return "Image: $code_text";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($pref['image_post_disabled_method'])
|
||||||
|
{
|
||||||
|
return '[ image disabled ]';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "Image: $code_text";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
+ ----------------------------------------------------------------------------+
|
|
||||||
| e107 website system
|
|
||||||
|
|
|
||||||
| <20>Steve Dunstan 2001-2002
|
|
||||||
| http://e107.org
|
|
||||||
| jalist@e107.org
|
|
||||||
|
|
|
||||||
| Released under the terms and conditions of the
|
|
||||||
| GNU General Public License (http://gnu.org).
|
|
||||||
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/user_func.php,v $
|
|
||||||
| $Revision: 1.1.1.1 $
|
|
||||||
| $Date: 2006-12-02 04:33:59 $
|
|
||||||
| $Author: mcfly_e107 $
|
|
||||||
+----------------------------------------------------------------------------+
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
|
||||||
|
|
||||||
function e107_userGetuserclass($user_id)
|
|
||||||
{
|
|
||||||
global $cachevar;
|
|
||||||
$key = 'userclass_'.$user_id;
|
|
||||||
$val = getcachedvars($key);
|
|
||||||
if ($val)
|
|
||||||
{
|
|
||||||
return $cachevar[$key];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$uc_sql = new db;
|
|
||||||
if ($uc_sql->db_Select("user", "user_class, user_admin", "user_id=".intval($user_id)))
|
|
||||||
{
|
|
||||||
$row = $uc_sql->db_Fetch();
|
|
||||||
$uc = $row['user_class'];
|
|
||||||
$uc .= ",".e_UC_MEMBER;
|
|
||||||
if($row['user_admin'])
|
|
||||||
{
|
|
||||||
$uc .= ",".e_UC_ADMIN;
|
|
||||||
}
|
|
||||||
return $uc;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
Reference in New Issue
Block a user