Members: 16,996
Threads: 38,845
Posts: 159,389
Online: 29

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse
Old 16.10.2005, 16:07   #1 (permalink)
Junior Mamber
 
Join Date: Oct 2005
Posts: 46
Romek D. is on a distinguished road
Arrow Problem ze skryptem PHP w Mambo

Witam. Mam taki skrypt do pokazywania wartości Google(TM) PageRank(TM). Skrypt działa poprawnie, gdy jest w osobnym pliku na serwerze, ale gdy chcę go uruchomić w Mambo, zamiast skryptu wyświetlają się tylko fragmenty kodu źródłowego PHP.
Żeby było łatwiej, podam kod skryptu:

<?php
define('GOOGLE_MAGIC', 0xE6359A60);

function zeroFill($a, $b)
{
$z = hexdec(80000000);
if ($z & $a)
{
$a = ($a>>1);
$a &= (~$z);
$a |= 0x40000000;
$a = ($a>>($b-1));
}
else
{
$a = ($a>>$b);
}
return $a;
}


function mix($a,$b,$c) {
$a -= $b; $a -= $c; $a ^= (zeroFill($c,13));
$b -= $c; $b -= $a; $b ^= ($a<<8);
$c -= $a; $c -= $b; $c ^= (zeroFill($b,13));
$a -= $b; $a -= $c; $a ^= (zeroFill($c,12));
$b -= $c; $b -= $a; $b ^= ($a<<16);
$c -= $a; $c -= $b; $c ^= (zeroFill($b,5));
$a -= $b; $a -= $c; $a ^= (zeroFill($c,3));
$b -= $c; $b -= $a; $b ^= ($a<<10);
$c -= $a; $c -= $b; $c ^= (zeroFill($b,15));

return array($a,$b,$c);
}

function GoogleCH($url, $length=null, $init=GOOGLE_MAGIC) {
if(is_null($length)) {
$length = sizeof($url);
}
$a = $b = 0x9E3779B9;
$c = $init;
$k = 0;
$len = $length;
while($len >= 12) {
$a += ($url[$k+0] +($url[$k+1]<<8) +($url[$k+2]<<16) +($url[$k+3]<<24));
$b += ($url[$k+4] +($url[$k+5]<<8) +($url[$k+6]<<16) +($url[$k+7]<<24));
$c += ($url[$k+8] +($url[$k+9]<<8) +($url[$k+10]<<16)+($url[$k+11]<<24));
$mix = mix($a,$b,$c);
$a = $mix[0]; $b = $mix[1]; $c = $mix[2];
$k += 12;
$len -= 12;
}

$c += $length;
switch($len)
{
case 11: $c+=($url[$k+10]<<24);
case 10: $c+=($url[$k+9]<<16);
case 9 : $c+=($url[$k+8]<<8);
case 8 : $b+=($url[$k+7]<<24);
case 7 : $b+=($url[$k+6]<<16);
case 6 : $b+=($url[$k+5]<<8);
case 5 : $b+=($url[$k+4]);
case 4 : $a+=($url[$k+3]<<24);
case 3 : $a+=($url[$k+2]<<16);
case 2 : $a+=($url[$k+1]<<8);
case 1 : $a+=($url[$k+0]);
}
$mix = mix($a,$b,$c);
return $mix[2];
}

function strord($string) {
for($i=0;$i<strlen($string);$i++) {
$result[$i] = ord($string{$i});
}
return $result;
}

function getrank($url)
{
$url = 'info:'.$url;
$ch = GoogleCH(strord($url));

$file = "http://www.google.com/search?client=navclient-auto&ch=6$ch&features=Rank&q=$url";
$data = file($file);
$rankarray = explode (':', $data[2]);
$rank = $rankarray[2];
return $rank;
}
if (isset($_GET['url']) && !empty($_GET['url']))
{
$url = $_GET['url'];
$pr = getrank($url);
$pr_html = '
<div align="left">
<b>PageRank podanej strony wynosi: </b> '.$pr.'
</div>
';
}
else
$pr_html = '';

?>
<html>
<title>Sprawdź PageRank</title>
<body>
<form method="get">
<table border="0">
<tr>
<td>
URL strony: (przykład: www.google.com)
</td>
<td>
<input name="url" type="text" value="<?=$_GET['url'];?>">
</td>
<td>
<input type="submit" value="Pokaż PageRank">
</td>
</tr>
</table>
</form>
<?=$pr_html;?>
</body>
</html>
Romek D. is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 16.10.2005, 23:38   #2 (permalink)
Expert Mamber
 
format2's Avatar
 
Join Date: Mar 2005
Location: Gniezno
Posts: 309
format2 is on a distinguished road
Send a message via ICQ to format2 Send a message via MSN to format2
Default Re: Problem ze skryptem PHP w Mambo

Wsadzasz go do modułu strony...? W module może myć tylko HTML. Sugeruje zrobić w module IFRAMEa z osobnego pliku - jak tak chcesz to miec...
__________________
Czuwam nad Waszym bezpieczeństwem...
format2 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 20.10.2005, 10:26   #3 (permalink)
Baby Mamber
 
Al Catraz's Avatar
 
Join Date: Jan 2005
Posts: 20
Al Catraz is on a distinguished road
Default Re: Problem ze skryptem PHP w Mambo

Proponuję zrobić to jako nowy moduł i zainstalować. Tutaj masz przykład: http://help.mambopl.net/index.php/content/view/271/37/

Piszesz instalkę w .xml, dodajesz plik mod_jakiśtam.php z wklejonym skryptem, pakujesz zipem i instalujesz przez panel admina.
__________________
Nie pytam o problemy, których nie próbowałbym rozwiązać...
Al Catraz is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04.11.2005, 09:31   #4 (permalink)
Junior Mamber
 
Join Date: Oct 2005
Posts: 46
Romek D. is on a distinguished road
Default Re: Problem ze skryptem PHP w Mambo

Zrobiłem, jak proponowaliście, ale niestety moduł wyświetla się jako blok w menu po lewej stronie, a ja chce, żeby to była osobna podstrona!
Romek D. is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03.12.2005, 13:11   #5 (permalink)
Junior Mamber
 
Join Date: Oct 2005
Posts: 46
Romek D. is on a distinguished road
Default Re: Problem ze skryptem PHP w Mambo

Czy ktoś wie jak rozwiązać problem?
__________________
Moje ulubione strony: http://www.pozycjoner.org | http://webhelp.pl
Romek D. is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03.12.2005, 17:43   #6 (permalink)
Mamber
 
jacaka's Avatar
 
Join Date: Oct 2005
Posts: 116
jacaka is on a distinguished road
Default Re: Problem ze skryptem PHP w Mambo

kod z poczatku watka zapisz np jako sprPR.php i wrzuc do na root serwa
a w nowo tworzonym module wklej kod
Code:
<iframe src="sprPR.php" width=180 frameborder=0>
</iframe>
i masz po sprawie
oczywiscie zmodyfikuj sobie np wielkosc czcionek zeby ci nie wylazilo z kolumny
__________________
http://www.flamaster.info
jacaka is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03.12.2005, 19:50   #7 (permalink)
Junior Mamber
 
Join Date: Oct 2005
Posts: 46
Romek D. is on a distinguished road
Default Re: Problem ze skryptem PHP w Mambo

Nie da się tego zrobić bez używania ramek i żeby to była osobna podstrona?
__________________
Moje ulubione strony: http://www.pozycjoner.org | http://webhelp.pl
Romek D. is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03.12.2005, 20:22   #8 (permalink)
Mamber
 
jacaka's Avatar
 
Join Date: Oct 2005
Posts: 116
jacaka is on a distinguished road
Default Re: Problem ze skryptem PHP w Mambo

a gdzie tu masz ramke?
bo ja plywajacej ramki iframe nie nazwalbym ramka chcby ze wzgledu na funkcjonalnosc, predzej layerem
__________________
http://www.flamaster.info
jacaka is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TUTORIAL: How to INTEGRATE Mambo modules into non-MOS static php pages in your site marcnyc Mambo 4.5 'How Do I' Questions 10 28.02.2006 04:23
Mambo Open Source MosDBTable Class Unspecified Vulnerability theprincy Annunci 0 15.07.2005 15:04
Mambo install problem or host problem? joflow Mambo 4.5.1 General Talk 6 03.02.2005 14:30
Mambo a IE 6.0 problem ranczo Jak to zrobic 9 19.10.2004 22:46
Mambo and Custom php pages? clayb Mambo 4.5 General Talk 5 14.06.2004 08:53


All times are GMT +2. The time now is 00:16.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.