How to fix "Function eregi() is deprecated in PHP 5.3

Need some help with the script?

Help Plzz!!

Postby ilyas_88 » Thu Apr 29, 2010 3:28 pm

Thanks for your answer :roll: I've changed this code before I install cutenews system. I do not understand why I can not add / edit news :(

When I click on add / edit news I get this error:

Parse error: syntax error, unexpected '(', expecting T_NS_SEPARATOR in /customers/mysite.net/mysite.net/httpd.www/x/inc/mod/addnews.mdu on line 114
test
ilyas_88
 
Posts: 32
Joined: Sun Jul 12, 2009 3:19 am
Location: norway

Postby mangomonkey » Thu Apr 29, 2010 5:33 pm

Hi, I have carried out the procedure listed in the first post, and everything is working well except for when I am in the admin panel. When I go to add news, or edit news, I get the following error. Any help appreciated!

Code: Select all
Parse error: syntax error, unexpected '(', expecting T_NS_SEPARATOR in /home/domainuser/public_html/news/inc/mod/addnews.mdu on line 114
mangomonkey
 
Posts: 8
Joined: Tue May 13, 2008 9:53 am

try it..

Postby marcusmagalhaes » Thu Apr 29, 2010 6:43 pm

// ********************************************************************************
// Do add News to DB
// ********************************************************************************
if ($action == 'doaddnews'){
if (($added_time = strtotime($day.' '.$month.' '.$year.' '.$hour.':'.$minute.':'.$second)) == -1){
$added_time = (time() + $config_date_adjust * 60);
}

if (!$title){
$title = substr($short_story, 0, 10).'...';
}

$id = $sql->last_insert_id('news', '', 'id') + 1;

run_actions('new-save-entry');

$sql->insert(array(
'table' => 'news',
'values' => array(
'date' => $added_time,
'author' => $member['username'],
'title' => replace_news('add', $title),
'short' => strlen(replace_news('add', $short_story)),
'full' => strlen(replace_news('add', $full_story)),
'avatar' => $avatar,
'category' => $category,
'url' => ($url ? url_namespace($url) : url_namespace(totranslit($title))),
'hidden' => (($config_approve_news == 'yes' and $member['level'] > 2) ? true : false)
)
));

$sql->insert(array(
'table' => 'story',
'values' => array(
'post_id' => $id,
'short' => replace_news('add', $short_story),
'full' => replace_news('add', $full_story)
)
));

run_actions('new-save-entry');

foreach($sql->select(array('table' => 'users')) as $row){
$sql->update(array(
'table' => 'users',
'where' => array("username = $member[username]"),
'values' => array('publications' => $row['publications'] + 1)
));
}


if ($config_send_mail_upon_new == 'yes' and $config_admin_mail){
cute_mail($config_admin_mail, 'New article on '.$config_home_title,
langdate($config_timestamp_comment, $added_time).
' A new article was added by '.$member['username']."\n\n".
$title."\n\n".
replace_news('admin', $short_story)."\n\n".
'--'."\n".
$config_http_home_url.'?id='.$id
);
}

msg('info', $echo['headerAdded'], sprintf($echo['headerAddedComplete'], $title, $PHP_SELF.'?mod=editnews&id='.$id));
}



mangomonkey wrote:Hi, I have carried out the procedure listed in the first post, and everything is working well except for when I am in the admin panel. When I go to add news, or edit news, I get the following error. Any help appreciated!

Code: Select all
Parse error: syntax error, unexpected '(', expecting T_NS_SEPARATOR in /home/domainuser/public_html/news/inc/mod/addnews.mdu on line 114
marcusmagalhaes
 
Posts: 163
Joined: Tue Apr 24, 2007 1:17 pm

Postby ilyas_88 » Thu Apr 29, 2010 7:09 pm

I've found it, thank you very much :D
Last edited by ilyas_88 on Thu Apr 29, 2010 7:34 pm, edited 2 times in total.
test
ilyas_88
 
Posts: 32
Joined: Sun Jul 12, 2009 3:19 am
Location: norway

Postby marcusmagalhaes » Thu Apr 29, 2010 7:29 pm

inc/mod/addnews.mdu
ilyas_88 wrote:which file to edit this code and where? :cry:
marcusmagalhaes
 
Posts: 163
Joined: Tue Apr 24, 2007 1:17 pm

Postby ilyas_88 » Thu Apr 29, 2010 7:44 pm

Thnx marcusmagalhaes. I can add/edit news now :P but in admin panel when i klikk on Options/System settings, I get the following error:

Deprecated: Function eregi() is deprecated in /customers/mysite.net/mysite.net/httpd.www/x/inc/mod/syscon.mdu on line 12

Deprecated: Function eregi() is deprecated in /customers/mysite.net/mysite.net/httpd.www/x/inc/mod/syscon.mdu on line 12
test
ilyas_88
 
Posts: 32
Joined: Sun Jul 12, 2009 3:19 am
Location: norway

Postby mangomonkey » Thu Apr 29, 2010 7:54 pm

Thats perfect, thanks, what did you change? Sorry to be a bother but do you have one for edit news please? Thanks again.
mangomonkey
 
Posts: 8
Joined: Tue May 13, 2008 9:53 am

Postby marcusmagalhaes » Thu Apr 29, 2010 8:01 pm

my syscon.mdu...

<?php
// ********************************************************************************
// System Configuration
// ********************************************************************************
if (!$action){
echoheader('options', $echo['header']);
?>

<form action="<?=$PHP_SELF; ?>" method="post">

<?
if (eregi('MSIE', $_SERVER['HTTP_USER_AGENT']) or eregi('Opera', $_SERVER['HTTP_USER_AGENT'])){
?>

<script language="JavaScript">
//Change Cell Content - By SiC/CYAN
function switchCell(n) {
for(i=0;i<navcell.length;i++){
navcell[i].className="tab-off";
tb[i].style.display="none";
}
navcell[n].className="tab-on";
tb[n].style.display="block";
}
</script>




ilyas_88 wrote:Thnx marcusmagalhaes. I can add/edit news now :P but in admin panel when i klikk on Options/System settings, I get the following error:

Deprecated: Function eregi() is deprecated in /customers/mysite.net/mysite.net/httpd.www/x/inc/mod/syscon.mdu on line 12

Deprecated: Function eregi() is deprecated in /customers/mysite.net/mysite.net/httpd.www/x/inc/mod/syscon.mdu on line 12
marcusmagalhaes
 
Posts: 163
Joined: Tue Apr 24, 2007 1:17 pm

Postby marcusmagalhaes » Thu Apr 29, 2010 8:02 pm

sorry... edit news???

mangomonkey wrote:Thats perfect, thanks, what did you change? Sorry to be a bother but do you have one for edit news please? Thanks again.
marcusmagalhaes
 
Posts: 163
Joined: Tue Apr 24, 2007 1:17 pm

Postby ilyas_88 » Thu Apr 29, 2010 8:06 pm

I have edited the Add, edit.mdu inc/mod/ . add news and edit News works perfectly now. but when I open the Admin Panel /Options/System settings so I get the Following error:

Deprecated: Function eregi() is deprecated in /customers/mysite.net/mysite.net/httpd.www/x/inc/mod/syscon.mdu on line 12

Deprecated: Function eregi() is deprecated in /customers/mysite.net/mysite.net/httpd.www/x/inc/mod/syscon.mdu on line 12


if you meant it?
test
ilyas_88
 
Posts: 32
Joined: Sun Jul 12, 2009 3:19 am
Location: norway

Postby marcusmagalhaes » Thu Apr 29, 2010 8:23 pm

in syscon.mdu

change this
<?
if (eregi('MSIE', $_SERVER['HTTP_USER_AGENT']) or eregi('Opera', $_SERVER['HTTP_USER_AGENT'])){
?>

for this
<?
if (preg_match( '/MSIE ([0-9].[0-9]{1,2})/',$_SERVER['HTTP_USER_AGENT']) or preg_match( '/Opera ([0-9].[0-9]{1,2})/',$_SERVER['HTTP_USER_AGENT'])){
?>


ilyas_88 wrote:I have edited the Add, edit.mdu inc/mod/ . add news and edit News works perfectly now. but when I open the Admin Panel /Options/System settings so I get the Following error:

Deprecated: Function eregi() is deprecated in /customers/mysite.net/mysite.net/httpd.www/x/inc/mod/syscon.mdu on line 12

Deprecated: Function eregi() is deprecated in /customers/mysite.net/mysite.net/httpd.www/x/inc/mod/syscon.mdu on line 12


if you meant it?
marcusmagalhaes
 
Posts: 163
Joined: Tue Apr 24, 2007 1:17 pm

Postby ilyas_88 » Thu Apr 29, 2010 8:26 pm

it works!! :D
Last edited by ilyas_88 on Thu Apr 29, 2010 8:47 pm, edited 2 times in total.
test
ilyas_88
 
Posts: 32
Joined: Sun Jul 12, 2009 3:19 am
Location: norway

Postby marcusmagalhaes » Thu Apr 29, 2010 8:39 pm

I'm not use cache remove, because I'm not use cache.. I will check later...

ilyas_88 wrote:in the admin panel when I change samthing or edit the news I gett error inn functions.inc.php file line 744

something is wrong in this code?

////////////////////////////////////////////////////////
// Function: cache_remover
// Description: ??????????????

function cache_remover($alone = ''){

$fdir = opendir(rootpath.'/cache');
while ($file = readdir($fdir)){
if ($file != '.' and $file != '..' and $file != '.htaccess'){
if ($alone){
if (preg_match($alone.'(.*).(short|full).', $file)){
@unlink(rootpath.'/cache/'.$file);
}

if (!preg_match('.(short|full).', $file)){
@unlink(rootpath.'/cache/'.$file);
}
}

if (!$alone){
@unlink(rootpath.'/cache/'.$file);
}
}
}

return true;
}
marcusmagalhaes
 
Posts: 163
Joined: Tue Apr 24, 2007 1:17 pm

Postby ilyas_88 » Thu Apr 29, 2010 8:43 pm

it works!! :D sorry I ask to mach, but I really need help to fix those problems :)

in the admin panel when I change samthing or edit the news I gett error inn functions.inc.php file line 744

something is wrong in this code?

////////////////////////////////////////////////////////
// Function: cache_remover
// Description: ??????????????

function cache_remover($alone = ''){

$fdir = opendir(rootpath.'/cache');
while ($file = readdir($fdir)){
if ($file != '.' and $file != '..' and $file != '.htaccess'){
if ($alone){
if (preg_match($alone.'(.*).(short|full).', $file)){
@unlink(rootpath.'/cache/'.$file);
}

if (!preg_match('.(short|full).', $file)){
@unlink(rootpath.'/cache/'.$file);
}
}

if (!$alone){
@unlink(rootpath.'/cache/'.$file);
}
}
}

return true;
}
test
ilyas_88
 
Posts: 32
Joined: Sun Jul 12, 2009 3:19 am
Location: norway

Postby ilyas_88 » Thu Apr 29, 2010 8:47 pm

OK, thanks. you can reply whenever you want :wink:
test
ilyas_88
 
Posts: 32
Joined: Sun Jul 12, 2009 3:19 am
Location: norway

PreviousNext

Return to Help



Who is online

Users browsing this forum: No registered users and 3 guests

cron