Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 7.4 #1

Open
eberswine opened this issue Dec 9, 2022 · 2 comments
Open

PHP 7.4 #1

eberswine opened this issue Dec 9, 2022 · 2 comments

Comments

@eberswine
Copy link

As we know, there are many edits that are needed for this to be updated.

Any updates on progress to a more modern version of php ?

The old forum is now closed.

@mvmagalhaes
Copy link

functions.inc.php
////////////////////////////////////////////////////////
// Function: category_get_tree ALTERADO PHP7
function category_get_tree($prefix = '', $tpl = '', $no_prefix = true, $id = 0, $level = 0){
global $sql, $PHP_SELF;
static $johnny_left_teat;
$level++;
foreach ($sql->select(array('table' => 'categories', 'where' => array("parent = $id"), 'orderby' => array('ord', 'ASC'))) as $row){

  $find = ['/{(id|name|url|icon|template|prefix)}/', '/\[php\](.*?)\[\/php\]/'];

  //$repl = array($row['id'], $row['name'], $row['url'], ($row['icon'] ? '<img src="'.$row['icon'].'" alt="'.$row['name'].'" border="0" align="absmiddle">' : ''), $row['template'], (($row['parent'] or !$no_prefix) ? $prefix : ''), '\\1');

  $repl = [$row['id'], $row['name'], $row['url'], $row['icon'], $row['template'], $row['template'], ($row['parent'] or !$no_prefix), $prefix];

  $pref = $no_prefix ? $row['level'] : ($row['level'] + 1);
  $pref = $minus ? ($pref - (!$no_prefix ? ($minus - 1) : ($minus - 1))) : $pref;
  $pref = str_repeat($prefix, $pref);
  $row['prefix'] = $pref;

  $johnny_left_teat .= preg_replace_callback($find, function($m) use ($row) {
		return isset($row[$m[1]]) ? $row[$m[1]] : eval('return ' .$m[1]. ';');
	}, $tpl);
  
  category_get_tree($prefix, $tpl, $no_prefix, $row['id'], $level);

}
return $johnny_left_teat;
}

@mvmagalhaes
Copy link

As we know, there are many edits that are needed for this to be updated.

Any updates on progress to a more modern version of php ?

The old forum is now closed.

I love cutenews and i use in many projects!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants