Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [php][smarty] Problem z Eval
Forum PHP.pl > Forum > Gotowe rozwiązania > Systemy szablonów
seostuff
Witam,

mam taki problem,

Parse error: syntax error, unexpected '>' in .../seo/plugins/block.php.php(23) : eval()'d code on line 28

block.php.php

  1. <?php
  2. /**
  3.  * Smarty plugin to execute PHP code
  4.  *
  5.  * @package Smarty
  6.  * @subpackage PluginsBlock
  7.  * @author Uwe Tews
  8.  */
  9.  
  10. /**
  11.  * Smarty {php}{/php} block plugin
  12.  *
  13.  * @param string $content contents of the block
  14.  * @param object $template template object
  15.  * @param boolean $ &$repeat repeat flag
  16.  * @return string content re-formatted
  17.  */
  18. function smarty_block_php($params, $content, $template, &$repeat)
  19. {
  20. /*if (!$template->allow_php_tag) {
  21.   throw new SmartyException("{php} is deprecated, set allow_php_tag = true to enable");
  22.   } */
  23. eval($content);
  24. return '';
  25. }
  26.  
  27. ?>


i kod do którego odnosi się: eval()'d code on line 28

  1. {php}
  2. function GetPageRank($q,$host='toolbarqueries.google.com',$context=NULL) {
  3. $seed = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer.";
  4. $result = 0x01020345;
  5. $len = strlen($q);
  6. for ($i=0; $i<$len; $i++) {
  7. $result ^= ord($seed{$i%strlen($seed)}) ^ ord($q{$i});
  8. $result = (($result >> 23) & 0x1ff) | $result << 9;
  9. }
  10. $ch=sprintf('8%x', $result);
  11. $url='http://%s/tbr?client=navclient-auto&ch=%s&features=Rank&q=info:%s';
  12. $url=sprintf($url,$host,$ch,$q);
  13. @$pr=file_get_contents($url,false,$context);
  14. return $pr?substr(strrchr($pr, ':'), 1):false;
  15. }
  16. {/php}
  17.  


Chodzi o to:
  1. $result ^= ord($seed{$i%strlen($seed)}) ^ ord($q{$i});
.

Pokazuje, że jest tutaj zamknięcie >, no ale jak widać nic nie ma.. Już się z tym męcze kilka godzin, próboje różnych rzeczy i nic.

Może mógłbym prosić o pomoc?

Jest ktoś w stanie pomóc?

Z góry dziękuje.
nospor
co ma oznaczac taki zapis:
$seed{liczba}
?
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2024 Invision Power Services, Inc.