Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php][smarty] Problem z Eval, Proszę o pomoc
seostuff
post 18.12.2011, 14:32:44
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 18.12.2011

Ostrzeżenie: (0%)
-----


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.


--------------------
2007 edo ferrari 599 2005 edo lamborghini gallardo spyder
Go to the top of the page
+Quote Post
nospor
post 18.12.2011, 19:23:58
Post #2





Grupa: Moderatorzy
Postów: 36 457
Pomógł: 6297
Dołączył: 27.12.2004




co ma oznaczac taki zapis:
$seed{liczba}
?


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 27.04.2024 - 23:51